المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Checking if a hotkey is avilable && making a window Always on Top in an application.



C++ Programming
05-01-2009, 06:03 PM
Hey folks!

Got 2 minor questions i thought i ask here maybe you know an answer to.

First: do you know about any way to check if a given hotkey is available on the system or not? I'm talking about hotkeys you can register using RegisterHotKey (http://msdn.microsoft.com/en-us/library/ms646309.aspx)[^ (http://msdn.microsoft.com/en-us/library/ms646309.aspx)]. I know this method will fail if the key specified is already registered by someone but if it is not it WILL register the key, but i would like a way to check if i could register it WITHOUT actually doing it (that would happen later on). I know one way would be to try and register it and if it succeeds unregister it again right away but this solution doesn't sound so nice.
Second: I'd like to have a window staying above all other windows that belong to the same process, so it is kind of an always-on-top window but not a system-wide always-on-top window, i do not want this window to stay above all the other windows on the system that belong to different processes.

Thanks in advance for any suggestions.

<div class="ForumSig"><b>> The problem with computers is that they do what you tell them to do and not what you want them to do. Life: great graphics, but the gameplay sux.