Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Window message order after WM_CREATE

484 views
Skip to first unread message

Kurt Vogel

unread,
Mar 29, 1994, 11:54:30 PM3/29/94
to
I need to perform some initialization after the frame window is
created (after WM_CREATE), but before the first WM_PAINT message. Are
there any window messages that I can process that come after WM_CREATE
and before WM_PAINT that gets called only once per instance?

Thanks for any advice,
Kurt

ku...@quack.kfu.com


Chris Marriott

unread,
Mar 30, 1994, 2:49:13 AM3/30/94
to
In article <gfg...@quack.kfu.com> ku...@quack.kfu.com "Kurt Vogel" writes:

>I need to perform some initialization after the frame window is
>created (after WM_CREATE), but before the first WM_PAINT message. Are
>there any window messages that I can process that come after WM_CREATE
>and before WM_PAINT that gets called only once per instance?

There are no guarantees about message order. Probably the best thing to do
is to post yourself a message during processing of "WM_CREATE", then do
whatever it is that you want to do during processing of that user message.

Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| Internet: ch...@chrism.demon.co.uk | astronomy program for Windows. |
| CompuServe: 100113,1140 | Mail me for details! |
| Author member of Association of Shareware Professionals (ASP) |
| Windows, C/C++ consultancy undertaken, anywhere in the world. |
--------------------------------------------------------------------------

Ron Klatchko

unread,
Mar 30, 1994, 5:42:29 PM3/30/94
to
Kurt Vogel (ku...@quack.kfu.com) wrote:
: I need to perform some initialization after the frame window is

: created (after WM_CREATE), but before the first WM_PAINT message. Are
: there any window messages that I can process that come after WM_CREATE
: and before WM_PAINT that gets called only once per instance?

Post a message to yourself while handling WM_CREATE.

moo
--
----------------------------+-----------------------------------------------
Ron Klatchko | Been there, done that,
r...@crl.com | Bought the t-shirt

Matt Arnold

unread,
Apr 1, 1994, 1:47:35 AM4/1/94
to
In comp.os.ms-windows.programmer.misc you write:

>Kurt Vogel (ku...@quack.kfu.com) wrote:
>: I need to perform some initialization after the frame window is
>: created (after WM_CREATE), but before the first WM_PAINT message. Are
>: there any window messages that I can process that come after WM_CREATE
>: and before WM_PAINT that gets called only once per instance?

> Post a message to yourself while handling WM_CREATE.

That sounds like it may not be reliable under all circumstances.

It's simpler than that, anyway...

When you get the WM_CREATE, simply pass it to DefWindowProc() first,
check the return value for success, and then perform your initialization
right then and there and you can even decide to fail the WM_CREATE if
*your* post-create initialization fails.

In fact, many C++ class libraries have functions that work this way:
members with names like PreCreate() and PosCreate(), etc.


case WM_CREATE:
if (DefWindowProc(hWnd, WM_CREATE, wParam, lParam) >= 0)
if (/* your post-create init code succeeds */)
return 0;
return -1;

Matt

Zweitze de Vries

unread,
Mar 31, 1994, 1:15:31 PM3/31/94
to
In article <gfg...@quack.kfu.com>
ku...@quack.kfu.com (Kurt Vogel) writes:

>I need to perform some initialization after the frame window is
>created (after WM_CREATE), but before the first WM_PAINT message. Are
>there any window messages that I can process that come after WM_CREATE
>and before WM_PAINT that gets called only once per instance?

I'd try WM_GETMINMAXINFO
--
Zweitze de Vries zwe...@et.tudelft.nl
Faculty of Electrotechnics
Delft University of Technology
Netherlands Never trust a virtual machine

coppe...@gmail.com

unread,
Mar 3, 2017, 11:51:27 AM3/3/17
to
WM_GETMINMAXINFO is (not sure if often, or always) the first message a WndProc gets.
0 new messages