View Single Post
  #2 (permalink)  
Old September 22nd, 2005, 02:57 PM
scancode scancode is offline
Registered User
Join Date: Sep 2005
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to scancode

Option Explicit 

' API functions 
Private Declare Function ReleaseCapture Lib "user32" () As Long 
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long 
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long 

' Constants for above API calls 
Private Const HTCAPTION = 2 
Private Const WM_NCLBUTTONDOWN = &HA1 

Private Sub Form_Load() 
  Dim retVal As Long 

  retVal = SetWindowText(Me.hwnd, Label1) 
End Sub 

Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 
  SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& 
End Sub
Code by nzjonboy
- Use google

Reply With Quote