Click here to Skip to main content
16,004,353 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDialogs Pin
Tzoockee27-Mar-02 10:06
Tzoockee27-Mar-02 10:06 
GeneralRe: Dialogs Pin
Christian Graus27-Mar-02 10:12
protectorChristian Graus27-Mar-02 10:12 
GeneralRe: Dialogs Pin
lucy27-Mar-02 10:08
lucy27-Mar-02 10:08 
GeneralRe: Dialogs Pin
Tomasz Sowinski27-Mar-02 10:31
Tomasz Sowinski27-Mar-02 10:31 
GeneralRe: Dialogs Pin
Christian Graus27-Mar-02 10:12
protectorChristian Graus27-Mar-02 10:12 
GeneralRe: Dialogs Pin
Nish Nishant27-Mar-02 13:45
sitebuilderNish Nishant27-Mar-02 13:45 
QuestionWin API equivalent of cin? Pin
thx27-Mar-02 10:02
thx27-Mar-02 10:02 
AnswerRe: Win API equivalent of cin? Pin
Christian Graus27-Mar-02 10:11
protectorChristian Graus27-Mar-02 10:11 
Nope. Well, kind of nope. Windows programming is not linear, it is event based. So there are three events you can focus on, they are OnKeyDown, OnChar and OnKeyUp. OnChar is the best place to check keyboard input, but you need to be aware of a few things.

1. nothing will happen with the key unless you make it. If you want to put the text into a view, you need to build a string from it and draw it

2. If you have controls or windows that can take the input focus, they will recieve this message instead of your main window.

What you may want to do is have a text input area, which can be easily done with a dialog or form view. An edit or rich edit box will take care of the details of recieving and displaying keyboard input ( such as dealing with backspaces, etc ), and all you need to do is use GetWindowText to recieve the result. You also get messages from these controls when people type stuff, etc.



Christian

The tragedy of cyberspace - that so much can travel so far, and yet mean so little.

"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
AnswerRe: Win API equivalent of cin? Pin
Chris Losinger27-Mar-02 10:19
professionalChris Losinger27-Mar-02 10:19 
GeneralRe: Win API equivalent of cin? Pin
29-Mar-02 5:59
suss29-Mar-02 5:59 
AnswerRe: Win API equivalent of cin? Pin
Tomasz Sowinski27-Mar-02 10:15
Tomasz Sowinski27-Mar-02 10:15 
AnswerRe: Win API equivalent of cin? Pin
Ravi Bhavnani27-Mar-02 10:29
professionalRavi Bhavnani27-Mar-02 10:29 
GeneralRe: Win API equivalent of cin? Pin
Christian Graus27-Mar-02 10:26
protectorChristian Graus27-Mar-02 10:26 
GeneralRe: Win API equivalent of cin? Pin
Tomasz Sowinski27-Mar-02 10:28
Tomasz Sowinski27-Mar-02 10:28 
GeneralRe: Win API equivalent of cin? Pin
Ravi Bhavnani27-Mar-02 10:36
professionalRavi Bhavnani27-Mar-02 10:36 
GeneralRe: Win API equivalent of cin? Pin
Tomasz Sowinski27-Mar-02 10:32
Tomasz Sowinski27-Mar-02 10:32 
AnswerRe: Win API equivalent of cin? Pin
28-Mar-02 6:27
suss28-Mar-02 6:27 
GeneralUninstall DLL Pin
27-Mar-02 9:45
suss27-Mar-02 9:45 
GeneralRe: Uninstall DLL Pin
soptest27-Mar-02 9:47
soptest27-Mar-02 9:47 
GeneralRe: Uninstall DLL Pin
27-Mar-02 9:54
suss27-Mar-02 9:54 
Generalsequential member variable name Pin
lucy27-Mar-02 9:27
lucy27-Mar-02 9:27 
GeneralRe: sequential member variable name Pin
Tim Smith27-Mar-02 9:45
Tim Smith27-Mar-02 9:45 
GeneralRe: sequential member variable name Pin
lucy27-Mar-02 10:05
lucy27-Mar-02 10:05 
GeneralRe: sequential member variable name Pin
Tomasz Sowinski27-Mar-02 10:34
Tomasz Sowinski27-Mar-02 10:34 
GeneralRe: sequential member variable name Pin
lucy27-Mar-02 11:29
lucy27-Mar-02 11:29 

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.