- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a QuickWin program in which I would like to implement a "Close All" command--except that I want to leave one window open, unit 10. The other unit numbers are not known, although there's only one in the range 20-29, one in the range 30-39, .... Now, this works
but I need to deallocate arrays according to what unit is actually closed.
I thought something like the following would be helpful, but GetUnitQQ() always returned -1.
NextUnit = GetUnitQQ(GetWindow(GetHwndQQ(10), GW_HWNDNEXT))
Does anyone know how to fix this up? Otherwise I'm left with restoring and minimizing window unit 10 whenever it gets the focus, and that seems quite clunky!
I appreciate what a helpful forum this is!
Dick
DO I = 11, 99 CLOSE(I) ENDDO
but I need to deallocate arrays according to what unit is actually closed.
I thought something like the following would be helpful, but GetUnitQQ() always returned -1.
NextUnit = GetUnitQQ(GetWindow(GetHwndQQ(10), GW_HWNDNEXT))
Does anyone know how to fix this up? Otherwise I'm left with restoring and minimizing window unit 10 whenever it gets the focus, and that seems quite clunky!
INTEGER :: I, nUnit, NextWin ! Close all child windows except LUN=10 I = FOCUSQQ(10) nUnit = NextWin(10) DO WHILE(nUnit .NE. 10) CALL MY_CLOSE_ROUTINE(nUnit) I = INQFOCUSQQ(nUnit) IF (nUnit .EQ. 10) nUnit = NextWin(10) ENDDO : : INTEGER FUNCTION NextWin(RefWin) USE DFLIB IMPLICIT NONE INTEGER, INTENT(IN) :: RefWin INTEGER :: I, nWin TYPE (QWINFO) :: wc wc%type = QWIN$RESTORE I = SetWSizeQQ(RefWin,wc) wc%type = QWIN$MIN I = SetWSizeQQ(RefWin,wc) I = INQFOCUSQQ(nWin) IF (nWin .EQ. RefWin) THEN wc%type = QWIN$RESTORE I = SetWSizeQQ(RefWin,wc) ENDIF NextWin = nWin END FUNCTION NextWin
I appreciate what a helpful forum this is!
Dick
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use INQUIRE (UNIT=n,OPENED=logicalvar) to see if a unit is open, and then process accordingly.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, but of course! Thank you, Steve.

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