Rollup
Rolls up or down a dialog window
BOOL Rollup( BOOL bClose = TRUE )
returns non zero when operation succeedes else zero.
To run this example, put codes in a c file under \OriginC\Originlab folder.
class TestRollUpDlg : public ResizeDialog { public: TestRollUpDlg() : ResizeDialog( IDD_SIMPLEBOX, "ODlg8" ) { } int DoModalEx(HWND hParent) { InitMsgMap(); return DoModal(hParent); } protected: EVENTS_BEGIN ON_INIT( OnInitDialog ) ON_SYSCOMMAND(OnSystemCommand)//mostly on minimize/maxmize event ON_CLICK_KEY(OnKey)//on dialog rolling up EVENTS_END BOOL OnInitDialog() { //add minimize and maxmize buttons ModifyStyle(0, WS_MINIMIZEBOX|WS_MAXIMIZEBOX); return TRUE; } bool OnSystemCommand(int nCmd) { out_int("OnSystemCommand=", nCmd); if( SC_MINIMIZE == nCmd) { BOOL bClose = !IsRolledup(); Rollup(bClose); return FALSE; } return TRUE; } BOOL OnKey(BOOL bRollingUp) { out_str(bRollingUp?"RollingUp":"RollingUp false"); return TRUE; } }; void open_rollup_dlg() { TestRollUpDlg myDlg; HWND hWnd = GetWindow(); int nRet = myDlg.DoModalEx(hWnd); }
Dialog::IsRolledup
Dialog.h