 |
WinExec ..msdn Add comment W32 Constants Translate this page |
 |
 |
The WinExec function runs the specified application.
Note This function is provided only for compatibility with 16-bit Windows. Win32-based applications should use the CreateProcess function
|
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
UINT WinExec(
LPCSTR lpCmdLine, // command line
UINT uCmdShow // window style
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER WinExec IN kernel32;
STRING cCmdLine,;
INTEGER nCmdShow
|
 |
 |
 |
| Parameters: |
 |
lpCmdLine
[in] Pointer to a null-terminated character string that contains the command line (file name plus optional parameters) for the application to be executed
uCmdShow
[in] Specifies how a Windows-based application window is to be shown ...
|
 |
 |
| Return value: |
 |
If the function succeeds, the return value is greater than 31.
If the function fails, the return value is one of the following error values:
* The system is out of memory or resources.
* 0
* The .exe file is invalid (non-Win32 .exe or error in .exe image).
#DEFINE ERROR_BAD_FORMAT 11
* The specified file was not found.
#DEFINE ERROR_FILE_NOT_FOUND 2
* The specified path was not found.
#DEFINE ERROR_PATH_NOT_FOUND 3
|
 |
 |
| Usage: |
 |
#DEFINE SW_NORMAL 1
= WinExec("notepad.exe", SW_NORMAL)
|
 |
 |
| My comment: |
 |
The native VFP command RUN | ! Command probably uses the same way, though I feel that sometimes the direct calling is more effective.
Microsoft says:
If a malicious user were to create an application called "Program.exe" on a system, any program that incorrectly calls WinExec using the Program Files directory will run this application instead of the intended application.
Watch a short video to see how to use the WinExec in VFP. |
 |
 |
| Word Index links for the WinExec : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2001-07-12 12:00:00 | | Modified: | 2008-01-26 20:09:48 | Visited in last 7 days: 45 |