... sounds easy but i've got troubls in doing it !!!!
i have a window in which i created a button (using CreateWindow("BUTTON", ...))
now i want the click on that button to be catched ... so i added :
LRESULT CALLBACK MyClass::WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
{
MyClass *pThis = ...
switch (uMessage)
{
case WM_NCCREATE:
{
...
}
break;
case WM_PAINT:
return pThis->OnPaint();
case BN_CLICKED():
return pThis->OnClickedLeBouton();
case WM_LBUTTONDOWN:
return pThis->OnLButtonDown();
case WM_COMMAND:
...
...
}
}
and this NEVER EVER calls the "OnClickedLeBouton()" function ....
BUT ... the clic on the button is catched by WM_COMMAND !!!
so i added
case WM_COMMAND:
switch (lParam)
{
case LE_BOUTON: // LE_BOUTON is the identifier for the button i created
return pThis->OnClickedLeBouton();
..
but it never catches the clic on the button anyway - it skips the "case ..."
do you have an explanation ? does it seem very weird to you or is it a normal behaviour ? i must missing something but i can't see exactly what :-/
i'll be glad with any help ))
i have a window in which i created a button (using CreateWindow("BUTTON", ...))
now i want the click on that button to be catched ... so i added :
LRESULT CALLBACK MyClass::WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
{
MyClass *pThis = ...
switch (uMessage)
{
case WM_NCCREATE:
{
...
}
break;
case WM_PAINT:
return pThis->OnPaint();
case BN_CLICKED():
return pThis->OnClickedLeBouton();
case WM_LBUTTONDOWN:
return pThis->OnLButtonDown();
case WM_COMMAND:
...
...
}
}
and this NEVER EVER calls the "OnClickedLeBouton()" function ....
BUT ... the clic on the button is catched by WM_COMMAND !!!
so i added
case WM_COMMAND:
switch (lParam)
{
case LE_BOUTON: // LE_BOUTON is the identifier for the button i created
return pThis->OnClickedLeBouton();
..
but it never catches the clic on the button anyway - it skips the "case ..."
do you have an explanation ? does it seem very weird to you or is it a normal behaviour ? i must missing something but i can't see exactly what :-/
i'll be glad with any help ))