Community
    • Login

    HOW BOSS Key feature?

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 3 Posters 261 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 阿杨Ayang阿
      阿杨Ayang
      last edited by

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

      thx.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @阿杨Ayang
        last edited by

        @阿杨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.

        1 Reply Last reply Reply Quote 3
        • EkopalypseE
          Ekopalypse
          last edited by

          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.

          1 Reply Last reply Reply Quote 2
          • 阿杨Ayang阿
            阿杨Ayang
            last edited by

            thx all

            @PeterJones windowskey+Number , Very Nice ~~~

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors