Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1223194
  • 博文数量: 788
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 7005
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-19 15:52
文章存档

2017年(81)

2011年(1)

2009年(369)

2008年(337)

分类:

2008-11-27 21:17:38



有一个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}

阅读(903) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~