how do I create a program in windows that can be activated by pressing short cut key instead of clicking?

StackOverflow https://stackoverflow.com/questions/19316159

Frage

I need to create a GUI working on windows that can be activated by pressing short cuts. 1. is it possible without setup class? 2. if not possible, just achieve pressing hotkeys and activate my program--how should i code it out--would be enough

thanks (I am using Qt for vs2012 add in to do the GUI)

War es hilfreich?

Lösung

I put some code up that starts a thread that does this. It is windows specific, but it does the job.

Clipboard Shortcut/Hotkey binding with Qt outside of application

One alternative to all of this, is to go to a shortcut to your program, go to its Properties, and then click on the shortcut area and type your desired shortcut. As long as it doesn't overlap with existing hotkeys that are registered in windows, it should work, without a hidden presence of your app in the system tray or some other background thread.

Hope that helps.

Andere Tipps

libqxt offers a QxtGlobalShortcut class that does what you want.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top