Hi. I'm trying to put a status bar in my win32 app, using the following code:
(in case of WM_CREATE Message)
Code:
HWND hStatus;
int statwidths[] = {100, -1};
hStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL,
WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,
hwnd, (HMENU)ID_STATUS, GetModuleHandle(NULL), NULL);
SendMessage(hStatus, SB_SETPARTS, sizeof(statwidths)/sizeof(int), (LPARAM)statwidths);
SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)"Test");
if(hStatus == NULL)
MessageBox(hwnd, "Could not create StatusBar.", "Error", MB_OK | MB_ICONERROR);
I added the MessageBox bit in after I compiled and ran the app and saw no StatusBar. It seems hStatus is null and that no Status Bar has been created. Could somebody please advice me as to why this is? Thankyou for any replies.