Click here to Skip to main content
Licence 
First Posted 12 Jun 2002
Views 99,744
Bookmarked 24 times

InputBox using WinAPI

By | 12 Jun 2002 | Article
InputBox using WinAPI.

Sample Image - InputBox.jpg

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.

License

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

mah

Web Developer

Russian Federation Russian Federation

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 Pinmemberkod123:36 21 Mar '12  
GeneralMy vote of 5 PinmemberSunny12702:57 8 Jan '12  
GeneralThou Shalt Not ... PinmemberDogWalker20:11 13 Sep '03  
GeneralAnother bug: GetClassInfoEx() PinmemberMichael Geary19:28 4 Sep '03  
GeneralGreat! But... PinmemberSimon Hofverberg23:37 18 Dec '02  
GeneralRe: Great! But... Pinmembermah23:49 18 Dec '02  
GeneralGreat PinmemberMel2:05 14 Jun '02  
GeneralHehe PinmemberNish - Native CPian0:12 13 Jun '02  
GeneralRe: Hehe Pinmembermah0:38 13 Jun '02  
GeneralRe: Hehe PinmemberNish - Native CPian1:08 13 Jun '02  
GeneralRe: Hehe Pinmembermah1:26 13 Jun '02  
GeneralRe: Hehe Pinmemberbrad W6:51 13 Jun '02  
GeneralRe: Hehe PinmemberNish - Native CPian14:07 13 Jun '02  
GeneralRe: Hehe PineditorAndrew Peace12:55 11 Jul '02  
GeneralRe: Hehe PinsubeditorNishant S14:45 11 Jul '02  
GeneralRe: Hehe PineditorAndrew Peace7:08 12 Jul '02  
GeneralRe: Hehe PinsubeditorNishant S14:08 12 Jul '02  
GeneralRe: Hehe PinmemberTim Smith14:26 11 Jul '02  
GeneralRe: Hehe PinsubeditorNishant S14:46 11 Jul '02  

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.

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