1
現在我做我需要釋放的IntPtr被Win32 API或WindowInteropHelper
IntPtr hwnd = new WindowInteropHelper(this).Handle;
IntPtr menuHandle = GetSystemMenu(hwnd, false);
WindowInteropHelper
是內置的,GetSystemMenu
是WIN 32 API
[DllImport("user32.dll")]
static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
獲取窗口和系統菜單的手柄處理獲得性
我的問題是,我是否需要釋放任一手柄?如果我這樣做,我應該怎麼做,什麼時候該做?
GetSystemMenu一個怎麼樣 – Steve
我已經更新了我的答案 –