Skip to content

Instantly share code, notes, and snippets.

@NKid
Created April 22, 2013 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NKid/8a403c0861f766eee8a1 to your computer and use it in GitHub Desktop.
Save NKid/8a403c0861f766eee8a1 to your computer and use it in GitHub Desktop.
Disable Close Button
SetTitleMatchMode, 2
RUN "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /recycle /nopreview
WinWaitActive,Microsoft Outlook
DisableCloseButton(WinExist("Microsoft Outlook"))
DisableCloseButton(hWnd="") {
hSysMenu:=DllCall("GetSystemMenu","Int",hWnd,"Int",FALSE)
nCnt:=DllCall("GetMenuItemCount","Int",hSysMenu)
DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-1,"Uint","0x400")
DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-2,"Uint","0x400")
DllCall("DrawMenuBar","Int",hWnd)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment