1.1.0 • Published 3 years ago

windowcpp v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

WindowCpp

Allow you to handle process from a windows application.

Installation

Use the package manager npm or yarn to install Mouse.

yarn add windowcpp
npm install windowcpp

Usage

Work in both: typescript and javascript.

const Window = require("windowcpp").default;

const processName = "Process Name"
const window = new Window(processName);

// [...]

API

window

Class to handle your process.

Example:

  • showWindow(nCmdShow).

    See the possible values of nCmdShow here.

    window.showWindow("SW_SHOWMAXIMIZED");
  • writeMemoryValue(address, message);

    Write the message in the current address. See more here.

      window.writeMemoryValue(0xFF0232DD, "12");
  • getWindowsSize()

    Return an object with the height and width of the window.
    const size = window.getWindowsSize();
    console.log(size.height);
    console.log(size.width);
  • postMessage(WPARAM);

    window.postMessage("VK_F12");
  • readMemoryValue(address);

    const value = window.readMemoryValue(0xFFFFFFFF);
    console.log(value);
  • screenshoot(filename);

    window.screenshoot("./screenshot.jpg");
  • setWindowPosition(hWndInsertAfter, movex, movey, width , height);

    Change the position and the size of the window. See more here.
    window.setWindowPosition("HWND_TOPMOST", 200, 200, 800, 400);
  • setForegroundWindow();

    Activate the window and bring to front. See more here.
    window.setForegroundWindow();
  • leftClick(x: number, y: number): void;

    Press left mouse button in the x and y position.
    window.leftClick(100,100);
  • rightClick(x: number, y: number): void;

    Press right mouse button in the x and y position.
    window.leftRight (100,100);
  • leftAndRightClick(x: number, y: number): void;

    Press right and left mouse button in the x and y position.
    window.leftAndRightClick(100,100);
  • moveMouse(x: number, y: number);

    Move the mouse in the x and y position.
    window.moveMouse(100,100);

Note

All commands refer to the chosen process.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

1.1.0

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago