提交 b0ba45a1 编写于 作者: S sw_pc

【electron】node-win32-api

上级 34b99509
<!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
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);
...@@ -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",
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册