Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public static void UninstallHook()
 {
     WinAPI.UnhookWindowsHookEx(m_Hook);
     WinAPI.DragAcceptFiles(mainWindow, false);
     m_Hook = IntPtr.Zero;
 }