Notifications
Clear all
[Closed] Mouse button hold timer
Page 3 / 3
Prev
Jun 17, 2011 8:15 am
I tried the recommendation on that page and could not get it to work… when launched on a secondary thread, the callback did not work.
Please let us know if you manage to get it to work.
Jun 17, 2011 8:15 am
I use this modification to start it in a new thread (not sure if this is the way to do it)
str+=" public InterceptMouse()
"
str+=" {
"
str+=" Thread thread = new Thread(new ThreadStart(WorkThreadFunction));
"
str+=" thread.Start();
"
str+=" }
"
str+=" public void WorkThreadFunction()
"
str+=" {
"
str+=" _hookID = SetHook(HookCallback);
"
str+=" MaxHwnd = IntPtr.Zero;
"
str+=" restrictToMax = false;
"
str+=" }
"
As predicted this stop the hook from working, maybe it’s a message pump failing somehow? Maybe it needs a DispatchMessage() somewhere… my magic is weak in this area
Jun 17, 2011 8:15 am
I tried using this, but instead of printing I set another Global to the state, so mouse move, up, down.
However, when I check my global, it keeps reporting moving and not up/down like it should when I click the mouse. It does at first, but then loses track or something?
Page 3 / 3
Prev