public override void CloseDW(uint dwReserved) { try { if(shellContextMenu != null) { shellContextMenu.Dispose(); shellContextMenu = null; } foreach(IntPtr ptr in lstPUITEMIDCHILD) { if(ptr != IntPtr.Zero) { PInvoke.CoTaskMemFree(ptr); } } if(dropTargetWrapper != null) { dropTargetWrapper.Dispose(); dropTargetWrapper = null; } InstanceManager.UnregisterButtonBar(); fFinalRelease = false; base.CloseDW(dwReserved); } catch(Exception exception) { QTUtility2.MakeErrorLog(exception, "buttonbar closing"); } }
public override void CloseDW(uint dwReserved) { // called when the user disables the Desktop Tool // this seems not to be called on log off / shut down... if(iContextMenu2 != null) { Marshal.ReleaseComObject(iContextMenu2); iContextMenu2 = null; } // dispose controls in the thread they're created. if(thumbnailTooltip != null) { thumbnailTooltip.Invoke(d => d.Dispose()); thumbnailTooltip = null; } if(subDirTip != null) { subDirTip.Invoke(d => d.Dispose()); subDirTip = null; } // unhook, unsubclass if(hHook_MsgDesktop != IntPtr.Zero) { PInvoke.UnhookWindowsHookEx(hHook_MsgDesktop); hHook_MsgDesktop = IntPtr.Zero; } if(hHook_MsgShell_TrayWnd != IntPtr.Zero) { PInvoke.UnhookWindowsHookEx(hHook_MsgShell_TrayWnd); hHook_MsgShell_TrayWnd = IntPtr.Zero; } if(hHook_KeyDesktop != IntPtr.Zero) { PInvoke.UnhookWindowsHookEx(hHook_KeyDesktop); hHook_KeyDesktop = IntPtr.Zero; } if(shellViewListener != null) { shellViewListener.ReleaseHandle(); shellViewListener = null; } base.CloseDW(dwReserved); }
public override void CloseDW(uint dwReserved) { try { if(treeViewWrapper != null) { treeViewWrapper.Dispose(); treeViewWrapper = null; } if(listViewManager != null) { listViewManager.Dispose(); listViewManager = null; } if(subDirTip_Tab != null) { subDirTip_Tab.Dispose(); subDirTip_Tab = null; } if(IsShown) { if(pluginServer != null) { pluginServer.Dispose(); pluginServer = null; } if(hHook_Key != IntPtr.Zero) { PInvoke.UnhookWindowsHookEx(hHook_Key); hHook_Key = IntPtr.Zero; } if(hHook_Mouse != IntPtr.Zero) { PInvoke.UnhookWindowsHookEx(hHook_Mouse); hHook_Mouse = IntPtr.Zero; } if(hHook_Msg != IntPtr.Zero) { PInvoke.UnhookWindowsHookEx(hHook_Msg); hHook_Msg = IntPtr.Zero; } if(explorerController != null) { explorerController.ReleaseHandle(); explorerController = null; } if(rebarController != null) { rebarController.Dispose(); rebarController = null; } if(!QTUtility.IsXP && (travelBtnController != null)) { travelBtnController.ReleaseHandle(); travelBtnController = null; } InstanceManager.RemoveFromTrayIcon(Handle); // TODO: check this using(RegistryKey key = Registry.CurrentUser.CreateSubKey(RegConst.Root)) { if(Config.Misc.KeepHistory) { foreach(QTabItem item in tabControl1.TabPages) { AddToHistory(item); } QTUtility.SaveRecentlyClosed(key); } if(Config.Misc.KeepRecentFiles) { QTUtility.SaveRecentFiles(key); } string[] list = (from QTabItem item2 in tabControl1.TabPages where item2.TabLocked select item2.CurrentPath).ToArray(); QTUtility2.WriteRegBinary(list, "TabsLocked", key); InstanceManager.UnregisterTabBar(); if(0x80000 != ((int)PInvoke.Ptr_OP_AND(PInvoke.GetWindowLongPtr(ExplorerHandle, -20), 0x80000))) { QTUtility.WindowAlpha = 0xff; } else { byte num; int num2; int num3; if(PInvoke.GetLayeredWindowAttributes(ExplorerHandle, out num2, out num, out num3)) { QTUtility.WindowAlpha = num; } else { QTUtility.WindowAlpha = 0xff; } } key.SetValue("WindowAlpha", QTUtility.WindowAlpha); IDLWrapper.SaveCache(key); } if((md5Form != null) && !md5Form.InvokeRequired) { md5Form.SaveMD5FormStat(); md5Form.Dispose(); md5Form = null; } Cursor = Cursors.Default; if((curTabDrag != null) && (curTabDrag != Cursors.Default)) { PInvoke.DestroyIcon(curTabDrag.Handle); GC.SuppressFinalize(curTabDrag); curTabDrag = null; } if((curTabCloning != null) && (curTabCloning != Cursors.Default)) { PInvoke.DestroyIcon(curTabCloning.Handle); GC.SuppressFinalize(curTabCloning); curTabCloning = null; } if(dropTargetWrapper != null) { dropTargetWrapper.Dispose(); dropTargetWrapper = null; } OptionsDialog.ForceClose(); if(tabSwitcher != null) { tabSwitcher.Dispose(); tabSwitcher = null; } } if(TravelLog != null) { Marshal.FinalReleaseComObject(TravelLog); TravelLog = null; } if(shellContextMenu != null) { shellContextMenu.Dispose(); shellContextMenu = null; } if(ShellBrowser != null) { ShellBrowser.Dispose(); ShellBrowser = null; } foreach(ITravelLogEntry entry in LogEntryDic.Values) { if(entry != null) { Marshal.FinalReleaseComObject(entry); } } LogEntryDic.Clear(); fFinalRelease = true; base.CloseDW(dwReserved); } catch(Exception exception2) { QTUtility2.MakeErrorLog(exception2, "tabbar closing"); } }