admin
2022-10-28 086ec74e94654e92b3a1c6f42612d12ef33ff4b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <list>
#include "Windows.h"
#include <string>
using namespace std;
class Win32Util
{
public:
    //°´ÕÕÃû³ÆËÑË÷´°Ìå
    static list<HWND> searchWindow(string name);
 
    //»ñÈ¡´°¿ÚÃû³Æ
    static string getWindowName(HWND hwnd);
 
    //»ñÈ¡»ñÈ¡¿Ø¼þÄÚÈÝ
    static wstring getText(HWND hwnd);
 
    //µ¥»÷
    static void click(int delay=0);
 
    //µ¥»÷Ö¸¶¨Î»ÖÃ
    static void click(int x,int y, int delay=0);
 
    //ÒÆ¶¯Êó±ê
    static void mouseMove(int x, int y,int delay=0);
 
    //»ñÈ¡½¹µã
    static void focus(HWND hwnd);
 
    //¸´ÖƵ½Õ³Ìù°å
    static void copy(string text);
 
    //¼üÅÌÊäÈëÊý×Ö
    static void keyboardNum(string num, int delay=0);
 
    //¼üÅÌÊäÈëÆäËû¼ü
    static void keyboard(int code, int delay=0);
 
    //¼üÅ̼üÈëÕ³Ìù
    static void keyboardPaste();
 
    //»ñÈ¡L2ÆÁÄ»Êý¾Ý
    static DEVMODE getL2ScreenInfo();
 
    //ÒÆ¶¯´°¿Ú
    static void moveWin(HWND win, int x,int y,int width,int height);
 
    //´°ÌåÊÇ·ñÏÔʾ
    static bool isWindowShow(HWND hwnd);
    //ÏÔʾ´°¿Ú
    static void showWindow(HWND hwnd);
 
    //Ñ¡ÔñtxtÎļþ
    static void selectTexFileWin10(HWND hwnd, string path);
 
    //Êó±ê¹ö¶¯
    static void rollMouseWheel(bool back,HWND win,int x, int y);
 
    //»ñȡλÖÃ
    static void getWindowRect(HWND hwnd,RECT *rect);
 
    //ÐéÄâµã»÷
    static void visualClick(HWND hwnd, LPARAM pos);
 
    //»ñÈ¡ÏÖÔÚµÄʱ¼ä
    static string getNowTime();
};