FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Keyboardbuffer clear
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Keyboardbuffer clear
Posted: Sat Oct 22, 2016 10:49 AM

Hi,

Probably this is aswer bevore, but I can't find it in the forum.
I have an application with a barcodescanner. It is a barcodescanner connected via USB that is simulating the keyboard

If the barcode is not found, It play an errorsound, and show a message.
The problem is that sometimes the code read by the barcodescanner is so long, that it enter the OK-button of the message, so it is not shown...
I want to clear the keyboard-buffer before showing the alert-box.

Thanks

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Keyboardbuffer clear
Posted: Mon Oct 24, 2016 11:08 PM

pragma BEGINDUMP

include "windows.h"

include "hbapi.h"

HB_FUNC( CLEARKEYBOARDBUFFER )
{
MSG stMsg = { 0 };

HWND hWnd = ( HWND ) hb_parnl( 1 );

while( PeekMessage( &stMsg, hWnd, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) );

hb_ret();
}

pragma ENDDUMP

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Keyboardbuffer clear
Posted: Tue Oct 25, 2016 06:52 AM

Have you tried calling SysRefresh() ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: Keyboardbuffer clear
Posted: Sun Oct 30, 2016 03:14 PM

Sorry for the very late response :lol:

The function CLEARKEYBOARDBUFFER() is working very nice :D

SysRefresh() is not working :(

Thank you

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion