as i know GUI(graphic user interface) be used in CLR or .Net application not in win32 Unless im in wrong !! easy way use MessageBox if you use in Win32 but if you use in .Net you have several way to print some text of course Messagebox works that .
every body please help me can we use GUI in Win32 app ?!! of course without game engine or simulation of GUI such as ClanLib !
What I eventually want to make is a program which shows a countdown timer when you press a number. When you press 1 it starts counting down from 10, when you press 2, it counts down from 20, etc..
So what I need to know to make this is:
- how to make a keypress handler (already did this)
- how to print text in my program window
- how to make a timer function
Right now i'm stuck at "how to print text in my program window". My program checks if the '5' or '6' key is pressed and displays a messagebox saying which one of those was pressed. Now I want these messages to show in the main window and not in a message box.
If you've for a WM_KEYDOWN handler, it should call SetTimer specifying the required interval (1000 millisecs, maybe?)
Add a WM_TIMER message handler which:
- updates your count variable.
- calls KillTimer when it get to the end of the sequence
- calls InvalidateRect (every time)
Add a WM_PAINT message handler
- this will be called in response to the InvalidateRect call, when Windows want you to repaint your window.
- use TextOut to display your count as a string