Skip to content

Instantly share code, notes, and snippets.

@LiuinStein
Created January 10, 2020 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LiuinStein/9d267516786d2b42d0717acaf93b298f to your computer and use it in GitHub Desktop.
Save LiuinStein/9d267516786d2b42d0717acaf93b298f to your computer and use it in GitHub Desktop.
Sogou input method speed statistics cheating tool
// SogouInputTool.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "SogouInputTool.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// The one and only application object
CWinApp theApp;
// 获取记事本的窗体句柄,没找到的话就打开一个记事本
HWND GetNotepadHWND()
{
HWND hwndRet = FindWindowW(NULL, _T("无标题 - 记事本"));
while(!IsWindow(hwndRet))
{
STARTUPINFO StartInfo = { sizeof(StartInfo) }; // name structure
PROCESS_INFORMATION ProcInfo; // name structure
wchar_t cmd[] = _T("notepad.exe");
memset(&ProcInfo, 0, sizeof(ProcInfo)); // Set up memory block,这个很重要
CreateProcess(NULL, cmd, NULL, NULL, NULL, NULL, NULL, NULL, &StartInfo, &ProcInfo);
// ShellExecute(NULL, _T("open"), _T("notepad"), NULL, NULL, SW_SHOW);
// WinExec("notepad", SW_SHOW);
// system("notepad");
hwndRet = FindWindowW(NULL, _T("无标题 - 记事本"));
}
return hwndRet;
}
int main()
{
// 获取窗体句柄
HWND hNotepad = GetNotepadHWND();
// 设置焦点
SetForegroundWindow(hNotepad);
SetFocus(hNotepad);
const char * send = " XCQP IUPN SBGBUURUFAZOBIQI "; // 输入序列
// 发送按键
int nLen = strlen(send);
for (int p = 0; p < 1; p++)
{
for (int i = 0; i < nLen; i++)
{
keybd_event(send[i], 0, 0, 0);
keybd_event(send[i], 0, KEYEVENTF_KEYUP, 0);
}
}
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment