Click here to Skip to main content
15,921,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCListCtrl Poperty to remove last unused column part. Pin
rakeshbbaldha28-Feb-07 18:38
rakeshbbaldha28-Feb-07 18:38 
AnswerRe: CListCtrl Poperty to remove last unused column part. Pin
Blake Miller6-Mar-07 7:23
Blake Miller6-Mar-07 7:23 
QuestionDoubt in using SendInput function Pin
Syamlal S Nair28-Feb-07 17:59
Syamlal S Nair28-Feb-07 17:59 
AnswerRe: Doubt in using SendInput function Pin
ThatsAlok28-Feb-07 19:52
ThatsAlok28-Feb-07 19:52 
GeneralRe: Doubt in using SendInput function Pin
Syamlal S Nair28-Feb-07 19:58
Syamlal S Nair28-Feb-07 19:58 
GeneralRe: Doubt in using SendInput function Pin
cp987628-Feb-07 20:20
cp987628-Feb-07 20:20 
GeneralRe: Doubt in using SendInput function Pin
Syamlal S Nair28-Feb-07 20:28
Syamlal S Nair28-Feb-07 20:28 
AnswerRe: Doubt in using SendInput function Pin
prasad_som28-Feb-07 22:01
prasad_som28-Feb-07 22:01 
SyamlalS wrote:
//code start
WinExec("notepad",1);


To start with, I wonder , why you are using this API, if there are better options available.

SyamlalS wrote:
But it is writing "d;\\sample.gho"


You have not considered virtual key state, which can be VK_SHIFT or VK_CAPITAL in this case.
Your code should be modified like this,
WinExec("notepad",1);
Sleep(1000);
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));
}



GeneralRe: Doubt in using SendInput function Pin
Syamlal S Nair28-Feb-07 22:11
Syamlal S Nair28-Feb-07 22:11 
AnswerRe: Doubt in using SendInput function Pin
prasad_som28-Feb-07 22:21
prasad_som28-Feb-07 22:21 
QuestionRe: Doubt in using SendInput function Pin
prasad_som1-Mar-07 1:12
prasad_som1-Mar-07 1:12 
AnswerRe: Doubt in using SendInput function Pin
Syamlal S Nair1-Mar-07 1:17
Syamlal S Nair1-Mar-07 1:17 
GeneralRe: Doubt in using SendInput function Pin
Syamlal S Nair1-Mar-07 17:39
Syamlal S Nair1-Mar-07 17:39 
QuestionRe: Doubt in using SendInput function Pin
prasad_som15-Mar-07 18:28
prasad_som15-Mar-07 18:28 
AnswerRe: Doubt in using SendInput function Pin
Syamlal S Nair15-Mar-07 18:37
Syamlal S Nair15-Mar-07 18:37 
GeneralRe: Doubt in using SendInput function Pin
prasad_som15-Mar-07 18:46
prasad_som15-Mar-07 18:46 
QuestionHow to judge if the folder can be written? Pin
Syouki_kou28-Feb-07 15:53
Syouki_kou28-Feb-07 15:53 
AnswerRe: How to judge if the folder can be written? Pin
Mark Salsbery28-Feb-07 16:14
Mark Salsbery28-Feb-07 16:14 
GeneralRe: How to judge if the folder can be written? Pin
Syouki_kou28-Feb-07 16:22
Syouki_kou28-Feb-07 16:22 
GeneralRe: How to judge if the folder can be written? Pin
Mark Salsbery28-Feb-07 16:51
Mark Salsbery28-Feb-07 16:51 
QuestionHow to send a scroll message to MS WORD? Pin
Michael ZY28-Feb-07 15:52
Michael ZY28-Feb-07 15:52 
Questionworker thread did not survive the release version - MFC Pin
awah28-Feb-07 15:34
awah28-Feb-07 15:34 
AnswerRe: worker thread did not survive the release version - MFC Pin
Xing Chen28-Feb-07 15:52
Xing Chen28-Feb-07 15:52 
AnswerRe: worker thread did not survive the release version - MFC Pin
prasad_som28-Feb-07 17:56
prasad_som28-Feb-07 17:56 
AnswerRe: worker thread did not survive the release version - MFC Pin
Roger Stoltz28-Feb-07 21:20
Roger Stoltz28-Feb-07 21:20 

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.