Hi AirCon (as in Con Air??? )
Can you show a basic call of this SetWindowsHookEx in VB? The search on the MSDN is not too clear. I have started API programing about 2 months ago and I am familiar with the basic, i.e., EnumWindows, SendMessage, etc.
See also GetAsyncKeyState() Windows API function (in MSDN.
Quotation: Remarks
The GetAsyncKeyState function works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to. For example, the call GetAsyncKeyState(VK_LBUTTON) always returns the state of the left physical mouse button, regardless of whether it is mapped to the left or right logical mouse button.
There is also a very direct way of figuring out whether a key or mouse button is down, though requires a hard loop to be constantly checking for it. The function GetKeyState(int) will tell you whether any key/mouse button is being pressed at a given time. You can use it like this:
byte keyState = GetKeyState(VK_MButton);
if(keyState & 128)
//mouse is down
else
//mouse is not down
Although Callback functions are most traditional, this function can come in handy when you wish to, say, use the mouse to "drag" a picture around the screen.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.