蛊毒传说
printf("%08X\n",shwnd);//用spy++测试了,句柄值是对的DWORD cmdpid;GetWindowThreadProcessId(cmd,&cmdpid);//当前控制台PIDDWORD notepid;GetWindowThreadProcessId(shwnd,¬epid);//输入栏PIDAttachThreadInput(cmdpid,notepid,TRUE);//连接控制台和记事本输入栏两个线程SetFocus(fhwnd);//焦点转移到输入栏printf("%08X",SetFocus(fhwnd));//此处输出0,调用失败keybd_event('A',0,0,0);//发送消息keybd_event('A',0,KEYEVENTF_KEYUP,0);AttachThreadInput(cmdpid,notepid,FALSE);//释放连接getchar();return 0;