怎么调用win98,自带的小游戏(50分)

冰刀

Unregistered / Unconfirmed
GUEST, unregistred user!
怎么调用win98,自带的小游戏?能告诉我用到的api函数吗?和具体的语句?<br>谢了!
 
Use API: Winexec(name,id)<br>You can get result!
 
uses shellapi;<br>shellexeculte()<br><br>你怎么就不会检索一下以前的帖子呢?
 
如果我不错的话,我觉得这里检索不是模糊检索,完全一样才检索得到。<br>能不能再说具体点?我没用过,谢谢了。<br>这儿好像好要牵扯到pascall,字符串和null类型字符串的转换
 
检索“shellexeculte”<br>它游戏不也是一个文件嘛?<br>shellexeculte 你调用任何文件都可以的
 
wjiachun,我已经use shellapi,但是<br>[Error] Unit1.pas(28): Undeclared identifier: 'shellexeculte'<br>不知是为什么?
 
当然没有shellexeculte了<br>应该是shellexecute吧???
 
对,应该是 shellexecute !<br>另,要是只是调用 windows 的那几个小游戏,那还不如用 winexec 来的简单
 
winexec 算了,还简单一点。
 
怎么我用 检索时 会出错???
 
建议不要用Winexec<br>This function is provided for compatibility with earlier versions of Windows. <br>For Win32-based applications, use the CreateProcess function. <br><br>用ShellExecute吧。<br>
 
冰刀:<br>抱歉,一时失误打下错误函数,我奇怪既然错误了<br>你用这个函数的参数又是哪儿来的?
 
还没有检测到参数,我用个()。<br>这个api函数的用法,能不能给个例子?<br>shellexecute(。。。。。。)
 
你不会自己查查帮助么?<br>shellexecute(0,'open','notepad.exe','c:/a.txt',nil,0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/~~~~~~~~~~~ &nbsp; ~~~~~~~/<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 可执行文件名 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;命令参数<br><br>无聊啊
 
我在帮助中没查到,在帮助索引中,输入,没有~!<br>谢谢你的答复。
 
以调用计算器为例 <br>var h:HWND;<br>&nbsp;begin<br>&nbsp; &nbsp;h:=winExec('calc.exe',SW_SHOWNORMAL);//calc.exe就是你要调用的程序<br>&nbsp; &nbsp;if h&lt;=32 then &nbsp; //如果程序无法启动<br>&nbsp; &nbsp; showmessage('调用失败');<br>&nbsp; end;
 
哈哈,好热闹啊
 
用winexec调用!!<br>另外!!!注意!!!win98和win2000下是不同的<br><br>command.com 为win98下, cmd.com为win2000下<br><br>win98下:<br>WinExec('command.com &nbsp;/c &nbsp;TYPE aaa.txt',SW_NORMAL);<br>win2000下<br>WinExec('command.com &nbsp;/c &nbsp;TYPE aaa.txt',SW_NORMAL);<br><br><br>以下为程序自动判断<br>既然WIN98与NT的命令解释器不一样,<br>win98: command.com &nbsp;环境变量Comspec=c:/windows/command.com<br>NT与2000:cmd.exe &nbsp;环境变量 Comspec=c:/nt/system32/cmd.exe<br><br>就可根据环境变量知道了,通用程序:<br>char buf[256]<br>GetEnvironmentVariable("Comspec",buf,sizeof(buf));<br>String ComStr=String(buf)+" /c &nbsp;copy abc.txt 123.dat";<br>WinExec(ComStr.c_str(),SW_NORMAL);<br>
 
简单问题回答的,我就不凑热闹了。。。
 
顶部