layout: post
title: Electron C# dll hook获取活动窗口的进程和路径
date: 2019-09-15 15:57:52 +0800
categories: EElectron
tags: [“Electron”, “Nodejs”, “C#”, “dll”]
notebook: Electron
disqus: false
gitalk: true
description: Electron 抓取底层的系统信息。获取活动窗口的进程名,进程id和路径位置。主要使用Electron,electron-edge-js,C#生成库文件。
在实现这个要求前,需要有node-gyp,node-gyp需要有python2.7,visual studio2015的什么动态链接库。为了简便方法的安装,我安装的的方法是直接安装windows-build-tools的包。
Windows的环境
1. 安装gyp
npm i -g node-gyp
2. 安装扩展包
npm install --global --production windows-build-tools
3. 配置python路径
路径的位置是在系统用户的文件夹下的.windows-build-tools里面。c:/user/用户/.windows-build-tools
node-gyp python --python /path/to/python27
安装Electron
npm i -g electron@latest
1. 建立工程
mkdir electron-demo
npm init
npm i electron
npm i electron-edge-js
2. 初始化index.html和index.js
index.html
<!DOCTYPE ht

本文介绍了如何使用Electron和C#创建DLL来hook获取活动窗口的进程名、ID和路径。首先,确保Windows环境中安装了gyp、扩展包并配置好Python路径。然后,通过Electron建立工程,使用C#创建DLL,最后展示hook窗口的程序执行结果。
最低0.47元/天 解锁文章
8467

被折叠的 条评论
为什么被折叠?



