🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #976

Re: Detecting Full-screen DOS apps

#976
From: David D'SOUZA
Date: Tue, 25 Dec 1990 21:18
37 lines
2488 bytes
In article <140@cf_su20.cf_su10.Sbi.COM> nee@cf_su14.Salomon.Com (Robert Nee) writes:
>
>I have a question for all of you experts.  How can I determine if
>a DOS application is running full screen under windows.  I am
>writing a windows program that opens a window in the background but
>I need to be able to determine if the user is in a full screen DOS
>session first to prevent from dumping him back into windows.

Actually, the problem is more general that you expect.  Say the user is
typing into a database Windows apps.  I have entered the first 4 digits
into a phone number field. Now, your app suddenly (say on a WM_TIMER
message) brings up some "random" window. It takes the focus/activation
away from the data base and puts it to your window.

Well, lots of apps do data validation on the field when they lose the
focus. And then they put up a messagebox telling the user what went
wrong. And when the message box is dismissed, the focus/activations
then goes back to the telephone field.  This sort of thing really
confuses users just like suddenly getting kicked out of your dos box.

Or, say I am running a paint program and drawing something and suddenly
your window pops up over my work of art... Bizarre things happen...


Check out the way DOS boxes were implemented.  If you switch away from
them and they need to give you a message, they flash their icon at you
(and maybe MessageBeep also). Next time you alt-tab (or whatever) to
them, they display their message box at a more friendly time.

An alternative: Create your window invisible. Then use SetWindowPos to
position your window behind the currently active window
(GetActiveWindow()).  Then, use SetWindowPos SWP_SHOWWINDOW |
SWP_NOACTIVATE to show your window without activating it.  If your
window is reasonably small, you could probably get away with bringing
it on top of the currently active window as long as you don't activate
it. (Otherwise the user won't see anything if the foreground app is
maximized for example.)
Technical Details
Message-ID: <60017@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!davidds
References: <140@cf_su20.cf_su10.Sbi.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!davidds
From: davidds@microsoft.UUCP (David D'SOUZA)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Detecting Full-screen DOS apps
Message-ID: <60017@microsoft.UUCP>
Date: 25 Dec 90 21:18:37 GMT
References: <140@cf_su20.cf_su10.Sbi.COM>
Reply-To: davidds@microsoft.UUCP (David D'SOUZA)
Organization: Microsoft Corp., Redmond WA
Lines: 37