-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsublime_glitch_fixer.bas
36 lines (27 loc) · 1.09 KB
/
sublime_glitch_fixer.bas
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
30
31
32
33
34
35
36
#Include "windows.bi"
#Include "useful/registry_standalone.bi"
Dim appname As ZString * MAX_PATH
GetModuleFilename(GetModuleHandle(NULL), @appname, SizeOf(appname))
Var reg = RegObj.RegLib(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run")
reg.SetValue("Sublime Glitch Fixer", appname)
Function EnumWindowsProc(hWndSubl As HWND, lParam As LPARAM) As BOOL
Dim cn As ZString * 100
GetClassName(hWndSubl, @cn, SizeOf(cn))
If cn = "PX_WINDOW_CLASS" Then
Dim rc As RECT
GetWindowRect(hWndSubl, @rc)
MoveWindow(hWndSubl, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top - 25, TRUE)
MoveWindow(hWndSubl, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE)
EndIf
Return TRUE
End Function
Dim lastVisibility As Boolean = TRUE
Do
Sleep 250, 1
Var hWnd = FindWindow("VirtualConsoleClass", NULL)
Var visibility = IsWindowVisible(hWnd) ' If hWnd is NULL it will also be FALSE...
If visibility <> lastVisibility AndAlso visibility = FALSE Then
EnumWindows(@EnumWindowsProc, NULL)
EndIf
lastVisibility = visibility
Loop