Click here to Skip to main content
13,290,729 members (75,940 online)
Click here to Skip to main content
Add your own
alternative version


28 bookmarked
Posted 12 Jun 2002

InputBox using WinAPI

, 12 Jun 2002
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

QuestionErrors... Pin
Member 123800679-Mar-16 2:37
memberMember 123800679-Mar-16 2:37 
GeneralMy vote of 5 Pin
kod122-Mar-12 0:36
memberkod122-Mar-12 0:36 
GeneralMy vote of 5 Pin
Sunny12708-Jan-12 3:57
memberSunny12708-Jan-12 3:57 
GeneralThou Shalt Not ... Pin
DogWalker13-Sep-03 21:11
memberDogWalker13-Sep-03 21:11 
GeneralAnother bug: GetClassInfoEx() Pin
Michael Geary4-Sep-03 20:28
memberMichael Geary4-Sep-03 20:28 
GeneralGreat! But... Pin
Simon Hofverberg19-Dec-02 0:37
memberSimon Hofverberg19-Dec-02 0:37 
GeneralRe: Great! But... Pin
mah19-Dec-02 0:49
membermah19-Dec-02 0:49 
GeneralGreat Pin
Mel14-Jun-02 3:05
memberMel14-Jun-02 3:05 
GeneralHehe Pin
Nish - Native CPian13-Jun-02 1:12
memberNish - Native CPian13-Jun-02 1:12 
GeneralRe: Hehe Pin
mah13-Jun-02 1:38
membermah13-Jun-02 1:38 
GeneralRe: Hehe Pin
Nish - Native CPian13-Jun-02 2:08
memberNish - Native CPian13-Jun-02 2:08 
GeneralRe: Hehe Pin
mah13-Jun-02 2:26
membermah13-Jun-02 2:26 
GeneralRe: Hehe Pin
brad W13-Jun-02 7:51
memberbrad W13-Jun-02 7:51 
GeneralRe: Hehe Pin
Nish - Native CPian13-Jun-02 15:07
memberNish - Native CPian13-Jun-02 15:07 
GeneralRe: Hehe Pin
Andrew Peace11-Jul-02 13:55
editorAndrew Peace11-Jul-02 13:55 
GeneralRe: Hehe Pin
Nishant S11-Jul-02 15:45
subeditorNishant S11-Jul-02 15:45 
GeneralRe: Hehe Pin
Andrew Peace12-Jul-02 8:08
editorAndrew Peace12-Jul-02 8:08 
GeneralRe: Hehe Pin
Nishant S12-Jul-02 15:08
subeditorNishant S12-Jul-02 15:08 
GeneralRe: Hehe Pin
Tim Smith11-Jul-02 15:26
memberTim Smith11-Jul-02 15:26 
GeneralRe: Hehe Pin
Nishant S11-Jul-02 15:46
subeditorNishant S11-Jul-02 15:46 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 13 Jun 2002
Article Copyright 2002 by mah
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid