Skip to content

Instantly share code, notes, and snippets.

@DankRank
Last active July 10, 2016 02:09
Show Gist options
  • Save DankRank/9551044c855da2aa47feb6e0917930c3 to your computer and use it in GitHub Desktop.
Save DankRank/9551044c855da2aa47feb6e0917930c3 to your computer and use it in GitHub Desktop.
MoveOSRS - fullscreen for oldschool runescape
#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