Talking to your apps

User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Talking to your apps

Post by Jimmy »

Enrico Maria Giordano wrote:It should work with both 32 and 64 bit.
got it work under BCC7 32 Bit, nice :D
greeting,
Jimmy
User avatar
Armando
Posts: 3249
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Contact:

Re: Talking to your apps

Post by Armando »

Hello Friends:

It works fine for me.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
richard-service
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: Talking to your apps

Post by richard-service »

Hi

It's working.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Talking to your apps

Post 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
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Talking to your apps

Post by Enrico Maria Giordano »

Solved! Now it works for all compilers combinations:

Code: Select all | Expand

#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
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Talking to your apps

Post by Antonio Linares »

excellent! many thanks Enrico! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply