Date: 02-16-2022
Return to Index
created by gbSnippets
'The GetKeyState provides information about the state of the keys at the time
'an event took place. This is different from the API function GetAsyncKeyState,
'which gives the status of the keys at the time the API is called.
'Primary Code:
GetKeyState
If (GetKeyState(%VK_CONTROL) AND &H8000) AND (GetKeyState(Asc("V")) AND &H8000) Then 'Ctrl-V
ElseIf (GetKeyState(%VK_SHIFT) AND &H8000) AND (GetKeyState(%VK_INSERT) AND &H8000) Then 'Shift-Ins
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Include "Win32API.inc"
Global hDlg as DWord
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add TextBox, hDlg, 100,"Push", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case CB.Msg
Case %WM_Char
MsgBox "Char"
If Cb.wparam = &H16 Then '%VK_Control and %VK_V then '&H16
MsgBox "wm_char ctrl-v"
Function = 0 : Exit Function
End If
Case %WM_Command
If CB.Ctl = 100 AND CB.Ctlmsg = %BN_Clicked Then
End If
Case %WM_Paste
MsgBox "paste"
End Select
End Function
'gbs_00190
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm