|
-
Mar 9th, 2005, 01:39 PM
#1
Thread Starter
Hyperactive Member
Label Help [RESOLVED]
VB Code:
Private Sub label13_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim Ret&
ReleaseCapture
Ret& = SendMessage(Me.hWnd, &HA1, 2, 0&)
End Sub
one of my mates sent me this just before he signed of suppose to make it so i click the label and move the program around the screen because i removed the default ones.
But it doesn't like ReleaseCapture.
Do i have to turn something on within VB ?
Last edited by Ricky1; Mar 9th, 2005 at 01:44 PM.
-
Mar 9th, 2005, 01:42 PM
#2
Thread Starter
Hyperactive Member
Re: Label Help
VB Code:
Declare Function ReleaseCapture Lib "user32.dll" () As Long
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
forgot this bit but i still get a error.
-
Mar 9th, 2005, 01:45 PM
#3
Re: Label Help
ReleaseCapture is an API function that you need to declare.
VB Code:
Private Declare Function ReleaseCapture Lib "user32.dll" () As Long
I would also suggest that, to make your code more descriptive, that you use constants for the message and the wParam argument you are using with SendMessage.
VB Code:
Private Const WM_NCLBUTTONDOWN As Long = &HA1
Private Const HTCAPTION As Long = 2
-
Mar 9th, 2005, 01:46 PM
#4
Thread Starter
Hyperactive Member
Re: Label Help [RESOLVED]
i resolved it i just had to move that second bit of code i had into a module works great now.
-
Mar 9th, 2005, 01:46 PM
#5
Re: Label Help
 Originally Posted by Hack
Labels don't have a handle, so if you wanted to use that to move a captionless form, you would need to either use the MouseMove event of the form, or a control that does have a handle, like a picture box.
He's sending the message to the Form, so the code works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|