LANIAN 2006. 11. 13. 11:42

#include <windows.h>
#include "resource.h"

BOOL CALLBACK MainDlgProc(HWND hDlg, UINT iMessage,WPARAM wParam,LPARAM lParam);
HINSTANCE g_hInst;
HWND hDlgMain;

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPervInstance
     , LPSTR lpszCmdParam, int nCmdShow)
{

g_hInst = hInstance;

DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG1), HWND_DESKTOP, MainDlgProc);

return 0;
}

BOOL CALLBACK MainDlgProc(HWND hDlg, UINT iMessage,WPARAM wParam , LPARAM lParam)
{

switch(iMessage)
{
case WM_INITDIALOG:
 hDlgMain = hDlg;
 return TRUE;
case WM_COMMAND:
 switch(LOWORD(wParam))
 {
 case IDOK:
 case IDCANCEL:
  EndDialog(hDlg,0);
  return TRUE;
 }
 return FALSE;
}
return FALSE;
}