How can Win+P be disabled in Windows 7?

5

I have already disabled the Win-key hotkeys with NoWinKeys as well as the Win+Arrow keys in the DWM. However Win+P, the hotkey for the projector settings (which I don’t use anyway because I have a desktop with only one monitor, not a laptop) seems to be immune to that setting. Every other Win-key hotkey is disabled (including, to my chagrin, Win+Tab), but Win+P remains resolute to ruin my day by preventing me from mapping it to a command prompt. (To be accurate, Win+U is also adamantly reserved for the accessibility options, regardless of whether or not you enable or use them.)

Since I have used NoWinKeys, I suspected that it must not be getting hooked by Explorer, but rather some other component (a driver?) like the Mobility Center (which also hooks Win+X), however again, I am not using a laptop. (I do recall at one point in the past using some hack to enable the Mobility Center on a desktop, but I think that was in a previous installation because that key doesn’t exist now.)

Does anyone know how to disable Win+P or how to figure out where it is being hooked in order to stop it?

(Yes, there are two questions on SU that mention Win+P, but neither has a solution to this.)

Synetech

Posted 2011-03-20T01:33:45.440

Reputation: 63 242

1Out of curiosity... why do you want to do this? Not saying it's an unreasonable question, just wondering. – nhinkle – 2011-07-26T03:29:56.720

1(1) I hate seeing that stupid (and useless, unused) projector popup whenever I press Win+P. (2) Like I said in the question, I use Win+P as a hotkey for the command-prompt. I am sick and tired of having to hold Ctrl+Shift+P to open a prompt because it requires an extra key, and requires more hand-contortion, especially since I use the command-prompt a lot. (3) I don’t like Microsoft deciding what I need. I also don’t use the accessibility control panel (except for MouseKeys which already has its own hotkey), so I don’t like Win+U being forcibly taken. – Synetech – 2011-07-26T06:22:35.720

1Adding to (1), unlike the Task Switch dialog, the stupid Projector dialog doesn’t go away when you let go of the hotkey, it stays on screen until you specifically dismiss it by reaching up to hit Escape, which is even more annoying. – Synetech – 2011-09-08T01:07:36.320

1Just to say I completely agree with you, we should be able to do with the hot keys just what the heck we want to. I just wish we could do it with/ any additional programs. Upvoting everyone! – Brave Newbie – 2011-12-04T23:47:24.033

Answers

3

You can disable Win-P with a simple AutoHotkey script, that consists of four characters:

#p::
  1. stands for windows key

  2. p is for - well - p
  3. The :: is for "hotkey"

If you want to run the command prompt with Win-P the code will look like this:

#InstallKeybdHook ; to make extra sure the keys are caught by AutoHotkey 
#p::run cmd.exe

I've tested both and they work for me under Windows 7 Ultimate. If you don't want to install AutoHotkey, download the zip, create the script in an editor and save it with the .ahk ending. If need be, it can be compiled into an .exe.

I have actually created a pretty nice post about disabling hotkeys with AutoHotkey.

Using AutoHotkey, you can customize and remap pretty much any key or hotkey on your keyboard.

But essentially I agree: any decent program should come with a built-in functionality to customize or disable hotkeys for certain functions.

user 99572 is fine

Posted 2011-03-20T01:33:45.440

Reputation: 3 173

I already did that a while back and it works for a while, but eventually stops working and Winx+P reverts to displaying the projection dialog. +1 because I’ve been using this method for several months, but would prefer a way to stop Windows from stealing the key for no reason (I have only one display on a desktop system). – Synetech – 2011-12-05T00:40:30.367

Funny, I have never had a script stop working. Really strange. A clear case of Gremlins. Sorry, cannot provide you with a sure-fire way to stop Windows from stealing. I have adapted the script with the keyboard hook for AutoHotkey. Does this help? – user 99572 is fine – 2011-12-05T22:20:00.013

I’m already using #p::Run %ComSpec% /k cd /d %desktop% and like I said it works fine most of the time but occasionally reverts. Either way, it does not help for other people who want to use the key combo for other purposes with other programs. :-( – Synetech – 2011-12-05T22:37:30.797

I’m accepting AutoHotKey as the provisional answer because it is what I have been using since I first noticed the issue. Like I said, it is not ideal, and hopefully AHK can fix the issue where hotkeys stop working in Vista+, but at least it works. (Actually, I created a fancy CMD.ahk script that does this and more. ☺) – Synetech – 2013-06-11T13:41:37.780

1

This is a rather old discussion but you can just rename the program the win+p calls "DisplaySwitch.exe" (found in the system folder) to something else. The fact would then remain the key is still there but attempts to summon a program that has a new name. To rename/move/delete the file you will need to also claim ownership which can be done in the properties. I am certain of how that would effect assignment of win+p to other tasks. This solution will not require any script or 3rd party software.

Simon

Posted 2011-03-20T01:33:45.440

Reputation: 11