This is for windows programming, so dont read any more if you dont want to mess with WinAPI.
I haven't personally used an input box , but I know how to make modal Dialog Boxes and MesageBoxes.
The easiest is the MessageBox. you'll need to #include <windows.h>, and tha call is something like:
retval = MessageBox(hwnd, "message text", "message box title", style);
hwnd is a handler to a window, it may be the constant NULL, it will be "on hand" if you #include <windows.h>.
the style is an integer, but it's used with constant like:
MB_YESNO, MB_YESNOCANCEL, MB_ABORTRETRYIGNORE or MB_OKCANCEL.
the function returns an integer indicating wich button was pressed. so you can compare it aganist a constan to determine what to do. I dont remeber the name of the constants rigth now, bou sure you can esilly determine the values for a first try...
The limitation is tha you can only a set of tree values can be retrieved... jeje.but its simple an it can be used even with console aplications... if they are running within windows...( At least in Win98 and WinXP ).
The alternative of the dialog boxes is more complicated, and you neet to know how to program at least a samall window and understand the basics of the event handling. In this aproach youll need to tell Dev that you are doing a Windows project, and create the Dialog box in a resource file, and in the main code, call a function that manages the events in the dialog box, wich may be designed to look like an InputBox.
this is to long to explain, so if its not what you need, I can't go any further...
There is the thisr option, wich I think is the rigth one.
I've used the Dialog that opens a file, or chooses the name/location to save... there is other dialogs like that, they are called Common dialogs, and there is a way to call them similar to the MessageBox call. I know only how to use the OpenSaveDialog, I sopose that th common input box must be also some kind of CommonDialog, but, I've searched for it, with negative results.
So, I can only hepl with "custom" modal dialog boxes so, if you think they may help you, feel free to e-mail me, and I'll tell the rest of the story!
Sdimitrov <sdi...@el...> wrote:
How to add edit box in my C++ Program?
And how to get values from edit box ?
I'm use Dev-C++ 1.9.1.
Thanks
________________________________________________
Message sent using
UebiMiau 2.7.2
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
---------------------------------
|