1. Win32lib shellExecute ??
- Posted by timmy <tim781 at PACBELL.NET>
Jan 01, 2000
-
Last edited Jan 02, 2000
Hi Can anyone give an example on using David's new
win32lib feature. It's for launching other programs in
Win32, but, I don't know what parameters to use.
How about an example for starting notepad.exe
that's in c:\windows\notepad.exe
I'm still a newbie.
thanks again... timmmy
5. New: shellExecute Command
shellExecute( command, file, style )
2. Re: Win32lib shellExecute ??
Hi, Timmy
shellExecute("open","notepad",5) will run notepad.exe for you.
Some notes:
if the program is not in c:\windows you will need the path e.g.
shellExecute("open","C:\\my folder\\mypgm.ext",5)
Also the last parm can do different things for you such as
if 2 will execute pgm only after your exw program ends,
if 3 will execute pgm maximized and return to your exw program,
if 4 will load pgm but return focus to your exw program immediately,
if 1 of 5 will execute pgm (not maximized) and returns to your exw
program but I don't know what the difference between 1 and 5 are.
Hope this helps,
Judith Evans
3. Re: Win32lib shellExecute ??
I would expect this might be documented fully in win32lib.htm before the
final release:
shellExecute( command, file, style )
The following operation strings are valid for 'command':
"open" -- The function opens the file specified by the 'file' parameter.
The file can be an executable file or a document file. It can
also be a folder.
"print" -- The function prints the file specified by 'file'. The file
should be a document file. If the file is an executable file,
the function opens the file, as if "open" had been specified.
"explore" -- The function explores the folder specified by 'file'.
This parameter can be NULL. In that case, the function opens the file
specified by 'file'.
'file' is a string that specifies the file to open or print or the folder
to open or explore. The function can open an executable file or a document
file. The function can print a document file.
If 'file' specifies an executable file, 'style' specifies how the
application is to be shown when it is opened. This parameter can be one of
the following values:
SW_SHOWDEFAULT Default style.
SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window.
SW_MINIMIZE Minimizes the specified window and activates the next top-
level window in the z-order.
SW_RESTORE Activates and displays the window. If the window is minimized
or maximized, Windows restores it to its original size and
position. An application should specify this flag when
restoring a minimized window.
SW_SHOW Activates the window and displays it in its current size and
position.
SW_SHOWMAXIMIZED Activates the window and displays it as a maximized
window.
SW_SHOWMINIMIZED Activates the window and displays it as a minimized
window.
SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active
window remains active.
SW_SHOWNA Displays the window in its current state. The active window
remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position.
The active window remains active.
SW_SHOWNORMAL (or SW_NORMAL) Activates and displays a window. If the
window is minimized or maximized, Windows restores it to its
original size and position. An application should specify
this flag when displaying the window for the first time.
4. Re: Win32lib shellExecute ??
- Posted by David Cuny <dcuny at LANSET.COM>
Jan 01, 2000
-
Last edited Jan 02, 2000
Brian Broker tactfully wrote:
> I would expect this might be documented
> fully in win32lib.htm before the final release:
Hint taken. Not that there ever is any 'final' release of Win32Lib.
-- David Cuny