bb.donnay-software.com
http://bb.donnay-software.com/donnay/

GetAsyncKeyState
http://bb.donnay-software.com/donnay/viewtopic.php?f=9&t=2488
Page 1 of 1

Author:  unixkd [ Wed Nov 07, 2018 10:41 am ]
Post subject:  GetAsyncKeyState

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

Author:  rdonnay [ Wed Nov 07, 2018 1:29 pm ]
Post subject:  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.

Author:  Auge_Ohr [ Wed Nov 07, 2018 2:57 pm ]
Post subject:  Re: GetAsyncKeyState

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/windows/desktop/api/winuser/nf-winuser-getasynckeystate

Author:  patito [ Thu Nov 08, 2018 1:04 pm ]
Post subject:  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

Author:  unixkd [ Wed Nov 14, 2018 8:16 am ]
Post subject:  Re: GetAsyncKeyState

Hi Hector

Code:
DllCall("USER32.DLL",DLL_STDCALL, "GetAsyncKeyState" ,y )


What if the parameter y in your API called in the above code ?

Thanks

Joe

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/