q335r49
Joined: 26 Oct 2005 Posts: 17
|
Posted: Thu Aug 14, 2008 7:22 am Post subject: Poor Man's fullscreen |
|
|
I wrote this some time ago, because I was using Microsoft Word and could't get a decent full screen. I've started using a word processor again, and I thought I might share it. Basically, it doesn't remove any toolbars, but lets you draw a black border around the window, to black out everything behind it -- thus, "poor man's"
Instructions:
1. When you see the screen go dim, click and drag a rectangle to determine the new screen width.
2. Mouse over blacked out portion to reveal
2. Mouse to top left corner to quit.
| Code: | #SingleInstance force
#NoEnv
CoordMode, mouse, screen
SetWorkingDir %A_ScriptDir%
WIN_TITLE = BLACK_BORDER
SCR_BOX := "W" . A_ScreenWidth . " H" . A_ScreenHeight . " X0 Y0"
SCR_REG := "0-0 " . A_ScreenWidth . "-0 " . A_ScreenWidth . "-" . A_ScreenHeight . " 0-" . A_ScreenHeight . " 0-0"
Gui, Color, Black
Gui +LastFound +AlwaysOnTop +ToolWindow -Caption
if 0 >= 1
{
if 0 = 1
{
MouseGetPos, X,Y, WinID
Winget, Section, ProcessName, ahk_id %WinID%
IniRead, AY, MyBlackBorder.ini,%Section%,AY, 40
IniRead, BY, MyBlackBorder.ini,%Section%,BY, 760
IniRead, AX, MyBlackBorder.ini,%Section%,AX, 40
IniRead, BX, MyBlackBorder.ini,%Section%,BX, 1240
}
else if 0 = 4
{
AX = %1%
AY = %2%
BX = %3%
BY = %4%
}
else
ExitApp
WinSet, Region, % SCR_REG . " " . AX . "-" . AY . " " . BX . "-" . AY . " " . BX . "-" . BY . " " . AX . "-" . BY . " " . AX . "-" . AY
Gui, show, %SCR_BOX%, %WIN_TITLE%
}
else
{
Winset, Transparent, 200
Gui, show, %SCR_BOX%, %WIN_TITLE%
Loop ;Wait for first mouse click
{
MouseGetPos, AX, AY
GetKeyState, MouseDown, LButton, P
if MouseDown = D
Break
Sleep 20
}
Loop ;Wait for release
{
MouseGetPos, BX, BY
WinSet, Region, % SCR_REG . " " . AX . "-" . AY . " " . BX . "-" . AY . " " . BX . "-" . BY . " " . AX . "-" . BY . " " . AX . "-" . AY
GetKeyState, MouseDown, LButton, P
if MouseDown != D
Break
Sleep 20
}
Winset, Transparent, 255
}
OnMessage(0x200, "WM_MOUSEMOVE")
Return
WM_MOUSEMOVE()
{
global AX, BX, AY, BY
Fade(WIN_TITLE, 32)
Gui, hide
Loop
{
MouseGetPos, X, Y
if (X>AX && X<BX && Y>AY && Y<BY)
break
if (X = 0 && Y = 0)
{
Winget, Section, ProcessName, A
IniWrite, %AX%, MyBlackBorder.ini,%Section%,AX
IniWrite, %BX%, MyBlackBorder.ini,%Section%,BX
IniWrite, %AY%, MyBlackBorder.ini,%Section%,AY
IniWrite, %BY%, MyBlackBorder.ini,%Section%,BY
ExitApp
}
Sleep, 100
}
Gui, show, NA
Fade(WIN_TITLE, -32)
return
}
Fade(Title, Speed=10)
{
IfWinNotExist, %Title%
return 1
WinGet, TransValue, Transparent
TransValue := (TransValue = "" ? (Speed > 0 ? 255 : 0) : TransValue)
Loop
{
TransValue-=Speed
if TransValue between 1 and 254
Winset, Transparent, %TransValue%
else
{
WinSet, Transparent, % Speed > 0 ? 0 : 255
return 0
}
}
} |
|
|