Microsoft Word Issue?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
RDC
Posts: 114
Joined: 29 Jan 2023, 10:22

Microsoft Word Issue?

06 Mar 2023, 12:38

Can anyone enlighten me as to why the below script doesn't seem to work with Microsoft Office products?
This is just a simple windows position lock, that so far has worked with everything except those products.

Code: Select all

#Persistent
#SingleInstance, Force

^L::  							 ; Ctrl+L = Lock window
winLock(hWnd := WinExist("A")) 	 ; Last active window.
SoundBeep 1500
Return

^U::  							 ; Ctrl+U = Unlock window
winRevert(hWnd)
SoundBeep 1000
Return

winLock(hWnd) {
nCnt := DllCall("GetMenuItemCount", "Int", sysMenu := hSysMenu(hWnd, False))
DllCall("RemoveMenu", "Int", sysMenu, "UInt", nCnt - 6, "UInt", 0x400), DllCall("DrawMenuBar", "Int", hWnd)
}

hSysMenu(hWnd, revert) {
Return DllCall("GetSystemMenu", "UInt", hWnd, "UInt", revert)
}

winRevert(hWnd) {
DllCall("DrawMenuBar", "UInt", hSysMenu(hWnd, True))
}

^Esc::ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 120 guests