diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-05-13 10:03:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-13 10:03:52 +0200 |
commit | 603b7c3ba2d2b5f9564684e0d9a96e4c86a8718d (patch) | |
tree | 7653a51eb6820c6ffb092ada025c8e6a3c9f02f5 | |
parent | Merge pull request #74 from tmm1/go-mod (diff) | |
parent | user32: add UIPI filter modifying function and constants (diff) | |
download | wireguard-windows-603b7c3ba2d2b5f9564684e0d9a96e4c86a8718d.tar.xz wireguard-windows-603b7c3ba2d2b5f9564684e0d9a96e4c86a8718d.zip |
Merge pull request #75 from zx2c4-forks/jd/uipi
user32: add UIPI filter modifying function and constants
-rw-r--r-- | user32.go | 282 |
1 files changed, 156 insertions, 126 deletions
@@ -1334,6 +1334,18 @@ const ( ENDSESSION_LOGOFF = 0x80000000 ) +// ChangeWindowMessageFilterEx constants +const ( + MSGFLT_RESET = 0 + MSGFLT_ALLOW = 1 + MSGFLT_DISALLOW = 2 + + MSGFLTINFO_NONE = 0 + MSGFLTINFO_ALREADYALLOWED_FORWND = 1 + MSGFLTINFO_ALREADYDISALLOWED_FORWND = 2 + MSGFLTINFO_ALLOWED_HIGHER = 3 +) + type NMBCDROPDOWN struct { Hdr NMHDR RcButton RECT @@ -1441,6 +1453,11 @@ type CREATESTRUCT struct { ExStyle uint32 } +type CHANGEFILTERSTRUCT struct { + size uint32 + extStatus uint32 +} + type WNDCLASSEX struct { CbSize uint32 Style uint32 @@ -1615,132 +1632,133 @@ var ( libuser32 *windows.LazyDLL // Functions - addClipboardFormatListener *windows.LazyProc - adjustWindowRect *windows.LazyProc - attachThreadInput *windows.LazyProc - animateWindow *windows.LazyProc - beginDeferWindowPos *windows.LazyProc - beginPaint *windows.LazyProc - bringWindowToTop *windows.LazyProc - callWindowProc *windows.LazyProc - checkMenuRadioItem *windows.LazyProc - clientToScreen *windows.LazyProc - closeClipboard *windows.LazyProc - createDialogParam *windows.LazyProc - createIconIndirect *windows.LazyProc - createMenu *windows.LazyProc - createPopupMenu *windows.LazyProc - createWindowEx *windows.LazyProc - deferWindowPos *windows.LazyProc - defWindowProc *windows.LazyProc - destroyIcon *windows.LazyProc - destroyMenu *windows.LazyProc - destroyWindow *windows.LazyProc - dialogBoxParam *windows.LazyProc - dispatchMessage *windows.LazyProc - drawIconEx *windows.LazyProc - drawMenuBar *windows.LazyProc - drawFocusRect *windows.LazyProc - drawTextEx *windows.LazyProc - emptyClipboard *windows.LazyProc - enableWindow *windows.LazyProc - endDeferWindowPos *windows.LazyProc - endDialog *windows.LazyProc - endPaint *windows.LazyProc - enumChildWindows *windows.LazyProc - findWindow *windows.LazyProc - getActiveWindow *windows.LazyProc - getAncestor *windows.LazyProc - getCaretPos *windows.LazyProc - getClassName *windows.LazyProc - getClientRect *windows.LazyProc - getClipboardData *windows.LazyProc - getCursorPos *windows.LazyProc - getDC *windows.LazyProc - getDesktopWindow *windows.LazyProc - getDpiForWindow *windows.LazyProc - getFocus *windows.LazyProc - getForegroundWindow *windows.LazyProc - getIconInfo *windows.LazyProc - getKeyState *windows.LazyProc - getMenuInfo *windows.LazyProc - getMessage *windows.LazyProc - getMonitorInfo *windows.LazyProc - getParent *windows.LazyProc - getRawInputData *windows.LazyProc - getScrollInfo *windows.LazyProc - getSysColor *windows.LazyProc - getSysColorBrush *windows.LazyProc - getSystemMetrics *windows.LazyProc - getSystemMetricsForDpi *windows.LazyProc - getWindow *windows.LazyProc - getWindowLong *windows.LazyProc - getWindowLongPtr *windows.LazyProc - getWindowPlacement *windows.LazyProc - getWindowRect *windows.LazyProc - getWindowThreadProcessId *windows.LazyProc - insertMenuItem *windows.LazyProc - invalidateRect *windows.LazyProc - isChild *windows.LazyProc - isClipboardFormatAvailable *windows.LazyProc - isDialogMessage *windows.LazyProc - isIconic *windows.LazyProc - isWindowEnabled *windows.LazyProc - isWindowVisible *windows.LazyProc - isZoomed *windows.LazyProc - killTimer *windows.LazyProc - loadCursor *windows.LazyProc - loadIcon *windows.LazyProc - loadImage *windows.LazyProc - loadMenu *windows.LazyProc - loadString *windows.LazyProc - messageBeep *windows.LazyProc - messageBox *windows.LazyProc - monitorFromWindow *windows.LazyProc - moveWindow *windows.LazyProc - unregisterClass *windows.LazyProc - openClipboard *windows.LazyProc - peekMessage *windows.LazyProc - postMessage *windows.LazyProc - postQuitMessage *windows.LazyProc - registerClassEx *windows.LazyProc - registerRawInputDevices *windows.LazyProc - registerWindowMessage *windows.LazyProc - releaseCapture *windows.LazyProc - releaseDC *windows.LazyProc - removeMenu *windows.LazyProc - screenToClient *windows.LazyProc - sendDlgItemMessage *windows.LazyProc - sendInput *windows.LazyProc - sendMessage *windows.LazyProc - setActiveWindow *windows.LazyProc - setCapture *windows.LazyProc - setClipboardData *windows.LazyProc - setCursor *windows.LazyProc - setCursorPos *windows.LazyProc - setFocus *windows.LazyProc - setForegroundWindow *windows.LazyProc - setMenu *windows.LazyProc - setMenuDefaultItem *windows.LazyProc - setMenuInfo *windows.LazyProc - setMenuItemInfo *windows.LazyProc - setParent *windows.LazyProc - setRect *windows.LazyProc - setScrollInfo *windows.LazyProc - setTimer *windows.LazyProc - setWinEventHook *windows.LazyProc - setWindowLong *windows.LazyProc - setWindowLongPtr *windows.LazyProc - setWindowPlacement *windows.LazyProc - setWindowPos *windows.LazyProc - showWindow *windows.LazyProc - systemParametersInfo *windows.LazyProc - trackPopupMenuEx *windows.LazyProc - translateMessage *windows.LazyProc - unhookWinEvent *windows.LazyProc - updateWindow *windows.LazyProc - windowFromDC *windows.LazyProc - windowFromPoint *windows.LazyProc + addClipboardFormatListener *windows.LazyProc + adjustWindowRect *windows.LazyProc + attachThreadInput *windows.LazyProc + animateWindow *windows.LazyProc + beginDeferWindowPos *windows.LazyProc + beginPaint *windows.LazyProc + bringWindowToTop *windows.LazyProc + callWindowProc *windows.LazyProc + changeWindowMessageFilterEx *windows.LazyProc + checkMenuRadioItem *windows.LazyProc + clientToScreen *windows.LazyProc + closeClipboard *windows.LazyProc + createDialogParam *windows.LazyProc + createIconIndirect *windows.LazyProc + createMenu *windows.LazyProc + createPopupMenu *windows.LazyProc + createWindowEx *windows.LazyProc + deferWindowPos *windows.LazyProc + defWindowProc *windows.LazyProc + destroyIcon *windows.LazyProc + destroyMenu *windows.LazyProc + destroyWindow *windows.LazyProc + dialogBoxParam *windows.LazyProc + dispatchMessage *windows.LazyProc + drawIconEx *windows.LazyProc + drawMenuBar *windows.LazyProc + drawFocusRect *windows.LazyProc + drawTextEx *windows.LazyProc + emptyClipboard *windows.LazyProc + enableWindow *windows.LazyProc + endDeferWindowPos *windows.LazyProc + endDialog *windows.LazyProc + endPaint *windows.LazyProc + enumChildWindows *windows.LazyProc + findWindow *windows.LazyProc + getActiveWindow *windows.LazyProc + getAncestor *windows.LazyProc + getCaretPos *windows.LazyProc + getClassName *windows.LazyProc + getClientRect *windows.LazyProc + getClipboardData *windows.LazyProc + getCursorPos *windows.LazyProc + getDC *windows.LazyProc + getDesktopWindow *windows.LazyProc + getDpiForWindow *windows.LazyProc + getFocus *windows.LazyProc + getForegroundWindow *windows.LazyProc + getIconInfo *windows.LazyProc + getKeyState *windows.LazyProc + getMenuInfo *windows.LazyProc + getMessage *windows.LazyProc + getMonitorInfo *windows.LazyProc + getParent *windows.LazyProc + getRawInputData *windows.LazyProc + getScrollInfo *windows.LazyProc + getSysColor *windows.LazyProc + getSysColorBrush *windows.LazyProc + getSystemMetrics *windows.LazyProc + getSystemMetricsForDpi *windows.LazyProc + getWindow *windows.LazyProc + getWindowLong *windows.LazyProc + getWindowLongPtr *windows.LazyProc + getWindowPlacement *windows.LazyProc + getWindowRect *windows.LazyProc + getWindowThreadProcessId *windows.LazyProc + insertMenuItem *windows.LazyProc + invalidateRect *windows.LazyProc + isChild *windows.LazyProc + isClipboardFormatAvailable *windows.LazyProc + isDialogMessage *windows.LazyProc + isIconic *windows.LazyProc + isWindowEnabled *windows.LazyProc + isWindowVisible *windows.LazyProc + isZoomed *windows.LazyProc + killTimer *windows.LazyProc + loadCursor *windows.LazyProc + loadIcon *windows.LazyProc + loadImage *windows.LazyProc + loadMenu *windows.LazyProc + loadString *windows.LazyProc + messageBeep *windows.LazyProc + messageBox *windows.LazyProc + monitorFromWindow *windows.LazyProc + moveWindow *windows.LazyProc + unregisterClass *windows.LazyProc + openClipboard *windows.LazyProc + peekMessage *windows.LazyProc + postMessage *windows.LazyProc + postQuitMessage *windows.LazyProc + registerClassEx *windows.LazyProc + registerRawInputDevices *windows.LazyProc + registerWindowMessage *windows.LazyProc + releaseCapture *windows.LazyProc + releaseDC *windows.LazyProc + removeMenu *windows.LazyProc + screenToClient *windows.LazyProc + sendDlgItemMessage *windows.LazyProc + sendInput *windows.LazyProc + sendMessage *windows.LazyProc + setActiveWindow *windows.LazyProc + setCapture *windows.LazyProc + setClipboardData *windows.LazyProc + setCursor *windows.LazyProc + setCursorPos *windows.LazyProc + setFocus *windows.LazyProc + setForegroundWindow *windows.LazyProc + setMenu *windows.LazyProc + setMenuDefaultItem *windows.LazyProc + setMenuInfo *windows.LazyProc + setMenuItemInfo *windows.LazyProc + setParent *windows.LazyProc + setRect *windows.LazyProc + setScrollInfo *windows.LazyProc + setTimer *windows.LazyProc + setWinEventHook *windows.LazyProc + setWindowLong *windows.LazyProc + setWindowLongPtr *windows.LazyProc + setWindowPlacement *windows.LazyProc + setWindowPos *windows.LazyProc + showWindow *windows.LazyProc + systemParametersInfo *windows.LazyProc + trackPopupMenuEx *windows.LazyProc + translateMessage *windows.LazyProc + unhookWinEvent *windows.LazyProc + updateWindow *windows.LazyProc + windowFromDC *windows.LazyProc + windowFromPoint *windows.LazyProc ) func init() { @@ -1758,6 +1776,7 @@ func init() { beginPaint = libuser32.NewProc("BeginPaint") bringWindowToTop = libuser32.NewProc("BringWindowToTop") callWindowProc = libuser32.NewProc("CallWindowProcW") + changeWindowMessageFilterEx = libuser32.NewProc("ChangeWindowMessageFilterEx") checkMenuRadioItem = libuser32.NewProc("CheckMenuRadioItem") clientToScreen = libuser32.NewProc("ClientToScreen") closeClipboard = libuser32.NewProc("CloseClipboard") @@ -1975,6 +1994,17 @@ func CallWindowProc(lpPrevWndFunc uintptr, hWnd HWND, Msg uint32, wParam, lParam return ret } +func ChangeWindowMessageFilterEx(hwnd HWND, msg uint32, action uint32, changeFilterStruct *CHANGEFILTERSTRUCT) bool { + ret, _, _ := syscall.Syscall6(changeWindowMessageFilterEx.Addr(), 4, + uintptr(hwnd), + uintptr(msg), + uintptr(action), + uintptr(unsafe.Pointer(changeFilterStruct)), + 0, + 0) + return ret != 0 +} + func CheckMenuRadioItem(hmenu HMENU, first, last, check, flags uint32) bool { ret, _, _ := syscall.Syscall6(checkMenuRadioItem.Addr(), 5, uintptr(hmenu), |