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

문제

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)

도움이 되었습니까?

해결책

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.

다른 팁

libqxt offers a QxtGlobalShortcut class that does what you want.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top