Using FF_WINMAIN

Started by Patrice Terrier, February 17, 2010, 02:59:36 PM

Previous topic - Next topic

Patrice Terrier

About FF_WINMAIN the documentation says:
QuoteThe FF_WINMAIN message handler provides a means where the programmer can inject code immediately before the main message loop begins processing

And my question is:
If this function is fired just before the main message loop begins processing, how can we retrieve the main form handle from inside this function?

Paul Squires

The answer is that you can not. The reason being is that the main form is not created at that point. I guess the documentation implies that the main form is created but the message loop is not running yet. That is not correct. FF_WinMain is called prior to the CreateWindowEx for the main form of the application.

I guess a better explanation would be:
Quote
The FF_WINMAIN message handler provides a means whereby the programmer can inject code immediately before the creation of the main form of the application. It is a good place to perform program initialization and a means to be able to abort the further loading the program if required.

Paul Squires
PlanetSquires Software