=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/winfep/winfepDlg.cpp,v retrieving revision 1.2 retrieving revision 1.5 diff -u -p -r1.2 -r1.5 --- OpenXM_contrib2/windows/winfep/winfepDlg.cpp 2010/01/21 03:00:21 1.2 +++ OpenXM_contrib2/windows/winfep/winfepDlg.cpp 2013/08/07 01:53:40 1.5 @@ -215,16 +215,38 @@ HCURSOR CWinfepDlg::OnQueryDragIcon() void CWinfepDlg::OnSend() { // TODO: この位置にコントロール通知ハンドラ用のコードを追加してください - if ( !infile ) return; + int i; + if ( !infile ) return; if ( currentline >= 0 && currentline < nlines ) { CString str; m_currentline.GetWindowText(str); LPCSTR line = (LPCSTR)str; - for ( int i = 0; line[i]; i++ ) { - if ( line[i] == '\t' ) - ::SendMessage(asirhwnd,WM_CHAR,' ',8); - else - ::SendMessage(asirhwnd,WM_CHAR,line[i],1); + for ( i = 0; line[i] && isspace(line[i]); i++ ); + if ( line[i] && + !strncmp(line+i,"end$",4) || !strncmp(line+i,"end;",4) ) return; + +// for ( i = 0; line[i]; i++ ) { +// if ( line[i] == '\t' ) +// ::SendMessage(asirhwnd,WM_CHAR,' ',8); +// else +// ::SendMessage(asirhwnd,WM_CHAR,line[i],1); +// } +// ::SendMessage(asirhwnd,WM_CHAR,'\n',1); + if ( line[i] ) { +#if 0 + m_currentline.SetSel(0,str.GetLength()); + m_currentline.Copy(); +#else + int len=str.GetLength()+1; + if (!::OpenClipboard(NULL) ) return; + HGLOBAL hMem = ::GlobalAlloc(GMEM_FIXED,len); + LPTSTR pMem = (LPTSTR)hMem; + ::lstrcpy(pMem,(LPCTSTR)line); + ::EmptyClipboard(); + ::SetClipboardData(CF_TEXT,hMem); + ::CloseClipboard(); +#endif + ::SendMessage(asirhwnd,WM_CHAR,0x19,1); } ::SendMessage(asirhwnd,WM_CHAR,'\n',1); show_line(++currentline); @@ -284,7 +306,7 @@ void CWinfepDlg::OnAsir() CFileDialog fileDialog(TRUE); if ( fileDialog.DoModal() == IDOK ) { CString pathName = fileDialog.GetPathName(); - _spawnl(_P_NOWAIT,pathName,pathName,NULL); + _spawnl(_P_NOWAIT,pathName,"asirgui",NULL); Sleep(5000); get_asirhwnd(); }