forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Detect mouse right click globally

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Mar 23, 2007 9:26 am    Post subject: Detect mouse right click globally Reply with quote

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
View user's profile Send private message Visit poster's website
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Fri Mar 23, 2007 4:03 pm    Post subject: Reply with quote

Hi vtol: Very Happy

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
View user's profile Send private message Visit poster's website
nickos
Valued Newbie


Joined: 17 Mar 2007
Posts: 26

PostPosted: Fri Mar 23, 2007 4:05 pm    Post subject: Re: Detect mouse right click globally Reply with quote

I found this old vdspack.dll for keyboard and mouse button state.

http://www.vdsworld.com/download.php?id=45&sid=2aecc59a65fc7d9e91666a61b7e38681
Back to top
View user's profile Send private message Send e-mail
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sat Mar 24, 2007 1:17 am    Post subject: Reply with quote

WOW Exclamation AWESOME Very Happy

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 Very Happy

I've been dreaming of detect mouse click since my first VDS day one Dancing Banana

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 Thumbs Up
Outta Here
Back to top
View user's profile Send private message Visit poster's website
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Sat Mar 24, 2007 10:50 am    Post subject: Reply with quote

Was glad to help, vtol Yes

See you soon and good luck
_______________

uVeDeSe
______________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group