Yep,
C'est pas compliqué ...
Dans ta fonction de Callback, tu dois traiter le message Param pour detecter l'appuie sur un bouton ou autre ...
Voici un exemple complet avec 2 boutons sur ton Dialog( IDOK et IDCANCEL). Ce sont ceux par défaut sous visual c++ :
#include <windows.h>
#include "resource.h"
HWND hDlg;
HINSTANCE hInst;
BOOL CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
hDlg = hWnd;
return 1;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
MessageBox(hWnd,"Salut tu as appuyer sur le bouton OK","Titre",MB_ICONINFORMATION);
break;
case IDCANCEL:
EndDialog(hWnd,IDCANCEL);
break;
}
break;
}
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
hInst = hInstance;
return DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc, NULL);
}
A++ et bonne continuation ...
Samir