Windows API Tab Controls

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Windows API Tab Controls
by on (#33306)
Anyone? I can't use the MFC examples provided, and there seems to be no where on the web that has an example for me to study. I am using Windows API + C++ with Microsoft Visual C++ 6.0. All I am after is a few simple tabs for my settings window. :cry: :D

by on (#33307)
I use tabs in my DS emulator. Get http://dualis.1emu.net/files/dlsgui-14-src.zip, then take a look in tabs.h/cpp and dualis.cpp (around where it calls create_propsheet).

by on (#33312)
I'm not using a dialog box, but an actual window. So I can't use the resource method.

If you examine the *.rc file, you can see that it uses the method this web site has to create the things for the DialogBox, but it creates the DialogBox indirectly passing the data using a parameter. Can I use this method with CreateWindowEx? Perhaps I could use the final parameter to pass the info?

http://www.softintegration.com/chhtml/toolkit/demos/Windows/demos/dialogboxindirect.html

by on (#33313)
When you get WM_INITDIALOG in the DlgProc for a given tab, feel free to slap on as many code-generated controls as you wish.

by on (#33316)
But I'm not using a DialogBox. Can I use a normal window or not?

by on (#33328)
Sure, I'm also putting the tabs on a normal window.

It's just the content you put on each tab that are dialogs (create dialogs without border and caption).

by on (#33331)
Aaaahhhhhh...
Oooohhhhhh...

Nice one. But the whole program seems to just freeze up whenever I load the window with the DialogBoxIndirect in it. Any ideas why?

by on (#33336)
No idea without knowing what the relevant code looks like (i.e. your tab creation code, dialog callbacks etc).

by on (#33341)
Do I have to include IsDialogMessage into my main windows loop or anything else to the loop?

by on (#33355)
I don't use it. I use PeekMessage with hwnd set to NULL.