Hook and steal mouse clicks?

Just starting out? Need help? Post your questions and find answers here.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Using any hooks should slow down your system by a fraction at least - but you prob. wouldn't notice.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Yes, you are correct. What I should have said is that they (the _LL hooks) can be more of a performance hog than the non _LL hooks. ;)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Sparkie wrote:WH_KEYBOARD_LL = no DLL required for global use
WH_MOUSE_LL = no DLL required for global use

all other WH_* = DLL required for global use
That's what I said.
bye,
Daniel
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

So then I guess that means I agree with you DarkDragon. We just chose to use different words. :wink:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Hello at all

Thanks for this tips FLUID BYTE
I have alway read me too, that it's obligatory to create a DLL to hook global

This is very interesting 8)
I have tried your code and that's works fine :D

I have tried to mix the two hook (Keyboard and mouse), that's works too.
But i have three questions :oops:

1/ Is it the good way to do that ??
2/ Have you more simple method, to go out, without have Quit in global ??
3/ When i press the Shift KEY, i have two debug letter, have you a way to don't do this ??? :cry:

Code: Select all

Global Quit

Procedure MouseKeyHook(nCode, wParam, lParam) 
   
 Select wParam
  
  Case #WM_RBUTTONDOWN 
  
   Debug "Clic droit"
  
  Case #WM_KEYDOWN
  
   EventwParam()
  
  Case #WM_KEYUP 
   
   EvenementClavier = EventwParam() 
 
   If EvenementClavier = 27
    Quit = #True
   ElseIf EvenementClavier <> 16
    Debug "Appuie touche " + Chr(EvenementClavier)
   EndIf
       
 EndSelect

 ProcedureReturn CallNextHookEx_(0, nCode, wParam, lParam) 
 
EndProcedure 

