how to use another .EXE windows application file in DELPHI 4?(100分)

  • 主题发起人 主题发起人 zxr
  • 开始时间 开始时间
Z

zxr

Unregistered / Unconfirmed
GUEST, unregistred user!
how to use another .EXE file in a delphi4 project?
please gaoshou show me that.
thanks in advance.
 
winexec('...',sw_shownormal)
 
用winexec来实现.
winexec('程序名',窗口模式);
 
createprocess is much better.
CreateProcess(nil,
zAppName, { pointer to command line string }
nil, { pointer to process security attributes }
nil, { pointer to thread security attributes }
false, { handle inheritance flag }
CREATE_NEW_CONSOLE or { creation flags }
NORMAL_PRIORITY_CLASS,
nil, { pointer to new environment block }
nil, { pointer to current directory name }
StartupInfo, { pointer to STARTUPINFO }
ProcessInfo)
 
哎!晚了!
 
HINSTANCE ShellExecute(
HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
);
也可以哟.
 
给出一个例子
hInstance:=ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
 
多人接受答案了。
 
后退
顶部