Hook and steal mouse clicks?

Just starting out? Need help? Post your questions and find answers here.
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 i know that IE is far to be the better :?
But since some years ago, some site refuse FIFO.
Then i have never use it ago :oops:

But sometime, i use OPERA, when IE is too long, or not works, i prefer it.
But the habitude is difficult to change, furthermore when i am a old crouton like me :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 »

You have a nice extension in FF to switch between FF and IE, directly in the main window, without loosing anything.
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 »

Haaa!!! I don't know that :D
I must say, that FF is empty of plugin very interesting.
Like this function for using an IE with notebook and full without mouse :shock:
http://www.commentcamarche.net/telechar ... s-browsing
I found this idea great :D
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 »

Yes it's a good idea. There's a lot in FF. Mine has automated orthograph verification in several languages, autoscroll by typing a word, all the useful search engine integrated (images/maps/wikipedia...) enabled by marking a text, rbutton-> search, ad block, code analyser, save all tabs ... ! Try it for some weeks, and forget IE.
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 IE not works now, and i have listen to you and actually i write with FF :wink:

Then truly, i want ask to you a question.....

In IE for select a code it's easy, ....i double click on him and it is selected.
But with FF, that don't works.
How is the best and quick method for selected it :roll:
ImageThe happiness is a road...
Not a destination
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 »

I have put together an example but I don't feel too well giving it to your hands!
Hey FLUID BYTE
I'm sad because i have found a bug into your great code :cry:

If the windows loose focus, then the capture of mouse works fine, but the key capture don't works correctly :shock:
Kwaï chang caïne wrote:One thousand of thanks, FLUID.
Then i correct my notation and i give you only five hundred thanks :lol:

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)
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:If the windows loose focus, then the capture of mouse works fine, but the key capture don't works correctly :shock:
I know. 8)

Lemme try to explain ...

In response to the #WM_KEYUP message you use the EventwParam() function. The result you get is actually NOT from the hook procedure but from PB's internal (not global) event loop (#WM_KEYUP). The advantage is that you can differ between UPPER- and lowercase letters. In order to make it work globally you need to change

Code: Select all

Debug "Appuie touche " + Chr(EventwParam())
to

Code: Select all

Debug "Appuie touche " + Chr(*kbhk\vkCode)
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
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:Yes IE not works now, and i have listen to you and actually i write with FF :wink:

Then truly, i want ask to you a question.....

In IE for select a code it's easy, ....i double click on him and it is selected.
But with FF, that don't works.
How is the best and quick method for selected it :roll:
Do a CTRL+A (to select all), and then CTRL+click in the code. And don't hesitate to click several times.
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 »

I know.
Lemme try to explain ...
In response to the #WM_KEYUP message you use the EventwParam() function. The result you get is actually NOT from the hook procedure but from PB's internal (not global) event loop (#WM_KEYUP). The advantage is that you can differ between UPPER- and lowercase letters. In order to make it work globally you need to change
Thanks my dear FLUID, il love you :D
You are right, that's works now.
It's sad to loose the lowercase :cry:
But if you say that it's impossible to do other .....i have not the choice
It's always super like this, without the DLL.

KCC is null, but like all the null he is difficult furthermore :?

I give to you, your other five hundred thanks, and i give you, two hundred thanks furthermore for your kind answer without laugh :lol:
You have listen KCC, you be carefull for your heart :lol:

Sincerelly thanks for support an oyster like me 8)
Do a CTRL+A (to select all), and then CTRL+click in the code. And don't hesitate to click several times.
Thanks for the tips, it's funny FF don't do like IE.
For selected the code there are just a little frame around the code, then with IE all the text is selected :shock:
But never mind .....the good news is that,....... thanks to you, i can copy/paste all the code in one time

Thank you very much DJES 8)
ImageThe happiness is a road...
Not a destination
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Re: Hook and steal mouse clicks?

Post by Xombie »

Hey, so - running a modified version of the KCC/Fluid Byte procedure as an executable. Will this return messages globally regardless of the program being typed or clicked in?

I don't want to do a sneak hidden application so I like having a little window and things open. This is a nice find if it'll return mouse and keyboard hooks globally when it's compiled and run as a simple application.
Post Reply