Thanks for any advice,
Kurt
>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. |
--------------------------------------------------------------------------
Post a message to yourself while handling WM_CREATE.
moo
--
----------------------------+-----------------------------------------------
Ron Klatchko | Been there, done that,
r...@crl.com | Bought the t-shirt
>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
>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