How Can I clean the mouse buffer Delphi

Delphi

11/10/2017

Hi, I am using the procedure below but the Delphi says "undeclared identifier" to TMsg and PeekMessage.

Someone can Helpe me please?

I´m using delphi tokyo 10.2.1 and this app is to IOS and Android.


procedure TForm1.EmptyMouseQueue;
var
Msg: TMsg;
begin
while PeekMessage( Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST,
PM_REMOVE or PM_NOYIELD )
do;
end;
Roberto

Roberto

Curtidas 0

Melhor post

Natanael Ferreira

Natanael Ferreira

13/10/2017

Good Morning,

PeekMessage is a function of windows API.
Add in WinApi.Windows form uses.
I'm not sure if it will work in your environment (app is to IOS and Android).
GOSTEI 1

Mais Respostas

Roberto

Roberto

11/10/2017

Thanks.

it is not working with IOS and Android.

I Put WinApi.windows and work with windows but theses const are not find "WM_MOUSEFIRST" and "WM_MOUSELAST". Could you help me?
GOSTEI 0
Natanael Ferreira

Natanael Ferreira

11/10/2017

These constants "WM_MOUSEFIRST" and "WM_MOUSELAST" are part of the Winapi.Messages library.

Add Winapi.Messages in the form's uses clause and test again.
GOSTEI 1
POSTAR