Is there anyway to put a common control such as a progressbar, etc. on a main window without using a complete window made as a dialog?
Posted on 2003-05-17 19:04:27 by Knight Chat X
What do you mean? You can place progressbars both on windows and dialogs.
Posted on 2003-05-17 19:13:34 by comrade
It's nearly just like creating any other window.

Use CreateWindow or CreateWindowEx.
For the lpClassName parameter specify the control's class name.
For dwStyle include the WS_CHILD style.
For hWndParent specify your app window.
For the hMenu parameter specify the child ID you want to give it.
Posted on 2003-05-17 19:20:36 by iblis
Well so far all attempts to successfully add a common control like progressbar etc. to a window created with the createwindowex function have failed.

However, i can create a dialog and add the common controls on a dialog window, but not put the controls on main window for some reason.
Posted on 2003-05-17 19:26:00 by Knight Chat X
InitializeCommonControls
Posted on 2003-05-17 19:55:52 by comrade
Here is an example
Posted on 2003-05-18 00:16:58 by WinCC
Thanks!

Just found answer below:
http://www.websteves.com/win32asm/winclass.htm
Posted on 2003-05-18 10:08:43 by Knight Chat X
Got another problem with creating controls on the main window, grrrrrrr, looked at code over & over and still don't see why it isn't working.

Ok, I looked over the "tab_control.zip" code to compare and it compiles just fine, but when I tried to test it in my own project it wouldn't create anything but the main window.

Also, I'm running Windows XP, but don't know if that has anything to do with it or not.

Any help is appreciated thanks!

Here's the code:
Posted on 2003-05-19 14:13:18 by Knight Chat X
You are using hMain instead of hwnd.

When you call CreateWindowEx for the main window, WM_CREATE is sent before you even return from CreateWindowEx (so hMain is still uninitialized). The parameter hwnd, however, has the handle for the just created main window when you receive WM_CREATE.
Posted on 2003-05-19 15:48:28 by tenkey
What I would like to know, is.. how to create controls on a dialog but use them on a main window (client).. so I don't have to convert between DIALOG and SCREEN coordinates.. or use stuff like GetDlgItem()..

CreateWindowEx(...) does the job but you have to go back and forth, figuring out the coords on how to line each of the controls up.. when using a dialog editor is sooo much easier..

anyone know where I am coming from here?
Posted on 2003-05-24 15:46:38 by drarem