Code: Select all
Case #WM_LBUTTONDOWN
;ReleaseCapture_()
SendMessage_(WindowID(#WindowMain), #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
This code allows the user to drag the window by clicking and dragging anywhere. Lower down in the cases, I have my #PB_Event_Timer. The timer always blocks and then fires many times after the drag. It's not too annoying, but I'm wondering if this is building up in the stack or something over time and would create an issue/bloat?
But here's the real question. I assume the only way to make it keep firing is to use a separate thread? Can't be. Here's why:
I made a new project in VB6 and place this code:
Code: Select all
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 ReleaseCapture Lib "user32" () As Long
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Me.hwnd, 161, 2, 0
End Sub
Private Sub Timer1_Timer()
Me.BackColor = QBColor(Int(Rnd * 14) + 1)
End Sub