Salut tous le monde !
J'ai un gros soucis ma boite de dialog
Je vous explique :
Dans ma boite de configuration, je souhaite sélectionner une couleur en cliquant sur un Picture control (IDC_CHOOSECOLOR).
Mais la boite de dialog ouverte par ChooseColor(&cc) ne s'ouvre qu'après avoir fermé ma fenêtre de configuration ??
J'ai remplacé la sélection d'une couleur par un simple MessageBox et le problème reste le même, la fenêtre MessageBox ne
s'ouvre qu'après avoir fermé ma fenêtre de configuration.
Je ne comprend pas pourquoi !
Voici mon code :
//----------------------
// Name: DoConfig()
// Desc:
//----------------------
VOID CMyClass::DoConfig()
{
DialogBox( NULL, MAKEINTRESOURCE(IDD_CONFIGURE), m_hWndParent, ConfigureDialogProcHelper );
}
//-----------------------------------------
// Name: ConfigureDialogProcHelper()
// Desc:
//-----------------------------------------
INT_PTR CALLBACK ConfigureDialogProcHelper( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
return g_pMyScreensaver->ConfigureDialogProc( hwndDlg, uMsg, wParam, lParam );
}
//----------------------------------
// Name: ConfigureDialogProc()
// Desc:
//----------------------------------
INT_PTR CALLBACK CMyClass::ConfigureDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
TCHAR sz[128];
DWORD iSpeed;
HWND hwndDC = GetDlgItem( hwndDlg, IDC_DENSITY_COLONNE );
HWND hwndDL = GetDlgItem( hwndDlg, IDC_DENSITY_LINE );
int cberr;
switch (uMsg)
{
case WM_PAINT:
ChangeColorOfPicObject(hwndDlg, IDC_CHOOSECOLOR, m_colRefCustom);
return TRUE;
break;
case WM_INITDIALOG:
WriteRegistry();
if( !m_bCustomColors )
CheckRadioButton( hwndDlg, IDC_DEFAULTCOLOR, IDC_CUSTOMCOLOR, IDC_DEFAULTCOLOR );
else
CheckRadioButton( hwndDlg, IDC_DEFAULTCOLOR, IDC_CUSTOMCOLOR, IDC_INTENSEPERSO );
// Set Chars density
wsprintf(sz, TEXT("%d"), m_iNb_Letters_By_Line);
SetWindowText(hwndDC, sz);
wsprintf(sz, TEXT("%d"), m_iNb_Line);
SetWindowText(hwndDL, sz);
return TRUE;
case WM_COMMAND:
switch( LOWORD( wParam ) )
{
case IDC_SCREENSETTINGS:
DoScreenSettingsDialog( hwndDlg );
break;
case IDC_CHOOSECOLOR:
MessageBox(NULL, "Salut", "Plop", 0);
//m_colRefCustom = DoChooseCustomColor(hwndDlg, m_colRefCustom);
break;
case IDOK:
m_bCustomColors = ( IsDlgButtonChecked( hwndDlg, IDC_CUSTOMCOLOR ) == BST_CHECKED );
WriteRegistry(); // save new settings
EndDialog(hwndDlg, IDOK);
break;
case IDCANCEL:
ReadRegistry(); // restore previous settings
EndDialog(hwndDlg, IDCANCEL);
break;
}
return TRUE;
break;
default:
return FALSE;
}
}
Si quelqu'un a une explication, une idée ...
Merci.
A+
:: NeKo ::