Valhalla Legends Forums Archive | Battle.net Bot Development | help move? please

AuthorMessageTime
RhiNo
can someone help me on moving a freakin form without title bar n what not cause i am workin on bot and thats next thing that need to be done any help would be appreciated
December 19, 2002, 5:41 PM
Spht
That sounds fun!

First, add this to your project source:

[code]Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long[/code]

Just some Win32 API functions you'll need for doing this.

Now, you may want to make a function that actually does the moving of the form...

[code]Private Sub MoveForm(frmForm As Form)
   Dim lngRetVal As Long
   
   ReleaseCapture
   lngRetVal = SendMessage(frmForm.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End Sub[/code]

Now, create a _MouseDown() event for where you want to click to drag the form. If you want to click the form to do it, then Form_MouseDown(). In here, choose whatever button you want to required to be clicked (idealy left-click) and then call MoveForm().
December 19, 2002, 7:55 PM
Grok
You didn't specify how you wanted the form to move.  Due to a user clicking on the form and dragging?  Are you providing your own 'caption' bar and wanting that to be the drag-move substitute?
December 20, 2002, 7:30 AM
RhiNo
yea i woulda said thanx earlier but i been sick and still am sorta but thanx
December 21, 2002, 4:49 PM

Search