Is it possible to implement console codes to win32 api code?

i hav written a program which works fine running in console mode. my question is, do i need to rewrite it so i can hav a nice interface with win32 api?
If you want to have a GUI interface, you'll have to rewrite all the I/O code.

That doesn't necessarily mean you have to rewrite the whole program. It depends how you organized your code.
You may include some function that creates ur window/interface and another one which updates the data shown...

Now, everywhere where u would call something like cout , cin, printf, scanf, etc you should rethink how you could pass that data to the output function(or backwards)...


and ofc you should replace main with WinMain^^...
Last edited on
so after i've changed all the I/O codes, where to i put the codes to hav the function running like it did in console? under WM_CREATE? or in WinMain?

ps my program is taking external data input to move the mouse cursor
You should call the function when you get a message related to the input - Eg: when the user presses 'OK' you read the textboxes and do all the stuff -
is it possible to create a child window that runs the console program? also when information is inputed in the main window, can it be sent to the child window (the console program).
What exactly is it that your console program does???
is it possible to create a child window that runs the console program?
if you leave int main instead of having WinMain, you will get the cmd window and cout will work as usual
this is my final year project and i have to write a program which receives input from another pc via tcp. The name of the project is using a gaze tracker to web browse without any other input.

at the moment i have created a console program that reads the input and does automated clicks every 2 seconds if the cursor is in the same position using a do while loop.

the problem now is since a mouse can do left and right clicks, i need to simulate them. therefore i need to have a interface that has buttons to select which type of mouse click, which for the mean while i m using GetAstnKeyState key 1, 2, 3,etc. How can modify the [GetAsynKeyState[/code] so the console receives button input like the keyboard buffer so my console program can carry on doing its job without needing to pause to wait for input?

one last question, if i use a child window for my console program, when it reaches the do while loop will it make the main window stop since it jumped its processing to another window?
Last edited on
Topic archived. No new replies allowed.