Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonUnch authored Jul 18, 2021
1 parent bc5a9b3 commit 88eec63
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
19 changes: 5 additions & 14 deletions altdrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#define _WIN32_WINNT 0x0400
#include <windows.h>

// App
#define APP_NAME L"AltDrag"
#define APP_NAMEA "AltDrag"
#define APP_VERSION "1.45"

// Messages
#define SWM_TOGGLE (WM_APP+1)
#define SWM_HIDE (WM_APP+2)
Expand All @@ -31,11 +26,6 @@
HINSTANCE g_hinst = NULL;
HWND g_hwnd = NULL;
UINT WM_TASKBARCREATED = 0;
UINT WM_UPDATESETTINGS = 0;
UINT WM_ADDTRAY = 0;
UINT WM_HIDETRAY = 0;
UINT WM_OPENCONFIG = 0;
UINT WM_CLOSECONFIG = 0;
wchar_t inipath[MAX_PATH];

// Cool stuff
Expand Down Expand Up @@ -167,11 +157,12 @@ void ShowSClickMenu(HWND hwnd, LPARAM param)
/////////////////////////////////////////////////////////////////////////////
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_TRAY) {
if (!msg) {
// In case some messages are not registered.
} else if (msg == WM_TRAY) {
if (lParam == WM_LBUTTONDOWN || lParam == WM_LBUTTONDBLCLK) {
ToggleState();
if (lParam == WM_LBUTTONDBLCLK
&& !(GetAsyncKeyState(VK_SHIFT) & 0x8000)) {
if (lParam == WM_LBUTTONDBLCLK) {
SendMessage(hwnd, WM_OPENCONFIG, 0, 0);
}
} else if (lParam == WM_MBUTTONDOWN) {
Expand Down Expand Up @@ -368,7 +359,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, char *szCmdLine, in
}
/////////////////////////////////////////////////////////////////////////////
// use -nostdlib and -e_unfuckMain@0 to use this main
void WINAPI unfuckWinMain(void)
void WINAPI noreturn unfuckWinMain(void)
{
HINSTANCE hInst;
HINSTANCE hPrevInstance = NULL;
Expand Down
6 changes: 3 additions & 3 deletions altdrag.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "AltDrag.exe.manifest"

#define VS_VERSION_INFO 1
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,5,0
PRODUCTVERSION 1,4,5,0
FILEVERSION 1,4,6,0
PRODUCTVERSION 1,4,6,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
Expand All @@ -21,7 +21,7 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "AltDrag"
VALUE "FileVersion", "1.45"
VALUE "FileVersion", "1.46"
VALUE "InternalName", "altdrag"
VALUE "OriginalFilename", "AltDrag.exe"
VALUE "CompanyName", "Gillibert Software"
Expand Down
3 changes: 1 addition & 2 deletions hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <endpointvolume.h>
#include "unfuck.h"
#include "hooks.h"
// App
#define APP_NAME L"AltDrag"

// Boring stuff
#define REHOOK_TIMER WM_APP+1
Expand Down Expand Up @@ -2629,6 +2627,7 @@ static int WheelActions(POINT pt, PMSLLHOOKSTRUCT msg, WPARAM wParam)
else if (action == AC_MAXIMIZE) ActionMaxRestMin(&pt, hwnd, delta);
else if (action == AC_ROLL) RollWindow(hwnd, delta);
else if (action == AC_HSCROLL) ret = ScrollPointedWindow(pt, -delta, WM_MOUSEHWHEEL);
else ret = 0; // No action

// ret is 0: next hook or 1: block mousedown and AltUp.
state.blockaltup = ret; // block or not;
Expand Down
21 changes: 17 additions & 4 deletions hooks.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
#ifndef ALTDRAG_RPC_H
#define ALTDRAG_RPC_H

#define WM_TRAY (WM_USER+1)
#define WM_SCLICK (WM_USER+2)
#define WM_UPDCFRACTION (WM_USER+3)
#define WM_UPDATETRAY (WM_USER+4)
// App
#define APP_NAME L"AltDrag"
#define APP_NAMEA "AltDrag"
#define APP_VERSION "1.46"

// User Messages
#define WM_TRAY (WM_USER+1)
#define WM_SCLICK (WM_USER+2)
#define WM_UPDCFRACTION (WM_USER+3)
#define WM_UPDATETRAY (WM_USER+4)
#define WM_UPDATESETTINGS (WM_USER+5)
#define WM_OPENCONFIG (WM_USER+6)
#define WM_CLOSECONFIG (WM_USER+7)
#define WM_ADDTRAY (WM_USER+8)
#define WM_HIDETRAY (WM_USER+9)

// List of possible actions
enum action { AC_NONE=0, AC_MOVE, AC_RESIZE, AC_MENU, AC_MINIMIZE, AC_MAXIMIZE, AC_CENTER
, AC_ALWAYSONTOP, AC_CLOSE, AC_LOWER, AC_BORDERLESS, AC_KILL
, AC_ROLL, AC_ALTTAB, AC_VOLUME, AC_TRANSPARENCY, AC_HSCROLL };

#define MOUVEMENT(action) (action <= AC_RESIZE)

#endif /* ALTDRAG_RPC_H */
8 changes: 4 additions & 4 deletions hooks.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1 VERSIONINFO
FILEVERSION 1,4,5,0
PRODUCTVERSION 1,4,5,0
FILEVERSION 1,4,6,0
PRODUCTVERSION 1,4,6,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
Expand All @@ -11,10 +11,10 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Hooks for AltDrag"
VALUE "FileDescription", "Hooks for AltSnap"
VALUE "InternalName", "hooks"
VALUE "OriginalFilename", "hooks.dll"
VALUE "FileVersion", "1.45"
VALUE "FileVersion", "1.46"
VALUE "CompanyName", "Gillibert Software"
VALUE "LegalCopyright", "Stefan Sundin"
END
Expand Down

0 comments on commit 88eec63

Please sign in to comment.