开发者

Is it correct/proper to use DialogBox as the main window?

开发者 https://www.devze.com 2023-01-07 07:20 出处:网络
Is it correct-proper as in windows doesn\'t say it\'s bad or not recommended. For example like this: int APIENTRY _tWinMain(HINSTANCE hInstance,

Is it correct-proper as in windows doesn't say it's bad or not recommended.

For example like this:

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hP开发者_如何转开发revInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);
    UNREFERENCED_PARAMETER(nCmdShow);

    INT_PTR result = DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAINWINDOWBOX), nullptr, MainWindow);

    return static_cast<int>( result );
}


Using a Dialog Box as the main window is actually supported as one of the default configurations by MFC, so yes, that's fine (according to Microsoft).

For what it's worth, virtually every Windows app I've written in years used a dialog box as the main window, but that's because I don't write office-type applications.


Yes definitely...Haven't you seen calculator (calc.exe)? it is a dialog based application having main window as a dialog.

0

精彩评论

暂无评论...
验证码 换一张
取 消