1. J.Nickerson: DosBox
- Posted by Grape Vine <g__vine at hotmail.com> Jun 10, 2001
- 372 views
This works great, just one thing i need. I dont want the dos box show now. Any idea how to do it? Grape Vine 13728824
2. Re: J.Nickerson: DosBox
- Posted by jjnick at cvn.com Jun 10, 2001
- 354 views
I don't understand the sentence: "I dont want the dos box show now." Please elaborate . . . ----- Original Message ----- From: "Grape Vine" <g__vine at hotmail.com> To: "EUforum" <EUforum at topica.com> Subject: J.Nickerson: DosBox > > This works great, just one thing i need. I dont want the dos box show > now. Any idea how to do it? > > Grape Vine > 13728824 >
3. Re: J.Nickerson: DosBox
- Posted by jjnick at cvn.com Jun 10, 2001
- 362 views
This is a multi-part message in MIME format. ------=_NextPart_000_0015_01C0F20C.A3729A20 charset="iso-8859-1" Just need to add the following lines after acquiring memory for the = startup info structure . . . store(ptStartup, dwFlags, STARTF_USESHOWWINDOW) store(ptStartup, wShowWindow, SW_HIDE) Don't forget to define STARTF_USESHOWWINDOW . . . Here is the rest of the code: -- This routine will call a DOS console, suspend euphoria window (code), -- then revert back to the window once the DOS console is done. -- -- Of course, euphoria's system() does the same thing, but does not -- work in Windows 2000: the euphoria program continues running even -- if the DOS console is still running. Calling system_exec() works -- under 2000 but the console is not released when finished. -- -- Please Note: the "/c" switch in the call to "command.com" will exit -- the DOS console when finished. -- -- Have to use the API CreateProcess() because it is the only function -- that works with WaitForSingleObject(), given the context of the -- requirement outlined above. -- -- Jason Nickerson include win32lib.ew without warning global constant TRUE =3D 1, FALSE =3D 0, NORMAL_PRIORITY_CLASS =3D 32, INFINITE =3D -1, STARTF_USESHOWWINDOW =3D 1 global constant cb =3D allot( DWord ),=20 lpReserved =3D allot( Ptr ),=20 lpDesktop =3D allot( Ptr ), =20 lpTitle =3D allot( Ptr ),=20 dwX =3D allot( DWord ),=20 dwY =3D allot( DWord ),=20 dwXSize =3D allot( DWord ),=20 dwYSize =3D allot( DWord ),=20 dwXCountChars =3D allot( DWord ),=20 dwYCountChars =3D allot( DWord ), dwFillAttribute =3D allot( DWord ), dwFlags =3D allot( DWord ), wShowWindow =3D allot( Word ), cbReserved2 =3D allot( Word ), lpReserved2 =3D allot( Ptr ), hStdInput =3D allot( Hndl ), hStdOutput =3D allot( Hndl ), hStdError =3D allot( Hndl ), SIZEOF_STARTUPINFO =3D allotted_size()=20 =20 global constant hProcess =3D allot( Hndl ), hThread =3D allot( Hndl ), dwProcessId =3D allot( DWord ),=20 dwThreadId =3D allot( DWord ),=20 SIZEOF_PROCESSINFO =3D allotted_size()=20 object rv global integer createProcess global integer closeHandle global integer waitProcess constant Win =3D create ( Window, "CreateProcess() Example", = 0, Default, Default, 255, 100, 0 ), btRun =3D create ( PushButton, "Run Example", Win, = 10, 10, 225, 50, 0 ) ---------------------- -- onLoad_Win ---------------------- procedure onLoad_Win() atom k32 k32 =3D open_dll("kernel32.dll") if k32 =3D 0 then rv =3D message_box(sprintf( "%s", { "FATAL ERROR opening = \"kernel32.dll\" - Aborting . . ." } ), "CreateProcess", = MB_ICONERROR+MB_TASKMODAL ) abort(-1) end if createProcess =3D define_c_func(k32, "CreateProcessA", {C_POINTER, = C_POINTER, C_POINTER, C_POINTER, C_INT, C_LONG, C_POINTER, C_POINTER, C_POINTER, C_POINTER}, C_INT) closeHandle =3D define_c_func(k32, "CloseHandle", {C_LONG}, = C_INT) waitProcess =3D define_c_func(k32, "WaitForSingleObject", {C_LONG, = C_LONG}, C_LONG) end procedure ---------------------- -- onClick_btRun ---------------------- procedure onClick_btRun() atom memset1 atom memset2 atom memset3 atom ptProcess atom ptStartup atom pCommand atom pCurrentDir memset1 =3D new_memset() ptProcess =3D acquire_mem(memset1, SIZEOF_PROCESSINFO ) memset2 =3D new_memset() ptStartup =3D acquire_mem(memset2, SIZEOF_STARTUPINFO ) store(ptStartup, dwFlags, STARTF_USESHOWWINDOW) store(ptStartup, wShowWindow, SW_HIDE) memset3 =3D new_memset() pCommand =3D acquire_mem(memset3, "command.com /c dir /s *.*" ) pCurrentDir =3D acquire_mem(memset3, "C:\\" ) if not c_func(createProcess, { NULL, pCommand, NULL, NULL, TRUE, = NORMAL_PRIORITY_CLASS, NULL, NULL, ptStartup, ptProcess } ) then rv =3D message_box(sprintf( "%s", { "Could not shell . . ." } ), = "CreateProcess", MB_ICONERROR+MB_TASKMODAL ) release_mem(memset1) release_mem(memset2) release_mem(memset3) return end if setVisible(Win, False) -- Don't necessarily need this but if not used, = the window goes funny -- Now, wait for the DOS console to end before continuing on with the = code rv =3D c_func(waitProcess, { fetch(ptProcess, hProcess), INFINITE}) rv =3D c_func(closeHandle, { fetch(ptProcess, hProcess) }) setVisible(Win, True) -- Don't necessarily need this but if not used, = the window goes funny release_mem(memset1) release_mem(memset2) release_mem(memset3) end procedure ------------------ -- E V E N T S ------------------ onClick [ btRun ] =3D routine_id( "onClick_btRun" ) onOpen [ Win ] =3D routine_id( "onLoad_Win" ) ------------------------- -- START WINDOW ------------------------- WinMain( Win, Normal ) ----- Original Message -----=20 From: "Grape Vine" <g__vine at hotmail.com> To: "EUforum" <EUforum at topica.com> Sent: Sunday, June 10, 2001 10:59 PM Subject: RE: J.Nickerson: DosBox >=20 > When i call blat i dont wat the dos box that goes with it to show up. > or at least ot be able to give the use the option to hide it >=20 > jjnick at cvn.com wrote: > > I don't understand the sentence: "I dont want the dos box show now." > >=20 > > Please elaborate . . . > >=20 > > ----- Original Message -----=20 > > From: "Grape Vine" <g__vine at hotmail.com> > > To: "EUforum" <EUforum at topica.com> > > Sent: Sunday, June 10, 2001 12:30 PM > > Subject: J.Nickerson: DosBox > >=20 > >=20 > > >=20 > > > This works great, just one thing i need. I dont want the dos box = show=20 > > > now. Any idea how to do it? > > >=20 > > > Grape Vine > > > 13728824 > > >=20 > >=20 > >=20 >=20 >=20 >=20 > Grape Vine > 13728824 >=20 ------=_NextPart_000_0015_01C0F20C.A3729A20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=3DArial size=3D2>Just need to add the following lines = after=20 acquiring memory for the startup info structure . . .</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial = size=3D2><FONT=20 face=3D"Courier New" size=3D1> store(ptStartup,=20 dwFlags, = STARTF_USESHOWWINDOW)<BR> store(ptStartup,=20 wShowWindow, SW_HIDE)</FONT><BR></FONT></DIV> <DIV><FONT face=3DArial size=3D2>Don't forget to define = STARTF_USESHOWWINDOW . .=20 .</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Here is the rest of the = code:</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>-- This routine will call a DOS = console,=20 suspend euphoria window (code),<BR>-- then revert back to the window = once the=20 DOS console is done.<BR>--<BR>-- Of course, euphoria's system() does the = same=20 thing, but does not<BR>-- work in Windows 2000: the euphoria program = continues=20 running even<BR>-- if the DOS console is still running. Calling=20 system_exec() works<BR>-- under 2000 but the console is not released = when=20 finished.<BR>--<BR>-- Please Note: the "/c" switch in the call to = "command.com"=20 will exit<BR>-- the DOS console when finished.<BR>--<BR>-- Have to use = the API=20 CreateProcess() because it is the only function<BR>-- that works with=20 WaitForSingleObject(), given the context of the<BR>-- requirement = outlined=20 above.<BR>--<BR>-- Jason Nickerson</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>include win32lib.ew<BR>without=20 warning</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>global constant=20 TRUE &nb= sp; =20 =3D =20 1,<BR> FALSE &n= bsp; &nb= sp; =20 =3D =20 0,<BR> NORMAL_PRIORITY_CLA= SS =3D=20 32,<BR> INFINITE &nbs= p; =20 =3D -1,<BR> =20 STARTF_USESHOWWINDOW =3D 1</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><BR><FONT face=3D"Courier New" size=3D1>global constant<BR> =20 cb  = ; =20 =3D allot( DWord ), <BR> =20 lpReserved =3D allot(=20 Ptr ), <BR> =20 lpDesktop =3D = allot(=20 Ptr ), <BR> =20 lpTitle = =3D=20 allot( Ptr ), <BR> =20 dwX &nbs= p; =20 =3D allot( DWord ), <BR> =20 dwY &nbs= p; =20 =3D allot( DWord ), <BR> =20 dwXSize = =3D=20 allot( DWord ), <BR> =20 dwYSize = =3D=20 allot( DWord ), <BR> = dwXCountChars =3D=20 allot( DWord ), <BR> = dwYCountChars =3D=20 allot( DWord ),<BR> dwFillAttribute =3D allot( = DWord=20 ),<BR> dwFlags = =20 =3D allot( DWord = ),<BR> wShowWindow =20 =3D allot( Word =20 ),<BR> cbReserved2 =3D = allot(=20 Word = ),<BR> lpReserved2 =3D=20 allot( Ptr =20 ),<BR> hStdInput &nbs= p; =3D=20 allot( Hndl =20 ),<BR> hStdOutput = =3D allot(=20 Hndl =20 ),<BR> hStdError &nbs= p; =3D=20 allot( Hndl ),<BR> SIZEOF_STARTUPINFO =3D=20 allotted_size() <BR> <BR>global=20 constant<BR> hProcess  = ; =20 =3D allot( Hndl =20 ),<BR> hThread = =20 =3D allot( Hndl =20 ),<BR> dwProcessId =3D = allot( DWord=20 ), <BR> = dwThreadId =3D=20 allot( DWord ), <BR> SIZEOF_PROCESSINFO =3D=20 allotted_size() </FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>object rv<BR>global integer=20 createProcess<BR>global integer closeHandle<BR>global integer=20 waitProcess</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>constant = Win =20 =3D create ( Window, "CreateProcess()=20 Example", 0, = Default, Default, 255, 100, 0=20 ),<BR> btRun =3D create ( = PushButton,=20 "Run=20 Example", &nbs= p; =20 Win, &nb= sp; =20 10, 10, 225, 50, 0 )</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>----------------------<BR>--=20 onLoad_Win<BR>----------------------</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>procedure = onLoad_Win()<BR> atom=20 k32</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1> k32 =3D=20 open_dll("kernel32.dll")<BR> if k32 =3D 0 then<BR> rv = =3D=20 message_box(sprintf( "%s", { "FATAL ERROR opening \"kernel32.dll\" - = Aborting .=20 . ." } ), "CreateProcess", MB_ICONERROR+MB_TASKMODAL=20 )<BR> abort(-1)<BR> end if</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1> createProcess =3D = define_c_func(k32,=20 "CreateProcessA", {C_POINTER, C_POINTER,=20 C_POINTER, C_POINTER, C_INT,<BR> C_LONG, C_POINTER, = C_POINTER,=20 C_POINTER, C_POINTER}, C_INT)<BR> closeHandle =3D=20 define_c_func(k32,=20 "CloseHandle", {C_LONG}, = C_INT)<BR> waitProcess =3D define_c_func(k32,=20 "WaitForSingleObject", {C_LONG, C_LONG}, C_LONG)<BR>end = procedure</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>----------------------<BR>--=20 onClick_btRun<BR>----------------------</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>procedure = onClick_btRun()</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1> atom = memset1<BR> atom=20 memset2<BR> atom memset3<BR> atom ptProcess<BR> atom=20 ptStartup<BR> atom pCommand<BR> atom pCurrentDir</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1> memset1 =3D=20 new_memset()<BR> ptProcess =3D acquire_mem(memset1, = SIZEOF_PROCESSINFO=20 )<BR> memset2 =3D new_memset()<BR> ptStartup =3D = acquire_mem(memset2,=20 SIZEOF_STARTUPINFO )<BR> store(ptStartup, = dwFlags, =20 STARTF_USESHOWWINDOW)<BR> store(ptStartup, wShowWindow,=20 SW_HIDE)<BR> memset3 =3D = new_memset()<BR> pCommand =3D=20 acquire_mem(memset3, "command.com /c dir /s *.*" )<BR> pCurrentDir = =3D=20 acquire_mem(memset3, "C:\\" )</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1> if not = c_func(createProcess, { NULL,=20 pCommand, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, = ptStartup,=20 ptProcess } ) then<BR> rv =3D message_box(sprintf( "%s", { = "Could not=20 shell . . ." } ), "CreateProcess", MB_ICONERROR+MB_TASKMODAL=20 )<BR> release_mem(memset1)<BR> release_mem(memset2)= <BR> release_mem(memset3)<BR> return<BR> end=20 if<BR> setVisible(Win, False) -- Don't necessarily need this but if = not=20 used, the window goes funny<BR> -- Now, wait for the DOS console to = end=20 before continuing on with the code<BR> rv =3D = c_func(waitProcess, {=20 fetch(ptProcess, hProcess), INFINITE})<BR> rv =3D = c_func(closeHandle, {=20 fetch(ptProcess, hProcess) })<BR> setVisible(Win, True) -- = Don't=20 necessarily need this but if not used, the window goes=20 funny<BR> release_mem(memset1)<BR> release_mem(memset2)<BR>&nbs= p;release_mem(memset3)</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>end procedure</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>------------------<BR>-- E V E = N T=20 S<BR>------------------<BR>onClick [ btRun ] =3D routine_id( = "onClick_btRun" &nbs= p;=20 )<BR>onOpen [ Win ] =3D routine_id(=20 "onLoad_Win" &= nbsp; =20 )</FONT></DIV> <DIV><FONT face=3D"Courier New" size=3D1></FONT> </DIV> <DIV><FONT face=3D"Courier New" size=3D1>-------------------------<BR>-- = START=20 WINDOW<BR>-------------------------<BR>WinMain( Win, Normal = )</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2> </DIV></FONT> <DIV><FONT face=3DArial size=3D2>----- Original Message ----- </FONT> <DIV><FONT face=3DArial size=3D2>From: "Grape Vine" <</FONT><A=20 href=3D"mailto:g__vine at hotmail.com"><FONT face=3DArial=20 size=3D2>g__vine at hotmail.com</FONT></A><FONT face=3DArial = size=3D2>></FONT></DIV> <DIV><FONT face=3DArial size=3D2>To: "EUforum" <</FONT><A=20 href=3D"mailto:EUforum at topica.com"><FONT face=3DArial=20 size=3D2>EUforum at topica.com</FONT></A><FONT face=3DArial = size=3D2>></FONT></DIV> <DIV><FONT face=3DArial size=3D2>Sent: Sunday, June 10, 2001 10:59 = PM</FONT></DIV> <DIV><FONT face=3DArial size=3D2>Subject: RE: J.Nickerson: = DosBox</FONT></DIV></DIV> <DIV><FONT face=3DArial><BR><FONT size=3D2></FONT></FONT></DIV><FONT = face=3DArial=20 the dos=20 box that goes with it to show up.<BR>> or at least ot be able to give = the use=20 the option to hide it<BR>> <BR>> </FONT><A=20 href=3D"mailto:jjnick at cvn.com"><FONT face=3DArial=20 size=3D2>jjnick at cvn.com</FONT></A><FONT face=3DArial size=3D2> = wrote:<BR>> > I=20 don't understand the sentence: "I dont want the dos box show = now."<BR>> >=20 <BR>> > Please elaborate . . .<BR>> > <BR>> > = -----=20 Original Message ----- <BR>> > From: "Grape Vine" <</FONT><A=20 href=3D"mailto:g__vine at hotmail.com"><FONT face=3DArial=20 size=3D2>g__vine at hotmail.com</FONT></A><FONT face=3DArial = size=3D2>><BR>> >=20 To: "EUforum" <</FONT><A href=3D"mailto:EUforum at topica.com"><FONT = face=3DArial=20 size=3D2>EUforum at topica.com</FONT></A><FONT face=3DArial = size=3D2>><BR>> >=20 Sent: Sunday, June 10, 2001 12:30 PM<BR>> > Subject: J.Nickerson:=20 DosBox<BR>> > <BR>> > <BR>> > > <BR>> > > = This=20 works great, just one thing i need. I dont want the dos box show = <BR>> >=20 > now. Any idea how to do it?<BR>> > > <BR>> > > = Grape=20 Vine<BR>> > > 13728824<BR>> > > <BR>> > <BR>> = >=20 <BR>> <BR>> <BR>> <BR>> Grape Vine<BR>> 13728824<BR>>=20 ------=_NextPart_000_0015_01C0F20C.A3729A20--