xj qian
2024-06-25 46bf65da8237cb34a62bbe0d6d4b8ba2bb2dc7b1
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#include "win32/win.hpp"
 
#if 0
#define WINAPI   __stdcall
extern "C"
{
    void *  WINAPI  LoadLibraryW(const wchar_t* lpText);
    bool  WINAPI FreeLibrary(void *  hModule);
    void *  WINAPI  GetProcAddressW(void* hModule, const char* lpText);
 
    LPARAM WINAPI  GetPropW(HWND  hWnd,string  lpString);
        
    HWND WINAPI  GetParent(HWND) ;
    LRESULT WINAPI MessageBoxW(HWND hWnd,string title,string caption,int button );
    LRESULT WINAPI MessageBoxA(HWND hWnd,const char* title,const char* caption,int button );
    LRESULT WINAPI SendMessage(HWND hWnd,int msg,WPARAM wparam,LPARAM lparam) ;
    LRESULT WINAPI PostMessage(HWND hWnd,int msg,WPARAM wparam,LPARAM lparam) ;
        
    HDC WINAPI GetDC(HWND hWnd) ;//native from "user32.dll" alias "GetDC";
    int WINAPI ReleaseDC(HWND hWnd,int hDC) ;//native from "user32.dll" alias "ReleaseDC";
 
    HWND WINAPI GetChild(HWND hWnd,int uCmd) ;//native from "user32.dll" alias "GetChild";
    int WINAPI GetWindowTextW(HWND hWnd,string str,int nMaxCount) ;//native from "user32.dll" alias "GetWindowTextW";
    int WINAPI SetWindowTextW(HWND hWnd,string str) ;//native from "user32.dll" alias "SetWindowTextW";
    int WINAPI GetWindowTextLengthW(HWND hWnd) ;//native from "user32.dll" alias "GetWindowTextLengthW";
 
    int WINAPI EnableWindow(HWND hWnd,bool abled) ;//native from "user32.dll" alias "EnableWindow";
    int WINAPI SetFocus(HWND hWnd) ;//native from "user32.dll" alias "SetFocus";
    HWND WINAPI GetFocus() ;//native from "user32.dll" alias "GetFocus";
    int WINAPI IsWindowVisible(HWND hWnd) ;//native from "user32.dll" alias "IsWindowVisible";
    //int WINAPI GetLocalTime(ref dwtime dt)  ;//native from "Kernel32.dll" alias "GetLocalTime";
    bool WINAPI AnimateWindow(HWND hWnd,int dwTime,int dwFlags) ;//native from "user32.dll" alias "AnimateWindow";
    int WINAPI GetKeyState(int nVirtKey) ;//native from "user32.dll" alias "GetKeyState";
 
    int WINAPI SetWindowLong(HWND hWnd, int nIndex, int dwNewLong) ;//native from "user32.dll" alias "SetWindowLongW";
    LPARAM WINAPI GetWindowLong(HWND hWnd, int nIndex) ;//native from "user32.dll" alias "GetWindowLongW";
    int WINAPI GetClientRect(HWND hWnd, xrect & lpRect) ;//native from "user32.dll" alias "GetClientRect";
    int WINAPI GetWindowRect(HWND hWnd, xrect & lpRect) ;//native from "user32.dll" alias "GetWindowRect";
    int WINAPI MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint) ;//native from "user32.dll" alias "MoveWindow";
    int WINAPI GetCursorPos(/*manage*/xpoint & IpPoint) ;//native from "user32.dll" alias "GetCursorPos";
    int WINAPI SetCursorPos(int X, int Y) ;//native from "user32.dll" alias "SetCursorPos";
    int WINAPI SetParent(HWND hWndChild,HWND hWndNewParent) ;//native from "user32.dll" alias "SetParent";
    int WINAPI SetWindowPos(HWND hWnd, HWND hWndlnsertAfter,int X,int Y,int cx, int cy,int  Flags) ;//native from "user32.dll" alias "SetWindowPos";
    int WINAPI CreateWindowEx(int dwExStyle,string IpClassName,string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int hMenu, int hInstance, int lpParam) ;//native from "user32.dll" alias "CreateWindowExW";
    int WINAPI ScrollWindow(HWND hWnd, int XAmount, int YAmount, xrect IpRect, xrect lpClipRect) ;//native from "user32.dll" alias "ScrollWindow";
    int WINAPI ShowWindow(HWND hWnd, int nCmdShow) ;//native from "user32.dll" alias "ShowWindow";
    int WINAPI WindowFromPoint(int xPoint, int yPoint) ;//native from "user32.dll" alias "WindowFromPoint";
    int WINAPI SetClassLongW(HWND hWnd,int nlndex,int dwNewLong) ;//native from "user32.dll" alias "SetClassLongW";
    int WINAPI ScreenToClient(HWND hWnd, xpoint lpPoint) ;//native from "user32.dll" alias "ScreenToClient";
    int WINAPI GetCursor() ;//native from "user32.dll" alias "GetCursor";
    int WINAPI GetPinYinLeader(string & ,string) ;//native from "pinyin.dll" alias "GetPinYinLeader";
    int WINAPI SetTextColor(int hdc, int crColor ) ;//native from "gdi32.dll" alias "SetTextColor";
    int WINAPI SetCapture(HWND hWnd) ;//native from "user32.dll" alias "SetCapture";
    int WINAPI SetTimer(HWND hWnd, int nIDEvent, int uElapse, int lpTimerFunc) ;//native from "user32.dll" alias "SetTimer";
    int WINAPI KillTimer(HWND hWnd, int nIDEvent) ;//native from "user32.dll" alias "KillTimer";
    HWND WINAPI FindWindowExW(HWND hWndParent, HWND hWndChildAfter, string lpszClass, string lpszWindow) ;//native from "user32.dll" alias "FindWindowExW";
    int WINAPI DestroyWindow(HWND hWnd) ;//native from "user32.dll" alias "DestroyWindow";
    HMENU WINAPI CreatePopupMenu() ;//native from "user32.dll" alias "CreatePopupMenu";
    bool WINAPI AppendMenuW(HMENU hMenu, int uFlags, int uIDNewltem, string lpNewltem) ;//native from "user32.dll" alias "AppendMenuW";
    bool WINAPI TrackPopupMenu(HMENU hMenu, int uFlags, int x, int y, int nReserved, HWND hWnd, xrect prcRect) ;//native from "user32.dll" alias "TrackPopupMenu";
    //int WINAPI CallWindowProc(int OldWProc,HWND hWnd,int uMsg,param wParam,param lParam) ;//native from "user32.dll" alias "CallWindowProcW";
    int WINAPI InvalidateRect(HWND hWnd,xrect & lpRect, bool bErase) ;//native from "user32.dll" alias "InvalidateRect";
    int WINAPI Sleep(int dwMilliseconds) ;//native from "kernel32.dll" alias "Sleep";
    int WINAPI DestroyWindow(HWND hWnd) ;//native from "user32.dll" alias "DestroyWindow";
    int WINAPI GetClassNameW(HWND hWnd,string str,int nMaxCount) ;//native from "user32.dll" alias "GetClassNameW";
    int WINAPI GetDeviceCaps(HWND hWnd,int HORZRES) ;//native from "user32.dll" alias "GetDeviceCaps";    
    int WINAPI GetComputerName(string name , int len) ;//native from "kernel32.dll" alias "GetComputerName";    
    int WINAPI IsWindow(HWND hWnd) ;//native from "user32.dll" alias "IsWindow";    
    int WINAPI GetCurrentDirectory(int nBufferLength, string lpBuffer) ;//native from "kernel32.dll" alias "GetCurrentDirectory";    
    int WINAPI ShellExecuteW(HWND hWnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd) ;//native from "shell32.dll" alias "ShellExecuteW";    
    int WINAPI DeleteFile(string lpFileName) ;//native from "Shlwapi.dll" alias "DeleteFileW";    
    bool WINAPI PathFileExists(string lpFileName) ;//native from "shlwapi.dll" alias "PathFileExistsW";    
    int WINAPI CreateDirectory(string lpFileName, string lpFileAttributes) ;//native from "kernel32.dll" alias "CreateDirectoryW";    
    //bool WINAPI SystemParametersinfo(int uiAction,int uiParam,param pvParam,int fWinlni) ;//native from "user32.dll" alias "SystemParametersinfo";    
    int WINAPI GetSystemMetrics(int nIndex) ;//native from "user32.dll" alias "GetSystemMetrics";    
    HWND WINAPI FindWindowW(string lpClassName, string lpWindowName);//native from "user32.dll" alias "FindWindowW";    
    
    int WINAPI GetTempPathW(int NAME_LEN,string & OutPath) ;//native from "kernel32.dll" alias "GetTempPathW";
    int WINAPI GetModuleHandleW(string lpModuleName) ;//native from "kernel32.dll" alias "GetModuleHandleW";
    int WINAPI GetModuleFileName(int hModule ,string & lpFileName ,int nSize ) ;//native from "kernel32.dll" alias "GetModuleFileName";
    void WINAPI GetLocalTime(SYSTEMTIME& lpSystemTime) ;//native from "kernel32.dll" alias "GetLocalTime";
}
#endif
 
