« AltDrag

« back to index

Building AltDrag

This page explains how to compile AltDrag. There are two distinct parts that you have to compile separately, the 32-bit part and the 64-bit part.

I recommend that you build AltDrag using mingw-w64 inside Cygwin.


In the Cygwin installer, install the following packages:

Once installed, open the Cygwin terminal and type:

git clone https://github.com/stefansundin/altdrag.git
cd altdrag
./build.bat x64
explorer .

This should get the source code and build all the binaries. The last command should open the explorer window so you can see if you find:

You can also run ./build.bat run to automatically launch AltDrag after it has been built.


If you want to build the installer, you need to download NSIS Unicode. Put NSIS in PATH (restart your terminal to update PATH), and then run ./build.bat all x64 to build the installer.


The configuration window was made with ResEdit, a compact resource editor. ResEdit is not needed to build AltDrag.

To configure ResEdit to use cygwin’s mingw-w64 header files, add C:\cygwin64\usr\i686-w64-mingw32\sys-root\mingw\include\ to your include paths.


Run ./build.bat lang to generate strings.h files from Translate.ini files. This is used to hard-code new translations before a release. New languages have to be added to import_languages.c to be generated.


If you do not want to use Cygwin, you can get mingw-w64 and Git standalone:

If you have trouble downloading the code, you can try downloading a zip.

Configure PATH

After downloading the compilers, you need to add them to the PATH variable so the build script can use the them. Do this by right clicking on the Computer desktop icon, go to the Advanced tab, press the Environment variables button, locate the PATH variable and add _\bin_ to the list, and press ok on all the dialogs. If you want to build the 64-bit part, add mingw-w64 to the PATH as well.

Here is an example of my PATH variable: C:\mingw-w32\bin;C:\mingw-w64\bin

Now open cmd.exe and go to AltDrag’s directory. If you had the terminal open when you changed the PATH variable, you must restart it.

32-bit part

The 32-bit part is AltDrag.exe and hooks.dll. To compile them simply run build.bat. It’s convenient to run build in a terminal so you can see any error messages.

64-bit part

The 64-bit part is HookWindows_x64.exe and hooks_x64.dll. These files are only used if you enable HookWindows and are running x64. They need to be 64-bit so that they can hook into 64-bit processes. To compile them you must use mingw-w64. Run build x64 to build the files.

Note that AltDrag.exe and hooks.dll are not supposed to be compiled as 64-bit programs. You still need a 32-bit component to be able to use HookWindows for 32-bit processes, and because there is a prevalence of 32-bit programs that we use even on 64-bit Windows, it doesn’t make sense to make AltDrag 64-bit only (yet).

Improve this page

Post in the subreddit to suggest improvements to this page.