Ahhh... Ok. Win95. My example was for 16bit windows... I'm no expert on Win32 though. Below is an exerpt from a win32 help file (Hope it helps)<br>
<br>
The WinMain function is called by the system as the initial entry point for a Win32-based application. <br>
<br>
int WINAPI WinMain(<br>
<br>
HINSTANCE hInstance, // handle to current instance<br>
HINSTANCE hPrevInstance, // handle to previous instance<br>
LPSTR lpCmdLine, // pointer to command line<br>
int nCmdShow // show state of window<br>
); <br>
Parameters<br>
<br>
hInstance<br>
<br>
Identifies the current instance of the application. <br>
<br>
hPrevInstance<br>
<br>
Identifies the previous instance of the application. For a Win32-based application, this parameter is always NULL. If you need to detect whether another instance already exists, create a named mutex using the CreateMutex function. If the GetLastError function returns ERROR_ALREADY_EXISTS, another instance of your application exists (it created the mutex).<br>
<br>
lpCmdLine<br>
<br>
Points to a null-terminated string specifying the command line for the application. <br>
<br>
nCmdShow<br>
<br>
Specifies how the window is to be shown. This parameter can be one of the following values: <br>
<br>
Value Meaning<br>
SW_HIDE Hides the window and activates another window.<br>
SW_MINIMIZE Minimizes the specified window and activates the top-level window in the system’s list.<br>
SW_RESTORE Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position (same as SW_SHOWNORMAL).<br>
SW_SHOW Activates a window and displays it in its current size and position.<br>
SW_SHOWMAXIMIZED Activates a window and displays it as a maximized window.<br>
SW_SHOWMINIMIZED Activates a window and displays it as an icon.<br>
SW_SHOWMINNOACTIVE Displays a window as an icon. The active window remains active.<br>
SW_SHOWNA Displays a window in its current state. The active window remains active.<br>
SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.<br>
SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position (same as SW_RESTORE).<br>
Return Values<br>
<br>
If the function succeeds, terminating when it receives a WM_QUIT message, it should return the exit value contained in that message’s wParam parameter. If the function terminates before entering the message loop, it should return 0. <br>
<br>
Remarks<br>
<br>
WinMain initializes an application, displays its main window, and then enters a message retrieval-and-dispatch loop that is the top-level control structure for the remainder of the application’s execution. The message loop terminates when a WM_QUIT message is received. At that point, WinMain exits the application, returning the value passed in the WM_QUIT message’s wParam parameter. If WM_QUIT was received as a result of calling PostQuitMessage, the value of wParam is the value of the PostQuitMessage function’s nExitCode parameter. For more information, see Creating a Message Loop.<br>
<br>
<p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href=
Page</a><br>