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
   |  
BOOL CALLBACK PRSMaFenetreDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
 
switch (message)
{
// du code mais rien d'important pour la suite
 
  case WM_COMMAND:
     switch(LOWORD(wParam))
     {
         case ID_CB1:
            if (HIWORD(wParam) == CBN_SELCHANGE)
            {
                 if (GetDlgItemText(hDlg, ID_ASS_ALIAS, szBuff, sizeof(szBuff)) != 0)
                 {
 
                      // Ca passe bien tout ce code
 
                      if (strstr(strupr(szBuff), "XXX") == 0)
                          SendDlgItemMessage(hDlg, ID_CB2, CB_SETCURSEL, 3, 0L);
                      if (strstr(strupr(szBuff), "YYY") == 0)
                          SendDlgItemMessage(hDlg, ID_CB2, CB_SETCURSEL, 1, 0L);
                 }
            }
            break;
 
         case ID_CB2:
            // C'est ici que je veux récuperer le CB_SETCURSEL aussi
            if (HIWORD(wParam) == CBN_SELCHANGE)
            {
                 i = (int) SendDlgItemMessage(hDlg, ID_CB2, CB_GETCURSEL, 0, 0L);
                 if (i == 1 || i == 4)
                     CheckDlgButton(hDlg, ID_CHECKBOX1, BST_CHECKED);
            }
            break;
     }
     break;
}
 
} | 
Partager