OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Specifying the main window display mode

You can change how your application's main window is displayed by setting the TApplication data member nCmdShow, which corresponds to the WinMain parameter nCmdShow.

You can set this variable as soon as the Run function begins, up until the time you call TApplication::InitInstance(). This effectively means you can set nCmdShow in either the InitApplication or InitMainWindow function. For example, suppose you want to display your window maximized whenever the user runs the application. You could set nCmdShow in your InitMainWindow function as follows:

#include <owl\applicat.h>
#include <owl\framewin.h>
class TMyApplication : public TApplication
{
TApplication(name) {}
void InitMainWindow();
};
void TMyApplication::InitMainWindow() {
//Sets the main window.
SetMainWindow(new
TFrameWindow(0,
"Maximum Window"));
// Causes main window to be maximized
nCmdShow = SW_SHOWMAXIMIZED;
}
int OwlMain(int argc, char* argv[])
{
return
TMyApplication("Wow!").Run();
}
Definition of class TApplication.
Definition of class TFrameWindow.
STDAPI_(owl::TDocTemplate **) GetDocTemplateHead(owl STDAPI_(owl::TModule **) GetModulePtr(owl in OwlMain)(int argc, TCHAR *argv[])
Main entry point for an Owl application.
Definition module.h:391

nCmdShow can be set to any value appropriate as a parameter to the ShowWindow Windows function or the TWindow::Show() member function, such as SW_HIDE, SW_SHOWNORMAL, SW_NORMAL, and so on.