1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| #include <afxwin.h>
#include "resource.h" // Pour utiliser les ressources
// Prototype de notre fonction
LRESULT CALLBACK MainProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam);
// Rien de spécial ici
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
DialogBox(hInstance,(LPCTSTR)IDD_MAIN,NULL,(DLGPROC)MainProc);
return 0;
}
// Procédure de gestion de la boite de dialogue
LRESULT CALLBACK MainProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam)
{
int Select;
switch(message)
{
case WM_COMMAND:
Select=LOWORD(wParam);
switch(Select)
{
case IDC_RUNSRV:
//SetDlgItemText(Dlg,IDC_SRVLOG,"Hello World !!\r\n");
GetDlgItem(Dlg, IDC_SRVLOG)->SetWindowText(_T("Hello World !!\r\n"));
return TRUE;
case IDOK:
EndDialog(Dlg,0);
return TRUE;
case IDCANCEL:
EndDialog(Dlg,Select);
return TRUE;
}
default:
return FALSE;
}
} |
Partager