delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
findwindow和findwindowex用来查找mid窗口的问题 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiAPI/html/delphi_20061127161821165.html
有一个mdi子窗口mdi_1,然后在mid_1窗口中mdi_11:=   tmdi_11.Create(self),最后在mdi_11中找mdi_1窗口的句柄,不能找到.请介绍一下findwindowex使用方法.  
   
  我使用的findwindow可以找到非mdi窗口  
  hd:=findwindow('mdi_1',0)  
   
  使用findwindowex什么都找不到  
  hd:=findwindowex(mdi_1.ParentWindow,0,'mdi_1',nil);  
 

用findCompent

已经解决了,但是'MDIClient'还不清楚是什么意思  
   
  //参考如下代码        
      var        
              vHandle:       THandle;        
      begin        
              vHandle       :=       FindWindow('TForm1',       nil);       //寻找MDI主窗体        
              Memo1.Lines.Add(IntToStr(vHandle));        
              vHandle       :=       FindWindowEx(vHandle,       0,       'MDIClient',       nil);       //寻找MDI容器区域        
              Memo1.Lines.Add(IntToStr(vHandle));        
              vHandle       :=       FindWindowEx(vHandle,       0,       'TForm3',       nil);       //寻找MDI子窗体        
      end;

FindWindowEx(  
  Parent:   HWND;                                               {a   handle   to   a   parent   window}  
  Child:   HWND;                                               {a   handle   to   a   child   window}  
  ClassName:   PChar;                                   {a   pointer   to   a   null   terminated   class   name   string}  
  WindowName:   PChar                                 {a   pointer   to   a   null   terminated   window   name   string}  
  ):   HWND;                                                                 {returns   a   handle   to   a   window}

posted on 2008-11-27 21:12 delphi2007 阅读(1445) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。