Jurica2505
asked on
Execute programs
how to execute programs(like notepad, wordpad, paint...)?
Forgot to tell to put ShellAPI in the uses clause.
And here's another example:
ShellExecute(Handle, 'open', 'wordpad', 'c:\autoexec.bat', '', SW_NORMAL);
Cheers,
Epsylon.
And here's another example:
ShellExecute(Handle, 'open', 'wordpad', 'c:\autoexec.bat', '', SW_NORMAL);
Cheers,
Epsylon.
you can try this the other way:
WinExec('notepad.exe',2);
You can replace the 2 at 1 or 0:
0 mean invisible
1 mean minimize
2 mean maximize
WinExec('notepad.exe',2);
You can replace the 2 at 1 or 0:
0 mean invisible
1 mean minimize
2 mean maximize
Epsylon changed the proposed answer to a comment
Uses ShellAPI;
ShellExecute(Handle, 'open', 'notepad', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'somefile.txt', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'somefile.doc', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'wordpad', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'paint', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'notepad', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'somefile.txt', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'somefile.doc', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'wordpad', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'paint', '', '', SW_NORMAL);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ShellExecute(Handle, 'open', 'notepad', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'somefile.txt', '', '', SW_NORMAL);
ShellExecute(Handle, 'open', 'somefile.doc', '', '', SW_NORMAL);
Regards,
Epsylon.