Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29419 Discussions

creating a tab control using CreateWindowEx

nandita
Beginner
2,581 Views
Hi,
I'm trying to create a tab control in a Fortran Windows Application in CVF. Iused the following code inthe MainWndProc() function.
Code:
 type (T_INITCOMMONCONTROLSEX) iccex
 ...
 case(WM_CREATE)
    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
    return
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.
Thanks,
nandita
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
2,581 Views
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.
Jugoslav
0 Kudos
nandita
Beginner
2,581 Views
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?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
2,581 Views
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.
Jugoslav
0 Kudos
nandita
Beginner
2,581 Views
silly me
it works now...thanks so much!
nandita
0 Kudos
Reply