RedPanda-CPP/templates/Single_Dialog_Application_m...

43 lines
994 B
Plaintext
Raw Normal View History

#include <windows.h>
#include "resource.h"
HINSTANCE hInst;
LRESULT MainDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {
MSG msg;
HWND hMainDlg = NULL;
hInst = hInstance;
hMainDlg = CreateDialog(hInstance, (LPCTSTR)IDD_MAIN_DIALOG, 0,(DLGPROC)MainDlgProc);
ShowWindow(hMainDlg, nCmdShow);
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT MainDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
switch (message) {
case WM_INITDIALOG :
return TRUE ;
case WM_COMMAND :
switch (LOWORD (wParam)) {
case IDOK :
case IDCANCEL :
DestroyWindow(hDlg);
return TRUE ;
}
break ;
case WM_CLOSE:
DestroyWindow(hDlg);
return TRUE;
case WM_DESTROY:
PostQuitMessage(0);
return TRUE;
};
return FALSE;//<2F><><EFBFBD><EFBFBD>FALSE<53><45>ȱʡ<C8B1>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DefDlgProc(),<2C><>ʾû<CABE>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
}