Good morning,
Is it possible to simulate a left mouse click on a buttongadget?
I searched the forum with "Simulate button click" but I did not find...
Thank you for your help
Simulate button click
Re: Simulate button click
Windows only:
Code: Select all
Macro MouseClick()
mouse_event_(#MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event_(#MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
EndMacro
;
MouseClick()
Re: Simulate button click
For a button in your own code you can send an event:
PostEvent(#PB_Event_Gadget, WindowNumber, ButtonGadgetNumber, #PB_EventType_LeftClick)
PostEvent(#PB_Event_Gadget, WindowNumber, ButtonGadgetNumber, #PB_EventType_LeftClick)
Re: Simulate button click
Hello Caronte3D,
What I want is to simulate a click as if I had clicked on a button (and not another) and for it to be detected in my While until loop by the Case corresponding to my button
I want to trigger this click on this button automatically in my program
What I want is to simulate a click as if I had clicked on a button (and not another) and for it to be detected in my While until loop by the Case corresponding to my button
I want to trigger this click on this button automatically in my program
Re: Simulate button click
Hello PeDe,
If I understand correctly, I just have to put the following code idea:
PostEvent(#PB_Event_Gadget, #WindowsWindow, #MusicList, #PB_EventType_LeftClick)
where #WindowsWindow is my Windows window
and #MusicList the gadget that will receive the click
If I understand correctly, I just have to put the following code idea:
PostEvent(#PB_Event_Gadget, #WindowsWindow, #MusicList, #PB_EventType_LeftClick)
where #WindowsWindow is my Windows window
and #MusicList the gadget that will receive the click
Re: Simulate button click
Yes, but if the button is in the same (your) program, I think is better if you use a procedure for that button, so you simply call that procedure when you want the same functionallity of that button, no need to send events (if it's not a must for somethig).
Re: Simulate button click
But yes, Caronte3D,
Am I stupid, should have thought about it...
Am I stupid, should have thought about it...