Click here to Skip to main content
Click here to Skip to main content
Go to top

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

Comments and Discussions

GeneralMy vote of 5 Pinmemberkod121-Mar-12 23:36 
GeneralMy vote of 5 PinmemberSunny12708-Jan-12 2:57 
GeneralThou Shalt Not ... PinmemberDogWalker13-Sep-03 20:11 
GeneralAnother bug: GetClassInfoEx() PinmemberMichael Geary4-Sep-03 19:28 
GeneralGreat! But... PinmemberSimon Hofverberg18-Dec-02 23:37 
GeneralRe: Great! But... Pinmembermah18-Dec-02 23:49 
GeneralGreat PinmemberMel14-Jun-02 2:05 
GeneralHehe PinmemberNish - Native CPian13-Jun-02 0:12 
GeneralRe: Hehe Pinmembermah13-Jun-02 0:38 
GeneralRe: Hehe PinmemberNish - Native CPian13-Jun-02 1:08 
GeneralRe: Hehe Pinmembermah13-Jun-02 1:26 
GeneralRe: Hehe Pinmemberbrad W13-Jun-02 6:51 
GeneralRe: Hehe PinmemberNish - Native CPian13-Jun-02 14:07 
GeneralRe: Hehe PineditorAndrew Peace11-Jul-02 12:55 
GeneralRe: Hehe PinsubeditorNishant S11-Jul-02 14:45 
GeneralRe: Hehe PineditorAndrew Peace12-Jul-02 7:08 
GeneralRe: Hehe PinsubeditorNishant S12-Jul-02 14:08 
GeneralRe: Hehe PinmemberTim Smith11-Jul-02 14:26 
GeneralRe: Hehe PinsubeditorNishant 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 | Mobile
Web03 | 2.8.140922.1 | Last Updated 13 Jun 2002
Article Copyright 2002 by mah
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid