admin
7 天以前 6cd92a169cbc0db35042f243a09d976fd3e1445c
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
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#include <list>
#include <string>
#include <wtypes.h>
using namespace std;
class Win32Util
{
private:
    static    std::string convertLPWSTRToUTF8(LPWSTR lpwstr);
 
public:
 
 
    //°´ÕÕÃû³ÆËÑË÷´°Ìå
    static list<HWND> searchWindow(string name);
 
    //»ñÈ¡´°¿ÚÃû³Æ
    static string getWindowName(HWND hwnd);
 
 
    static string getClassName(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 keyboardNum(string num, int delay = 0);
 
    //¼üÅÌÊäÈëÆäËû¼ü
    static void keyboard(int code, int delay = 0);
 
    //ÐéÄâ¼üÈë
    static void virtualKeyboard(HWND hwnd, int code);
 
    //¼üÅ̼üÈëÕ³Ìù
    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);
 
    //Êó±ê¹ö¶¯
    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();
 
    static void sendMessage(HWND hwnd, UINT  msg, LPARAM p0, LPARAM p1);
 
    static void postMessage(HWND hwnd, UINT  msg, LPARAM p0, LPARAM p1);
 
    static void input_num(HWND hwnd, string content);
 
    static  void addToTHS(string code);
};