HOW BOSS Key feature?



  • need Global shortcut for hide or show Notepad++ main window,that is boss key.

    thx.



  • @阿杨Ayang ,

    I’ve never had to hide the fact that I’m editing a text file from my boss. Just what are you editing that’s so secret? ;-) (Just kidding: I don’t want to know.)

    You cannot assign a shortcut command (keystroke) to the minimize button itself. But if you have a scripting language plugin or equivalent, it can be done by sending the Windows WM_SYSCOMMAND message with the wparam SC_MINIMIZE.

    NppExec: npp_sendmsg 0x0112 0xF020 0
    PerlScript: notepad->SendMessage(0x0112, 0xF020, 0);

    Hmm, I’d forgotten that PythonScript doesn’t have the SendMessage feature directly attached to the notepad and editor objects, and I’m not immediately finding which pre-installed module gives access to the Win32 SendMessage directly. @Ekopalypse or another Python expert will have to chime in to get my list of example lines complete.

    Anyway, if you’re willing to choose one of those routes, install the appropriate plugin or external module; if you need help binding a specific instance to a keystroke, let us know which flavor of scripting you chose, and we can walk you through the next steps.



  • Translated to python

    import ctypes
    SendMessage = ctypes.WinDLL('user32').SendMessageW
    FindWindow = ctypes.WinDLL('user32').FindWindowW
    npp_hwnd = FindWindow("Notepad++", None)
    SendMessage(npp_hwnd , 0x0112, 0xF020, 0)
    

    BUT why not using windows BOSS shortcuts??

    Assuming you have npp in the taskbar, let’s say in second position, then WindowsKey+2 will either start npp or, if already started, toggle the visibility/focus.



  • thx all

    @PeterJones windowskey+Number , Very Nice ~~~


Log in to reply