public void InstallHook() { var hModule = WinAPI.GetModuleHandle(null); m_Callback = Callback; m_Hook = WinAPI.SetWindowsHookEx(HookType.WH_GETMESSAGE, m_Callback, hModule, threadId); // Allow dragging of files onto the main window. generates the WM_DROPFILES message WinAPI.DragAcceptFiles(mainWindow, true); }
public static void UninstallHook() { // WinAPI.ChangeClipboardChain(mainWindow, nextClipboardViewer); WinAPI.UnhookWindowsHookEx(m_Hook); // WinAPI.UnhookWindowsHookEx(m_Hook2); WinAPI.DragAcceptFiles(mainWindow, false); m_Hook = IntPtr.Zero; m_Hook2 = IntPtr.Zero; }
public static void InstallHook() { threadId = WinAPI.GetCurrentThreadId(); if (threadId > 0) { Window.EnumThreadWindows(threadId, EnumCallback, IntPtr.Zero); } var hModule = WinAPI.GetModuleHandle(null); m_Hook = WinAPI.SetWindowsHookEx(HookType.WH_GETMESSAGE, Callback, hModule, threadId); // Allow dragging of files onto the main window. generates the WM_DROPFILES message WinAPI.DragAcceptFiles(mainWindow, true); }
public static void InstallHook(IntPtr m) { mainWindow = m; m_ClassName = UnityEngine.Application.productName; threadId = WinAPI.GetCurrentThreadId(); if (threadId > 0) { Window.EnumThreadWindows(threadId, EnumCallback, IntPtr.Zero); } // nextClipboardViewer = (IntPtr)WinAPI.SetClipboardViewer(mainWindow); var hModule = WinAPI.GetModuleHandle(null); m_Hook = WinAPI.SetWindowsHookEx(HookType.WH_GETMESSAGE, Callback, hModule, threadId); // m_Hook = WinAPI.SetWindowsHookEx(HookType.WH_GETMESSAGE, Callback, hModule, threadId); // Allow dragging of files onto the main window. generates the WM_DROPFILES message WinAPI.DragAcceptFiles(mainWindow, true); }
public static void UninstallHook() { WinAPI.UnhookWindowsHookEx(m_Hook); WinAPI.DragAcceptFiles(mainWindow, false); m_Hook = IntPtr.Zero; }