creating a tab control using CreateWindowEx

creating a tab control using CreateWindowEx


I'm trying to create a tab control in a Fortran Windows Application in CVF. Iused the following code inthe MainWndProc() function.


    iccex%dwSize = sizeof(iccex)
       iccex%dwICC = ICC_TAB_CLASSES
    call initCommonControlsEx(iccex)
    hwndTab = CreateWindowEx(0, WC_TABCONTROL, ""C, &
     ior(WS_CHILD, IOR(WS_VISIBLE,TCS_MULTILINE)), 0, 0, 0, 0, hwnd, &
     IDC_TAB1, ghInstance, Null)
    MainWndProc = 0

However I get the following error:
C:Documents and Settings
gawadeMy DocumentsoVF est1 est1.f90(187) : Error: This name does not have a type, and must have an explicit type. [WC_TABCONTROL] hwndTab = CreateWindowEx(0, WC_TABCONTROL, ""C, & ----------------------------------------------^ Error executing df.exe.

I then tried to use some other common control windows classes in CreateWindowEx, some of them work and others don't.
Is there some other way to insert a tab control in the main window? I want to make something that looks like the Properties window.


5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

character(*), parameter:: WC_TABCONTROL = "systabcontrol32"C

unfortunately, for some reason, is not defined in CVF's DFWINTY.f90, but you can use the literal string instead.


Yes, I figured that out. For some reason it is defined as

character*15, parameter :: TAB_CLASS_NAME = "SysTabControl32"C

But I still could't see the tab control when i start the application.

Finally I just inserted the tab control in a modeless dialog box that is created in WM_CREATE.

I don't like this too much. Is there a better way to do this?

In your posted code, Tab control's dimensions are zero -- does that explain why you don't see it :o) ? (Tip: you can use Spy++ application to examine hierarchy and properties of all windows in the system).

Otherwise, approaches with modeless child dialogs are frequently used for "property window" kinds of stuff, because they're simpler to design and maintain than a bunch of CreateWindows, but in your case you'd probably want the tab control as direct child of main window, and child dialogs as children of the tab control.


silly me
it works now...thanks so much!


Leave a Comment

Please sign in to add a comment. Not a member? Join today