Sign in to follow this  
Followers 0
jpm

Timer Problem

6 posts in this topic

@valik,@larry,...

Do you understand why the Loop in Execute does not get all messages?

the problem is the following When I resize a GUI windows if the timer occurs between a WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE the prochandler in guibox.cpp receive directly the message

when it works the log i did is :

0174 0128052E WM_EXITSIZEMOVE      wParam=00000000 lParam=00000000
0178 0128052E WM_TIMER             wParam=0000040a lParam=00000000
----------- inside getmessage loop
Msg102 msg=466, ret=-1, type=0, close=1
Exit getmessage msg=466, ret=-1, type=0, close=1

When it does not :

0056 00CA0214 WM_EXITSIZEMOVE      wParam=00000000 lParam=00000000
0104 00CA0214 WM_NCLBUTTONDOWN     wParam=00000011 lParam=00ce0199
0105 00CA0214 WM_SYSCOMMAND        wParam=0000f008 lParam=00ce0199
0106 00CA0214 WM_GETMINMAXINFO     wParam=00000000 lParam=00126e58
0107 00CA0214 WM_WINDOWPOSCHANGING wParam=00000000 lParam=00126e64
0108 00CA0214 WM_GETMINMAXINFO     wParam=00000000 lParam=001269cc
0109 00CA0214 WM_ENTERSIZEMOVE     wParam=00000000 lParam=00000000 <--------------------
0110 00CA0214 WM_SIZING            wParam=00000008 lParam=00126e70
0111 00CA0214 Msg=02A2 wParam=00000000 lParam=00000000
0112 00CA0214 WM_TIMER             wParam=0000040a lParam=00000000
-----> message received by prochandler and not by the getmessage loop -------------------
0113 00CA0214 Msg=WM_USER+0066           wParam=00000000 lParam=00000000
0114 00CA0214 WM_SIZING            wParam=00000008 lParam=00126e70
0115 00CA0214 WM_WINDOWPOSCHANGING wParam=00000000 lParam=00126e64
0116 00CA0214 WM_GETMINMAXINFO     wParam=00000000 lParam=001269cc
0117 00CA0214 WM_NCCALCSIZE        wParam=00000001 lParam=00126e38

THanks for the help :D

Share this post


Link to post
Share on other sites



I always have trouble understanding the message loop, but IIRC the messages only appear in the message loop when they need translation. Some messages go directly to the window procedure. Also if you use sendmessage it goes directly to the procedure (where PostMessage sends them to the message loop).

I think. It was very badly documented in the Petzold windows book I read.

Share this post


Link to post
Share on other sites

I always have trouble understanding the message loop, but IIRC the messages only appear in the message loop when they need translation.  Some messages go directly to the window procedure.  Also if you use sendmessage it goes directly to the procedure (where PostMessage sends them to the message loop).

I think.  It was very badly documented in the Petzold windows book I read.

Thanks JON,

Mine is a PostMessage and sometime as explain it does sometime it does not.

I will do a workaround until I undertand better what is going on.

THe pb to solve is the timeout on the Gui when resizing occurs. :D

Share this post


Link to post
Share on other sites

Can you change bits of the code that say things like:

WM_USER+102

to use a full define (like AUT_WM_NOTIFYICON in application.h). I'm easily confused so I don't like "magic" numbers :D

Share this post


Link to post
Share on other sites

Can you change bits of the code that say things like:

WM_USER+102

to use a full define (like AUT_WM_NOTIFYICON in application.h).  I'm easily confused so I don't like "magic" numbers :huh2:

Yes Boss, :)

I am also a little confuse about reusing a WM_USER+XXX already in use by some function. :D

THat the reason I start my numbering a 100 I could have do more !!!

Share this post


Link to post
Share on other sites

If it all possible, always use ::RegisterWindowMessage instead of referencing message #'s from WM_USER or WM_APP. This will guarantee that each message is unique system wide, and avoids the problems with message numbering.

Here is a good tutorial :

http://www.flounder.com/messages.htm

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0