DOS Box/Full screen from DOS app in Windows 
Author Message
 DOS Box/Full screen from DOS app in Windows

I have a DOS application currently running under Win95.
Is it possible for such an app to resize itself to either
a DOS Box or Full screen?

I've looked through Ralf Brown's list and not found anything
there - even tried writing <Alt>-<Enter> directly to the kbd
controller (didn't work, as expected...)

Does anyone have any other ideas or pointers?
TIA
Pete



Wed, 04 Apr 2001 03:00:00 GMT  
 DOS Box/Full screen from DOS app in Windows

Quote:
>>I have a DOS application currently running under Win95.
>>Is it possible for such an app to resize itself to either
>>a DOS Box or Full screen?

        I'm not sure if that's possible.  I don't think that dos can
change anything outside of it's environment, except for the DPMI stuff,
but that wouldn't do it.

Quote:
>>I've looked through Ralf Brown's list and not found anything
>>there - even tried writing <Alt>-<Enter> directly to the kbd
>>controller (didn't work, as expected...)

        that wouldn't work because when you press ALT-ENTER on the
keyboard, windows must intercept it.  by stuffing it in the keyboard
buffer, you're just giving it right back to your application.

        Try switching to a graphics mode(like 13h) then back to text
mode and your program may stay in full screen.

Davd



Thu, 05 Apr 2001 03:00:00 GMT  
 DOS Box/Full screen from DOS app in Windows
there is an option in the PIF file you can use to make it go full-screen.  It
will also go full-screen if you use a BIOS function to put it in one of the
graphics modes.

David

Quote:

> I have a DOS application currently running under Win95.
> Is it possible for such an app to resize itself to either
> a DOS Box or Full screen?

> I've looked through Ralf Brown's list and not found anything
> there - even tried writing <Alt>-<Enter> directly to the kbd
> controller (didn't work, as expected...)

> Does anyone have any other ideas or pointers?
> TIA
> Pete

--
---------------------------------------------------------------

http://www.geocities.com/Area51/Station/5196/index.html    (home page)
http://www.geocities.com/Area51/Station/5196/ttc.html      (tao te ching)
http://www.geocities.com/Area51/Station/5196/treasure.html (computer page)



Thu, 05 Apr 2001 03:00:00 GMT  
 DOS Box/Full screen from DOS app in Windows


Quote:
> >>I have a DOS application currently running under Win95.
> >>Is it possible for such an app to resize itself to either
> >>a DOS Box or Full screen?

>         I'm not sure if that's possible.  I don't think that dos can
> change anything outside of it's environment, except for the DPMI stuff,
> but that wouldn't do it.

I've managed to crack half the problem (going DOS box->full
screen) using thr "set focus" service:

        mov     ax, 168bh
        sub     bx, bx
        int     2fh

but going from full screen back to DOS box is proving rather
elusive :-(

Quote:
> >>I've looked through Ralf Brown's list and not found anything
> >>there - even tried writing <Alt>-<Enter> directly to the kbd
> >>controller (didn't work, as expected...)

>         that wouldn't work because when you press ALT-ENTER on the
> keyboard, windows must intercept it.  by stuffing it in the keyboard
> buffer, you're just giving it right back to your application.

Not the keyboard buffer - straight into the 804x - but that
does not work either.  I guess Windows virtualises this too.
Here is the code I was using, perhaps there's something wrong
with it?

: ;       File: ALTENTER.ASM
: ;       Write Alt-Enter to keyboard controller
:
: TERMINATE       equ     4Ch
: DOS             equ     21h
:
: KEYBIOS         equ     16h
: KBREAD          equ     0
: KBSTATUS        equ     1
:
: BIOSDATA        equ     40h
:
: ;
: ; keycodes for stuffing:
: ; ~~~~~~~~~~~~~~~~~~~~~~
: K_ENT           equ     1Ch
: K_ALT           equ     38h
:
: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:                                         ;
: cycle   MACRO                           ;
:         local   next                    ;
:         jcxz    next                    ;
: next:                                   ;
:         ENDM                            ;
:                                         ;
: status  MACRO   iter                    ;
:         local   w1, done                ;
:         push    cx                      ;
:         mov     cx, iter                ;
: w1:     in      al, 64h                 ;Get status
:         test    al, 02h                 ;
:         jz      done                    ;
:         loop    w1                      ;
: done:   pop     cx                      ;
:         ENDM                            ;
:                                         ;
: key1    MACRO   NUMBER                  ;Write keyboard command to port 64h
:         wait    800h                    ;
:         mov     al, NUMBER              ;
:         out     64h, al                 ;
:         cycle                           ;
:         ENDM                            ;
:                                         ;
: key2    MACRO   NUMBER                  ;Write keyboard data to port 60h
:         wait    800h                    ;
:         mov     al, NUMBER              ;
:         out     60h, al                 ;
:         cycle                           ;
:         ENDM                            ;
:                                         ;
: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:
: CODE    SEGMENT WORD    PUBLIC 'CODE'
:         ASSUME  CS:CODE, DS:CODE, ES:NOTHING
:
:         org     100h                    ;COM file
:                                         ;
: start   PROC   NEAR                     ;
:                                         ;
:         mov     ax, cs                  ;set DS = CS
:         mov     ds, ax                  ;
:                                         ;
:         mov     ax, BIOSDATA            ;point ES at BIOS dataseg
:         mov     es, ax                  ;
:         jmp     short   L2              ;flush keyboard buffer if necessary
:                                         ;
: L1:     mov     ah, KBREAD              ;read char and discard
:         int     KEYBIOS                 ;
: L2:     mov     ah, KBSTATUS            ;check status
:         int     KEYBIOS                 ;
:         jnz     L1                      ;Z flag clear: more chars to read
:                                         ;
:         mov     si, offset HotkeySequ   ;fake the hotkey
:         jmp     short   L4              ;
:                                         ;
: L3:     call    presskey                ;
:         mov     cx, 2                   ;pause 2 ticks
:         call    delay                   ;
:         inc     si                      ;
: L4:     mov     ah, [si]                ;DS is ok.
:         or      ah, ah                  ;
:         jnz     L3                      ;
:                                         ;
:         mov     ah, TERMINATE           ;exit with errorlevel 0
:         mov     al, 0                   ;
:         int     DOS                     ;
:                                         ;
: start   ENDP                            ;
:                                         ;
: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:                                         ;
: delay   PROC    NEAR                    ;delay for nr of clock ticks in CX
:                                         ;
:         mov     di, 006Ch               ;point at clock LSW
: t1:     mov     ax, es:[di]             ;assumes ES pointing at BIOS dataseg
: t2:     nop                             ;
:         cmp     ax, es:[di]             ;
:         je      t2                      ;
:         loop    t1                      ;
:         ret                             ;
:                                         ;
: delay   ENDP                            ;
:                                         ;
: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:                                         ;
: presskey        PROC    NEAR            ;stuff keycode in AH
:                                         ;
:         key1    0ADh                    ;Disable keyboard
:         key1    061h                    ;Program keyboard command
:         key2    ah                      ;stuff keycode from AH
:         key1    021h                    ;Load keyboard command
:         key1    0AEh                    ;Enable keyboard
:         ret                             ;
:                                         ;
: presskey        ENDP                    ;
:                                         ;
: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:                                                         ; make/break codes
: HotkeySequ      db      K_ALT,          K_ENT           ; "press" them
:                 db      K_ENT + 80h,    K_ALT + 80h     ; "release" them
:                 db      00h                             ; end of list
:                                                         ;
: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:
: CODE    ENDS
:
:         END

I've used the same technique successfully in plain DOS,
but it would appear too crude for Windows...
--
Pete
        "We have not inherited the earth from our ancestors,
         we have borrowed it from our descendants."



Fri, 06 Apr 2001 03:00:00 GMT  
 DOS Box/Full screen from DOS app in Windows


Quote:
>I have a DOS application currently running under Win95.
>Is it possible for such an app to resize itself to either
>a DOS Box or Full screen?

If you get a handle to your console window with GetForegroundWindow (no
parameters) you can send it the same message that ALT-ENTER sends.  Use a
message trace to see what this is.  Karl M


Tue, 17 Apr 2001 03:00:00 GMT  
 DOS Box/Full screen from DOS app in Windows
In response to,
Quote:
>I have a DOS application currently running under Win95.
>Is it possible for such an app to resize itself to either
>a DOS Box or Full screen?

Karl replied,
If you get a handle to your console window with GetForegroundWindow (no
parameters) you can send it the same message that ALT-ENTER sends.  Use a
message trace to see what this is.  Karl M
---------
Karl, I notice your answer to this post and it caught my curiosity.
Are you implying that the poster should call GetForegroundWindow from
a Dos app running in a separate VM from the system VM. For this to
be done he would have to load a dos tsr first and also have a Vxd to do
it's bidding on the windows side, not to mention doing anything with the
handle afterwards.  You must have "thought" he was talking about a
win32console app not a bonafid dos app.
For a dos app, making an accompanying PIF file to set it to full screen
or desired window size would be the way to go.


Wed, 18 Apr 2001 03:00:00 GMT  
 DOS Box/Full screen from DOS app in Windows


Thanks to all those who replied on this one - I've all but
given up on the idea :-(

Quote:
> In response to,
> >I have a DOS application currently running under Win95.
> >Is it possible for such an app to resize itself to either
> >a DOS Box or Full screen?
> Karl replied,
> If you get a handle to your console window with GetForegroundWindow (no
> parameters) you can send it the same message that ALT-ENTER sends.  Use a
> message trace to see what this is.  Karl M
> ---------
> Karl, I notice your answer to this post and it caught my curiosity.
> Are you implying that the poster should call GetForegroundWindow from
> a Dos app running in a separate VM from the system VM. For this to
> be done he would have to load a dos tsr first and also have a Vxd to do
> it's bidding on the windows side, not to mention doing anything with the

It seems to me that what is needed is indeed a VxD with an int 2f
API callable from the DOS VM.  I got as far as getting the DOS
Box to go full screen using int 2f/AX=168b/BX=0 but there does
not appear to exist a converse facility.

I did come across a reference to a "VWFD.386" that purportedly
can report whether a DOS app is fullscreen or windowed, but it
has no support for actually doing the switching between (VDevice
ID 7fe0h if anyone is interested - perhaps Win3.x only?)

Quote:
> handle afterwards.  You must have "thought" he was talking about a
> win32console app not a bonafid dos app.
> For a dos app, making an accompanying PIF file to set it to full screen
> or desired window size would be the way to go.

Would not that only be of use as the DOS app was loaded?
--
Pete


Thu, 19 Apr 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. WIN2000, DOS box, full screen

2. How to activate mouse in Dos box or full screen in Win98

3. Switching dos app to full screen under W2K

4. Q: Detecting if DOS-app in Wondows FUllscreen or Windowed DOS-box

5. Tryapl2 in win2000 full screen dos problem

6. XP and Dos Full Screen freeze

7. Migrating DOS/Clipper Apps to Windows/Clipper Apps

8. DOS fn 3Fh under DOS box problem

9. Clipper app not working in DOS box

10. xBase++ apps runs in a DOS box !

11. Prot mode Clip app in OS/2 dos box

12. RFI: Launching MSW Apps from DOS Box

 

 
Powered by phpBB® Forum Software