コード例 #1
0
 public bool Destroy()
 {
     if (User32Methods.DestroyWindow(this.Handle))
     {
         this.Handle = IntPtr.Zero;
         return(true);
     }
     return(false);
 }
コード例 #2
0
ファイル: WindowFactory.cs プロジェクト: zyj0021/WinApi
        public static void DestroyAllWindows(string className)
        {
            IntPtr windowPtr;

            do
            {
                windowPtr = User32Methods.FindWindow(className, null);
                User32Methods.DestroyWindow(windowPtr);
            } while (windowPtr != IntPtr.Zero);
        }
コード例 #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (this.IsDisposed)
     {
         return;
     }
     if (this.IsSourceOwner)
     {
         User32Methods.DestroyWindow(this.Handle);
     }
     else
     {
         ((INativeConnectable)this).Detach();
     }
     this.IsDisposed = true;
     GC.SuppressFinalize(this);
 }