DialogBar
constructor
DialogBar( )
EX1
#include <Origin.h> #include <..\Originlab\dialogex.h> //Need to created a dialog bar in some resource project #define IDD_DIALOGBAR1 103 #define IDC_BUTTON1 2382 #define IDC_EDIT1 2383 class BarDialog : public Dialog { public: BarDialog() :Dialog(IDD_DIALOGBAR1, "oDlg8.dll") { } BOOL Create(HWND hWnd) { InitMsgMap(); return Dialog::Create(hWnd); } BOOL OnInitDialog() { Edit edt = GetItem(IDC_EDIT1); edt.Text = "Default"; return TRUE; } BOOL OnDestroy() { out_str("Destroyed Bar"); return TRUE; } BOOL OnMessage(Control cntrl) { out_str("On Message"); Edit edt = GetItem(IDC_EDIT1); //MessageBox( GetWindow(), edt.Text); return TRUE; } EVENTS_BEGIN ON_INIT( OnInitDialog ) ON_DESTROY(OnDestroy) ON_BN_CLICKED(IDC_BUTTON1, OnMessage) EVENTS_END }; void test_me() { static BarDialog dlg; static DialogBar dlgBar; if(dlgBar) { dlgBar.Destroy(); return; } dlgBar.CreateControl(dlg); }
Dialog.h