Hello all,
I have a window with a tab control on it, what I need to do is get the resource dialog and place it into the tab control and show/hide as needed.
for the life of me I can not get it to work, could you take a look at the source give me an idea of where the malfunction is?
Any help would be greatly appreciated..
Thanks
I have a window with a tab control on it, what I need to do is get the resource dialog and place it into the tab control and show/hide as needed.
for the life of me I can not get it to work, could you take a look at the source give me an idea of where the malfunction is?
Code:
#Compile Exe #Include "Win32Api.Inc" #Include "COMMCTRL.INC" '#Resource "<add resource with dialog>" '=================================================================== '103 DIALOGEX 0, 0, 249, 182 'STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU 'FONT 8, "MS Shell Dlg", 400, 0, 0x1 'BEGIN ' DEFPUSHBUTTON "OK",1041,192,7,50,14 ' PUSHBUTTON "Cancel",1042,192,24,50,14 ' PUSHBUTTON "Apply",1043,193,41,49,14 'END '=================================================================== %DIALOG_ID = 103 'or whatever number you want %APP_OK = 1041 %APP_CLOSE = 1042 %APP_APPLY = 1043 CallBack Function OptionsDialog() As Long Local hDlg As Long Select Case CbMsg Case %WM_INITDIALOG hDlg = CreateDialogParam(GetModuleHandle(ByVal %NULL), ByVal 103, CbHndl, 0, 0) 'CodePtr(hDlgFrame1), 0) If hDlg = 0 Then MsgBox "ERROR " & Str$(getLastError()) End If Dialog Set Loc hDlg,0,0 Dialog Set Size hDlg,500,500 Dialog Show State hDlg, %SW_SHOW Case %WM_COMMAND Select Case CbWParam Case %APP_OK EndDialog CbHndl, %APP_OK Case %APP_CLOSE EndDialog CbHndl, %APP_CLOSE Case %APP_APPLY EndDialog CbHndl, %APP_APPLY End Select End Select Function = %FALSE End Function Function PBMain Local hDlg As Long Local lRslt As Long Local szBuf As Asciiz * 32 Local hCtl As Long Local tTabItem As TC_ITEM Dialog New 0, "Options", 73, 82, 250, 225, %WS_POPUP Or _ %WS_BORDER Or %WS_DLGFRAME Or %WS_SYSMENU Or %WS_MINIMIZEBOX Or _ %WS_MAXIMIZEBOX Or %WS_CLIPSIBLINGS Or %WS_VISIBLE Or %DS_MODALFRAME _ Or %DS_3DLOOK Or %DS_NOFAILCREATE Or %DS_SETFONT, %WS_EX_WINDOWEDGE _ Or %WS_EX_CONTROLPARENT Or %WS_EX_LEFT Or %WS_EX_LTRREADING Or _ %WS_EX_RIGHTSCROLLBAR Or %WS_CHILD, To hDlg ' Control Add "SysTabControl32", hDlg, 540, _ "SysTabControl32_1", 5, 5, 240, 195, %WS_CHILD Or %WS_CLIPSIBLINGS Or %WS_VISIBLE Or _ %WS_TABSTOP Or %TCS_SINGLELINE Or %TCS_TABS, %WS_EX_LEFT Or _ %WS_EX_LTRREADING Control Handle hDlg, 540 To hCtl tTabItem.Mask = %TCIF_TEXT tTabItem.iImage = -1 tTabItem.pszText = VarPtr(szBuf) szBuf = "General" TabCtrl_InsertItem(hCtl, 0, tTabItem) Dialog Show Modal hDlg, Call OptionsDialog 'To lRslt Function = lRslt End Function
Thanks
Comment