这段代码有何错误,如何改正(10分)

  • 主题发起人 主题发起人 sy0116
  • 开始时间 开始时间
S

sy0116

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);<br>var<br>hwnd,h:longint;<br>begin<br>hwnd:=FindWindow(nil,pchar('foxmail'));<br>h:=FindWindowEx(hwnd,0,nil,pchar('收取'));<br>edit1.Text:=inttostr(h);<br>
 
var<br>hwnd,h:HWND;<br>
 
var<br>hwnd,h:longint;<br>begin<br>hwnd:=FindWindow(nil,pchar('foxmail'));<br>FindWindowEx(hwnd,h,nil,pchar('收取'));<br>edit1.Text:=inttostr(h);<br>end;
 
var<br>hwnd,h:longint;<br>begin<br>hwnd:=FindWindow(nil,pchar('foxmail'));<br>FindWindowEx(hwnd,h,nil,pchar('收取'));//查看API函数帮助文件<br>edit1.Text:=inttostr(h);<br>end;
 
我感觉好像是对的!
 
区分 大小写 !
 
procedure TForm1.btnTestClick(Sender: TObject);<br>const<br>&nbsp; C_WinCaption = 'foxmail';<br>var<br>&nbsp; wd, h: HWND;<br>begin<br>&nbsp; wd := FindWindow(nil,pchar(C_WinCaption));<br>&nbsp; if (wd = 0) then<br>&nbsp; begin<br>&nbsp; &nbsp; Caption := format('Can''t find ''%s''', [C_WinCaption]);<br>&nbsp; &nbsp; exit;<br>&nbsp; end;<br><br>&nbsp; h := FindWindowEx(wd,0,nil,pchar('收取'));<br>&nbsp; Caption := format('%d', [h]);<br>end;<br><br><br>如果还有错,我再看看.^_^
 
后退
顶部