如题,请高手指点

解决方案 »

  1.   


    [DllImport("user32.dll",   EntryPoint="CreateWindowEx")]  
      public   static   extern   int   CreateWindowEx   (  
      int   dwExStyle,  
      string   lpClassName,  
      string   lpWindowName,  
      int   dwStyle,  
      int   x,  
      int   y,  
      int   nWidth,  
      int   nHeight,  
      int   hWndParent,  
      int   hMenu,  
      int   hInstance,  
      ref   int   lpParam  
      );   
      

  2.   

    to xianguang321:
    可以举个例子吗?比如我又一个 UserControl1 (继承自UserControl),我要把它创建为窗体。用CreateWindowEx该怎么做。
      

  3.   

    //MSDN Sintax:HWND CreateWindowEx( 
        DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, 
        DWORD dwStyle, int x, int y, int nWidth, 
        int nHeight, HWND hWndParent, HMENU hMenu, 
        HINSTANCE hInstance, LPVOID lpParam
    );----------------
    //C# Declaration [DllImport("User32", SetLastError=true)]
    internal static extern int CreateWindowEx (
        int dwExStyle, string lpClassName, string lpWindowName, int dwStyle, 
        int X, int Y, int nWidth, int nHeight, int hWndParent, int hMenu,
        int hInstance, IntPtr lpParam);----------------
    //Direct Use m_lTTHwnd = CreateWindowEx(0, TOOLTIP_CLASS, string.Empty, 
       lWinStyle, 0, 0, 0, 0, m_lParentHwnd, 0, 0, IntPtr.Zero);这是我从网上给你找的,希望对你有帮助!
      

  4.   

    网址:http://www.codeproject.com/KB/shell/balloonshow.aspx
      

  5.   

    to xianguang321:这里的TOOLTIP_CLASS是一个Win32类,并不是托管类。我想做到的在托管环境下创建一个Control的的派生类,再用CreateWindowEx创建为窗体。请指教
      

  6.   

    生命在于折腾啊...public virtual void CreateHandle(CreateParams cp);
    Declaring Type: System.Windows.Forms.NativeWindow 下个reflector看看system.windows.forms.dll是怎么实现的吧,大概有帮助