WINDOWS
Deactivate a window
I made a paint soft using PG, but I found the following problem. When my app is deactivate, the front most window of it is still active. How can I improve this problem? My app use palette (floater window), too. I want to hide when my app send back.
There's a Tech Note (#11) about this at the Staz web site. It's a bug in the way FB handles floating windows. The code at the web site fixes most of the problems, but it's still a little ugly when you switch layers.
Thanks for your advice. I could improve the problem.
The following code works well. (Save it as a FixDocWnd.FLTR and the include it in your project Main file)
INCLUDE FILE _aplIncl
GLOBALS "Runtime.GLBL"
COMPILE 0,_pGproject_dimmedVarsOnly
END GLOBALS
GOTO "Start"
LOCAL FN fixDocWindows(Hilite%)
DIM doc%,wDocPtr&
DIM plt%,wPltPtr&
DIM Modal%
doc% = WINDOW(_ActiveDoc)
LONG IF doc%
plt% = WINDOW(_ActivePlt)
LONG IF plt%
GET WINDOW plt%,wPltPtr&
Hilite% = Hilite% AND (PEEK(@wPltPtr&.wHilited%))<>0
Modal% = wPltPtr&.wRefCon& AND 32768
LONG IF Modal%
Hilite% = _False
END IF
END IF
GET WINDOW doc%,wDocPtr&
LONG IF (PEEK(@wDocPtr&.wHilited%)<>0) <> Hilite%
CALL HILITEWINDOW (wDocPtr&,Hilite%)
CALL DRAWGROWICON (wDocPtr&)
END IF
END IF
END FN
'------------ Main Entry
"Start"
SELECT gLongAction&
CASE _oSwitch
FN fixDocWindows(gInBackground% = _false)
END SELECT
IF 0 THEN RETURN
|