Keyboardbuffer clear

Keyboardbuffer clear

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Keyboardbuffer clear

Postby toninhofwi » 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
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Keyboardbuffer clear

Postby Antonio Linares » Tue Oct 25, 2016 6:52 am

Have you tried calling SysRefresh() ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Keyboardbuffer clear

Postby Marc Vanzegbroeck » Sun Oct 30, 2016 3: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft, Rick Lipkin and 81 guests