Last active
July 10, 2016 02:09
-
-
Save DankRank/9551044c855da2aa47feb6e0917930c3 to your computer and use it in GitHub Desktop.
MoveOSRS - fullscreen for oldschool runescape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#define WINVER 0x0500 | |
#define _WIN32_WINNT 0x0500 | |
#include <windows.h> | |
#include <tchar.h> | |
#define ADSIZE 96 | |
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { | |
HWND hw = FindWindow(nullptr, _T("Old School RuneScape")); | |
if (hw == nullptr) { | |
MessageBox(nullptr, _T("Couldn't find OSRS window"), _T("MoveOSRS by DankRank"), MB_ICONERROR); | |
return 1; | |
} | |
SetWindowLong(hw, GWL_STYLE, GetWindowLong(hw, GWL_STYLE) & ~WS_BORDER & ~WS_THICKFRAME & ~WS_SYSMENU & ~WS_CAPTION | WS_POPUP); | |
MONITORINFO mi = { sizeof(MONITORINFO) }; | |
GetMonitorInfo(MonitorFromWindow(hw, MONITOR_DEFAULTTONEAREST), &mi); | |
RECT &r = lstrcmp(_T("/w"), lpCmdLine) ? mi.rcMonitor : mi.rcWork; | |
SetWindowPos( | |
hw, (HWND)-1, | |
r.left, r.top - ADSIZE, | |
r.right - r.left, r.bottom - r.top + ADSIZE, | |
SWP_NOZORDER); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment