Board index » delphi » Mouse blocks windows message qeue?

Mouse blocks windows message qeue?

Hi,
In an application, I use a thread to do processing to keep the user
interface live.
The Thread does sql queries in the background.
When the thread is done, the thread post a 'Done' message, and the
thread is suspended..
The received message then causes screen update.
This works well, but the user can totally prevent the screen update by
holding the mouse button down. The 'Done' message is still posted, but
no message is received by the main thread.
Any suggestions please?
Thank you
Johan Smit
 

Re:Mouse blocks windows message qeue?


"Johan Smit" <smi...@lantic.net> skrev i melding
news:3ebf4e4e.12176980@news.saix.net...

Quote
> Hi,
> In an application, I use a thread to do processing to keep the user
> interface live.
> The Thread does sql queries in the background.
> When the thread is done, the thread post a 'Done' message, and the
> thread is suspended..
> The received message then causes screen update.
> This works well, but the user can totally prevent the screen update by
> holding the mouse button down. The 'Done' message is still posted, but
> no message is received by the main thread.
> Any suggestions please?

I somewhat believed this was standard behaviour. Why would anyone keep mouse
button pressed and expect things to happen ?

--
Regards,

Bj?rge S?ther
bjorge@haha_itte.no
-------------------------------------
I'll not spend any money on American Software products
until armed forces are out of Iraq.

Re:Mouse blocks windows message qeue?


On Mon, 12 May 2003 07:34:43 GMT, smi...@lantic.net (Johan Smit)
wrote:

Quote
>Hi,
>In an application, I use a thread to do processing to keep the user
>interface live.
>The Thread does sql queries in the background.
>When the thread is done, the thread post a 'Done' message, and the
>thread is suspended..
>The received message then causes screen update.
>This works well, but the user can totally prevent the screen update by
>holding the mouse button down. The 'Done' message is still posted, but
>no message is received by the main thread.

Are you sure no message is received ?
It might be that it is received but not acted on

Re:Mouse blocks windows message qeue?


On Mon, 12 May 2003 10:19:54 +0200, "Bj?rge S?ther"

Quote
<bjorge@hahaha_itte.no> wrote:

<snip>

Quote
>I somewhat believed this was standard behaviour. Why would anyone keep mouse
>button pressed and expect things to happen ?

Users have strange expectations

Quote

>--
>Regards,

>Bj?rge S?ther
>bjorge@haha_itte.no
>-------------------------------------
>I'll not spend any money on American Software products
>until armed forces are out of Iraq.

Well now they have been kicked out of Saudi
- which is not what they really expected - or wanted

And that Jay Garner guy (no relation to the amusing actor James
Garner) has been told to 'pack his kit'

An interesting situation ... a bit of an 'own goal' ...

Re:Mouse blocks windows message qeue?


On Mon, 12 May 2003 10:19:54 +0200, "Bj?rge S?ther"

Quote
<bjorge@hahaha_itte.no> wrote:
>I somewhat believed this was standard behaviour. Why would anyone keep mouse
>button pressed and expect things to happen ?

Hi Bj?rge,
Thank you.
It appears to be natural to keep the left button down when scrolling,
then not to release the mouse button. Result = no screen update.
Any suggestions?
Regards
Johan Smit

Re:Mouse blocks windows message qeue?


On Mon, 12 May 2003 09:06:01 GMT, Bounce_It_je...@iss.u-net.com_.bin

Quote
(J French) wrote:

>Are you sure no message is received ?
>It might be that it is received but not acted on

Hi,
Thank you
Yes, I am sure. I put a debugging log thing in there.
Definitely, the message is sent, but not received.
If the user let go of the mouse button, the message is received.
Regards
Johan Smit

Re:Mouse blocks windows message qeue?


Quote
Johan Smit wrote:
> It appears to be natural to keep the left button down when scrolling,
> then not to release the mouse button. Result = no screen update.
> Any suggestions?

Well, obviously it's possible to update the screen while a mouse button
is down.

How are you sending the message from your thread object to your main
thread? How is your main thread handling it? How does the main thread
indicate that the screen needs updating?

--
Rob

Re:Mouse blocks windows message qeue?


On Tue, 13 May 2003 00:11:58 -0500, Rob Kennedy <rkenn...@cs.wisc.edu>
wrote:

Hi Rob,

Quote

>Well, obviously it's possible to update the screen while a mouse button
>is down.
Yes
>How are you sending the message from your thread object to your main
>thread?
Postmessage
> How is your main thread handling it?

Normally, it receives the message, then calls the update screen
procedure.
When the mouse button is down, the message is not received at all.

Quote
>How does the main thread
>indicate that the screen needs updating?

There is an update procedure that is called when the message is
received. It loads a list into a HTML component.
Regards
Johan Smit

Re:Mouse blocks windows message qeue?


"Johan Smit" <smi...@lantic.net> skrev i melding
news:3ec311b5.1020279@news.saix.net...

Quote
> On Tue, 13 May 2003 00:11:58 -0500, Rob Kennedy <rkenn...@cs.wisc.edu>
> wrote:

> Hi Rob,

> >Well, obviously it's possible to update the screen while a mouse button
> >is down.
> Yes
> >How are you sending the message from your thread object to your main
> >thread?
> Postmessage
> > How is your main thread handling it?
> Normally, it receives the message, then calls the update screen
> procedure.
> When the mouse button is down, the message is not received at all.

