Jump to content

Simple funny toolbox


electrico
 Share

Recommended Posts

This is simple funny toolbox, that can check space on drives, (please correct this function if you want and can do it better), shows your IP adress, date, and turn off pc after the time you specify (must be confirmed with button press).

Function Alt+SHift+F8 you can see my photo. :D

All decorations is for my girl, to make program more attractive.

Everything in graphics made by windows mspanit.exe and nothing more. A bit nooby but for me OK as I am not really interested in design.

If someone tested and liked it, or can correct something to be better, post reply please :huggles:

All files are attached.

Reason for edit: direct link to download the source files:

www.cyberspace.times.lv/src.rar

Now have fun!

Edited by electrico
Link to comment
Share on other sites

Playlet, thank you but i noticed only 2 functions. It is 1)it checks LAN status, 2)a bit corrected "turn off pc after" function. But however, this function does not work or maybe I am wrong with the data I enter? I tryed 00:20, 20, etc. It replyes "You did not enter time !" Notify me if there is something else and thanks for your attention!

Link to comment
Share on other sites

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=boss.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;PEREDELATJ na DriveGetType etc..
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiConstants.au3>
#include <Date.au3>
#include <EditConstants.au3>
#include <Inet.au3>
#include <sound.au3>
#include <SendMessage.au3>
Global $drive, $mygui, $button1, $button2, $button5, $button4, $drive2, $drive3, $drive4,  $dateis, $button3, $shedit, $label1, $label3, $myip, $button6, $label_a, $label_b, $intdrive, $intdrive2, $intdrive1, $intdrive3, $number, $checkboxsound
Global $soundfile = _SoundOpen(@TempDir & "\sound.mp3")
Global Const $SC_DRAGMOVE = 0xF012
Opt("GuiOnEventMode", 1)
Opt("MustDeclareVars", 1)
Opt("TrayAutoPause", 0)
HotKeySet ("+!{F8}", "secretfunc")
FileInstall("mylogo.bmp", @TempDir & "\mylogo.bmp")
FileInstall("sound.mp3", @TempDir & "\sound.mp3")
FileInstall("dale.jpg", @TempDir & "\dale.jpg")
FileInstall("chip.bmp", @TempDir & "\chip.bmp")
$mygui = GuiCreate ("Simple ToolBox", 220, 300, -1, -1, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST)
    GuiSetState (@SW_SHOW)
GuiSetBkColor(0xffffff)
GuiCtrlCreatePic(@TempDir & "\dale.jpg", 130, 30, 93, 124)
GuiCtrlCreatePic(@TempDir & "\chip.bmp", 20, 85, 76, 129)
    GuiSetOnEvent($GUI_EVENT_CLOSE, "Close")
    GuiSetOnEvent($GUI_EVENT_PRIMARYDOWN, "messagetogui")
