- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Im having some problems setting up a dialog tab control. I have modified the Angle example program and added a tab control to the dialog resource called 100. I have added the following code to the WM_CREATE message but the tab control displays nothing.
lret = DlgInit(100, gdlg)
lret = DlgSet(gdlg, IDC_TAB, 2,DLG_NUMITEMS)
!!!!! lret = DlgSetSub(gdlg, IDC_TAB, ChangeTabSub)
lret = DlgSet(gdlg, IDC_TAB, "Input Parameters", 1)
lret = DlgSet(gdlg, IDC_TAB, "Output Parameters", 2)
lret = DlgSet(gdlg, IDC_TAB, IDD_TAB_DIALOG1, 1)
lret = DlgSet(gdlg, IDC_TAB, IDD_TAB_DIALOG2, 2)
!!!!! lret = DlgSetSub(gdlg, IDC_TAB, ChangeTabSub)
lret = DlgSet(gdlg, IDC_TAB, "Input Parameters", 1)
lret = DlgSet(gdlg, IDC_TAB, "Output Parameters", 2)
lret = DlgSet(gdlg, IDC_TAB, IDD_TAB_DIALOG1, 1)
lret = DlgSet(gdlg, IDC_TAB, IDD_TAB_DIALOG2, 2)
I don't think I have a handle to the dialog as it is shown with the following code before I added my own code.
hwndDlg = CreateDialogParam(hInst, INT4(100), hwnd, LOC(DlgProc), 0)
hDlg = hwndDlg
hDlg = hwndDlg
lret = ShowWindow(hwndDlg, SW_SHOW)
How can I get a handle to the dialog so that I can use DlgSet()? I have attached the full code incase there is a better place to set up the tab control.
Any help greatly appreciated.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use DgInit(IDD_DIALOG, Dlg) to create a dialog box, you must define Dlg as drived type TYPE DIALOG:
USE DFLOGM
type (dialog) dlg
you can thenget the dialog window handle as Dlg%hWnd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code that shows the dialog is not lret = DlgInit(100, gdlg) but the following:
hwndDlg = CreateDialogParam(hInst, INT4(100), hwnd, LOC(DlgProc), 0)
hDlg = hwndDlg
hDlg = hwndDlg
lret = ShowWindow(hwndDlg, SW_SHOW)
How can I set up the tab control from the ShowWindow function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You apparently get the dialog handle as HwndDlg from CreateDialogParam.
To set up the dialog as you want it, you can send messages to dialog items using SendDlGItemMessage
Code:
SendDlgItemMessage( HWND hDlg, & !handle of dialog box int nIDDlgItem, & ! identifier of control UINT Msg, & ! message to send WPARAM wParam, & ! first message parameter LPARAM lParam & ! second message parameter )
All the Tab controlmessages you need , along with the parameters they require can be found by searching the Help for messages beginning TCM_ .
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page