#include "mex.h" #include // Forwar algorithm // void send_input(WORD vk, int updown); int send_char(char ch, int shift_down); void mexFunction (int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[]) { HWND hWndID; int cnt; char str[] = "hogehoge"; int shift_state = GetAsyncKeyState(VK_SHIFT)==0 ? 0 : 1; // befor change focus int sfs = 0; // save shift down state int i; hWndID = FindWindow("Notepad", NULL); SetForegroundWindow(hWndID); Sleep(100); send_input( VK_SHIFT, 0); for(i=0;i