Func messagetogui()
    _SendMessage($mygui, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc
$label1 = GuiCtrlCreateLabel ("Check free space:", 20, 5)
GuiCtrlSetColor ($label1, 0xcc00cc)
$button1 = GuiCtrlCreateButton ("Drive E:", 20, 23)
GuiCtrlSetOnEvent ($button1, "checkfreespaceone")
$button2 = GuiCtrlCreateButton ("Drive D:", 90, 23)
GuiCtrlSetOnEvent ($button2, "checkfreespaceond")
$button5 = GuiCtrlCreateButton ("Drive C:", 20, 58)
GuiCtrlSetOnEvent ($button5, "checkfreespaceonc")
$button4 = GuiCtrlCreateButton ("Drive F:", 90, 58)
GuiCtrlSetOnEvent ($button4, "checkfreespaceonf")
$dateis = _DateAdd ("d", 0, _NowCalcDate())
$label_a = GuiCtrlCreateLabel ("Today's date is:       " & $dateis, 20, 280)
$myip = @IPAddress1
If $myip = "127.0.0.1" Then
    $label_b = GuiCtrlCreateLabel ("You are not connected to internet", 20, 210)
Else
    $label_b = GuiCtrlCreateLabel ("Your IP adress is:  " & $myip, 15, 210)
EndIf
$Label3 = GuiCtrlCreateLabel ("Turn off PC after: ", 20, 240)
$shedit = GuiCtrlCreateEdit ("", 120, 240, 30, 20, $ES_CENTER)
$button3 = GuiCtrlCreateButton ("Set", 160, 240, 30, 20)
GuiCtrlSetOnEvent($button3 , "shutdowncpu")
_SoundPlay($soundfile)
$checkboxsound = GUICtrlCreateCheckbox("No Sound", 147, 3)
GuiCtrlSetOnEvent ($checkboxsound, "soundplay1")
Func soundplay1()
Local $checkme = GuiCtrlRead($checkboxsound)
If $checkme = $GUI_CHECKED Then
    _SoundPause($soundfile)
ElseIf $checkme = $GUI_UNCHECKED Then
    _SoundPlay($soundfile)
EndIF
EndFunc
Func shutdowncpu()
    $number = GUICtrlRead($shedit)
    If $number <> "" And StringIsDigit ($number) Then
    GuiCtrlSetState ($button1, $GUI_DISABLE)
    GuiCtrlSetState ($button2, $GUI_DISABLE)
    GuiCtrlSetState ($button3, $GUI_DISABLE)
    GuiCtrlSetState ($shedit, $GUI_DISABLE)
    GuiCtrlSetState ($label3, $GUI_DISABLE)
    GuiCtrlSetState ($button5, $GUI_DISABLE)
    GuiCtrlSetState ($button4, $GUI_DISABLE)
    GuiCtrlSetState ($label_a, $GUI_DISABLE)
    GuiCtrlSetState ($label_b, $GUI_DISABLE)
    Sleep (3000)
    GuiSetState (@SW_MINIMIZE)
    MsgBox (64, "Information:", "Computer will be turned off automatically after " & $number & " minutes")
    Sleep ($number*60000)
    MsgBox(64, "", "Is ok.")
Else
    MsgBox(48, "", "Enter number of minutes please.")
EndIf
EndFunc
Func checkfreespaceone()
    $drive = DriveSpaceFree ("E:\")
    $intdrive = Int ($drive)
MsgBox (64, "Free space on drive E:", "There is " & $intdrive & " MB free space.")
If @HomeDrive = "E:" Then
    MsgBox(48, "Homedrive!", "For normal CPU functioning you must have more than 1 GB (1024 MB) on this drive!")
EndIF
EndFunc
Func checkfreespaceond()
    $drive2 = DriveSpaceFree ("D:\")
    $intdrive2 = Int ($drive2)
MsgBox (64, "Free space on drive D:", "There is " & $intdrive2 & " MB free space.")
If @HomeDrive = "D:" Then
    MsgBox(48, "Homedrive!", "For normal CPU functioning you must have more than 1 GB (1024 MB) on this drive!")
EndIF
EndFunc
Func Close()
    Exit
EndFunc
Func checkfreespaceonf()
    $drive3 = DriveSpaceFree ("F:\")
    $intdrive3 = Int ($drive3)
MsgBox (64, "Free space on drive F:", "There is " & $intdrive3 & " MB free space.")
If @HomeDrive = "F:" Then
    MsgBox(48, "Homedrive!", "For normal CPU functioning you must have more than 1 GB (1024 MB) on this drive!")
EndIF
EndFunc
Func checkfreespaceonc()
    $drive4 = DriveSpaceFree ("C:\")
    $intdrive1 = Int ($drive4)
MsgBox (64, "Free space on drive C:", "There is " & $intdrive1 & " MB free space.")
If @HomeDrive = "C:" Then
    MsgBox(48, "Homedrive!", "For normal CPU functioning you must have more than 1 GB (1024 MB) on this drive!")
EndIF
EndFunc
Func secretfunc()
    GuiCreate ("Programmer's signature:", 420, 200)
    GuiSetState(@SW_SHOW)
    GuiCtrlCreatePic (@TempDir & "\mylogo.bmp", 0, 0, 420, 200)
    Sleep (10000)
    GuiDelete()
EndFunc
While 1
    Sleep (10)
WEnd

This is I think final version of this nooby script. HomeDrive detect before space warning was added, and window border removed - this wiev I like more :D Playlet, thanks for the help and I think you will like this version. Also thanks for Melba23 ofc, for the help, removing borders and keep window movable.

Edited by electrico
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...