当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 偶只是感兴趣,没有什么坏的想法哈 :) ......
    摘要: 提问的智慧 copyright (c) 2001 by eric s. raymond 中文版copyleft 2001 by d.h.grand(nobody/ginux) 英文版:http://www.tuxedo.org/~esr/faqs/smart-questions.html 感谢eric的耐心指点和同意,本文才得以完成并发布,本指南 英文版版权为eric steven ray......


SetWindowPos中HWNDMOSTTOP的问题.

如果程序有两个或者两个以上的窗体,在非主窗体(启动窗体)中使用  
  SetWindowPos(Form2->Handle,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE   |   SWP_NOMOVE);  
  好像没有效果.但在主窗体中这样用可以,为什么?  
 

NO.1   作者: jishiping

其实重载Form的CreateParam函数,改变WndParent就可以了。这个  
  WndParent只要不是Application->Handle就可以了。  
   
  class   TForm2   :   public   TForm  
  {  
  __published: //   IDE-managed   Components  
  private: //   User   declarations  
  protected:  
          void   __fastcall   CreateParams(TCreateParams&);  
  public: //   User   declarations  
          __fastcall   TForm2(TComponent*   Owner);  
  };  
   
  void   __fastcall   TForm2::CreateParams(TCreateParams&   Params)  
  {  
          TForm*   Form;  
   
          TForm::CreateParams(Params);  
          Form   =   dynamic_cast<TForm*>(Owner);  
          Params.WndParent   =   Form   ?   Form->Handle  
                    :   Application->MainForm->Handle;  
  }


    摘要: #include <stdio.h> int a[]={1, 2, 3}; void main(void) { printf("a[2]=%d.\n", a[2]); printf("2[a]=%d.\n", 2[a]); } 不上机,求输出结果!请给出说明! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE