Click here to Skip to main content
11,710,423 members (90,817 online)
Click here to Skip to main content

InputBox using WinAPI

, 12 Jun 2002 111.3K 2K 28
Rate this:
Please Sign up or sign in to vote.
InputBox using WinAPI.

Sample Image - InputBox.jpg


Do you know VB's InputBox? Me too. =)

So, this class is for those people who need VB-like InputBox in VC++.


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.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Russian Federation Russian Federation
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
kod121-Mar-12 23:36
memberkod121-Mar-12 23:36 
GeneralMy vote of 5 Pin
Sunny12708-Jan-12 2:57
memberSunny12708-Jan-12 2:57 
GeneralThou Shalt Not ... Pin
DogWalker13-Sep-03 20:11
memberDogWalker13-Sep-03 20:11 
GeneralAnother bug: GetClassInfoEx() Pin
Michael Geary4-Sep-03 19:28
memberMichael Geary4-Sep-03 19:28 
GeneralGreat! But... Pin
Simon Hofverberg18-Dec-02 23:37
memberSimon Hofverberg18-Dec-02 23:37 
GeneralRe: Great! But... Pin
mah18-Dec-02 23:49
membermah18-Dec-02 23:49 
GeneralGreat Pin
Mel14-Jun-02 2:05
memberMel14-Jun-02 2:05 
GeneralHehe Pin
Nish - Native CPian13-Jun-02 0:12
memberNish - Native CPian13-Jun-02 0:12 
GeneralRe: Hehe Pin
mah13-Jun-02 0:38
membermah13-Jun-02 0:38 
GeneralRe: Hehe Pin
Nish - Native CPian13-Jun-02 1:08
memberNish - Native CPian13-Jun-02 1:08 
GeneralRe: Hehe Pin
mah13-Jun-02 1:26
membermah13-Jun-02 1:26 
GeneralRe: Hehe Pin
brad W13-Jun-02 6:51
memberbrad W13-Jun-02 6:51 
GeneralRe: Hehe Pin
Nish - Native CPian13-Jun-02 14:07
memberNish - Native CPian13-Jun-02 14:07 
GeneralRe: Hehe Pin
Andrew Peace11-Jul-02 12:55
editorAndrew Peace11-Jul-02 12:55 
GeneralRe: Hehe Pin
Nishant S11-Jul-02 14:45
subeditorNishant S11-Jul-02 14:45 
GeneralRe: Hehe Pin
Andrew Peace12-Jul-02 7:08
editorAndrew Peace12-Jul-02 7:08 
GeneralRe: Hehe Pin
Nishant S12-Jul-02 14:08
subeditorNishant S12-Jul-02 14:08 
GeneralRe: Hehe Pin
Tim Smith11-Jul-02 14:26
memberTim Smith11-Jul-02 14:26 
GeneralRe: Hehe Pin
Nishant S11-Jul-02 14:46
subeditorNishant S11-Jul-02 14:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150819.1 | Last Updated 13 Jun 2002
Article Copyright 2002 by mah
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid