Need help with AutoHotKey

Discussion in 'other software & services' started by Rasheed187, Nov 13, 2015.

  1. Rasheed187

    Rasheed187 Registered Member

    Joined:
    Jul 10, 2004
    Posts:
    17,546
    Location:
    The Netherlands
  2. SpousalMilk

    SpousalMilk Registered Member

    Joined:
    Jun 24, 2012
    Posts:
    48
    Location:
    USA
    I never use Ctrl+Z accidentally in Explorer but I can see the value in having such a script. I tried the script posted at the link and it doesn't work when the Desktop area is clicked/active so I googled around and tinkered and here's mine working in Windows 10 and the latest ahk program. I like to be prompted when I screw up so i kept the MsgBox in.

    Code:
    #IfWinActive ahk_class ExploreWClass
    ^z::
    MsgBox Ctrl+Z has been disabled.
    return
    
    #IfWinActive ahk_class CabinetWClass
    ^z::
    MsgBox Ctrl+Z has been disabled.
    return
    
    #IfWinActive ahk_class Progman
    ^z::
    MsgBox Ctrl+Z has been disabled.
    return
    
    #IfWinActive ahk_class WorkerW
    ^z::
    MsgBox Ctrl+Z has been disabled.
    return
    
    #IfWinActive
     
  3. Rasheed187

    Rasheed187 Registered Member

    Joined:
    Jul 10, 2004
    Posts:
    17,546
    Location:
    The Netherlands
    Thanks for checking, but I don't get it, is this script meant to disable the Ctrl+Z keyboard combo, or should it also block it from the context menu?
     
  4. SpousalMilk

    SpousalMilk Registered Member

    Joined:
    Jun 24, 2012
    Posts:
    48
    Location:
    USA
    From my brief testing it will disable Ctrl+Z only if Windows Explorer is the active window or if the Desktop wallpaper is clicked.

    I'm not sure what you mean by block it from context menu. If a program has an undo button in the File menu and you clicked that this script would not block it if that's what you mean.

    I tested with MS Word, Notepad++, a renamed folder on Desktop and a renamed folder in another drive partition. Ctrl+Z was correctly blocked :)
     
  5. Rasheed187

    Rasheed187 Registered Member

    Joined:
    Jul 10, 2004
    Posts:
    17,546
    Location:
    The Netherlands
    When you right click on the desktop, you will get to see the context menu. My aim was to block the "Undo Delete (or copy)" option. Is this possible with this script?
     
  6. SpousalMilk

    SpousalMilk Registered Member

    Joined:
    Jun 24, 2012
    Posts:
    48
    Location:
    USA
    If you're clicking with the mouse on a menu, then no... the script only works for key presses.
     
  7. Rasheed187

    Rasheed187 Registered Member

    Joined:
    Jul 10, 2004
    Posts:
    17,546
    Location:
    The Netherlands
    OK, so if you click on the Undo entry in the context menu, files will still be moved back? Strange that M$ didn't give an option to turn this off, or to delete file operation history.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.