| View previous topic :: View next topic |
| Author |
Message |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Mar 23, 2007 9:26 am Post subject: Detect mouse right click globally |
|
|
I need to detect mouse right click on any window when many are open from my VDS app.
I'm wanting to be able to save the right clicked window as a cropped pic by way of VDSSheepCAP.DLL to automate for ease.
I've checked most DLL's here and they only detect mouse clicks on the VDS program main window and child window.
If I have to have the windows classname or ID would be no problem.
Know of a API or DLL/DSU for getting right mouse click globally?
Thanks for looking.. |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Fri Mar 23, 2007 4:03 pm Post subject: |
|
|
Hi vtol:
You can use user32.dll library. Look at this code:
| Code: | Title To detect mouse buttons state
LOADLIB user32.dll
DIALOG CREATE,To detect mouse buttons state,-1,0,243,165,SMALLCAP,ONTOP
DIALOG ADD,SHAPE,left_bt,32,51,41,103,WHITE,BLACK,,RECTANGLE
DIALOG ADD,SHAPE,central_bt,32,101,41,45,WHITE,BLACK,,SQUARE
DIALOG ADD,SHAPE,right_bt,32,149,41,103,WHITE,BLACK,,SQUARE,RECTANGLE
DIALOG SHOW
option decimalsep,.
:Evloop
wait event,0.01
goto @event()
:Close
FREELIB user32.dll
exit
:Timer
rem Left Button: @LIB(user32,GetAsyncKeyState,INT:,$01)
rem Central Button: @LIB(user32,GetAsyncKeyState,INT:,$04)
rem Right Button: @LIB(user32,GetAsyncKeyState,INT:,$02)
if @unequal(@LIB(user32,GetAsyncKeyState,INT:,$01),0)
DIALOG SET,left_bt,navy
else
DIALOG SET,left_bt,white
end
if @unequal(@LIB(user32,GetAsyncKeyState,INT:,$04),0)
DIALOG SET,central_bt,navy
else
DIALOG SET,central_bt,white
end
if @unequal(@LIB(user32,GetAsyncKeyState,INT:,$02),0)
DIALOG SET,right_bt,navy
else
DIALOG SET,right_bt,white
end
goto Evloop |
________________
Good luck
________________
uVeDeSe |
|
| Back to top |
|
 |
nickos Valued Newbie

Joined: 17 Mar 2007 Posts: 26
|
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Sat Mar 24, 2007 1:17 am Post subject: |
|
|
WOW AWESOME
Thanks a ton uvedese, I googled and read till my eyes fell out last night and gave up on the idea because I didnt like the HOOK DLL method of some homemade DLLs. I even got a virus from a free Delphi32 hook DLL download, finally unhooked and destroyed its DLL virus.
But I feel safe with your code using USER32.DLL and since you see its not hooking keyboard for keyloggers
I've been dreaming of detect mouse click since my first VDS day one
I took time to test your code and it worked perfect on every below OS:
Windows 98 Second Edition
Windows 2000 Professional (full version)
Windows XP Home
Windows XP Professional (full version)
Windows VISTA Ulitmate (full version) OEM
Hey Nickos
Keyboard commands were dropped in the VDS5 version.
And I allready tried that old VDSDLL27 keyboard command, but the GLOBAL and the DLL command keep bringing ERRORS.
| Code: | Description: VDSDLL v27
Check the key state of nearly any key of your keyboard
Commands:
DLL KEYBOARD, GLOBAL{, global}
This command sets the checking of the keystate to global if the last
parameter is not empty.
Otherwise it sets the checking for your application exclusively.
In the last way, it will only accept keys if your application has the focus.
Functions:
@DLL(KEYBOARD, <key>)
This function returns 1 if the key <key> is down, otherwise it will return nothing.
EXAMPLE:
@DLL(KEYBOARD,RBUTTON) |
Thanks again uvedese, very cool code
 |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Sat Mar 24, 2007 10:50 am Post subject: |
|
|
Was glad to help, vtol
See you soon and good luck
_______________
uVeDeSe
______________ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|