Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Disable Minimize for Specific Application


  • Please log in to reply
9 replies to this topic
WheatyP
  • Members
  • 3 posts
  • Last active: Jul 03 2013 11:37 AM
  • Joined: 02 Jul 2013

Hi all, is it possible to disable the 'minimize' and 'restore down' buttons of an application such as Wordpad i.e. mouse clicks are disabled in a certain area of the screen?

 

Thanks



Linear Spoon
  • Members
  • 842 posts
  • Last active: Sep 29 2015 03:56 AM
  • Joined: 29 Oct 2011

Using this function on Windows 7, the minimize button still "appears" to be active, but doesn't do anything when clicked. Hopefully that's good enough.

;Test hotkey - disable minimize button of the active window
F1::DisableMinimize(WinExist("A"))

;Modified from SKANs DisableCloseButton function
DisableMinimize(hWnd)
{
      hSysMenu:=DllCall("GetSystemMenu","Int",hWnd,"Int",FALSE)
      nCnt:=DllCall("GetMenuItemCount","Int",hSysMenu)
      DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-4,"Uint","0x400")
      DllCall("DrawMenuBar","Int",hWnd)
}

Join us at the new forum - http://www.ahkscript.org/

 


vsub
  • Members
  • 1098 posts
  • Last active: Sep 28 2015 09:48 AM
  • Joined: 10 Nov 2011
WinSet,Style,-0x20000,A

Linear Spoon
  • Members
  • 842 posts
  • Last active: Sep 29 2015 03:56 AM
  • Joined: 29 Oct 2011

I like your solution more vsub, nice happy.png


Join us at the new forum - http://www.ahkscript.org/

 


WheatyP
  • Members
  • 3 posts
  • Last active: Jul 03 2013 11:37 AM
  • Joined: 02 Jul 2013

Thanks guys both solutions are great especially wrapping it up in just one line vsub!

How do I add the 'Restore down' so that too is in active? Also will this disable the 'Restore Down' function when you double click the top bar?



WheatyP
  • Members
  • 3 posts
  • Last active: Jul 03 2013 11:37 AM
  • Joined: 02 Jul 2013

Looks like WinSet, Style, -0xC00000, A should do the trick!!



Skrell
  • Members
  • 384 posts
  • Last active: Jul 07 2016 05:03 PM
  • Joined: 23 Aug 2011

 

Using this function on Windows 7, the minimize button still "appears" to be active, but doesn't do anything when clicked. Hopefully that's good enough.

;Test hotkey - disable minimize button of the active window
F1::DisableMinimize(WinExist("A"))

;Modified from SKANs DisableCloseButton function
DisableMinimize(hWnd)
{
      hSysMenu:=DllCall("GetSystemMenu","Int",hWnd,"Int",FALSE)
      nCnt:=DllCall("GetMenuItemCount","Int",hSysMenu)
      DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-4,"Uint","0x400")
      DllCall("DrawMenuBar","Int",hWnd)
}

how could this be modified for the close button?



GEV
  • Members
  • 1364 posts
  • Last active:
  • Joined: 23 Oct 2013
how could this be modified for the close button?

 

http://www.autohotke...e-close-button/



Skrell
  • Members
  • 384 posts
  • Last active: Jul 07 2016 05:03 PM
  • Joined: 23 Aug 2011

This is not what i wanted; i wanted the close button to appear "active" and not greyed out.  :-/



vsub
  • Members
  • 1098 posts
  • Last active: Sep 28 2015 09:48 AM
  • Joined: 10 Nov 2011
Try this