Re: How to start up an .exe program from within BlackBox?

From: [at]} <robert.d.campbell{>
Date: Mon, 29 Jan 2001 13:18:40 +0100 (BST)

On Friday I posted a suggestion for starting a Windows exe
file from within BlackBox (ie use WinApi.WinExec).

Bart van Wijck described this as 'Surprising simple'.

I am not used to having Windows described as simple, so
I checked it.

WinApi.WinExec is an old Windows 3.x function, and is technically
obsolete in Win32 (ie 95, NT, etc). Instead you should use (according
to the book - I haven't tried it) the function CreateProcess which has
10 parameters including pointers to data structures that need to be
created using other functions (GetStartupInfo). Some of the parameters
contain numerous bits each of which is a separate flag.

An alternative approach that also works, and is simple, is :


VAR
  cmd : ARRAY 256 OF CHAR;


PROCEDURE ShowDoc*;
  BEGIN
    HostDialog.Start (cmd)
  END ShowDoc;


BEGIN
  cmd := 'C:\Program Files\Microsoft Office\Office\WINWORD.EXE c:\MyDoc.doc'
END.


Regards

Robert Campbell

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

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy
ðH 5
Received on Mon Jan 29 2001 - 12:18:40 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:45 UTC