- how can i return the window class name?
Aug 25, 2015 at 2:06pm UTC
i thot that for get the window class name:
1 2
char chrClassName[255];
int b=GetClassName (fb,chrClassName,255);
but gives me the window title. can anyone give me the function name for get the window class name?
(that class name that we regist before create the window)
Aug 25, 2015 at 2:28pm UTC
seems that function is ok... i was doing 1 big problem with class name:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
WNDCLASSEX FormClass;
char classname[20]="Form" ;
sprintf(classname,"%s" ,strCaption.c_str());//problem
HINSTANCE mod = (HINSTANCE)GetModuleHandle(NULL);
FormClass.cbSize = sizeof (WNDCLASSEX);
FormClass.style = CS_DBLCLKS;
FormClass.lpfnWndProc = WndProcForm;
FormClass.cbClsExtra = 0;
FormClass.cbWndExtra = 0;
FormClass.hInstance = mod;
FormClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
FormClass.hCursor = LoadCursor(NULL, IDC_ARROW);
FormClass.hbrBackground = (HBRUSH)GetSysColor(COLOR_BACKGROUND);
FormClass.lpszMenuName = NULL;
FormClass.lpszClassName = classname;
FormClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
// register the new window class
RegisterClassEx(&FormClass);
i did an error on that class name using the sprintf().. now works fine.
thank for all
Topic archived. No new replies allowed.