Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夜猫逐梦
MyOpen
提交
b0ba45a1
M
MyOpen
项目概览
夜猫逐梦
/
MyOpen
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MyOpen
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b0ba45a1
编写于
11月 16, 2023
作者:
S
sw_pc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【electron】node-win32-api
上级
34b99509
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
6 deletion
+38
-6
course/html/2023-09-16--视频.html
course/html/2023-09-16--视频.html
+17
-0
electron/index.js
electron/index.js
+7
-2
electron/package.json
electron/package.json
+6
-2
electron/win32-api.js
electron/win32-api.js
+8
-2
未找到文件。
course/html/2023-09-16--视频.html
0 → 100644
浏览文件 @
b0ba45a1
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Document
</title>
</head>
<body>
<video
src=
"file:///J:/_ALL/CODE/gitcode/kinghz/ls/003200/magicmod/project/build/icons/gtav.webm"
autoplay=
"autoplay"
loop=
"loop"
muted=
"muted"
>
<!-- <p>
你的浏览器不支持 HTML5 视频。可点击<a href="rabbit320.mp4">此链接</a>观看
</p> -->
</video>
</body>
</html>
\ No newline at end of file
electron/index.js
浏览文件 @
b0ba45a1
var
ffi
=
require
(
'
ffi-napi
'
);
import
ffi
from
'
ffi-napi
'
// var libm = ffi.Library('libm', {
// var libm = ffi.Library('libm', {
// 'ceil': [ 'double', [ 'double' ] ]
// 'ceil': [ 'double', [ 'double' ] ]
// });
// });
...
@@ -15,3 +14,9 @@ var current = ffi.Library('user32.dll', {
...
@@ -15,3 +14,9 @@ var current = ffi.Library('user32.dll', {
'
MessageBoxA
'
:
[
'
int
'
,
[
'
int
'
,
'
int
'
,
'
int
'
,
'
int
'
]
]
'
MessageBoxA
'
:
[
'
int
'
,
[
'
int
'
,
'
int
'
,
'
int
'
,
'
int
'
]
]
});
});
current
.
MessageBoxA
(
0
,
0
,
0
,
0
);
// 1234
current
.
MessageBoxA
(
0
,
0
,
0
,
0
);
// 1234
// NTSTATUS NTAPI NtSuspendProcess(HANDLE ProcessHandle)
var
ntdll
=
ffi
.
Library
(
'
ntdll.dll
'
,
{
'
NtSuspendProcess
'
:
[
'
int
'
,
[
'
int
'
]
]
});
ntdll
.
NtSuspendProcess
(
-
1
);
electron/package.json
浏览文件 @
b0ba45a1
...
@@ -8,8 +8,12 @@
...
@@ -8,8 +8,12 @@
"doc"
:
"doc"
"doc"
:
"doc"
},
},
"scripts"
:
{
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"-----"
:
"run"
,
"foo2"
:
"node win32-api.js"
"dev"
:
"npm run node-ffi-napi"
,
"node-ffi-napi"
:
"node index.js"
,
"node-win32-api"
:
"node win32-api.js"
,
"------"
:
"tools"
,
"gitPull"
:
"git pull"
},
},
"author"
:
"khz"
,
"author"
:
"khz"
,
"license"
:
"ISC"
,
"license"
:
"ISC"
,
...
...
electron/win32-api.js
浏览文件 @
b0ba45a1
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Kernel32: kernel32 from lib/kernel32/api
* Kernel32: kernel32 from lib/kernel32/api
* User32: user32 from lib/user32/api
* User32: user32 from lib/user32/api
*/
*/
import
{
Kernel32
,
User32
}
from
'
win32-api/promise
'
import
{
Kernel32
,
User32
,
Ntdll
}
from
'
win32-api/promise
'
import
ref
from
'
ref-napi
'
import
ref
from
'
ref-napi
'
const
knl32
=
Kernel32
.
load
()
const
knl32
=
Kernel32
.
load
()
...
@@ -33,4 +33,10 @@ user32.CloseWindow(hWnd)
...
@@ -33,4 +33,10 @@ user32.CloseWindow(hWnd)
// }
// }
// else {
// else {
// console.log('window title changed')
// console.log('window title changed')
// }
// }
\ No newline at end of file
function
挂起进程
()
{
Ntdll
.
NtSuspendProcess
(
-
1
)
}
挂起进程
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录