OpenWindow(0, 0, 0, 240, 140, "MouseBlock", #WS_CAPTION|#WS_SYSMENU|1) 
StickyWindow(0,1) 
hhkLLMouse = SetWindowsHookEx_(#WH_MOUSE_LL, @MouseKeyHook(), GetModuleHandle_(0), 0) 
hhkLLKey = SetWindowsHookEx_(#WH_KEYBOARD_LL, @MouseKeyHook(), GetModuleHandle_(0), 0) 

Repeat 
 Evenement = WaitWindowEvent() 
Until Quit = #True Or Evenement = #PB_Event_CloseWindow

UnhookWindowsHookEx_(hhkLLMouse)
UnhookWindowsHookEx_(hhkLLKey)
Thanks again for all
ImageThe happiness is a road...
Not a destination
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

The idea of Kwai messing with hooks gives me the creeps. :P
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

... gives me two hemorrhoids apiece...
oh... and have a nice day.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Fluid and Kaeru wrote:creeps and hemorrhoids ...
It's totally normal, because i'm a asshole in programming with a egg head :D

But i'm a asshole with a egg head without answer too :?
Apparently, my computer will explode my face in few minut at read your comment :roll:
Last edited by Kwai chang caine on Thu Feb 26, 2009 9:02 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

** CAN'T, DESCRIBE, HOW ***ING HARD, I, AM, LAUGHING RIGHT NOW ... **

:lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

That's good, that's good :lol:
LAUGHING , LAUGHING , hi , hi, hi :lol:

But in the same time of you laugh , hi, hi, hi :lol: :lol:
Can you :lol: :lol: say me, hihihi :lol:
Why hahaha :lol: my procedure MouseKeyHook(nCode, wParam, lParam) :lol: :lol:
Is not hihihi good :lol: :lol:

Because houhouhou :lol: :lol: the more funny :lol: :lol: in this story hy hy hy hy :lol: it's that works :lol: :lol:
I don't know it's for houhouhou a long time :lol: :lol: but it's works hahaha :lol:

Not too much laugh, because i don't explode only my computer, i'm affraid also for my hemorrhoids :lol:
ImageThe happiness is a road...
Not a destination
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Kwaï chang caïne wrote:It's totally normal, because i'm a asshole in programming with a egg head :D
:lol:
Kwaï chang caïne wrote:1/ Is it the good way to do that ??
2/ Have you more simple method, to go out, without have Quit in global ??
3/ When i press the Shift KEY, i have two debug letter, have you a way to don't do this ???
Kwaï, honestly, do you really know what you are doing?

I have put together an example but I don't feel too well giving it to your hands! :shock:

Code: Select all

Structure KBDLLHOOKSTRUCT
	vkCode.l
	scanCode.l
	flags.l
	time.l
	dwExtraInfo.l
EndStructure

Procedure HookProc(nCode,wParam,lParam)
	Select wParam
		Case #WM_RBUTTONDOWN
		Debug "Clic droit"
		
		Case #WM_KEYDOWN
		
		Case #WM_KEYUP
		*kbhk.KBDLLHOOKSTRUCT = lParam
				
		If *kbhk\vkCode ! #VK_LSHIFT And *kbhk\vkCode ! #VK_RSHIFT And *kbhk\vkCode ! #VK_CAPITAL
			Debug "Appuie touche " + Chr(EventwParam())
		EndIf
	EndSelect
	
	ProcedureReturn CallNextHookEx_(0,nCode,wParam,lParam)	
EndProcedure

OpenWindow(0,0,0,240,140,"Mouse+Keyboard Block",#WS_CAPTION | #WS_SYSMENU | 1)

StickyWindow(0,1)

hhkLLMouse = SetWindowsHookEx_(#WH_MOUSE_LL,@HookProc(),GetModuleHandle_(0),0)
hhkLLKey = SetWindowsHookEx_(#WH_KEYBOARD_LL,@HookProc(),GetModuleHandle_(0),0)

AddKeyboardShortcut(0,#PB_Shortcut_Escape,101)

Repeat
	EventID = WaitWindowEvent()
	
Until EventID = #PB_Event_CloseWindow Or EventMenu() = 101

UnhookWindowsHookEx_(hhkLLMouse)
UnhookWindowsHookEx_(hhkLLKey)
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

One thousand of thanks, FLUID.
I need that for do a keylogger for my personal use.
Because sometime, i wrote a long text in a forum thread, and when i click on the submit button, "paf" the post not go out, and the text is cleared :?
With this, i wrote all the key pressed in a txt, and i can save my post.

Again thanks my good FLUID
And be careful, a more big laugh is bad for the heart :lol:
Kwaï, honestly, do you really know what you are doing?
But no, you know i'm born an oyster :oops:
But even the oyster dream to have a brain a day :roll:

I have see this great tips, no DLL :shock:
And kcc who know nothing, try to put his little stone :oops:
I have put together an example but I don't feel too well giving it to your hands!
Why, you be affraid of what i do with this ???? :shock:
Or you believe that i break my old computer with this :oops:
ImageThe happiness is a road...
Not a destination
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Kwaï chang caïne wrote:Because sometime, i wrote a long text in a forum thread, and when i click on the submit button, "paf" the post not go out, and the text is cleared :?
With Firefox, I don't have this problem anymore ... :?:
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Yes you are right, i use IE.
How you have guess my use ?? :lol:

But i think for a time that it's not the fault of IE, but sometimes especially with the VB forum codesource.
I send the post, and i have a empty page.
When i click the back button, the windows of text is empty too.
All is lost :?

I know that it exist Keylogger freeware, like this :
http://www.01net.com/outils/telecharger ... 37053.html
But i like make it myself, if it's possible, and it's better with my love PB :D
ImageThe happiness is a road...
Not a destination
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Kwaï chang caïne wrote:When i click the back button, the windows of text is empty too.
All is lost :?
this definitely an IE problem.
when I used IE years ago and did RolePlay, I wrote my moves in notepad and pasted it into the browser when ready.
I lost too much moves before I did so, in different forums, different software.

when I started to use FiFo I could stop this, because on backbutton all the text was still there.
oh... and have a nice day.
Post Reply