I'm using DevC++ to develop my program and I started my project as a Console Application. Then I changed in the project Options the type to Win32 GUI ,in order to hide the console (or FreeConsole() that does the same).
But when I use a cin in the program, nothing happens. I mean, I know as the console is hidden I can't work with cin (which needs the console to work), so: wich method should I use to get a keyboard input?
you could use the GetAsyncKeyState() function... to make the console scan the keys the user is pressing. Example: the user presses "comp"-> you program opens My Computer for him.
second example... the user presses "show"-> you show the console.. or "hide" to hide it. That ca be done :) I'm not sure though that that's what you need
I think that people use GetAsyncKeyState() far more than is right. It is not a well-behaved function, especially as there are almost always better ways to get input.
Do as Disch suggested, and catch the WM_KEYDOWN or WM_CHAR events in your window proc.