#if 0
namespace win32
{
    void *  LoadLibrary(const wchar_t* lpText)
    {
        return ::LoadLibraryW(lpText);
    }
 
    bool  FreeLibrary(void *  hModule)
    {
        return ::FreeLibrary(hModule);
    }
 
    void *  GetProcAddress(void* hModule, const char* lpText)
    {
        return ::GetProcAddressW(hModule,lpText);
    }
 
    LPARAM  GetPropW(HWND  hWnd,string  lpString)
    {
 
    }
        
    HWND  GetParent(HWND) ;
    LRESULT MessageBoxW(HWND hWnd,string title,string caption,int button );
    LRESULT MessageBoxA(HWND hWnd,const char* title,const char* caption,int button );
    LRESULT SendMessage(HWND hWnd,int msg,WPARAM wparam,LPARAM lparam) ;
    LRESULT PostMessage(HWND hWnd,int msg,WPARAM wparam,LPARAM lparam) ;
        
    HDC GetDC(HWND hWnd) ;//native from "user32.dll" alias "GetDC";
    int ReleaseDC(HWND hWnd,int hDC) ;//native from "user32.dll" alias "ReleaseDC";
 
    HWND GetChild(HWND hWnd,int uCmd) ;//native from "user32.dll" alias "GetChild";
    int GetWindowTextW(HWND hWnd,string str,int nMaxCount) ;//native from "user32.dll" alias "GetWindowTextW";
    int SetWindowTextW(HWND hWnd,string str) ;//native from "user32.dll" alias "SetWindowTextW";
    int GetWindowTextLengthW(HWND hWnd) ;//native from "user32.dll" alias "GetWindowTextLengthW";
 
