node-autoit-koffi 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/util.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ export declare const getDll: () => string | null;
3
+ export declare const getWString: (buf: Buffer) => any;
4
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";AAIA,eAAO,MAAM,MAAM,qBAWlB,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,QAKrC,CAAC"}
package/dist/util.js ADDED
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.getWString = exports.getDll = void 0;
30
+ const os = __importStar(require("os"));
31
+ const node_path_1 = __importDefault(require("node:path"));
32
+ const wchar_1 = __importDefault(require("./wchar"));
33
+ const getDll = () => {
34
+ const libDir = node_path_1.default.join(__dirname, "../dlls");
35
+ switch (os.arch()) {
36
+ case "ia32":
37
+ return node_path_1.default.join(libDir, "AutoItX3.dll");
38
+ case "x64":
39
+ return node_path_1.default.join(libDir, "AutoItX3_x64.dll");
40
+ }
41
+ return null;
42
+ };
43
+ exports.getDll = getDll;
44
+ const getWString = (buf) => {
45
+ for (let i = 0; i < buf.length; i += wchar_1.default.size) {
46
+ if (buf[i] == 0 && buf[i + 1] == 0)
47
+ return wchar_1.default.toString(buf.slice(0, i));
48
+ }
49
+ return wchar_1.default.toString(buf);
50
+ };
51
+ exports.getWString = getWString;
@@ -0,0 +1,16 @@
1
+ declare const _exports: any;
2
+ export = _exports;
3
+ export const name: "wchar_t";
4
+ export const indirection: 1;
5
+ export function get(buf: any, offset: any): any;
6
+ export function set(buf: any, offset: any, val: any): any;
7
+ export const string: any;
8
+ export function toString(buffer: Buffer): string;
9
+ /**
10
+ * On Windows they're UTF-16 (2-bytes),
11
+ * but on Unix platform they're UTF-32 (4-bytes).
12
+ *
13
+ * TODO: add a way to optionally enable `-fshort-wchar` for Unix (gcc option).
14
+ */
15
+ export var size: any;
16
+ //# sourceMappingURL=wchar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wchar.d.ts","sourceRoot":"","sources":["../src/wchar.js"],"names":[],"mappings":";;;;AAkDc,gDAMb;AACa,0DAYb;;AAoCkB,iCAJR,MAAM,UAOhB;AArFD;;;;;GAKG;AAEH,qBAAS"}
package/dist/wchar.js ADDED
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ /*
3
+ This code is from ref-wchar by nathan
4
+
5
+ License
6
+ (The MIT License)
7
+
8
+ Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ */
16
+ /**
17
+ * Module dependencies.
18
+ */
19
+ var ref = require('ref-napi');
20
+ //var Iconv = require('iconv').Iconv;
21
+ var iconv = require('iconv-lite');
22
+ /**
23
+ * On Windows they're UTF-16 (2-bytes),
24
+ * but on Unix platform they're UTF-32 (4-bytes).
25
+ *
26
+ * TODO: add a way to optionally enable `-fshort-wchar` for Unix (gcc option).
27
+ */
28
+ var size;
29
+ if ('win32' == process.platform) {
30
+ size = 2;
31
+ }
32
+ else {
33
+ size = 4;
34
+ }
35
+ var wchar_encoding = ('utf-' + (8 * size) + ref.endianness).toLowerCase();
36
+ //var getter = new Iconv('UTF-' + (8 * size) + ref.endianness, 'UTF-8');
37
+ //var setter = new Iconv('UTF-8', 'UTF-' + (8 * size) + ref.endianness);
38
+ /**
39
+ * The `wchar_t` type.
40
+ */
41
+ exports = module.exports = Object.create(ref.types['int' + (8 * size)]);
42
+ exports.name = 'wchar_t';
43
+ exports.size = size;
44
+ exports.indirection = 1;
45
+ exports.get = function get(buf, offset) {
46
+ if (offset > 0 || buf.length !== exports.size) {
47
+ offset = offset | 0;
48
+ buf = buf.slice(offset, offset + size);
49
+ }
50
+ return exports.toString(buf);
51
+ };
52
+ exports.set = function set(buf, offset, val) {
53
+ var _buf = val; // assume val is a Buffer by default
54
+ if (typeof val === 'string') {
55
+ //_buf = setter.convert(val[0]);
56
+ _buf = iconv.encode(val[0], wchar_encoding);
57
+ }
58
+ else if (typeof val === 'number') {
59
+ //_buf = setter.convert(String.fromCharCode(val));
60
+ _buf = iconv.encode(String.fromCharCode(val), wchar_encoding);
61
+ }
62
+ else if (!_buf) {
63
+ throw new TypeError('muss pass a String, Number, or Buffer for `wchar_t`');
64
+ }
65
+ return _buf.copy(buf, offset, 0, size);
66
+ };
67
+ /**
68
+ * The "wchar_t *" type.
69
+ *
70
+ * We use the "CString" type as a base since it's pretty close to what we
71
+ * actually want. We just have to define custom "get" and "set" functions.
72
+ */
73
+ exports.string = Object.create(ref.types.CString);
74
+ exports.string.name = 'WCString';
75
+ exports.string.get = function get(buf, offset) {
76
+ var _buf = buf.readPointer(offset);
77
+ if (_buf.isNull()) {
78
+ return null;
79
+ }
80
+ var stringBuf = _buf.reinterpretUntilZeros(exports.size);
81
+ return exports.toString(stringBuf);
82
+ };
83
+ exports.string.set = function set(buf, offset, val) {
84
+ var _buf = val; // val is a Buffer? it better be \0 terminated...
85
+ if ('string' == typeof val) {
86
+ //_buf = setter.convert(val + '\0');
87
+ _buf = iconv.encode(val + '\0', wchar_encoding);
88
+ }
89
+ return buf.writePointer(_buf, offset);
90
+ };
91
+ /**
92
+ * Turns a `wchar_t *` Buffer instance into a JavaScript String instance.
93
+ *
94
+ * @param {Buffer} buffer - buffer instance to serialize
95
+ * @public
96
+ */
97
+ exports.toString = function toString(buffer) {
98
+ //return getter.convert(buffer).toString('utf8');
99
+ return iconv.decode(buffer, wchar_encoding);
100
+ };
Binary file
@@ -0,0 +1,177 @@
1
+ #pragma once
2
+
3
+ ///////////////////////////////////////////////////////////////////////////////
4
+ //
5
+ // AutoItX v3
6
+ //
7
+ // Copyright (C)1999-2013:
8
+ // - Jonathan Bennett <jon at autoitscript dot com>
9
+ // - See "AUTHORS.txt" for contributors.
10
+ //
11
+ // This file is part of AutoItX. Use of this file and the AutoItX DLL is subject
12
+ // to the terms of the AutoItX license details of which can be found in the helpfile.
13
+ //
14
+ // When using the AutoItX3.dll as a standard DLL this file contains the definitions,
15
+ // and function declarations required to use the DLL and AutoItX3_DLL.lib file.
16
+ //
17
+ ///////////////////////////////////////////////////////////////////////////////
18
+
19
+
20
+ #ifdef __cplusplus
21
+ #define AU3_API extern "C"
22
+ #else
23
+ #define AU3_API
24
+ #endif
25
+
26
+
27
+ // Definitions
28
+ #define AU3_INTDEFAULT (-2147483647) // "Default" value for _some_ int parameters (largest negative number)
29
+
30
+ //
31
+ // nBufSize
32
+ // When used for specifying the size of a resulting string buffer this is the number of CHARACTERS
33
+ // in that buffer, including the null terminator. For example:
34
+ //
35
+ // WCHAR szBuffer[10];
36
+ // AU3_ClipGet(szBuffer, 10);
37
+ //
38
+ // The resulting string will be truncated at 9 characters with the the terminating null in the 10th.
39
+ //
40
+
41
+
42
+ ///////////////////////////////////////////////////////////////////////////////
43
+ // Exported functions
44
+ ///////////////////////////////////////////////////////////////////////////////
45
+
46
+ #include <windows.h>
47
+
48
+ AU3_API void WINAPI AU3_Init(void);
49
+ AU3_API int AU3_error(void);
50
+
51
+ AU3_API int WINAPI AU3_AutoItSetOption(LPCWSTR szOption, int nValue);
52
+
53
+ AU3_API void WINAPI AU3_ClipGet(LPWSTR szClip, int nBufSize);
54
+ AU3_API void WINAPI AU3_ClipPut(LPCWSTR szClip);
55
+ AU3_API int WINAPI AU3_ControlClick(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPCWSTR szButton, int nNumClicks, int nX = AU3_INTDEFAULT, int nY = AU3_INTDEFAULT);
56
+ AU3_API int WINAPI AU3_ControlClickByHandle(HWND hWnd, HWND hCtrl, LPCWSTR szButton, int nNumClicks, int nX = AU3_INTDEFAULT, int nY = AU3_INTDEFAULT);
57
+ AU3_API void WINAPI AU3_ControlCommand(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPCWSTR szCommand, LPCWSTR szExtra, LPWSTR szResult, int nBufSize);
58
+ AU3_API void WINAPI AU3_ControlCommandByHandle(HWND hWnd, HWND hCtrl, LPCWSTR szCommand, LPCWSTR szExtra, LPWSTR szResult, int nBufSize);
59
+ AU3_API void WINAPI AU3_ControlListView(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPCWSTR szCommand, LPCWSTR szExtra1, LPCWSTR szExtra2, LPWSTR szResult, int nBufSize);
60
+ AU3_API void WINAPI AU3_ControlListViewByHandle(HWND hWnd, HWND hCtrl, LPCWSTR szCommand, LPCWSTR szExtra1, LPCWSTR szExtra2, LPWSTR szResult, int nBufSize);
61
+ AU3_API int WINAPI AU3_ControlDisable(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl);
62
+ AU3_API int WINAPI AU3_ControlDisableByHandle(HWND hWnd, HWND hCtrl);
63
+ AU3_API int WINAPI AU3_ControlEnable(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl);
64
+ AU3_API int WINAPI AU3_ControlEnableByHandle(HWND hWnd, HWND hCtrl);
65
+ AU3_API int WINAPI AU3_ControlFocus(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl);
66
+ AU3_API int WINAPI AU3_ControlFocusByHandle(HWND hWnd, HWND hCtrl);
67
+ AU3_API void WINAPI AU3_ControlGetFocus(LPCWSTR szTitle, LPCWSTR szText, LPWSTR szControlWithFocus, int nBufSize);
68
+ AU3_API void WINAPI AU3_ControlGetFocusByHandle(HWND hWnd, LPWSTR szControlWithFocus, int nBufSize);
69
+ AU3_API HWND WINAPI AU3_ControlGetHandle(HWND hWnd, LPCWSTR szControl);
70
+ AU3_API void WINAPI AU3_ControlGetHandleAsText(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPCWSTR szControl, LPWSTR szRetText, int nBufSize);
71
+ AU3_API int WINAPI AU3_ControlGetPos(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPRECT lpRect);
72
+ AU3_API int WINAPI AU3_ControlGetPosByHandle(HWND hWnd, HWND hCtrl, LPRECT lpRect);
73
+ AU3_API void WINAPI AU3_ControlGetText(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPWSTR szControlText, int nBufSize);
74
+ AU3_API void WINAPI AU3_ControlGetTextByHandle(HWND hWnd, HWND hCtrl, LPWSTR szControlText, int nBufSize);
75
+ AU3_API int WINAPI AU3_ControlHide(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl);
76
+ AU3_API int WINAPI AU3_ControlHideByHandle(HWND hWnd, HWND hCtrl);
77
+ AU3_API int WINAPI AU3_ControlMove(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, int nX, int nY, int nWidth = -1, int nHeight = -1);
78
+ AU3_API int WINAPI AU3_ControlMoveByHandle(HWND hWnd, HWND hCtrl, int nX, int nY, int nWidth = -1, int nHeight = -1);
79
+ AU3_API int WINAPI AU3_ControlSend(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPCWSTR szSendText, int nMode = 0);
80
+ AU3_API int WINAPI AU3_ControlSendByHandle(HWND hWnd, HWND hCtrl, LPCWSTR szSendText, int nMode = 0);
81
+ AU3_API int WINAPI AU3_ControlSetText(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPCWSTR szControlText);
82
+ AU3_API int WINAPI AU3_ControlSetTextByHandle(HWND hWnd, HWND hCtrl, LPCWSTR szControlText);
83
+ AU3_API int WINAPI AU3_ControlShow(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl);
84
+ AU3_API int WINAPI AU3_ControlShowByHandle(HWND hWnd, HWND hCtrl);
85
+ AU3_API void WINAPI AU3_ControlTreeView(LPCWSTR szTitle, LPCWSTR szText, LPCWSTR szControl, LPCWSTR szCommand, LPCWSTR szExtra1, LPCWSTR szExtra2, LPWSTR szResult, int nBufSize);
86
+ AU3_API void WINAPI AU3_ControlTreeViewByHandle(HWND hWnd, HWND hCtrl, LPCWSTR szCommand, LPCWSTR szExtra1, LPCWSTR szExtra2, LPWSTR szResult, int nBufSize);
87
+
88
+ AU3_API void WINAPI AU3_DriveMapAdd(LPCWSTR szDevice, LPCWSTR szShare, int nFlags, /*[in,defaultvalue("")]*/LPCWSTR szUser, /*[in,defaultvalue("")]*/LPCWSTR szPwd, LPWSTR szResult, int nBufSize);
89
+ AU3_API int WINAPI AU3_DriveMapDel(LPCWSTR szDevice);
90
+ AU3_API void WINAPI AU3_DriveMapGet(LPCWSTR szDevice, LPWSTR szMapping, int nBufSize);
91
+
92
+ AU3_API int WINAPI AU3_IsAdmin(void);
93
+
94
+ AU3_API int WINAPI AU3_MouseClick(/*[in,defaultvalue("LEFT")]*/LPCWSTR szButton, int nX = AU3_INTDEFAULT, int nY = AU3_INTDEFAULT, int nClicks = 1, int nSpeed = -1);
95
+ AU3_API int WINAPI AU3_MouseClickDrag(LPCWSTR szButton, int nX1, int nY1, int nX2, int nY2, int nSpeed = -1);
96
+ AU3_API void WINAPI AU3_MouseDown(/*[in,defaultvalue("LEFT")]*/LPCWSTR szButton);
97
+ AU3_API int WINAPI AU3_MouseGetCursor(void);
98
+ AU3_API void WINAPI AU3_MouseGetPos(LPPOINT lpPoint);
99
+ AU3_API int WINAPI AU3_MouseMove(int nX, int nY, int nSpeed = -1);
100
+ AU3_API void WINAPI AU3_MouseUp(/*[in,defaultvalue("LEFT")]*/LPCWSTR szButton);
101
+ AU3_API void WINAPI AU3_MouseWheel(LPCWSTR szDirection, int nClicks);
102
+
103
+ AU3_API int WINAPI AU3_Opt(LPCWSTR szOption, int nValue);
104
+
105
+ AU3_API unsigned int WINAPI AU3_PixelChecksum(LPRECT lpRect, int nStep = 1);
106
+ AU3_API int WINAPI AU3_PixelGetColor(int nX, int nY);
107
+ AU3_API void WINAPI AU3_PixelSearch(LPRECT lpRect, int nCol, /*default 0*/int nVar, /*default 1*/int nStep, LPPOINT pPointResult);
108
+ AU3_API int WINAPI AU3_ProcessClose(LPCWSTR szProcess);
109
+ AU3_API int WINAPI AU3_ProcessExists(LPCWSTR szProcess);
110
+ AU3_API int WINAPI AU3_ProcessSetPriority(LPCWSTR szProcess, int nPriority);
111
+ AU3_API int WINAPI AU3_ProcessWait(LPCWSTR szProcess, int nTimeout = 0);
112
+ AU3_API int WINAPI AU3_ProcessWaitClose(LPCWSTR szProcess, int nTimeout = 0);
113
+
114
+ AU3_API int WINAPI AU3_Run(LPCWSTR szProgram, /*[in,defaultvalue("")]*/LPCWSTR szDir, int nShowFlag = SW_SHOWNORMAL);
115
+ AU3_API int WINAPI AU3_RunWait(LPCWSTR szProgram, /*[in,defaultvalue("")]*/LPCWSTR szDir, int nShowFlag = SW_SHOWNORMAL);
116
+ AU3_API int WINAPI AU3_RunAs(LPCWSTR szUser, LPCWSTR szDomain, LPCWSTR szPassword, int nLogonFlag, LPCWSTR szProgram, /*[in,defaultvalue("")]*/LPCWSTR szDir, int nShowFlag = SW_SHOWNORMAL);
117
+ AU3_API int WINAPI AU3_RunAsWait(LPCWSTR szUser, LPCWSTR szDomain, LPCWSTR szPassword, int nLogonFlag, LPCWSTR szProgram, /*[in,defaultvalue("")]*/LPCWSTR szDir, int nShowFlag = SW_SHOWNORMAL);
118
+
119
+ AU3_API void WINAPI AU3_Send(LPCWSTR szSendText, int nMode = 0);
120
+ AU3_API int WINAPI AU3_Shutdown(int nFlags);
121
+ AU3_API void WINAPI AU3_Sleep(int nMilliseconds);
122
+ AU3_API int WINAPI AU3_StatusbarGetText(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, /*[in,defaultvalue(1)]*/int nPart, LPWSTR szStatusText, int nBufSize);
123
+ AU3_API int WINAPI AU3_StatusbarGetTextByHandle(HWND hWnd, /*[in,defaultvalue(1)]*/int nPart, LPWSTR szStatusText, int nBufSize);
124
+
125
+ AU3_API void WINAPI AU3_ToolTip(LPCWSTR szTip, int nX = AU3_INTDEFAULT, int nY = AU3_INTDEFAULT);
126
+
127
+ AU3_API int WINAPI AU3_WinActivate(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
128
+ AU3_API int WINAPI AU3_WinActivateByHandle(HWND hWnd);
129
+ AU3_API int WINAPI AU3_WinActive(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
130
+ AU3_API int WINAPI AU3_WinActiveByHandle(HWND hWnd);
131
+ AU3_API int WINAPI AU3_WinClose(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
132
+ AU3_API int WINAPI AU3_WinCloseByHandle(HWND hWnd);
133
+ AU3_API int WINAPI AU3_WinExists(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
134
+ AU3_API int WINAPI AU3_WinExistsByHandle(HWND hWnd);
135
+ AU3_API int WINAPI AU3_WinGetCaretPos(LPPOINT lpPoint);
136
+ AU3_API void WINAPI AU3_WinGetClassList(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPWSTR szRetText, int nBufSize);
137
+ AU3_API void WINAPI AU3_WinGetClassListByHandle(HWND hWnd, LPWSTR szRetText, int nBufSize);
138
+ AU3_API int WINAPI AU3_WinGetClientSize(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPRECT lpRect);
139
+ AU3_API int WINAPI AU3_WinGetClientSizeByHandle(HWND hWnd, LPRECT lpRect);
140
+ AU3_API HWND WINAPI AU3_WinGetHandle(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
141
+ AU3_API void WINAPI AU3_WinGetHandleAsText(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPWSTR szRetText, int nBufSize);
142
+ AU3_API int WINAPI AU3_WinGetPos(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPRECT lpRect);
143
+ AU3_API int WINAPI AU3_WinGetPosByHandle(HWND hWnd, LPRECT lpRect);
144
+ AU3_API DWORD WINAPI AU3_WinGetProcess(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
145
+ AU3_API DWORD WINAPI AU3_WinGetProcessByHandle(HWND hWnd);
146
+ AU3_API int WINAPI AU3_WinGetState(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
147
+ AU3_API int WINAPI AU3_WinGetStateByHandle(HWND hWnd);
148
+ AU3_API void WINAPI AU3_WinGetText(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPWSTR szRetText, int nBufSize);
149
+ AU3_API void WINAPI AU3_WinGetTextByHandle(HWND hWnd, LPWSTR szRetText, int nBufSize);
150
+ AU3_API void WINAPI AU3_WinGetTitle(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPWSTR szRetText, int nBufSize);
151
+ AU3_API void WINAPI AU3_WinGetTitleByHandle(HWND hWnd, LPWSTR szRetText, int nBufSize);
152
+ AU3_API int WINAPI AU3_WinKill(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText);
153
+ AU3_API int WINAPI AU3_WinKillByHandle(HWND hWnd);
154
+ AU3_API int WINAPI AU3_WinMenuSelectItem(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPCWSTR szItem1, LPCWSTR szItem2, LPCWSTR szItem3, LPCWSTR szItem4, LPCWSTR szItem5, LPCWSTR szItem6, LPCWSTR szItem7, LPCWSTR szItem8);
155
+ AU3_API int WINAPI AU3_WinMenuSelectItemByHandle(HWND hWnd, LPCWSTR szItem1, LPCWSTR szItem2, LPCWSTR szItem3, LPCWSTR szItem4, LPCWSTR szItem5, LPCWSTR szItem6, LPCWSTR szItem7, LPCWSTR szItem8);
156
+ AU3_API void WINAPI AU3_WinMinimizeAll();
157
+ AU3_API void WINAPI AU3_WinMinimizeAllUndo();
158
+ AU3_API int WINAPI AU3_WinMove(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nX, int nY, int nWidth = -1, int nHeight = -1);
159
+ AU3_API int WINAPI AU3_WinMoveByHandle(HWND hWnd, int nX, int nY, int nWidth = -1, int nHeight = -1);
160
+ AU3_API int WINAPI AU3_WinSetOnTop(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nFlag);
161
+ AU3_API int WINAPI AU3_WinSetOnTopByHandle(HWND hWnd, int nFlag);
162
+ AU3_API int WINAPI AU3_WinSetState(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nFlags);
163
+ AU3_API int WINAPI AU3_WinSetStateByHandle(HWND hWnd, int nFlags);
164
+ AU3_API int WINAPI AU3_WinSetTitle(LPCWSTR szTitle,/*[in,defaultvalue("")]*/ LPCWSTR szText, LPCWSTR szNewTitle);
165
+ AU3_API int WINAPI AU3_WinSetTitleByHandle(HWND hWnd, LPCWSTR szNewTitle);
166
+ AU3_API int WINAPI AU3_WinSetTrans(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nTrans);
167
+ AU3_API int WINAPI AU3_WinSetTransByHandle(HWND hWnd, int nTrans);
168
+ AU3_API int WINAPI AU3_WinWait(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nTimeout = 0);
169
+ AU3_API int WINAPI AU3_WinWaitByHandle(HWND hWnd, int nTimeout);
170
+ AU3_API int WINAPI AU3_WinWaitActive(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nTimeout = 0);
171
+ AU3_API int WINAPI AU3_WinWaitActiveByHandle(HWND hWnd, int nTimeout);
172
+ AU3_API int WINAPI AU3_WinWaitClose(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nTimeout = 0);
173
+ AU3_API int WINAPI AU3_WinWaitCloseByHandle(HWND hWnd, int nTimeout);
174
+ AU3_API int WINAPI AU3_WinWaitNotActive(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, int nTimeout);
175
+ AU3_API int WINAPI AU3_WinWaitNotActiveByHandle(HWND hWnd, int nTimeout = 0);
176
+
177
+ ///////////////////////////////////////////////////////////////////////////////
Binary file
@@ -0,0 +1,36 @@
1
+ const test = require("node:test");
2
+ const {
3
+ init,
4
+ mouseMove,
5
+ send,
6
+ clipGet,
7
+ sleep,
8
+ mouseGetPos,
9
+ winGetClientSize,
10
+ } = require("../dist");
11
+
12
+ test("mouseMove", async () => {
13
+ await init();
14
+ await mouseMove(0, 0);
15
+ });
16
+
17
+ test("send", async () => {
18
+ await init();
19
+ await sleep(3000);
20
+ await send("Good job", 1);
21
+ });
22
+
23
+ test("clipGet", async () => {
24
+ await init();
25
+ console.log(await clipGet());
26
+ });
27
+
28
+ test("mouseGetPos", async () => {
29
+ await init();
30
+ console.log(await mouseGetPos());
31
+ });
32
+
33
+ test("winGetClientSize", async () => {
34
+ await init();
35
+ console.log(await winGetClientSize("Untitled - Notepad"));
36
+ });
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "node-autoit-koffi",
3
+ "version": "1.0.0",
4
+ "description": "This Node.js module provides support for all AutoIt functions, allowing users to automate Windows GUI tasks seamlessly.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "license": "MIT",
8
+ "scripts": {
9
+ "build": "rimraf dist && tsc",
10
+ "start": "npm run build && node dist/index.js"
11
+ },
12
+ "dependencies": {
13
+ "iconv-lite": "^0.6.3",
14
+ "koffi": "^2.8.0",
15
+ "lodash": "^4.17.21",
16
+ "ref-napi": "^3.0.3"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "^20.11.19",
20
+ "prettier": "^3.2.5",
21
+ "rimraf": "^5.0.5",
22
+ "typescript": "^5.3.3"
23
+ },
24
+ "keywords": [
25
+ "autoit",
26
+ "napi",
27
+ "nodejs",
28
+ "ffi",
29
+ "koffi"
30
+ ],
31
+ "readmeFilename": "README.md",
32
+ "homepage": "https://github.com/nullmastermind/node-autoit-koffi",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/nullmastermind/node-autoit-koffi.git"
36
+ },
37
+ "author": {
38
+ "name": "Van Dong",
39
+ "email": "thenullmastermind@gmail.com",
40
+ "url": "https://github.com/nullmastermind"
41
+ }
42
+ }
package/tools/gen.ts ADDED
File without changes