|
From: <rgo...@li...> - 2007-02-02 18:17:19
|
Hello all.
This is my first post.
I already look at the archives and found very important things but I =
still
have a problem.
=20
I want to make a status bar.
I'm using mingw with gcc 3.4.2 under Bloodshed Dev-C++.
=20
In my file I include the following declaration:
#define _WIN32_IE 0x0500
=20
After that I include the headers:
#include <windows.h>
#include <commctrl.h>
=20
In the WinMain function I load the common controls with the code:
INITCOMMONCONTROLSEX myCommonCtrls;
myCommonCtrls.dwSize =3D sizeof( INITCOMMONCONTROLSEX );
myCommonCtrls.dwICC =3D ICC_BAR_CLASSES;
InitCommonControlsEx( &myInitCtrls );
=20
After that, in the WM_CREATE message of the windows procedure I create =
the
status bar.
=20
If I use the code:
hStatus =3D CreateStatusWindow( WS_CHILD | WS_VISIBLE | WS_BORDER, =
"Ready",
hwnd, ID_STATUS_BAR );
Everything works ok.
=20
But in msdn I saw that CreateStatusWindow function is obsolete and I =
must
use CreateWindow instead.
When I create the status bar using CreateWindow the status bar don't
appears.
The code is as follows:
hStatus =3D CreateWindow( "STATUSCLASSNAME", "", WS_CHILD | WS_VISIBLE =
|
WS_BORDER | SBARS_SIZEGRIP | CCS_BOTTOM,
0, 0, 0, 0, hwnd, (HMENU) ID_STATUS_BAR, CurrenthInstance, NULL );
=20
If I use CreateWindowEx with no extra style the result is the same.
I also try putting the code in the WinMain function and the result is =
the
same.
=20
So I can=92t I use CreateWindow to create a status bar? What am I doing =
wrong?
I found many examples in the internet and many used CreateWindow =
function
and were compiled with gcc.
=20
I also link using the libcomctl32.a library.
=20
Best regards.
Rui
=20
|