[C++] Win32 API, 프로그램에서 선택된 글씨 가져오기
#include #include using namespace std; int main() { int len; while (1) { HWND hWnd = GetForegroundWindow(); DWORD fromId = GetCurrentThreadId(); DWORD pid = GetWindowThreadProcessId(hWnd, NULL); AttachThreadInput(fromId, pid, TRUE); HWND focus = GetFocus(); DWORD hi; DWORD a; SendMessage(focus, EM_GETSEL, (WPARAM) &hi, (LPARAM) &a); len = SendMessage(focus, WM_GETTEXTLENGTH, 0, 0); int maxLen = ..
2020. 12. 27.