Advanced taskmanager, fico..

« Older   Newer »
  Share  
I.Ren
icon1  CAT_IMG Posted on 26/2/2008, 18:26     +1   -1




Il programma si tratta di un taskmanager "avanzato"..

Il codice di autoit è il seguente, ma potete trovare tranquillamente l'exe qui sotto..

CODICE
#include <GUIConstants.au3>
Global Const $prog = 'Advanced task manager '
Global Const $mem = MemGetStats()
$gui = GUICreate($prog & '- By I.Ren',500,500)
$proc = ProcessList()
$list = GUICtrlCreateList('',0,0,500,400)
GUICtrlSetColor(-1,0x00cc5)
$Pro=ProcessList()
GUICtrlSetData($List,"")
for $i = 1 to $Pro[0][0]
   GUICtrlSetData($List,$Pro[$i][0])
Next
$close = GUICtrlCreateButton ('Close',5,410,80,20)
$add  = GUICtrlCreateButton ('Add process',90,410,80,20)
$aggiorna = GUICtrlCreateButton ('Refresh list',180,410,80,20)
$finestre1 = GUICtrlCreateButton ('Kill a window',270,410,80,20)
$finestre2 = GUICtrlCreateButton ('Kill all windows',360,410,80,20)
$status = GUICtrlCreateLabel ("RAM Left: " & $mem[2] &  '   KB            Total ram: ' & $mem[1] & '  KB             Memory Load:  '  & $mem[0] & "%",1,482,498,16,BitOr($SS_SIMPLE,$SS_SUNKEN))
GUICtrlSetColor(-1,0xFF0000)
GUICtrlSetFont($status,10,400,1,'Arial')
$shut = GUICtrlCreateButton ('Shutdown',5,440,80,20)
$off = GUICtrlCreateButton ('Log off',90,440,80,20)
$restart = GUICtrlCreateButton ('Reboot',180,440,80,20)
$standby = GUICtrlCreateButton ('Standby',270,440,80,20)
$congelo = GUICtrlCreateButton ('Hibernate',360,440,80,20)
$info = GUICtrlCreateButton ('PCInfo',450,420)
GUISetBkColor(0xDDDDDD)
GUISetState ( )

While 2
Switch GUIGetMsg ()
Case $info
_info ()
Case $congelo
TrayTip('','Hibernate in 10 seconds',9)
Sleep(10000)
Shutdown(64)
If Not Shutdown(64) Then MsgBox(0,$prog & '- error!','Hibernate its impossible!' & @cr & @cr & "Possible causes: Your operative system it's not windows vista.")
Case $standby
TrayTip('','Standby in 10 seconds',9)
Sleep(10000)
Shutdown(32)
Case $restart
TrayTip('','Reboot in 10 seconds',9)
Sleep(10000)
Shutdown(2)
Case $off
TrayTip('','logOff in 10 seconds',9)
Sleep(10000)
Shutdown(0)
Case $shut
TrayTip('','Shutdown in 10 seconds',9)
Sleep(10000)
Shutdown(1)

Case $finestre2
$var = WinList()
$finestre = For $i = 1 to $var[0][0]
If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
   WinKill($var[$i] [0])
EndIf

Case $finestre1
$nome = InputBox('Name','Insert the name of the window')
WinKill($nome)

Case $aggiorna
$Pro=ProcessList()
GUICtrlSetData($List,"")
for $i = 1 to $Pro[0][0]
   GUICtrlSetData($List,$Pro[$i][0])
Next
GUICtrlDelete($status)
$status = GUICtrlCreateLabel ("RAM Left: " & $mem[2] &  '   KB                                                           Memory Load:  '  & $mem[0] & "%",1,482,498,16,BitOr($SS_SIMPLE,$SS_SUNKEN))
GUICtrlSetColor(-1,0xFF0000)
GUICtrlSetFont($status,10,400,1,'Arial')        
       Case $add
       $toAdd = FileOpenDialog('',@desktopdir,'All file (*.*)')
If @error <> 1 Then
       Run($toAdd)
