|
-
March 4th, 2008, 03:29 PM
#1
CreateWindowEx - no result
Hello gurus.
Problem:
function CreateWindowEx does not create statusbar window, where everything is fine. I am using Visual Studio 8. See following code please:
Code:
HWND hwnd = CreateWindowEx(
0,
STATUSCLASSNAME,(TCHAR*)NULL,
WS_VISIBLE | WS_CHILD | SBARS_SIZEGRIP,
0,0,0,0,
parenthwnd, //it is valid
(HMENU)unique_ID, //1005
GetModuleHandle(NULL),
NULL
);
Where:
1. I have initialized Common Controls using ICC_BAR_CLASSES, so it is not issue
2. parenthwnd is valid window handle
Question:
1. Why there is no window created ? where hwnd is NULL as result of this function.
2. I am compiling it as UNICODE application, can this be issue?
3. You have any other suggestion using which I can make it work ?
Waiting for the kind reply. It is really strange how statusbar is not being created.
regards
-
March 4th, 2008, 05:00 PM
#2
Re: CreateWindowEx - no result
This is from the MSDN docs for CreateWindowEx:
If the function succeeds, the return value is a handle to the new window.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
This function typically fails for one of the following reasons:
- an invalid parameter value
- the system class was registered by a different module
- The WH_CBT hook is installed and returns a failure code
- if one of the controls in the dialog template is not registered, or its window window procedure fails WM_CREATE or WM_NCCREATE
-
March 4th, 2008, 05:05 PM
#3
Re: CreateWindowEx - no result
Resolved.
Actaully am polishing my library to port it to MSVC and instance of parent class passed did not have valid handle, and it was destroyed before being assigned as parent window.
Thanks for your input.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|