본문 바로가기
Code review

[WinApi]Dialog base start

by cafrisun 2009. 5. 27.
 

간단한 Dialog base application start~

이미지를 클릭하시면 원본크기로 보실수 있습니다.
                     <IDD_DIALOG>

01: #include "windows.h"
02: #include "resource.h"
03:
04: BOOL CALLBACK DlgProc (HWND, UINT, WPARAM, LPARAM) ;
05:
06: int APIENTRY WinMain(HINSTANCE hInstance,
07:                      HINSTANCE hPrevInstance,
08:                      LPSTR     lpCmdLine,
09:                      int       nCmdShow)
10: {
11:     DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG), NULL, (DLGPROC)DlgProc);
12:     return 0;
13: }
14:
15:
16: BOOL CALLBACK DlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
17: {
18:         switch (message)
19:         {
20:                 case WM_INITDIALOG :
21:                         return TRUE;
22:
23:                 case WM_COMMAND :
24:                         switch(LOWORD(wParam))
25:                         {
26:                                 case IDOK :
27:                                 case IDCANCEL :
28:                                         EndDialog(hDlg, 0);
29:                                         return TRUE;
30:                         }
31:                         break;
32:         }
33:         return FALSE;
34: }


반응형

'Code review' 카테고리의 다른 글

[C]time functions  (0) 2009.05.27
[WinApi]GetLogicalDrives()  (0) 2009.05.27
[C]Fucntion comment  (0) 2009.05.27