g_hRun : HWND;
lpExitCode : LPDWORD;
GetExitCodeProcess(g_hRun, lpExitCode);
[Error] total.pas(220): Types of actual and formal var parameters must be identical
lpExitCode : LPDWORD;
GetExitCodeProcess(g_hRun, lpExitCode);
[Error] total.pas(220): Types of actual and formal var parameters must be identical
解决方案 »
- delphi7求租
- 希望版主增加一个无满意揭帖区,或发贴的时候显示同时显示无满意揭帖率
- 请问我的简体程序已经转成繁体程序,请问服务器的数据库要变成繁体的吗。。不变可以吗,在繁体程序会出现乱码吗?
- 调用ORACLE8的存储过程进行图片的插入和读取的问题。。。。十万火急。。。。
- 关于QuickReport!
- 学李维的《SOAP/WEB SERVICE开发》的问题,请各位大虾指教
- 请教:如何获取错误类型?
- 在98下面编写的调用dll文件的程序,在2000下 为什么出现错误
- 那里有自动生成insert sql的工具
- 如何安装MTS??????????????
- 怎样在TREEVIEW中的子树上右键弹出菜单?
- 如何检测软驱里是否有软盘?
function GetExitCodeProcess(hProcess: THandle; var lpExitCode: DWORD): BOOL; stdcall;function GetExitCodeProcess; external 'kernel32.dll' name 'GetExitCodeProcess';其实这些都声明在 Windows 单元中了,我也只是 Copy 而已 :)
dExitCode : DWORD;
GetExitCodeProcess(hproc, dExitCode);
GETLASTERROR=0 表示没有发生错误
g_hRun := ShellExecute(
Application.MainForm.Handle,
nil,
'gl.exe',
PChar(g_sUserAndPwd),
nil,
SW_MAXIMIZE);
得到的句柄好像无效。
If the function succeeds, the return value is the instance handle of the application that was run, or the handle of a dynamic data exchange (DDE) server application.GetExitCodeProcess hProcess
Identifies the process.
Windows NT: The handle must have PROCESS_QUERY_INFORMATION access. For more information, see Process Objects你传入 GetExitCodeProcess 的 hProcess 参数不对在这种情况下我是用 CreateProcess 代替 ShellExecute 的。
suInfo: TStartupInfo;
procInfo: TProcessInformation;
xCode: DWORD;
errMsg, cmd: string;
begin
FillChar(suInfo, Sizeof(TStartupInfo), #0);
with suInfo do begin
dwFlags := STARTF_USESHOWWINDOW;
wShowWindow := SW_Hide;
lpReserved := nil;
lpDesktop := nil;
lpTitle := nil;
cbReserved2 := 0;
lpReserved2 := nil;
cb := sizeof(TStartupInfo);
end;
cmd := 'c:\windows\command\cmd.exe';
if CreateProcess(nil, pchar(cmd), nil, nil, False,
CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASs, nil, nil,
suInfo, procInfo) then begin
if GetExitCodeProcess(procInfo.hProcess, xCode) then begin
if xCode<>0 then begin
Application.MessageBox(pchar(' 呀哈!!') ,'出错',MB_ICONSTOP);
else
errMsg := ' GetExitCodeProcess failed.'+#13#10+'错误:'+SysErrorMessage(GetLastError)
end
else
errMsg := ' 建立进程失败。'+#13#10+'错误:'+SysErrorMessage(GetLastError);