I am a very new C++ programmer, so I'll problably going to ask a lot of questions the next few weeks.
My first question is this one:
I want to create a console application which should be able to check for some keys even if it is minimized. For instance, the Windows Media Player reacts on pressing the Play/Pause Button if its minimized. How can I do this for my own program?
There are probably a half dozen or so possible ways to do this but to me the most straight forward way would be to use a named pipe. You would write the name of the pipe out to a file or something that your Macro's can reference.
The function "SendMessage()" might seem like it would be easier to use, but then you'd have to grab the window handle every time you did this.
It seems that I need some extra libraries for the code on that page on registerHotKey, at least it doesn't know the imported lib in my code. How can I include these Libraries?
On the page is a link to a code collection, but I can't find the corresponding code in the list of possible downloads...
OK; I changed the Code so that it shows no errors any more. But when I try it, it doesn't show any ouput. I experimented and found out, that nor messages are retrieved by getMessage, so It does nothing but waiting for incoming messages which never come. What can I do to fix this?
A weir thing is that I don't even see the output of the first cout. Only if I add a std::cin >> i at the position marked with a * I can see the output "Hotkey registered..."
But it also seems that the program does something, because I can't type Shift+B while its running, if I try, nothing happens.
Ideally this application is not a console one (console works just for testing purpose), but a GUI one (WinMain entry point). A GUI application tipically have a message loop which can be leaved by using PostQuitMessage function.