GetAsyncKeyState

This forum is for general support of Xbase++
Post Reply
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

GetAsyncKeyState

#1 Post by unixkd »

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

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GetAsyncKeyState

#2 Post by rdonnay »

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.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: GetAsyncKeyState

#3 Post by Auge_Ohr »

unixkd 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.
can you give a Sample what you want to do with GetAsyncKeyState :?:
https://docs.microsoft.com/en-us/window ... nckeystate
greetings by OHR
Jimmy

patito
Posts: 121
Joined: Tue Aug 31, 2010 9:01 pm

Re: GetAsyncKeyState

#4 Post by patito »

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

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: GetAsyncKeyState

#5 Post by unixkd »

Hi Hector

Code: Select all

DllCall("USER32.DLL",DLL_STDCALL, "GetAsyncKeyState" ,y )
What if the parameter y in your API called in the above code ?

Thanks

Joe

Post Reply