diff --git a/src/modules/ctypes/winnt/kernel32.jsm b/src/modules/ctypes/winnt/kernel32.jsm index a9d975a..a6d40e7 100644 --- a/src/modules/ctypes/winnt/kernel32.jsm +++ b/src/modules/ctypes/winnt/kernel32.jsm @@ -35,7 +35,6 @@ function kernel32_defines(lib) { lib.lazy_bind("GetProcAddress", win32.FARPROC, win32.HMODULE, win32.LPCSTR); lib.lazy_bind("GetCurrentThreadId", win32.DWORD); - } new ctypes_library(KERNEL32_LIBNAME, KERNEL32_ABIS, kernel32_defines, this); diff --git a/src/modules/ctypes/winnt/user32.jsm b/src/modules/ctypes/winnt/user32.jsm index 154999f..f894413 100644 --- a/src/modules/ctypes/winnt/user32.jsm +++ b/src/modules/ctypes/winnt/user32.jsm @@ -32,7 +32,7 @@ function user32_defines(lib) { lib.lazy_bind("GetWindowTextW", ctypes.int, win32.HWND, win32.LPTSTR, ctypes.int); lib.lazy_bind("FindWindowW", win32.HWND, win32.LPCTSTR, win32.LPCTSTR); - lib.lazy_bind("SendMessageW", win32.LRESULT, win32.HWND, win32.UINT, win32.WPARAM, win32.WPARAM); + lib.lazy_bind("SendMessageW", win32.LRESULT, win32.HWND, win32.UINT, win32.WPARAM, win32.LPARAM); this.WM_GETICON = 0x007F; this.ICON_SMALL = 0; this.ICON_BIG = 1; @@ -183,6 +183,8 @@ function user32_defines(lib) { this.HC_SYSMODALON = 4; this.HC_SYSMODALOFF = 5; + lib.lazy_bind("GetWindowThreadProcessId", win32.DWORD, win32.HWND, win32.LPDWORD); + } new ctypes_library(USER32_LIBNAME, USER32_ABIS, user32_defines, this); diff --git a/src/modules/ctypes/winnt/win32.jsm b/src/modules/ctypes/winnt/win32.jsm index 15e554c..05f6234 100644 --- a/src/modules/ctypes/winnt/win32.jsm +++ b/src/modules/ctypes/winnt/win32.jsm @@ -24,6 +24,7 @@ var win32 = new function() { this.UINT_PTR = is64bit ? ctypes.uint64_t : ctypes.unsigned_int; this.WORD = ctypes.unsigned_short; this.DWORD = ctypes.unsigned_long; + this.LPDWORD = this.DWORD.ptr; this.PVOID = ctypes.voidptr_t; this.LPVOID = ctypes.voidptr_t; this.LONG = ctypes.long; diff --git a/src/modules/winnt/FiretrayStatusIcon.jsm b/src/modules/winnt/FiretrayStatusIcon.jsm index 49ff851..51a5af5 100644 --- a/src/modules/winnt/FiretrayStatusIcon.jsm +++ b/src/modules/winnt/FiretrayStatusIcon.jsm @@ -132,19 +132,6 @@ firetray.StatusIcon = { switch (+lParam) { case win32.WM_LBUTTONUP: log.debug("WM_LBUTTONUP"); - let rv = user32.SendMessageW(hWnd, firetray.Win32.WM_TRAYMESSAGEFWD, 0, 1); - break; - case win32.WM_RBUTTONUP: - log.debug("WM_RBUTTONUP"); - break; - case win32.WM_CONTEXTMENU: - log.debug("WM_CONTEXTMENU"); - break; - case win32.NIN_KEYSELECT: - log.debug("NIN_KEYSELECT"); - break; - default: - } try { @@ -158,6 +145,19 @@ try { log.error(error); } + break; + case win32.WM_RBUTTONUP: + log.debug("WM_RBUTTONUP"); + break; + case win32.WM_CONTEXTMENU: + log.debug("WM_CONTEXTMENU"); + break; + case win32.NIN_KEYSELECT: + log.debug("NIN_KEYSELECT"); + break; + default: + } + } return user32.DefWindowProcW(hWnd, uMsg, wParam, lParam); diff --git a/src/modules/winnt/FiretrayWindow.jsm b/src/modules/winnt/FiretrayWindow.jsm index 1eb505e..ad6e98d 100644 --- a/src/modules/winnt/FiretrayWindow.jsm +++ b/src/modules/winnt/FiretrayWindow.jsm @@ -164,7 +164,6 @@ firetray.Handler.registerWindow = function(win) { firetray.Window.updateVisibility(wid, true); log.debug("window "+wid+" registered"); -/* try { let callProcHook = user32.HOOKPROC(firetray.Window.callProcHook); log.debug("callhk="+callProcHook); @@ -184,7 +183,6 @@ firetray.Handler.registerWindow = function(win) { +firetray.Handler.appName+"."); else win.alert(x); } -*/ log.debug("AFTER"); firetray.Handler.dumpWindows(); return wid; @@ -202,10 +200,8 @@ firetray.Handler.unregisterWindow = function(win) { if (!delete firetray.Handler.windows[wid]) throw new DeleteError(); -/* user32.UnhookWindowsHookEx(firetray.Handler.callProcHooks.get(wid)); firetray.Handler.callProcHooks.remove(wid); -*/ firetray.Handler.windowsCount -= 1; firetray.Handler.visibleWindowsCount -= 1;