hi, i choose dev c so i can make programs for different platforms without changing -too much- the code form one to another. i am used to windows programming (with ides, where i select the form or component then choose the event or whatever). when i created my first windows application, there was some code to generate the window, but the body looked like this:
while (GetMessage (&messages, NULL, 0, 0))
{
/ Translate virtual-key messages into character messages /
TranslateMessage(&messages);
/ Send message to WindowProcedure /
DispatchMessage(&messages);
}
is there any turorial to deal whith this?
for example, if i want to handle mouse events, my guess is that in translate message there is a parameter list which tells which kind of message is this and the message parameters (button, xy coordinates keyboard or mouse etc.) is there any explanation somewhere on what kind of messages are received? how do you generate the 'repaint' event?
if i can find a 'blackboard' example (just a window where you can trace with the mouse when left button is pressed, without any other details that would distract) i may have a glimpse on how to handle and dispatch events.
Also, there is only one file created when i generated the app (i still have not placed any code, since i dont how to put it yet), and i see there is a translatemessages and dispatchmessages function, but the prototype is not in this file so they must be declared somewhere else, and my wild guess is that if i want to put content in my application, i have to put something inside those two functions, where are they?
more to the point, where can i get a step by step starter tutorial on windows applications with dev c?, and if possible, where can i get info on the differences or things i have to take into account when moving from windows to any linux/posix? (is the same to write for mac as to linux or i have to make more changes as well?)
tnx!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> is there any turorial to deal whith this?
There are easier and more modern ways of GUI programming, but if you must Charles Petzold's "Win32 Programming" is the seminal work on teh subject. Also http://www.winprog.org/tutorial/ is commonly referenced.
> Also, there is only one file created when i generated the app
You can add your own. The basic Windows template is what it is.
> but the prototype is not in this file so they must be declared somewhere else
Not necessarily. If they are defined before use, there is no need for a prototype.
> where can i get info on the differences or things i have to take
> into account when moving from windows to any linux/posix?
The easiest way is not to use the Win32 API in the first instance. Also it is the hardest method of Windows programming. Use something portable like wxWidgets. To that end you would be better off using wxDev-C++ which is Dev-C++ + wxWidgets + integrated visual design tools. http://wxdsgn.sourceforge.net/
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi, i choose dev c so i can make programs for different platforms without changing -too much- the code form one to another. i am used to windows programming (with ides, where i select the form or component then choose the event or whatever). when i created my first windows application, there was some code to generate the window, but the body looked like this:
while (GetMessage (&messages, NULL, 0, 0))
{
/ Translate virtual-key messages into character messages /
TranslateMessage(&messages);
/ Send message to WindowProcedure /
DispatchMessage(&messages);
}
is there any turorial to deal whith this?
for example, if i want to handle mouse events, my guess is that in translate message there is a parameter list which tells which kind of message is this and the message parameters (button, xy coordinates keyboard or mouse etc.) is there any explanation somewhere on what kind of messages are received? how do you generate the 'repaint' event?
if i can find a 'blackboard' example (just a window where you can trace with the mouse when left button is pressed, without any other details that would distract) i may have a glimpse on how to handle and dispatch events.
Also, there is only one file created when i generated the app (i still have not placed any code, since i dont how to put it yet), and i see there is a translatemessages and dispatchmessages function, but the prototype is not in this file so they must be declared somewhere else, and my wild guess is that if i want to put content in my application, i have to put something inside those two functions, where are they?
more to the point, where can i get a step by step starter tutorial on windows applications with dev c?, and if possible, where can i get info on the differences or things i have to take into account when moving from windows to any linux/posix? (is the same to write for mac as to linux or i have to make more changes as well?)
tnx!
> is there any turorial to deal whith this?
There are easier and more modern ways of GUI programming, but if you must Charles Petzold's "Win32 Programming" is the seminal work on teh subject. Also http://www.winprog.org/tutorial/ is commonly referenced.
> Also, there is only one file created when i generated the app
You can add your own. The basic Windows template is what it is.
> but the prototype is not in this file so they must be declared somewhere else
Not necessarily. If they are defined before use, there is no need for a prototype.
> where can i get info on the differences or things i have to take
> into account when moving from windows to any linux/posix?
The easiest way is not to use the Win32 API in the first instance. Also it is the hardest method of Windows programming. Use something portable like wxWidgets. To that end you would be better off using wxDev-C++ which is Dev-C++ + wxWidgets + integrated visual design tools. http://wxdsgn.sourceforge.net/
Clifford
hi, tnx! i will check them both (the starter tutorial on win32 api and the package with widgets)
Also check out http://www.wxwidgets.org/ so you know what wxWidgets is and how it might be used to create platform portable code.