Please test it, I do appreciate your feedback. I think this may be very interesting for our apps!
listen.prg
- Code: Select all Expand view
- #include "FiveWin.ch"
function Main()
local oDlg, oGet, cText := Space( 30 )
DEFINE DIALOG oDlg
@ 1, 1 GET oGet VAR cText
oGet:bGotFocus = { || Listen() }
ACTIVATE DIALOG oDlg CENTERED
return nil
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( LISTEN )
{
INPUT inputs[4];
// Pulsación de tecla Windows
inputs[0].type = INPUT_KEYBOARD;
inputs[0].ki.wVk = VK_LWIN;
// Pulsación de tecla H
inputs[1].type = INPUT_KEYBOARD;
inputs[1].ki.wVk = 'H';
// Liberación de tecla H
inputs[2].type = INPUT_KEYBOARD;
inputs[2].ki.wVk = 'H';
inputs[2].ki.dwFlags = KEYEVENTF_KEYUP;
// Liberación de tecla Windows
inputs[3].type = INPUT_KEYBOARD;
inputs[3].ki.wVk = VK_LWIN;
inputs[3].ki.dwFlags = KEYEVENTF_KEYUP;
// Envía las pulsaciones de teclas
SendInput(4, inputs, sizeof(INPUT));
}
#pragma ENDDUMP