$Pro=ProcessList()
   GUICtrlSetData($List,"")
   for $i = 1 to $Pro[0][0]
   GUICtrlSetData($List,$Pro[$i][0])
Next
EndIf

If @error = 1 Then MsgBox(0,'','No file exe select')
       
       Case $close
       $domanda = MsgBox(20,$prog & '- answer','Are you sure to terminate the process?')
       Select
       Case 6;Si
   $ToClose = GUICtrlRead($list)
If ProcessExists($toClose) Then
       $byeProcess = ProcessClose($toClose)
$Pro=ProcessList()
GUICtrlSetData($List,"")
for $i = 1 to $Pro[0][0]
   GUICtrlSetData($List,$Pro[$i][0])
Next
EndIf

If Not ProcessExists($toClose) Then
       MsgBox(0,$prog & '- Error','The process dont exist!' & @CR & @CR & 'Try to refresh the list..')
EndIf
EndSelect
       
       Case $GUI_EVENT_CLOSE
       ExitLoop
EndSwitch
WEnd

Func IsVisible($handle)
 If BitAnd( WinGetState($handle), 2 ) Then
   Return 1
 Else
   Return 0
 EndIf

EndFunc

Func _info()
GuiCreate('PCinfo - by Autoit example, created by Para', 469, 639,(@DesktopWidth-469)/2, (@DesktopHeight-639)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$VOL = DriveGetLabel("C:\")
$SERIAL = DriveGetSerial("C:\")
$TOTAL = DriveSpaceTotal("C:\")
$FREE = DriveSpaceFree("C:\")

$ComputerName = GuiCtrlCreateLabel("Computer Name", 10, 10, 150, 20)
$CurrentUserName = GuiCtrlCreateLabel("Current User Name", 10, 40, 150, 20)
$Operatingsystem = GuiCtrlCreateLabel("Operating System", 10, 70, 150, 20)
$ServicePack = GuiCtrlCreateLabel("Service Pack", 10, 100, 150, 20)
$VolumeLabel = GuiCtrlCreateLabel("C: Volume Label", 10, 130, 150, 20)
$SerialNumber = GuiCtrlCreateLabel("C: Serial Number", 10, 160, 150, 20)
$TotalSpace = GuiCtrlCreateLabel("C: Total Space", 10, 190, 150, 20)
$FreeSpace = GuiCtrlCreateLabel("C: Free Space", 10, 220, 150, 20)
$IpAddress = GuiCtrlCreateLabel("Ip Address", 10, 250, 150, 20)
$StartupDirectory = GuiCtrlCreateLabel("Startup Directory", 10, 280, 150, 20)
$WindowsDirectory = GuiCtrlCreateLabel("Windows Directory", 10, 310, 150, 20)
$SystemFolderDirectory = GuiCtrlCreateLabel("System Folder Directory", 10, 340, 150, 20)
$DesktopDirectory = GuiCtrlCreateLabel("Desktop Directory", 10, 370, 150, 20)
$MyDocumentsDirectory = GuiCtrlCreateLabel("My Documents Directory", 10, 400, 150, 20)
$ProgramFileDirectory = GuiCtrlCreateLabel("Program File Directory", 10, 430, 150, 20)
$StartMenuDirectory = GuiCtrlCreateLabel("Start Menu Directory", 10, 460, 150, 20)
$DesktopWidth = GuiCtrlCreateLabel("Desktop Width (Pixels)", 10, 520, 150, 20)
$TemporaryFileDirectory = GuiCtrlCreateLabel("Temporary File Directory", 10, 490, 150, 20)
$DesktopHeight = GuiCtrlCreateLabel("Desktop Height (Pixels)", 10, 550, 150, 20)
$Date = GuiCtrlCreateLabel("Date", 10, 580, 150, 20)
$Time = GuiCtrlCreateLabel("Time", 10, 610, 150, 20)
$Input_ComputerName = GuiCtrlCreateInput("" & @ComputerName, 180, 10, 280, 20)
$Input_CurrentUserName = GuiCtrlCreateInput("" & @UserName, 180, 40, 280, 20)
$Input_OperatingSystem = GuiCtrlCreateInput("" & @OSTYPE, 180, 70, 280, 20)
$Input_ServicePack = GuiCtrlCreateInput("" & @OSServicePack, 180, 100, 280, 20)
$Input_VolumeLabel = GuiCtrlCreateInput("" & $VOL, 180, 130, 280, 20)
$Input_SerialNumber = GuiCtrlCreateInput("" & $SERIAL, 180, 160, 280, 20)
$Input_TotalSpace = GuiCtrlCreateInput("" & $TOTAL, 180, 190, 280, 20)
$Input_FreeSpace = GuiCtrlCreateInput("" & $FREE, 180, 220, 280, 20)
$Input_IpAddress = GuiCtrlCreateInput("" & @IPAddress1, 180, 250, 280, 20)
$Input_StartupDirectory = GuiCtrlCreateInput("" & @StartupDir, 180, 280, 280, 20)
$Input_WindowsDirectory = GuiCtrlCreateInput("" & @WindowsDir, 180, 310, 280, 20)
$Input_SystemFolderDirectory = GuiCtrlCreateInput("" & @SystemDir, 180, 340, 280, 20)
$Input_DesktopDirectory = GuiCtrlCreateInput("" & @DesktopDir, 180, 370, 280, 20)
$Input_MyDocumentsDirectory = GuiCtrlCreateInput("" & @MyDocumentsDir, 180, 400, 280, 20)
$Input_ProgramFilesDirectory = GuiCtrlCreateInput("" & @ProgramFilesDir, 180, 430, 280, 20)
$Input_StartMenuDirectory = GuiCtrlCreateInput("" & @StartMenuDir, 180, 460, 280, 20)
$Input_TemporaryFileDirectory = GuiCtrlCreateInput("" & @TempDir, 180, 490, 280, 20)
$Input_DesktopWidth = GuiCtrlCreateInput("" & @DesktopWidth, 180, 520, 280, 20)
$Input_DesktopHeight = GuiCtrlCreateInput("" & @DesktopHeight, 180, 550, 280, 20)
$Input_Date = GuiCtrlCreateInput("(MONTH)(DAY)(YEAR) " & @MON & "-" & @MDAY & "-" & @YEAR, 180, 580, 280, 20)
$Input_Time = GuiCtrlCreateInput("(HOUR)(MIN)(SEC) " & @HOUR &  ":" & @MIN & ":" & @SEC, 180, 610, 280, 20)
GUISetBkColor(0xDDDDDD)
EndFunc
GuiSetState()
While 1
   $msg = GuiGetMsg()
   Select
   Case $msg = $GUI_EVENT_CLOSE
       If WinExists('PCinfo') Then
       WinKill('PCinfo')
       GUISwitch($gui)
EndIf
       ExitLoop
   EndSelect
WEnd
Exit


Ditemi che ne pensate!

Download attachment
advanced_taskmanager.zip ( Number of downloads: 75 )

 
Top
Opale
CAT_IMG Posted on 26/2/2008, 20:10     +1   -1




ignoranza: Hibernate sarebbe?
 
Top
fedexweb
CAT_IMG Posted on 26/2/2008, 21:32     +1   -1




cavolo..................................
e bellissimo....mi complimento!!
ps: se lo traducevi in italiano puoi avere piu' chance non credi?
 
Top
gesucristo91
CAT_IMG Posted on 26/2/2008, 23:51     +1   -1




wonderful, dico sul serio ;)
 
Top
lknokl
CAT_IMG Posted on 27/2/2008, 00:27     +1   -1




Bellissimo ;) complimenti!!
 
Top
I.Ren
CAT_IMG Posted on 27/2/2008, 13:56     +1   -1




grazie! a tt!!

CITAZIONE
ignoranza: Hibernate sarebbe?

hibernate = congela..

si può fare solo su vista..
 
Top
5 replies since 26/2/2008, 18:26   306 views
  Share