I'm trying to accomplish what should be a simple task: I'm trying to create a toolbar. The code is good, yet the tool bar fails to load. I'm using the Dev-C++ package and am still learning how to use the tools. For some reason the CreateWindowEx() function isn't loading and returning a handle for the toolbar. There seems to be a problem with the header file because I have no other explanation for the program to fail as it does. If anybody knows a reason for this failure that better explains the problem and can offer a solution, I would like to hear from you.
//////////////////////////////////////////////////////////////
#include <commctrl.h>
...
...
...
case WM_CREATE:
{
0 should be the handle to the parent window for the Toolbar.
Also, you should be able to get getLastError() (or similar) to get the error that occurred during CreateWindowEx();
HWND CreateWindowEx(
DWORD dwExStyle, // extended window style
LPCTSTR lpClassName, // pointer to registered class name
LPCTSTR lpWindowName, // pointer to window name
DWORD dwStyle, // window style
int x, // horizontal position of window
int y, // vertical position of window
int nWidth, // window width
int nHeight, // window height
HWND hWndParent, // handle to parent or owner window
HMENU hMenu, // handle to menu, or child-window identifier
HINSTANCE hInstance, // handle to application instance
LPVOID lpParam // pointer to window-crea
Thanks for the link. I have tried to use the InitCommonControls() function, but that makes the program crash. I've also tried InitCommonControlsEx. The results are the same. I'm wondering if the lib file "libcomctl32.a" is not corrupt. It truly is frustrating.
Welp, I tried code sample from your above link... It worked. I don't understand why mine couldn't muster up even a handle, since it was pretty much the same thing. Anyway, I will be playing with it for a few days to get a better grip on it. Thanks for your help.