PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Patrice Terrier on February 17, 2010, 02:59:36 PM

Title: Using FF_WINMAIN
Post by: Patrice Terrier on February 17, 2010, 02:59:36 PM
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?
Title: Re: Using FF_WINMAIN
Post by: Paul Squires on February 17, 2010, 03:21:02 PM
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.