Hook and steal mouse clicks?
- DoubleDutch
- Addict 
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
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
						https://reportcomplete.com <- School end of term reports system
- 
				DarkDragon
- Addict 
- Posts: 2347
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
- Kwai chang caine
- Always Here 
- Posts: 5502
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
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 
 
I have tried your code and that's works fine 
 
I have tried to mix the two hook (Keyboard and mouse), that's works too.
But i have three questions 
  
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 ??? 
 
Thanks again for 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
 
 I have tried your code and that's works fine
 
 I have tried to mix the two hook (Keyboard and mouse), that's works too.
But i have three questions
 
  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 ???
 
 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) The happiness is a road...
The happiness is a road...Not a destination
- Fluid Byte
- Addict 
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
The idea of Kwai messing with hooks gives me the creeps.  
			
			
									
									
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
						- Kaeru Gaman
- Addict 
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- Kwai chang caine
- Always Here 
- Posts: 5502
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
It's totally normal, because i'm a asshole in programming with a egg headFluid and Kaeru wrote:creeps and hemorrhoids ...
 
 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.
									
			
									 The happiness is a road...
The happiness is a road...Not a destination
- Fluid Byte
- Addict 
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
** CAN'T, DESCRIBE, HOW ***ING HARD, I, AM, LAUGHING RIGHT NOW ... **
  
   
   
   
   
   
   
   
   
  
			
			
									
									 
   
   
   
   
   
   
   
   
  
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
						- Kwai chang caine
- Always Here 
- Posts: 5502
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
That's good, that's good   
 
LAUGHING , LAUGHING , hi , hi, hi 
 
But in the same time of you laugh , hi, hi, hi 
   
 
Can you 
   say me, hihihi
 say me, hihihi   
 
Why hahaha my procedure MouseKeyHook(nCode, wParam, lParam)
 my procedure MouseKeyHook(nCode, wParam, lParam)    
   
 
Is not hihihi good 
  
Because houhouhou 
   the more funny
 the more funny   
   in this story hy hy hy hy
 in this story hy hy hy hy   it's that works
 it's that works   
   
 
I don't know it's for houhouhou a long time 
   but it's works hahaha
 but it's works hahaha  
Not too much laugh, because i don't explode only my computer, i'm affraid also for my hemorrhoids
			
			
									
									 
 LAUGHING , LAUGHING , hi , hi, hi
 
 But in the same time of you laugh , hi, hi, hi
 
   
 Can you
 
   say me, hihihi
 say me, hihihi   
 Why hahaha
 my procedure MouseKeyHook(nCode, wParam, lParam)
 my procedure MouseKeyHook(nCode, wParam, lParam)    
   
 Is not hihihi good
 
  
Because houhouhou
 
   the more funny
 the more funny   
   in this story hy hy hy hy
 in this story hy hy hy hy   it's that works
 it's that works   
   
 I don't know it's for houhouhou a long time
 
   but it's works hahaha
 but it's works hahaha  
Not too much laugh, because i don't explode only my computer, i'm affraid also for my hemorrhoids

 The happiness is a road...
The happiness is a road...Not a destination
- Fluid Byte
- Addict 
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Kwaï chang caïne wrote:It's totally normal, because i'm a asshole in programming with a egg head
 
 Kwaï, honestly, do you really know what you are doing?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 ???
I have put together an example but I don't feel too well giving it to your hands!
 
 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?
						- Kwai chang caine
- Always Here 
- Posts: 5502
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
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 
 
 
 
But even the oyster dream to have a brain a day :roll:
I have see this great tips, no DLL 
 
And kcc who know nothing, try to put his little stone 
 
 
 
Or you believe that i break my old computer with this
			
			
									
									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
 
 But no, you know i'm born an oysterKwaï, honestly, do you really know what you are doing?
 
 But even the oyster dream to have a brain a day :roll:
I have see this great tips, no DLL
 
 And kcc who know nothing, try to put his little stone
 
 Why, you be affraid of what i do with this ????I have put together an example but I don't feel too well giving it to your hands!
 
 Or you believe that i break my old computer with this

 The happiness is a road...
The happiness is a road...Not a destination
- Kwai chang caine
- Always Here 
- Posts: 5502
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Yes you are right, i use IE.
How you have guess my use ?? 
 
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
			
			
									
									How you have guess my use ??
 
 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

 The happiness is a road...
The happiness is a road...Not a destination
- Kaeru Gaman
- Addict 
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
this definitely an IE problem.Kwaï chang caïne wrote:When i click the back button, the windows of text is empty too.
All is lost
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.
						