...what if you move the mouse a few ticks (like when dragging) ?

--
Regards,

Bj?rge S?ther
bjorge@haha_itte.no
-------------------------------------
I'll not spend any money on American Software products
until armed forces are out of Iraq.

Re:Mouse blocks windows message qeue?


"Johan Smit" <smi...@lantic.net> skrev i melding
news:3ec311b5.1020279@news.saix.net...

Quote
> On Tue, 13 May 2003 00:11:58 -0500, Rob Kennedy <rkenn...@cs.wisc.edu>
> wrote:

> Hi Rob,

> >Well, obviously it's possible to update the screen while a mouse button
> >is down.
> Yes
> >How are you sending the message from your thread object to your main
> >thread?
> Postmessage

Have you tried SendMessage ?

--
Regards,

Bj?rge S?ther
bjorge@haha_itte.no
-------------------------------------
I'll not spend any money on American Software products
until armed forces are out of Iraq.

Re:Mouse blocks windows message qeue?


On Thu, 15 May 2003 09:35:36 +0200, "Bj?rge S?ther"

Quote
<bjorge@hahaha_itte.no> wrote:

>Have you tried SendMessage ?

Hi Bj?rge,
Does not work on the thread, not sure why, but the message never gets
received.
I dumped the entire thread idea, I have spent too much time on it, and
it is still not user friendly.
Now I have a TQuery, Datasource, and DBGrid in the main thread.
DataSource.OnDataChange:
 Timer1.enabled := false;
 Timer1.enabled := true;
Timer1.OnTimer:  GetInfo(Self);
GetInfo then runs another query and TTables to populate the rest of
the page.
This works well, the user interface is responsive.
There is an unexpected snag:
DBGrid1.OnKeyup: qM.Locate('Name',char(Key),[loPartialkey]);
This is the only on key handler in the unit, and the form key preview
is set to false.
There are a few bitbuttons on a panel on the form for Close, Help and
Print, and the captions of these are : &Close, &Help, and &Print.
These accelerator keys are supposed to work from the keyboard Alt-C
etc keys.
So help me, if the user presses a P key while the focus is on the
dbgrid, the print routine is started. Similarly, to get a name
starting with C, the query does not find the names starting with C,
the form is closed.
Accellerator keys are supposed to work with the Alt keys.
I cannot catch this keystroke anywhere.
What am I doing wrong please?
Thank you
Johan Smit

Re:Mouse blocks windows message qeue?


On Thu, 15 May 2003 09:35:36 +0200, "Bj?rge S?ther"

Quote
<bjorge@hahaha_itte.no> wrote:

>Have you tried SendMessage ?

Hi Bj?rge,
Does not work on the thread, not sure why, but the message never gets
received.
I dumped the entire thread idea, I have spent too much time on it, and
it is still not user friendly.
Now I have a TQuery, Datasource, and DBGrid in the main thread.
DataSource.OnDataChange:
 Timer1.enabled := false;
 Timer1.enabled := true;
Timer1.OnTimer:  GetInfo(Self);
GetInfo then runs another query and TTables to populate the rest of
the page.
This works well, the user interface is responsive.
There is an unexpected snag:
DBGrid1.OnKeyup: qM.Locate('Name',char(Key),[loPartialkey]);
This is the only on key handler in the unit, and the form key preview
is set to false.
There are a few bitbuttons on a panel on the form for Close, Help and
Print, and the captions of these are : &Close, &Help, and &Print.
These accelerator keys are supposed to work from the keyboard Alt-C
etc keys.
So help me, if the user presses a P key while the focus is on the
dbgrid, the print routine is started. Similarly, to get a name
starting with C, the query does not find the names starting with C,
the form is closed.
Accellerator keys are supposed to work with the Alt keys.
I cannot catch this keystroke anywhere.
What am I doing wrong please?
Thank you
Johan Smit

Re:Mouse blocks windows message qeue?


On Thu, 15 May 2003 09:35:36 +0200, "Bj?rge S?ther"

Quote
<bjorge@hahaha_itte.no> wrote:

>Have you tried SendMessage ?

Hi Bj?rge,
Does not work on the thread, not sure why, but the message never gets
received.
I dumped the entire thread idea, I have spent too much time on it, and
it is still not user friendly.
Now I have a TQuery, Datasource, and DBGrid in the main thread.
DataSource.OnDataChange:
 Timer1.enabled := false;
 Timer1.enabled := true;
Timer1.OnTimer:  GetInfo(Self);
GetInfo then runs another query and TTables to populate the rest of
the page.
This works well, the user interface is responsive.
There is an unexpected snag:
DBGrid1.OnKeyup: qM.Locate('Name',char(Key),[loPartialkey]);
This is the only on key handler in the unit, and the form key preview
is set to false.
There are a few bitbuttons on a panel on the form for Close, Help and
Print, and the captions of these are : &Close, &Help, and &Print.
These accelerator keys are supposed to work from the keyboard Alt-C
etc keys.
So help me, if the user presses a P key while the focus is on the
dbgrid, the print routine is started. Similarly, to get a name
starting with C, the query does not find the names starting with C,
the form is closed.
Accellerator keys are supposed to work with the Alt keys.
I cannot catch this keystroke anywhere.
What am I doing wrong please?
Thank you
Johan Smit

Other Threads