Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCleaning unwanted items from registry through coding Pin
Le@rner20-May-08 18:46
Le@rner20-May-08 18:46 
AnswerRe: Cleaning unwanted items from registry through coding Pin
David Crow21-May-08 4:11
David Crow21-May-08 4:11 
AnswerRe: Cleaning unwanted items from registry through coding Pin
Nelek21-May-08 7:06
protectorNelek21-May-08 7:06 
QuestionDoes "#pragma once" have any difference in VC6.0 and VC9.0? Pin
followait20-May-08 18:28
followait20-May-08 18:28 
AnswerRe: Does "#pragma once" have any difference in VC6.0 and VC9.0? Pin
Rajkumar R20-May-08 19:14
Rajkumar R20-May-08 19:14 
AnswerRe: Does "#pragma once" have any difference in VC6.0 and VC9.0? Pin
toxcct20-May-08 21:25
toxcct20-May-08 21:25 
QuestionHow to capture "[" and "]" keys on OnKeyDown()? Pin
TooShy2Talk20-May-08 17:36
TooShy2Talk20-May-08 17:36 
AnswerRe: How to capture "[" and "]" keys on OnKeyDown()? Pin
Rajkumar R20-May-08 18:22
Rajkumar R20-May-08 18:22 
TooShy2Talk wrote:
For capturing letters, I use example pressing s.
if(nChar=="s")


you mean if (nChar == 'S') but you should always use Virtual Key codes, because nChar is the virtual key code, capital letter is identified by the Shift/caps key status. you may refer the list of key codes [Virtual-Key Codes ^] to use in your code.


TooShy2Talk wrote:
but for other keys like "[", "]" and numerics

for numbers you may use '0'(30) - '9'(39) or VK_NUMPAD(0 - 9) because number can be entered in two different keys num pad and other above characters.

"[" can still be identified by VK_OEM_4 by Virtual-Key Codes but depends on keyboard layout. so it is better to use [VkKeyScan(Ex)^] to convert character to virtual key code and compare,

SHORT iSqrBracketOpen  = VkKeyScan(_T('[')); // before hand once
void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
  if (nChar == iSqrBracketOpen)
 {
	MessageBox(_T("Open Square Bracket"));
 }
 ...
}

or use [ToAscii(Ex)^] or ToUnicode(Ex) to convert virtual key code to character and compare.
GeneralRe: How to capture "[" and "]" keys on OnKeyDown()? Pin
TooShy2Talk21-May-08 21:55
TooShy2Talk21-May-08 21:55 
QuestionMedia Decoder Application Pin
Akin Ocal20-May-08 15:33
Akin Ocal20-May-08 15:33 
AnswerRe: Media Decoder Application Pin
Rajkumar R20-May-08 17:40
Rajkumar R20-May-08 17:40 
QuestionBest way to setup this code - two client views Pin
Kwanalouie20-May-08 14:21
Kwanalouie20-May-08 14:21 
AnswerRe: Best way to setup this code - two client views Pin
Rajkumar R20-May-08 19:07
Rajkumar R20-May-08 19:07 
QuestionException caught but not handled completely Pin
Royce Fickling20-May-08 10:27
Royce Fickling20-May-08 10:27 
AnswerRe: Exception caught but not handled completely Pin
led mike20-May-08 11:46
led mike20-May-08 11:46 
QuestionMFC components and minGW... Pin
greghint20-May-08 9:58
greghint20-May-08 9:58 
AnswerRe: MFC components and minGW... Pin
Rajkumar R20-May-08 20:08
Rajkumar R20-May-08 20:08 
GeneralRe: MFC components and minGW... Pin
greghint11-Jun-08 16:27
greghint11-Jun-08 16:27 
Questioninitial position of pop-up dialog box Pin
Kwanalouie20-May-08 7:45
Kwanalouie20-May-08 7:45 
AnswerRe: initial position of pop-up dialog box Pin
David Crow20-May-08 7:48
David Crow20-May-08 7:48 
AnswerRe: initial position of pop-up dialog box Pin
Nelek21-May-08 6:56
protectorNelek21-May-08 6:56 
QuestionLoss of data using CList::AddTail() Pin
piul20-May-08 5:55
piul20-May-08 5:55 
QuestionRe: Loss of data using CList::AddTail() Pin
Ernest Laurentin20-May-08 7:51
Ernest Laurentin20-May-08 7:51 
QuestionRe: Loss of data using CList::AddTail() Pin
David Crow20-May-08 7:55
David Crow20-May-08 7:55 
QuestionHow can i copy raw image buffer to a dc? Pin
Soumyadipta20-May-08 5:09
Soumyadipta20-May-08 5:09 

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.