    int EnableWindow(HWND hWnd,bool abled) ;//native from "user32.dll" alias "EnableWindow";
    int SetFocus(HWND hWnd) ;//native from "user32.dll" alias "SetFocus";
    HWND GetFocus() ;//native from "user32.dll" alias "GetFocus";
    int IsWindowVisible(HWND hWnd) ;//native from "user32.dll" alias "IsWindowVisible";
    //int GetLocalTime(ref dwtime dt)  ;//native from "Kernel32.dll" alias "GetLocalTime";
    bool AnimateWindow(HWND hWnd,int dwTime,int dwFlags) ;//native from "user32.dll" alias "AnimateWindow";
    int GetKeyState(int nVirtKey) ;//native from "user32.dll" alias "GetKeyState";
 
    int SetWindowLong(HWND hWnd, int nIndex, int dwNewLong) ;//native from "user32.dll" alias "SetWindowLongW";
    LPARAM GetWindowLong(HWND hWnd, int nIndex) ;//native from "user32.dll" alias "GetWindowLongW";
    int GetClientRect(HWND hWnd, xrect & lpRect) ;//native from "user32.dll" alias "GetClientRect";
    int GetWindowRect(HWND hWnd, xrect & lpRect) ;//native from "user32.dll" alias "GetWindowRect";
    int MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint) ;//native from "user32.dll" alias "MoveWindow";
    int GetCursorPos(/*manage*/xpoint & IpPoint) ;//native from "user32.dll" alias "GetCursorPos";
    int SetCursorPos(int X, int Y) ;//native from "user32.dll" alias "SetCursorPos";
    int SetParent(HWND hWndChild,HWND hWndNewParent) ;//native from "user32.dll" alias "SetParent";
    int SetWindowPos(HWND hWnd, HWND hWndlnsertAfter,int X,int Y,int cx, int cy,int  Flags) ;//native from "user32.dll" alias "SetWindowPos";
    int CreateWindowEx(int dwExStyle,string IpClassName,string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int hMenu, int hInstance, int lpParam) ;//native from "user32.dll" alias "CreateWindowExW";
    int ScrollWindow(HWND hWnd, int XAmount, int YAmount, xrect IpRect, xrect lpClipRect) ;//native from "user32.dll" alias "ScrollWindow";
    int ShowWindow(HWND hWnd, int nCmdShow) ;//native from "user32.dll" alias "ShowWindow";
    int WindowFromPoint(int xPoint, int yPoint) ;//native from "user32.dll" alias "WindowFromPoint";
    int SetClassLongW(HWND hWnd,int nlndex,int dwNewLong) ;//native from "user32.dll" alias "SetClassLongW";
    int ScreenToClient(HWND hWnd, xpoint lpPoint) ;//native from "user32.dll" alias "ScreenToClient";
    int GetCursor() ;//native from "user32.dll" alias "GetCursor";
    int GetPinYinLeader(string & ,string) ;//native from "pinyin.dll" alias "GetPinYinLeader";
    int SetTextColor(int hdc, int crColor ) ;//native from "gdi32.dll" alias "SetTextColor";
    int SetCapture(HWND hWnd) ;//native from "user32.dll" alias "SetCapture";
    int SetTimer(HWND hWnd, int nIDEvent, int uElapse, int lpTimerFunc) ;//native from "user32.dll" alias "SetTimer";
    int KillTimer(HWND hWnd, int nIDEvent) ;//native from "user32.dll" alias "KillTimer";
    HWND FindWindowExW(HWND hWndParent, HWND hWndChildAfter, string lpszClass, string lpszWindow) ;//native from "user32.dll" alias "FindWindowExW";
    int DestroyWindow(HWND hWnd) ;//native from "user32.dll" alias "DestroyWindow";
    HMENU CreatePopupMenu() ;//native from "user32.dll" alias "CreatePopupMenu";
    bool AppendMenuW(HMENU hMenu, int uFlags, int uIDNewltem, string lpNewltem) ;//native from "user32.dll" alias "AppendMenuW";
    bool TrackPopupMenu(HMENU hMenu, int uFlags, int x, int y, int nReserved, HWND hWnd, xrect prcRect) ;//native from "user32.dll" alias "TrackPopupMenu";
    //int CallWindowProc(int OldWProc,HWND hWnd,int uMsg,param wParam,param lParam) ;//native from "user32.dll" alias "CallWindowProcW";
    int InvalidateRect(HWND hWnd,xrect & lpRect, bool bErase) ;//native from "user32.dll" alias "InvalidateRect";
    int Sleep(int dwMilliseconds) ;//native from "kernel32.dll" alias "Sleep";
    int DestroyWindow(HWND hWnd) ;//native from "user32.dll" alias "DestroyWindow";
    int GetClassNameW(HWND hWnd,string str,int nMaxCount) ;//native from "user32.dll" alias "GetClassNameW";
    int GetDeviceCaps(HWND hWnd,int HORZRES) ;//native from "user32.dll" alias "GetDeviceCaps";    
    int GetComputerName(string name , int len) ;//native from "kernel32.dll" alias "GetComputerName";    
    int IsWindow(HWND hWnd) ;//native from "user32.dll" alias "IsWindow";    
    int GetCurrentDirectory(int nBufferLength, string lpBuffer) ;//native from "kernel32.dll" alias "GetCurrentDirectory";    
    int ShellExecuteW(HWND hWnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd) ;//native from "shell32.dll" alias "ShellExecuteW";    
    int DeleteFile(string lpFileName) ;//native from "Shlwapi.dll" alias "DeleteFileW";    
    bool PathFileExists(string lpFileName) ;//native from "shlwapi.dll" alias "PathFileExistsW";    
    int CreateDirectory(string lpFileName, string lpFileAttributes) ;//native from "kernel32.dll" alias "CreateDirectoryW";    
    //bool SystemParametersinfo(int uiAction,int uiParam,param pvParam,int fWinlni) ;//native from "user32.dll" alias "SystemParametersinfo";    
    int GetSystemMetrics(int nIndex) ;//native from "user32.dll" alias "GetSystemMetrics";    
    HWND FindWindowW(string lpClassName, string lpWindowName);//native from "user32.dll" alias "FindWindowW";    
    
    int GetTempPathW(int NAME_LEN,string & OutPath) ;//native from "kernel32.dll" alias "GetTempPathW";
    int GetModuleHandleW(string lpModuleName) ;//native from "kernel32.dll" alias "GetModuleHandleW";
    int GetModuleFileName(int hModule ,string & lpFileName ,int nSize ) ;//native from "kernel32.dll" alias "GetModuleFileName";
    void GetLocalTime(SYSTEMTIME& lpSystemTime) ;//native from "kernel32.dll" alias "GetLocalTime";
}
#endif