Click here to Skip to main content
16,011,711 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem in running Window service Pin
ArunkumarSundaravelu11-Apr-07 23:43
ArunkumarSundaravelu11-Apr-07 23:43 
AnswerRe: Problem in running Window service Pin
bob1697212-Apr-07 5:40
bob1697212-Apr-07 5:40 
QuestionMemory Leak Pin
Rassul Yunussov11-Apr-07 23:30
Rassul Yunussov11-Apr-07 23:30 
QuestionRe: Memory Leak Pin
Mark Salsbery12-Apr-07 7:50
Mark Salsbery12-Apr-07 7:50 
AnswerRe: Memory Leak Pin
Rassul Yunussov12-Apr-07 22:43
Rassul Yunussov12-Apr-07 22:43 
GeneralRe: Memory Leak Pin
Mark Salsbery13-Apr-07 7:23
Mark Salsbery13-Apr-07 7:23 
GeneralRe: Memory Leak Pin
Rassul Yunussov15-Apr-07 18:33
Rassul Yunussov15-Apr-07 18:33 
QuestionKEYEVENTF_UNICODE macro Pin
Syamlal S Nair11-Apr-07 23:20
Syamlal S Nair11-Apr-07 23:20 
hi,

I am using the following code to send a string to the notepad, without direct keyboard input(using SendInput function):


//start of code
CString str(_T("D:\\sample.gho"));

INPUT key[2];
int nLeng = str.GetLength();

for(int index=0;index < nLeng;index++ )
{
::ZeroMemory(key, sizeof(key));
key[0].type = key[1].type = INPUT_KEYBOARD;
SHORT nKeyCode = VkKeyScan(str[index]);

if (VK_SHIFT & nKeyCode)
{
key[0].ki.wVk = VK_SHIFT;
key[0].ki.dwFlags = KEYEVENTF_KEYUP;
//shift key plus char
key[1].ki.wScan = str[index];
key[1].ki.dwFlags = KEYEVENTF_UNICODE ;

}
else if (VK_CAPITAL & nKeyCode)
{
key[0].ki.wVk = VK_CAPITAL;
key[0].ki.dwFlags = KEYEVENTF_KEYUP;
//capital key plus char
key[1].ki.wScan = str[index];
key[1].ki.dwFlags = KEYEVENTF_UNICODE ;

}
else
{
key[1].ki.wVk = nKeyCode;
key[1].ki.dwFlags = KEYEVENTF_UNICODE ;

}

key[0].ki.time = key[1].ki.time = 0;
key[0].ki.dwExtraInfo = key[1].ki.dwExtraInfo=0;
SendInput(2,key,sizeof(INPUT));
}
//end of code

But, unfortunately, I gets an error:

'KEYEVENTF_UNICODE' : undeclared identifier


Please help me.

Thanks in advance.


SYAMLAL

AnswerRe: KEYEVENTF_UNICODE macro Pin
Gospodin Baron12-Apr-07 3:19
Gospodin Baron12-Apr-07 3:19 
GeneralRe: KEYEVENTF_UNICODE macro Pin
Syamlal S Nair16-Apr-07 22:47
Syamlal S Nair16-Apr-07 22:47 
Questionprograming with port USB Pin
maheno11-Apr-07 23:12
maheno11-Apr-07 23:12 
AnswerRe: programing with port USB Pin
Rajesh R Subramanian12-Apr-07 1:51
professionalRajesh R Subramanian12-Apr-07 1:51 
Questionloading the whole text file into an array Pin
cyn811-Apr-07 22:44
cyn811-Apr-07 22:44 
AnswerRe: loading the whole text file into an array Pin
toxcct11-Apr-07 23:04
toxcct11-Apr-07 23:04 
GeneralRe: loading the whole text file into an array Pin
cyn811-Apr-07 23:15
cyn811-Apr-07 23:15 
GeneralRe: loading the whole text file into an array Pin
toxcct11-Apr-07 23:19
toxcct11-Apr-07 23:19 
GeneralRe: loading the whole text file into an array Pin
cyn811-Apr-07 23:35
cyn811-Apr-07 23:35 
AnswerRe: loading the whole text file into an array Pin
Cedric Moonen11-Apr-07 23:10
Cedric Moonen11-Apr-07 23:10 
GeneralRe: loading the whole text file into an array Pin
cyn811-Apr-07 23:19
cyn811-Apr-07 23:19 
AnswerRe: loading the whole text file into an array Pin
Paresh Chitte11-Apr-07 23:10
Paresh Chitte11-Apr-07 23:10 
AnswerRe: loading the whole text file into an array Pin
Gospodin Baron11-Apr-07 23:17
Gospodin Baron11-Apr-07 23:17 
GeneralRe: loading the whole text file into an array Pin
toxcct11-Apr-07 23:21
toxcct11-Apr-07 23:21 
GeneralRe: loading the whole text file into an array Pin
Mark Salsbery12-Apr-07 7:55
Mark Salsbery12-Apr-07 7:55 
GeneralRe: loading the whole text file into an array Pin
cyn811-Apr-07 23:29
cyn811-Apr-07 23:29 
GeneralRe: loading the whole text file into an array Pin
Gospodin Baron11-Apr-07 23:31
Gospodin Baron11-Apr-07 23:31 

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.