Hi all
Any one with the idea on how to use GetAsyncKeyState API to determine the rbClick on any part of an ActiveX dialog box for contextmenu popup.
Thanks
Joe
GetAsyncKeyState
Re: GetAsyncKeyState
You can probably use the GetCursorPos API call.
You will need to use Alaska's Binary Access Package (see docs) to work with the POINT structure.
GetCursorPos function
09/25/2018
2 minutes to read
Retrieves the position of the mouse cursor, in screen coordinates.
Syntax
Copy
BOOL GetCursorPos(
LPPOINT lpPoint
);
Parameters
lpPoint
Type: LPPOINT
A pointer to a POINT structure that receives the screen coordinates of the cursor.
Return Value
Type: BOOL
Returns nonzero if successful or zero otherwise. To get extended error information, call GetLastError.
You will need to use Alaska's Binary Access Package (see docs) to work with the POINT structure.
GetCursorPos function
09/25/2018
2 minutes to read
Retrieves the position of the mouse cursor, in screen coordinates.
Syntax
Copy
BOOL GetCursorPos(
LPPOINT lpPoint
);
Parameters
lpPoint
Type: LPPOINT
A pointer to a POINT structure that receives the screen coordinates of the cursor.
Return Value
Type: BOOL
Returns nonzero if successful or zero otherwise. To get extended error information, call GetLastError.
The eXpress train is coming - and it has more cars.
Re: GetAsyncKeyState
can you give a Sample what you want to do with GetAsyncKeyStateunixkd wrote:Any one with the idea on how to use GetAsyncKeyState API to determine the rbClick on any part of an ActiveX dialog box for contextmenu popup.

https://docs.microsoft.com/en-us/window ... nckeystate
greetings by OHR
Jimmy
Jimmy
Re: GetAsyncKeyState
Hi
That way you can make your call
#INCLUDE "ot4xb.ch"
#INCLUDE "dll.ch"
Local i, key, cResponse
For i = 0 To 255
// We consult the value of the key by means of the Api. _
//If pressed returns -32767 and we show the value of i
// 'Consultamos el valor de la tecla mediante el Api. _
// Si se presionó devuelve -32767 y mostramos el valor de i
If @user32:GetAsyncKeyState(i) = -32767 // or DllCall("USER32.DLL",DLL_STDCALL, "GetAsyncKeyState" ,y )
MsgBox() //Virtual key code :" i , " The key pressed is : " Chr(i)
// "Código de la tecla virtual :" i ," La Tecla presionada es : " Chr(i)
End If
sleep(50) //use Timer1:Interval
Next
Endif
Best Regard
Héctor Pezoa
That way you can make your call
#INCLUDE "ot4xb.ch"
#INCLUDE "dll.ch"
Local i, key, cResponse
For i = 0 To 255
// We consult the value of the key by means of the Api. _
//If pressed returns -32767 and we show the value of i
// 'Consultamos el valor de la tecla mediante el Api. _
// Si se presionó devuelve -32767 y mostramos el valor de i
If @user32:GetAsyncKeyState(i) = -32767 // or DllCall("USER32.DLL",DLL_STDCALL, "GetAsyncKeyState" ,y )
MsgBox() //Virtual key code :" i , " The key pressed is : " Chr(i)
// "Código de la tecla virtual :" i ," La Tecla presionada es : " Chr(i)
End If
sleep(50) //use Timer1:Interval
Next
Endif
Best Regard
Héctor Pezoa
Re: GetAsyncKeyState
Hi Hector
What if the parameter y in your API called in the above code ?
Thanks
Joe
Code: Select all
DllCall("USER32.DLL",DLL_STDCALL, "GetAsyncKeyState" ,y )
Thanks
Joe