-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfullWindow.js
More file actions
29 lines (24 loc) · 1.02 KB
/
fullWindow.js
File metadata and controls
29 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// https://akelpad.sourceforge.net/forum/viewtopic.php?p=24434#p24434
// https://infocatcher.ucoz.net/js/akelpad_scripts/fullWindow.js
// https://github.com/Infocatcher/AkelPad_scripts/blob/master/fullWindow.js
// (c) Infocatcher 2014
// Version: 0.1.0 - 2014-04-03
// Author: Infocatcher
//// Just like full screen mode, but preserve window size and position
// Required FullScreen plugin!
var hMainWnd = AkelPad.GetMainWnd();
var oSys = AkelPad.SystemFunction();
var lpRect;
if(
hMainWnd
&& (lpRect = AkelPad.MemAlloc(16 /*sizeof(RECT)*/))
&& oSys.Call("user32::GetWindowRect", hMainWnd, lpRect)
) {
var x = AkelPad.MemRead(_PtrAdd(lpRect, 0), 3 /*DT_DWORD*/);
var y = AkelPad.MemRead(_PtrAdd(lpRect, 4), 3 /*DT_DWORD*/);
var w = AkelPad.MemRead(_PtrAdd(lpRect, 8), 3 /*DT_DWORD*/) - x;
var h = AkelPad.MemRead(_PtrAdd(lpRect, 12), 3 /*DT_DWORD*/) - y;
AkelPad.Call("FullScreen::Main");
oSys.Call("user32::SetWindowPos", hMainWnd, 0, x, y, w, h, 0x14 /*SWP_NOZORDER|SWP_NOACTIVATE*/);
}
lpRect && AkelPad.MemFree(lpRect);