windows 11 project setting change with one-click Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
greatromulus
Posts: 3
Joined: 25 Aug 2023, 18:20

windows 11 project setting change with one-click

Post by greatromulus » 25 Aug 2023, 18:28

In windows 11 I press windows+p key to open project settings then i choose "Extend" or i choose "Second screen only". This is too much work for me everytime. İs there any way i can assign a key to change between two profiles with one-click?

this script did not worked ;

Code: Select all

^!d:: ; This sets the shortcut to Ctrl+Alt+D
    Send, #+P ; Simulate pressing Win+Shift+P
    Sleep, 1000 
    Send, {Down}{Enter} ; Simulate selecting the next display mode and applying it
return

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

greatromulus
Posts: 3
Joined: 25 Aug 2023, 18:20

Re: windows 11 project setting change with one-click

Post by greatromulus » 25 Aug 2023, 20:18

this script worked:

Code: Select all

 
^!l:: ; switch "Extend" to "Second screen only" shortcut combination
    Send, #+P 
    Send, P 
    Sleep, 1000
    Send, P 
    Sleep, 1000
    Send, P 
    Sleep, 1000
    Send, P 
    Sleep, 1000
    Send, {Enter} 
    Sleep, 1000 
    Send, {Esc} 

^!m:: ; switch  "Second screen only" to "Extend" shortcut combination
    Send, #P 
    Sleep, 1000 ;
    Send, P 
    Sleep, 1000
    Send, {Enter} 
    Sleep, 1000 
    Send, {Esc} 

return
 

User avatar
DevWithCoffee
Posts: 54
Joined: 13 Oct 2020, 12:16

Re: windows 11 project setting change with one-click  Topic is solved

Post by DevWithCoffee » 26 Aug 2023, 00:05

I would recommend this, it worked for me normally:
viewtopic.php?p=101332#p101332

greatromulus
Posts: 3
Joined: 25 Aug 2023, 18:20

Re: windows 11 project setting change with one-click

Post by greatromulus » 26 Aug 2023, 06:23

DevWithCoffee wrote:
26 Aug 2023, 00:05
I would recommend this, it worked for me normally:
viewtopic.php?p=101332#p101332
Yeah your solution a way way better and elegant than mine. I changed my script thanks a lot

Code: Select all

 
^!2:: ; switch  "Second screen only" to "Extend" shortcut combination (Two-screen)
run, C:\Windows\System32\DisplaySwitch.exe /extend
return
 

Code: Select all

 
^!1:: ; switch "Extend" to "Second screen only" shortcut combination (One-screen)
run, C:\Windows\System32\DisplaySwitch.exe /external
return
 

Post Reply

Return to “Ask for Help (v1)”