Page 2 of 2

Re: Talking to your apps

PostPosted: Tue Apr 02, 2024 3:36 pm
by Jimmy
Enrico Maria Giordano wrote:It should work with both 32 and 64 bit.

got it work under BCC7 32 Bit, nice :D

Re: Talking to your apps

PostPosted: Tue Apr 02, 2024 5:52 pm
by Armando
Hello Friends:

It works fine for me.

Regards

Re: Talking to your apps

PostPosted: Tue Apr 02, 2024 7:29 pm
by richard-service
Hi

It's working.

Re: Talking to your apps

PostPosted: Tue Apr 02, 2024 7:34 pm
by Enrico Maria Giordano
According to my tests, the program works fine only with these compilers combinations:

- Harbour MSC32
- Harbour BCC64
- xHarbour BCC32
- xHarbour BCC64

Re: Talking to your apps

PostPosted: Fri Apr 05, 2024 2:51 pm
by Enrico Maria Giordano
Solved! Now it works for all compilers combinations:

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];

    ZeroMemory(inputs, sizeof(inputs));

    // 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

Re: Talking to your apps

PostPosted: Fri Apr 05, 2024 3:00 pm
by Antonio Linares
excellent! many thanks Enrico! :-)