#WM_LBUTTONDOWN
Posted: Sat Apr 27, 2013 3:00 am
Hi,
may i am not the only one who miss #WM_LBUTTONDOWN.
This is no question but its also not done and therefore not enough for Tricks 'n' Tips.
Sorry for no translation. Its late in Germany.
I hope someone can use it.
may i am not the only one who miss #WM_LBUTTONDOWN.
This is no question but its also not done and therefore not enough for Tricks 'n' Tips.
Code: Select all
Procedure HookMouse(nCode, wParam, lParam)
Static Start.l
If nCode < 0
ProcedureReturn CallNextHookEx_(HookMouse, nCode, wParam, lParam)
EndIf
*MOUSESTRUCT.MOUSEHOOKSTRUCT = lParam
*position.POINT=*MOUSESTRUCT\pt
Select wParam
Case #WM_MOUSEMOVE
If Start
; Splitter aktiv => die Größe der Nachbargadgets ändern
EndIf
Case #WM_LBUTTONDOWN
Start=1
Debug *position\x ; leider nur Bildschirmkoordinaten - keine Fensterkoordinaten
Debug *position\y
Case #WM_LBUTTONUP
Start=0
Debug *position\x
Debug *position\y
EndSelect
ProcedureReturn CallNextHookEx_(HookMouse, nCode, wParam, lParam)
EndProcedure
OpenWindow(0, 75, 14, 664, 400, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered )
lpdwProcessId = GetWindowThreadProcessId_(WindowID(0), @processus)
HookMouse=SetWindowsHookEx_(#WH_MOUSE , @HookMouse(), 0, lpdwProcessId)
TL = StringGadget (#PB_Any, 0, 0, 32, 200, "TL")
TV = StringGadget (#PB_Any, 32, 0, 300, 200, "TV")
MC = StringGadget (#PB_Any, 332, 32, 32, 136, "MC")
BO = ButtonGadget (#PB_Any, 332, 0, 32, 32, "--")
MCT = StringGadget (#PB_Any, 364, 0,300, 200, "MCT")
;BU = ButtonGadget (#PB_Any, 332,168, 32, 32, "|")
U = StringGadget(#PB_Any, 0,200, 664, 200, "unten")
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case BO : Debug "BO"
Case U : Debug "unten"
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
UnhookWindowsHookEx_(HookMouse)
I hope someone can use it.