16,471
社区成员
发帖
与我相关
我的任务
分享
int WINAPI _tWinMain(HINSTANCE hInstExe, HINSTANCE, PTSTR pszCmdLine, int) {
HWND hWnd =
CreateDialog(hInstExe, MAKEINTRESOURCE(IDD_SCHEDLAB), NULL, Dlg_Proc);
BOOL fQuit = FALSE;
while (!fQuit) {
MSG msg;
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (!IsDialogMessage(hWnd, &msg)) {
if (msg.message == WM_QUIT) {
fQuit = TRUE;
} else {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
} else {
//这里运行自己的代码,写对话框中的列表
}
}
DestroyWindow(hWnd);
return(0);
}
BOOL CMyApp::InitInstance()
{
MyDlg dlg = new MyDlg();
m_pMainWnd = &dlg;
dlg.Create(IDD_DIALOG1);
dlg.ShowWindow(SW_SHOW);
return TRUE;
}
int CWinApp::Run()
{
if (m_pMainWnd == NULL && AfxOleGetUserCtrl())
{
// Not launched /Embedding or /Automation, but has no main window!
TRACE(traceAppMsg, 0, "Warning: m_pMainWnd is NULL in CWinApp::Run - quitting application.\n");
AfxPostQuitMessage(0);
}
return CWinThread::Run();
}