Solved

help createprocess for fullscreen dos application

Posted on 2000-03-18
7
446 Views
Last Modified: 2008-01-09
I am having trouble consistantly starting a DOS application in fullscreen mode using the CreateProcess method.  The code that follows works on my NT machine, but will not open the application in fullscreen mode on the very similar machines of my workmates (although it will open the app in a window).  I have compared kernel32 on all machines and it is the same size and date.
Can anyone tell me what I am doing wrong and how to correct it?


        sLINKInfo.dwFlags = STARTF_RUNFULLSCREEN
        sLINKInfo.cb = Len(sLINKInfo)
        If CreateProcess(vbNullString, _
                         "c:\linkpc\prod\lmn\lmn000mp.exe c: 1 t a", _
                         ByVal 0&, _
                         ByVal 0&, _
                         1&, _
                         NORMAL_PRIORITY_CLASS, _
                         ByVal 0&, _
                         "c:\linkpc\prod\lmn\", _
                         sLINKInfo, _
                         pLINKInfo)
0
Comment
Question by:mike_k
7 Comments
 
LVL 14

Expert Comment

by:wsh2
ID: 2632530
First understand what your command line is doing.. as you are executing a DOS program.. the true explicit line of execution is..

C:\COMMAND.COM /K c:\linkpc\prod\lmn\lmn000mp.exe c: 1 t a

The problem you are having is that the default Command.Com settings are not set for Full Screen. As of this very moment.. I am uncertain on how to tell you to change them.. But fear not.. I shall return.. <smile>.
0
 
LVL 14

Accepted Solution

by:
wsh2 earned 200 total points
ID: 2632543
Ok... From MSDN.. <smile>

Setting Properties for MS-DOS - Based Applications

In Windows 95, the properties sheets replace PIF Editor, which was used in earlier versions of Windows to optimize settings for MS-DOS - based applications.

To view or modify the properties settings for an MS-DOS - based program
Right-click the icon for the program, and then click Properties. (If the program's icon is not on the Windows 95 desktop, use Windows Explorer to find the program, then right-click the icon in Windows Explorer.) This displays the properties sheets for the program.
Click the tab you want to use and change the options as appropriate. (See the following section for information about all of these options.)
Do the same for all other options and tabs, and then click OK.
MS-DOS - based programs have six properties sheets - General, Program, Font, Memory, Screen, and Misc.

Use the General properties to see information about the type, size, and location of the MS-DOS - based application. From this properties sheet, you can turn on and off the Read Only, Archive, Hidden, and System attributes, which have the same meaning as they do in MS-DOS.

Caution Do not change file attributes unless you are absolutely sure of what you are doing.

General properties for an MS-DOS - based application

Use the Program properties to identify details about how the program will be run.

Program properties for an MS-DOS - based application

Option
 Comments
 
(Filename)
 Include the filename for the application.
 
Command Line
 Type the full command line, including the correct drive, path, and options, to run this application.
 
Working
 Specify the working directory.
 
Batch File
 Type the name of a batch file you want to run before the program starts.
 
Shortcut Key
 Specify the key combination (if any) that you want to use to quickly switch to this application.
 
Run
 Choose whether to run the program in a normal-sized window, a maximized window, or a minimized window.
 
Close on Exit
 Check this box if you want the window to close once the MS-DOS - based program has ended.
 

Use the Advanced command button to specify information about the mode in which your program will run.

Advanced properties for an MS-DOS - based application


Option
 Comments
 
Prevent MS-DOS - based Programs From Detecting Windows
 Check this box to hide Windows 95 from MS-DOS-based applications for those applications that cannot run or that perform poorly if they detect the presence of Windows 95.
 
Suggest MS-DOS Mode As Necessary
 Check this box to allow Windows 95 to detect whether MS-DOS-based applications run best in MS-DOS Mode. If it detects such an application, Windows 95 runs a wizard to set up a custom command to run the application.
 
MS-DOS Mode
 Check this box to run this program in exclusive MS-DOS Mode. No other processes are allowed to run simultaneously if you use this option.
 
Warn Before Entering MS-DOS Mode
 Check this box to enable the automatic warning presented when Windows 95 is about to run an application that requires MS-DOS Mode and must shut down all other applications. If this option is checked, Windows 95 will warn the user before beginning the shutdown process.
 
Specify A New MS-DOS Configuration
 Check this box to edit the CONFIG.SYS and AUTOEXEC.BAT files in the corresponding text boxes or by clicking the Configuration button.
 
CONFIG.SYS For MS-DOS Mode
 Type any lines you want to add to CONFIG.SYS to allow this application to run properly. This version of CONFIG.SYS is used only for the MS-DOS Mode session in which this application runs.
 
AUTOEXEC.BAT For MS-DOS Mode
 Type any lines you want to add to AUTOEXEC.BAT for this application. This version of AUTOEXEC.BAT is used only for the MS-DOS Mode session in which this application runs.
 

As shown in the preceding table, you can set the path for a specific MS-DOS - based application that runs in MS-DOS Mode in the AUTOEXEC.BAT box. For MS-DOS - based applications that don't run in MS-DOS Mode, you can only set a working directory. You can set a global path for all MS-DOS - based applications by adding a path statement in AUTOEXEC.BAT. You can also write a batch file that sets a path for an MS-DOS - based application; for example:

path=%path%;c:\utils;c:\norton
After you write the batch file, create a shortcut to your MS-DOS - based application, and specify the batch file's path and name in the Batch File field of the Program properties.

From the Font properties, you can specify the font size and type to be used when the MS-DOS - based program runs. From Font properties, you can also preview how the program window and the font will appear.

Font properties for an MS-DOS - based application


From the Memory properties, you can define the following memory allocation options:

Conventional memory, which consists of the first 640K of memory available on your computer.
Expanded memory, which can be installed as an expanded memory card or emulated by an expanded memory manager (EMM). EMM software maps pages of expanded memory onto the system's upper memory area.
Extended memory, which is essentially a seamless upward extension of the original 1-MB address space available in the memory of 80286 and 80386 computers. Extended memory always starts at exactly 1024K, where the upper memory area ends.
MS-DOS protected-mode memory, which Windows 95 automatically provides as expanded memory for MS-DOS - based applications that require it to run. It cannot provide this memory, however, if you include a statement in CONFIG.SYS that loads EMM386.EXE with the noems parameter. Use the ram parameter when loading EMM386.EXE in CONFIG.SYS, or use the x=mmmm-nnnn statement to allocate enough space in the upper memory area for Windows 95 to create an EMS page frame.
Using Upper Memory Blocks (UMBs) and High Memory Area (HMA) are two ways to free conventional memory for use by MS-DOS - based applications, and thus improve performance. In conventional memory, UMBs are the unused part of upper memory from 640K to 1 MB, where information can be mapped to free memory below 640K. HMA is the first 64K of extended memory, where drivers can be loaded to free conventional memory.

Memory properties for an MS-DOS - based application


From the Screen properties, you can specify options for how the application will be displayed.

Screen property sheet for an MS-DOS - based application

Option
 Comments
 
Usage
 Specify whether the application will run in a window with an initial size you can specify, a full-screen window, or a window with a size automatically determined by the graphic mode it uses.
 
Windows
 Choose whether to display a toolbar or to preserve the previous Windows 95 window settings.
 
Performance
 Choose Dynamic Memory Allocation to use the Windows 95 video ROM-handling capabilities. Choose Fast ROM Emulation to enable VxD emulation of selected video ROM services and to speed up video operations, particularly text output.
 
\\\new

From the Misc properties, you can specify details about running your program in the foreground and in the background. You can specify whether your program must have exclusive access to the system when it is in the foreground and whether running a screen saver is allowed when the program is active. You can also specify whether the program must be suspended when it is in the background.

In addition, you can specify preferences for mouse, idle sensitivity, Windows hot keys, and other options.

Miscellaneous properties for an MS-DOS - based application

In Windows 95, the Properties dialog box replaces PIF Editor, which was used in earlier versions of Windows to optimize the settings for MS-DOS - based applications.

For information about changing the properties for executable files, look up "file properties, changing" in the Windows 95 Help Index.

For Help on the Properties dialog box of an executable file, click the question mark button at the top of the dialog box, and then click the item you want information about.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2632564
<sighing>.. Well it was fun while it lasted.. I tried Pifs.. Bats.. and pretty much got the same results as the writer did.. <groan>. Its obvious that Command.Com is launching another  process and that the maximized settings are not being passed to the child. At this moment.. I say to "SHELL" with it, and will let others comment.. <smile>.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Expert Comment

by:FWAllan
ID: 2632769

Isn't shell sufficient?  The second parameter in shell specifies the open mode, eg hidden, full screen, etc.
0
 
LVL 27

Expert Comment

by:Ark
ID: 2632816
Hi
FWAllan: Do you see another option button just above "Answer"?
Cheers
0
 

Expert Comment

by:FWAllan
ID: 2633388
Agreed
0
 

Author Comment

by:mike_k
ID: 2642226
OK, Looks like all that I needed to do was to change the property of the executable and run the create process as I had listed it.  I don't know why I had to chnage the executable property, but I'll settle for that for now.

thanks,
Mike
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now