Hi all,this is just some small lesson I do to teach myself C.
So like the title said I have main dialog and 2 push buttons on it , and
I would like to set a focus on button number 2 , but something is wrong with my code and I dont get focus on button.
#include <windows.h>
#include "hfile.h"
//proto
BOOL CALLBACK Dlg_Func ( HWND , UINT , WPARAM , LPARAM );
int WINAPI WinMain ( HINSTANCE hInst , HINSTANCE hPrevInst , LPSTR lpCmdLine , int iShowCmd ) {
return DialogBox ( hInst , MAKEINTRESOURCE ( DIALOG1 ) , NULL , Dlg_Func ) ;
}
BOOL CALLBACK Dlg_Func ( HWND hWnd , UINT msg , WPARAM wParam , LPARAM lParam ) {
switch ( msg ) {
case WM_INITDIALOG:
SetFocus ( GetDlgItem ( hWnd , PUSHB02 ) );
break;
case WM_COMMAND:
break;
case WM_CLOSE:
EndDialog ( hWnd , 0 );
break;
}
return FALSE;
}
So my first question is why I dont have focus and
second is should I use break statment for separating cases or not ?
thx for help...