program MNMXNO,1.0(101) ! MBST_MAXIMIZE, MBST_MINIMIZE, MBST_NORMALIZE !----------------------------------------------------------------------- !EDIT HISTORY ![100] april 06, 2010 03:41 PM Edited by jacques ! Created to test MBST_NORMALIZE (in 5.1.1178.0) ![101] avril 07, 2010 09:10 AM Edited by jacques ! Fix minor type in AUI_CONTROL call (NUL_CSTATE vs NUL_CSTATUS) !----------------------------------------------------------------------- ++include ashinc:ashell.def MAP1 CSTATE,B,4 MAP1 OP,B,4 MAP1 I,F ? tab(-1,0);"Test MBST_MAXIMIZE, MBST_MINIMIZE, MBST_NORMALIZE" ? "This program creates a dialog in one state, then changes it" ? "automatically to the other two states at 3 second intervals" input "Enter starting CSTATE: 1=normal, 2=max, 3=min: ",CSTATE if CSTATE=1 then CSTATE = MBST_NORMALIZE ! same as 0 when creating ? "Starting in normal state..." elseif CSTATE=2 then CSTATE = MBST_MAXIMIZE ? "Starting in maximized state..." elseif CSTATE=3 then CSTATE = MBST_MINIMIZE ? "Starting in minimized state..." else ? "Invalid choice" end endif CSTATE = CSTATE or MBST_ENABLE OP = CTLOP_ADD for I = 1 to 4 XCALL AUI, AUI_CONTROL, OP, "dlg1", "Test Dialog",CSTATE, & MBF_DIALOG+MBF_ALTPOS+MBF_SYSMENU,NUL_CMD$, NUL_FUNC$,NUL_CSTATUS, & ![101] 10, 5, 15, 40, NUL_FGC, NUL_BGC, NUL_FONTATTR, NUL_FONTSCALE,& NUL_FONTFACE$, NUL_TOOLTIP$,NUL_PARENTID, NUL_WINCLASS$, & NUL_WINSTYLE,NUL_WINSTYLEX xcall SLEEP,3 if I < 4 then if (CSTATE and MBST_MAXIMIZE) then CSTATE = MBST_NORMALIZE ? "Switching to normal..." trace.print "Switching to normal..." elseif (CSTATE and MBST_MINIMIZE) then CSTATE = MBST_MAXIMIZE ? "Switching to maximized..." trace.print "Switching to maximized..." else ! normal CSTATE = MBST_MINIMIZE ? "Switching to minimized..." trace.print "Switching to minimized..." endif CSTATE = CSTATE or MBST_ENABLE trace.print "CSTATE ="+CSTATE xcall SLEEP,1 OP = CTLOP_CHG endif next I trace.print "Closing dialog" xcall SLEEP,2 xcall AUI, AUI_CONTROL, CTLOP_DEL, "dlg1" end