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
Keyboardbuffer clear
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Keyboardbuffer clear
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
-
- Posts: 161
- Joined: Tue Oct 18, 2005 10:01 am
Re: Keyboardbuffer clear
#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
#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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Keyboardbuffer clear
Have you tried calling SysRefresh() ?
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Keyboardbuffer clear
Sorry for the very late response
The function CLEARKEYBOARDBUFFER() is working very nice
SysRefresh() is not working
Thank you
The function CLEARKEYBOARDBUFFER() is working very nice
SysRefresh() is not working
Thank you
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite