Announcement

Collapse
No announcement yet.

Detect DOS window minimization, how to?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detect DOS window minimization, how to?

    Say you have a PB DOS program running in a
    DOS window, and the window gets minimized
    (either by the user or the operating system).
    Is there a way for your program to detect
    that it is minimized, say by checking
    something in the getkey loop?

    ------------------
    Politically incorrect signatures about immigration patriots are forbidden. Googling “immigration patriots” is forbidden. Thinking about Googling ... well, don’t even think about it.

  • #2
    DOS applications can't really access Windows directly, at least not easily. They are almost 100% isolated -- Microsoft calls it "protected" -- from the operating system.

    You can, however, use a Windows Console application to "link" a DOS program to Windows. My company's DOSBox product was designed to do exactly that.

    The free shareware version of DOSBox is available from this page of our web site...

    http://www.perfectsync.com/DOSBox.htm

    It will allow your PB/DOS applications to determine -- and control! -- things like the maximized/minimized state of the DOS box.

    -- Eric Pearson, Perfect Sync Software


    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    [This message has been edited by Eric Pearson (edited February 26, 2001).]
    "Not my circus, not my monkeys."

    Comment


    • #3
      A DOS application can directly switch to full-screen mode with a simple Interrupt call, but as Eric noted, there is no facility for the DOS application to detect a window state change, or select any state other than full-screen.

      When I get back to my DEV PC, I'll post the code to switch to full-screen mode (if you are interested, that is!).


      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        Here you go...
        Code:
        ' Switch to Full-Screen under Windows 3.x/95/98/ME/2000/NT
        IF BIT(pbvHost,8) OR UCASE$(ENVIRON$("OS")) = "WINDOWS_NT" THEN
          IF ISFALSE BIT(pbvHost,5) THEN      ' Not if we are in the IDE
            ! push DS
            ! mov AX,&H168B
            ! xor BX,BX
            ! int &H2F
            ! pop DS
          END IF
        END IF

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          The free shareware version of DOSBox is available from this page of our web site...
          Huh? Free Shareware?

          MCM


          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Yes, we have a Free (95% functional) version, and a Registered (fully functional, but not free) version.

            Isn't that a relatively common way for shareware to be provided?

            (I was trying to point out that the free version would do what Mark was asking about.)

            -- Eric

            ------------------
            Perfect Sync: Perfect Sync Development Tools
            Email: mailto:[email protected][email protected]</A>

            [This message has been edited by Eric Pearson (edited February 27, 2001).]
            "Not my circus, not my monkeys."

            Comment


            • #7
              Thanks for your response, Eric. Also Lance.

              If there is no pure PB solution, the next
              best thing would be to prevent the user from
              going to Windows via Ctrl-Esc, Alt-Spacebar,
              or the Windows key.

              This has been discussed before on this Forum,
              under "Capture the Windows key" -- where Lance
              recalled that an MS utility once existed for
              disabling the Windows key. But again a pure
              PB solution would be desirable.

              One solution would be to run the entire program
              as a CriticalSection (see the thread I started a
              few days ago). That looks like it's the only
              way.
              Politically incorrect signatures about immigration patriots are forbidden. Googling “immigration patriots” is forbidden. Thinking about Googling ... well, don’t even think about it.

              Comment

              Working...
              X