Jump to content

Another Boss Screen


TPaul81
 Share

Recommended Posts

Description:

Different approach on boss screen applications.

You need to have a screenshot of your desktop named cover.jpg in the same folder as the script for it to work.

I use a screenshot of an open word document with business reports, lol.

Works on Vista and XP fine.

To Do:

Mute sound while boss screen is active and restore it afterwards. Added. (My buddy's ScorpionXT suggestion, cause he does use it a lot for vids... :) )

Add password Option.

Known Bugs:

- Pressing HOME while the boss screen is visible, will make removing the boss screen inaccessible. Pressing Ctrl + Alt +Esc does exit the script. Update: Fixed.

- When Auto startup is selected, you have to manually copy the cover.jpg image for the boss screen in the startup folder. Update: Fixed. Script needs to be compiled and set fileinstall to the correct path of your cover.jpg .

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Network.ico
#AutoIt3Wrapper_outfile=BSScreen.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=Boss Screen
#AutoIt3Wrapper_Res_Description=Boss Screen hides your screen by using a previously taken snapshot.
#AutoIt3Wrapper_Res_Fileversion=1.1.0.0
#AutoIt3Wrapper_Res_LegalCopyright=TPaul
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
Opt("GUIOnEventMode", 1)
Opt("TrayIconHide", 0)
Opt("TrayMenuMode",1)

$settingsitem   = TrayCreateMenu("Settings")
$setautostart = TrayCreateItem("Autostart", $settingsitem)
TrayCreateItem("")
$aboutitem    = TrayCreateItem("About")
$exititem      = TrayCreateItem("Exit")

dim $coverOn
dim $xBackGround = @DesktopWidth
dim $yBackGround = @DesktopHeight
dim $Looper1 = 1
dim $ScreenHide = 0

;Pressing Ctrl - Alt - ESC exits the program
HotKeySet("^!{ESC}", "Exit1")
;Pressing END clears the cover up screen
HotKeySet("{END}", "Clear1")
;Pressing HOME splashes the cover up screen
HotKeySet("{HOME}", "Cover1")

Func Exit1()
    Exit
EndFunc ;==>EXIT1

Func Clear1()
    If $ScreenHide = 1 Then
    GUIDelete($coverOn) 
    Send("{VOLUME_MUTE}")
    $ScreenHide = 0
    Sleep(100)
    EndIf
EndFunc

Func Cover1()
    If $ScreenHide = 0 Then
    $coverOn = GUICreate("Boss Screen v.1", @DesktopWidth, @DesktopHeight, 0, 0, 0x80000000 & 0x00040000)
    $BG_Default = GUICtrlCreatePic("cover.JPG", 0, 0, @DesktopWidth, @DesktopHeight, 0x0200)
    Send("{VOLUME_MUTE}")
    $ScreenHide = 1
    GUISetState()
    Sleep(100)
    EndIf
EndFunc

Func AutostartOn()
;==> Startup functionality when script is compiled

If Not FileExists(@StartupCommonDir & "\" & @ScriptName) Then
    FileCopy(@WorkingDir & "\" & @ScriptName, @StartupCommonDir & "\" & @ScriptName)
EndIf
EndFunc

While $Looper1 <> 0

$msg = TrayGetMsg()

    Select
        Case $msg =0
            
        Case $msg = $aboutitem
            Msgbox(64,"About:","Boss Screen v.1.1" & @CRLF & "Copyright TPaul - 2008")
        Case $msg = $exititem
            Exit
        Case $msg = $setautostart
            Call("AutostartOn")
    EndSelect

$MOUSEPOS = MouseGetPos()

    Select
        Case $MOUSEPOS[0] = 0 And $ScreenHide=0
            Call("Cover1")

        Case $MOUSEPOS[0] = 0 And $ScreenHide=1
            Call("Clear1")
        
    EndSelect
    Sleep(100)
WEnd
Edited by TPaul81
Link to comment
Share on other sites

Swift is right, bmp is better when you can't save jpg images with 100% quality.... What if many programs (like paint) are blocked? You could add a hotkey to capture a quick screenshot with the _ScreenCapture command.

PS: milas ellinika?

Link to comment
Share on other sites

Swift is right, bmp is better when you can't save jpg images with 100% quality.... What if many programs (like paint) are blocked? You could add a hotkey to capture a quick screenshot with the _ScreenCapture command.

PS: milas ellinika?

I chose .jpg as the demo image format for the code for a couple of reasons... First of all when loaded in the ram it has a smaller signature and at some time when I originally wrote the script, I did need the smaller signature. Then its easier for me to save a screenshot using .jpg with 80% compression which has a good look.

PS: Nai, milao.

Link to comment
Share on other sites

Yeah. If you are really so desperate to use .bmp try:

Func _ReduceMemory($i_PID = -1)
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf

    Return $ai_Return[0]
EndFunc  ;==>_ReduceMemory
Link to comment
Share on other sites

Can we also use png ?? , because i felt png is the best for viewing and editing

AutoIt doesnt support PNG images, as far as I know. Also PNG images arent the best for 2 reasons:

1. PNG-24bit have the quality of uncompressed vectorised JPG = JPG 90%-100% QUALITY

2. PNG-24bit are BIG BIG BIG FILES, almost as big as BMP.

3. PNG-8bit are not even worth mentioning, since all they support are 256 colors max, just like a GIF, so the fake screen wouldnt look convincing.

So, I'd suggest that if you dont like JPG's, use BMP and James' memory reduction function.

Edited by TPaul81
Link to comment
Share on other sites

AutoIt doesnt support PNG images, as far as I know. Also PNG images arent the best for 2 reasons:

1. PNG-24bit have the quality of uncompressed vectorised JPG = JPG 90%-100% QUALITY

2. PNG-24bit are BIG BIG BIG FILES, almost as big as BMP.

3. PNG-8bit are not even worth mentioning, since all they support are 256 colors max, just like a GIF, so the fake screen wouldnt look convincing.

So, I'd suggest that if you dont like JPG's, use BMP and James' memory reduction function.

1. PNG's don't have the quality of JPG, you have to be kidding?

2. No they aren't, have you even looked at a PNG?

This PNG is 133KB:

Posted Image

Link to comment
Share on other sites

I will try to explain, probably got misunderstood because english isnt my native language.

1.& 2. A png 24-bit is not compressed. A jpg is by definition compressed, thus we use the compression ratio of a jpg as a quality index. A jpg and a png containing the exact same image with the exact same dimensions would have different sizes and the png would be bigger. Try it in Adobe Photoshop. Because PNG's are not compressed they are bigger and THEY DO have better quality, which comes from their bigger size.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...