16,472
社区成员
发帖
与我相关
我的任务
分享
void CSRT6880LockDlg::OnExecute()
{
// TODO: Add your control notification handler code here
CWnd *pWnd=FindWindow((LPCTSTR)"ConsoleWindowClass",NULL); //查找窗口是否存在,用SPY++看窗口类
// ASSERT_VALID(pWnd);
if(pWnd==NULL)
{
AfxMessageBox("没有找到DOS窗口,将退出程序!");
PostMessage(WM_CLOSE,0,0);
}
CString strTemp;
int nLineNumber;
UpdateData(1);
pEdit->EnableWindow(0);
if(m_Inistr.IsEmpty())
AfxMessageBox("没有命令,请重新编辑命令!");
else
{
for(nLineNumber=0;nLineNumber<5;nLineNumber++)
{
pEdit->GetLine(nLineNumber,strTemp.GetBufferSetLength(pEdit->LineLength(pEdit->LineIndex(nLineNumber+1)-2*(nLineNumber+1)+1)));
strTemp.ReleaseBuffer();
if(!strTemp.IsEmpty())
{
sParameter_1=strTemp;
strTemp.Empty();
for(int b=0;b<sParameter_1.GetLength();b++)
{
pWnd->ShowWindow(1); //激活窗口
(),WM_KEYDOWN,sParameter_1.GetAt(b),0);
::SendMessage(pWnd->GetSafeHwnd(),WM_CHAR,sParameter_1.GetAt(b),0); //发送消息 这里是字符D,要查找对应的virtualkey的值
(),WM_KEYUP,sParameter_1.GetAt(b),0);
}
sParameter_1.Empty();
// ::SendMessage(pWnd->GetSafeHwnd(),WM_KEYDOWN,'\r\n',0);
::SendMessage(pWnd->GetSafeHwnd(),WM_CHAR,'\r\n',0);
// ::SendMessage(pWnd->GetSafeHwnd(),WM_KEYUP,'\r\n',0);
}
}
}
}
void CSRT6880LockDlg::OnExecute()
{
// TODO: Add your control notification handler code here
CWnd *pWnd=FindWindow((LPCTSTR)"ConsoleWindowClass",NULL); //查找窗口是否存在,用SPY++看窗口类
// ASSERT_VALID(pWnd);
if(pWnd==NULL)
{
AfxMessageBox("没有找到DOS窗口,将退出程序!");
PostMessage(WM_CLOSE,0,0);
}
CString strTemp;
int nLineNumber;
UpdateData(1);
pEdit->EnableWindow(0);
if(m_Inistr.IsEmpty())
AfxMessageBox("没有命令,请重新编辑命令!");
else
{
for(nLineNumber=0;nLineNumber<5;nLineNumber++)
{
pEdit->GetLine(nLineNumber,strTemp.GetBufferSetLength(pEdit->LineLength(pEdit->LineIndex(nLineNumber+1)-2*(nLineNumber+1)+1)));
strTemp.ReleaseBuffer();
if(!strTemp.IsEmpty())
{
sParameter_1=strTemp;
strTemp.Empty();
for(int b=0;b<sParameter_1.GetLength();b++)
{
pWnd->ShowWindow(1); //激活窗口
::SendMessage(pWnd->GetSafeHwnd(),WM_CHAR,sParameter_1.GetAt(b),0); //发送消息 这里是字符D,要查找对应的virtualkey的值
}
sParameter_1.Empty();
::SendMessage(pWnd->GetSafeHwnd(),WM_CHAR,'\r\n',0);
}
}
}
}
CWnd *pWnd=FindWindow((LPCTSTR)"ConsoleWindowClass",NULL); //查找窗口是否存在,用SPY++看窗口类
// ASSERT_VALID(pWnd);
if(pWnd==NULL)
{
AfxMessageBox("没有找到DOS窗口,将退出程序!");
PostMessage(WM_CLOSE,0,0);
}
CString strTemp=m_Inistr;
int nLineNumber;
UpdateData(1);
if(m_Inistr.IsEmpty())
AfxMessageBox("没有命令,请重新编辑命令!");
pWnd->ShowWindow(1);
for(int b=0;b<strTemp.GetLength();b++)
{
int ret=::SendMessage(pWnd->GetSafeHwnd(),WM_CHAR,strTemp.GetAt(b),0); //发送消息 这里是字符D,要查找对应的virtualkey的值
}
::SendMessage(pWnd->GetSafeHwnd(),WM_CHAR,'\r\n',0);