Electron C# dll hook获取活动窗口的进程和路径

本文介绍了如何使用Electron和C#创建DLL来hook获取活动窗口的进程名、ID和路径。首先,确保Windows环境中安装了gyp、扩展包并配置好Python路径。然后,通过Electron建立工程,使用C#创建DLL,最后展示hook窗口的程序执行结果。
摘要由CSDN通过智能技术生成

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.htmlindex.js

index.html

<!DOCTYPE html>
<html><head></head>
<body>
   测试<input type=
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值