Git Product home page Git Product logo

fengjixuchui / winrobot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uvbs/winrobot

0.0 1.0 0.0 1.35 MB

A powerful screen capturer and Keyboard/mouse input simulator(Support Windows UAC\Winlogon\DirectShowOverlay)./Windows 高级桌面截图和输入控制工具,支持UAC、Winlogon、DirectShowOverlay窗口(基于 dll 注入 hook)。

License: MIT License

C++ 66.89% C 21.90% Batchfile 0.05% Java 11.16%

winrobot's Introduction

About WinRobot

![Gitter](https://badges.gitter.im/Join Chat.svg) GitHub license

  • A powerful & high performance screen capturer and Keyboard/mouse input simulator(Support Windows UAC\Winlogon\DirectShowOverlay).
  • (Optional)An implementation of java.awt.Robot under windows

User Manual

Compiling from source on Windows

About the files:

WinRobot\JNI The c++ part of the project
WinRobot\Java The java part of the project
  • Build C++ part: Add/adjust the following environment variables (via Control Panel/System/Advanced/Environment Variables):set JDKDIR to the path of jdk include,for example "c:\Program Files\Java\jdk1.6.0_22\include" The c++ part files are provided for Visual Studio 2010 sp1.The next step is to open "WinRobot\JNI\WinRobot.sln" and build the solution.The output directory is "WinRobot\bin\debug" and "WinRobot\bin\release".If all succeed,the following targets will be created:WinRobotHost.exe,JNIAdapter.dll,WinRobotCore.dll,WinRobotHook.dll,WinRobotHostPS.dll.

    About the output files:

      JNIAdapter*.dll WinRobot JNI library,load by JAVA part.
      WinRobotCore*.dll COM component:WinRobotService and WinRobotSession.
      WinRobotHook*.dll Provide API hook ability,used to hook DirectDraw Overlay API.
      WinRobotHost*.exe the service executable file.
      WinRobotHostPS*.dll Proxy dll for WinRobotHost*.exe,needed by ATL service.
    
  • Build java part: make sure you have install Java sdk 1.6+. Use NetBeans to open the project("WinRobot\java\WinRobot").Copy c++ output files(WinRobotHost*.exe,JNIAdapter*.dll,WinRobotCore*.dll,WinRobotHook*.dll,WinRobotHostPS*.dll) to WinRobot\Java\WinRobot\build\classes, to package them to the WinRobot.jar,

Install

For Win32:

WinRobotHostx32.exe -I

For Win64:

WinRobotHostx64.exe -I

How to use

C++

#ifdef _WIN64
#import "WinRobotCorex64.dll" raw_interfaces_only, raw_native_types,auto_search,no_namespace
#import "WinRobotHostx64.exe" auto_search,no_namespace
#else
#import "WinRobotCorex86.dll" raw_interfaces_only, raw_native_types,auto_search,no_namespace
#import "WinRobotHostx86.exe" auto_search,no_namespace
#endif

CComPtr<IWinRobotService> pService;
hr = pService.CoCreateInstance(__uuidof(ServiceHost) );

//get active console session
CComPtr<IUnknown> pUnk;
hr = pService->GetActiveConsoleSession(&pUnk);
CComQIPtr<IWinRobotSession> pSession = pUnk;

// capture screen
pUnk = 0;
hr = pSession->CreateScreenCapture(0,0,1024,768,&pUnk);

// get screen image data(with file mapping)
CComQIPtr<IScreenBufferStream> pBuffer = pUnk;
CComBSTR name;
ULONG size = 0;
pBuffer->get_FileMappingName(&name);
pBuffer->get_Size(&size);
CFileMapping fm;
fm.Open(name,size,false);
// do something with fm...

// get screen image data(with stream read)
CComQIPtr<ISequentialStream> pStream = pUnk;
char buf[1024];
ULONG cbBuffer  = 0 ;
while (pStream->Read(buf,sizeof(buf),&cbBuffer) == S_OK ){
    //	do something
}

JAVA

import com.caoym.WinRobot;
//...
WinRobot robot;
BufferedImage screen = robot.createScreenCapture(new Rectangle(0, 0, 1024, 768));

winrobot's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.