MoveW is a command-line utility for Windows designed to find the first visible window belonging to a specified process and move it to the desired screen coordinates.
The program is run from the command line with the following syntax:
movew -x<coord> -y<coord> -p<process_name> [-u]
Parameters:
-x<coord>
: (Required) The target X coordinate for the top-left corner of the window.-y<coord>
: (Required) The target Y coordinate for the top-left corner of the window.-p<process_name>
: (Required) The name of the executable file of the target process (e.g.,notepad.exe
,chrome.exe
).-u
: (Optional) If specified, the program will wait indefinitely for a window belonging to the target process to appear before attempting to move it. If omitted, the program will only check for currently existing windows and exit if none are found.
Examples:
- Move the first found Notepad window to coordinates (1024, 0):
movew -x1024 -y0 -pnotepad.exe
- Wait for a Notepad window to appear and then move it to coordinates (0, 0):
movew -x0 -y0 -pnotepad.exe -u
To build movew.exe
from the provided main.cpp
source code:
-
Prerequisites:
- Microsoft Visual Studio (with the C++ toolchain installed). The
build.bat
script specifically callsvcvars32.bat
from Visual Studio 2022 Community Edition, but may work with other versions. - (Optional)
mpress
executable packer (used inbuild.bat
for compression).
- Microsoft Visual Studio (with the C++ toolchain installed). The
-
Build Steps:
- Open a Developer Command Prompt for Visual Studio (or ensure
cl.exe
andrc.exe
are in your PATH). - Navigate to the directory containing
main.cpp
,version.rc
, andbuild.bat
. - Run the build script:
build.bat
- This will compile the resource script, compile the C++ code and link them.
- Open a Developer Command Prompt for Visual Studio (or ensure
- The program's console output messages are in Portuguese.
- The program attempts to preserve the original size of the window when moving it.
- Copyright (C) 2018 MAPENO.pt