Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get rid of confounded Command Window in Foxpro 2.6 for Windows 2

Status
Not open for further replies.

Gonzy

Programmer
Jul 9, 2000
1
US
Please help.&nbsp;&nbsp;I've wasted alot of time trying to figure out how to get rid of the command window upon start-up.&nbsp;&nbsp;Made a copy of sysmenu to create my own application menu...have alot of the system written, but everytime I start Foxpro 2.6 for Windows, there's that frickin' command window.&nbsp;&nbsp;I've tried the Hide Window Command, removing the pad option from the window pop-up, etc.&nbsp;&nbsp;The book says I can do it directly, but it does not give an example.<br><br>I know I can click on Window and click on Hide, but I don't want it to come up when my application comes up.&nbsp;&nbsp;What am I doing wrong?<br><br>Thank you for any and all help.<br><br>Gonzy
 
Sounds like you do not have a read event in you application and the program completed it task.<br>Here is Two samples in one program of how to create a never ending read event so the command window does not appear.&nbsp;&nbsp;The primary key is the read valid statement. the just in case key is the do while loop.<br><br>*<br>* MAIN PROGRAM LOOP<br>*<br>glRunExe = .t.<br>do App.mpr<br>do while glRunExe=.t.<br><br>&nbsp;&nbsp;on shutdown do EndExe<br>&nbsp;&nbsp;read valid glRunExe <br><br>enddo<br><br>procedure ENDEXE<br>*******************************************************************************************<br>* globial procedure for when the user saids they have had enought of this application<br>********************************************************************************************<br>clear read all<br>close data<br>clear events<br>on shutdown<br>*<br>glRunExe = .f.<br>if Backdoor trap = .t.<br>&nbsp;&nbsp;quit<br>endif<br>return .f.<br><br><br> <p>David W. Grewe<br><a href=mailto:Dave@internationalbid.net>Dave@internationalbid.net</a><br><a href= > </a><br>
 
Another way to get rid of the command window is to issue Ctrl-F4 and you could do that with a keyboard command.&nbsp;&nbsp;Issue Ctrl-F2 to activate it again.&nbsp;&nbsp;If you are operating in the development environment -- it is nice to be able to get to the command window.<br><br>CDavis
 
OK.&nbsp;&nbsp;Here's how I do it.&nbsp;&nbsp;You will need some code in the setup and cleanup snippets of your menu.<br><br>SETUP snippet<br><br>&nbsp;&nbsp;DEFINE WINDOW hidecomm FROM 1,1 TO 3,3<br>&nbsp;&nbsp;ACTIVATE WINDOW command IN hidecomm<br><br>CLEANUP snippet<br><br>&nbsp;&nbsp;DEACTIVATE WINDOW hidecomm<br>&nbsp;&nbsp;RELEASE WINDOW hidecomm<br><br>Occasionally, the command window does not come back.&nbsp;&nbsp;Just press CTRL-F2 to get the command window back.<br><br>Now, I usually make this code conditional.&nbsp;&nbsp;For instance, I have some power users (including myself) who can create queries and reports, so I let those users keep the command window.<br><br>For example:<br><br>SETUP<br><br>IF NOT cNetID$cPowerUsers<br>&nbsp;&nbsp;&nbsp;&nbsp;DEFINE WINDOW hidecomm FROM 1,1 TO 3,3<br>&nbsp;&nbsp;&nbsp;&nbsp;ACTIVATE WINDOW command IN hidecomm<br>ENDIF<br><br>CLEANUP<br><br>IF NOT cNetID$cPowerUsers<br>&nbsp;&nbsp;&nbsp;&nbsp;CLOSE DATABASES<br>&nbsp;&nbsp;&nbsp;&nbsp;QUIT<br>ELSE<br>&nbsp;&nbsp;&nbsp;&nbsp;SET HELP TO SYS(2004)+&quot;FOXHELP.HLP&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;POP MENU _msysmenu<br>&nbsp;&nbsp;&nbsp;&nbsp;DEACTIVATE WINDOW hidecomm<br>&nbsp;&nbsp;&nbsp;&nbsp;RELEASE WINDOW hidecomm<br>&nbsp;&nbsp;&nbsp;&nbsp;SET HELP OFF<br>&nbsp;&nbsp;&nbsp;&nbsp;SET HELP ON<br>ENDIF<br><br>Hope this helps.&nbsp;&nbsp;Good Luck.<br> <p>Mike Wood<br><a href=mailto:mwood@awod.com>mwood@awod.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top