
Introduction
Do you know VB's InputBox
? Me too. =)
So, this class is for those people who need VB-like InputBox
in VC++.
Usage
The usage of this class is very easy:
Add InputBox.h and InputBox.cpp into your project, include InputBox.h to the file where you suppose to use Inputbox
and:
#include "InputBox.h"
...
CInputBox ibox(hWndParent);
if (ibox.DoModal("Caption", "Prompt"))
MessageBox(NULL, ibox.Text, "Title", MB_OK);
In the constructor, you have to provide a valid hwnd
of the parent window. Function DoModal(...)
returns TRUE
if button OK is pressed and FALSE
if button Cancel.
CInputBox
doesn't need resource file. You can use it with MFC or without one.
That's all.