Jump to content

Mem usage


 Share

Recommended Posts

well... i was bored.. and did some research on the forums... couldn't find much... and the stuff i DID find was like... dllcall and complex stuff

THEN i found something alittle more simple

haha check this out...

#NoTrayIcon
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
HotKeySet ('{ESC}', '_Exit_')
HotKeySet ('+{DEL}', '_Show_TM_')
Opt ('GUIoneventmode',1)
$Gui = GUICreate (@ScriptName, 200,100, -1, -1, -2138570616)
GUISetBkColor (0xFFFFA2, $Gui)
$lStatus = GUICtrlCreateLabel ('', 1, 1, 198,98, $SS_CENTER)
GUICtrlSetBkColor (-1, 0x000000)
GUICtrlSetFont (-1, 60, '', '', 'Fixedsys')
GUICtrlSetColor (-1, 0xFFFFA2)
GUICtrlSetOnEvent (-1, '_Win_Move_')
GUISetOnEvent ($GUI_EVENT_CLOSE,'_exit_',$Gui)
GUISetState()
WinSetTrans ($Gui, '', 50)
WinSetOnTop ($GUI, '', 1)
Run(@SystemDir & '\taskmgr.exe', '', @SW_HIDE)
While 1
    $iStatus = StatusbarGetText ('Windows Task Manager', '', 2)
    GUICtrlSetData ($lStatus, StringTrimLeft ($iStatus, 10))
    Sleep (300)
    If Not ProcessExists ('Taskmgr.exe') Then Run(@SystemDir & '\taskmgr.exe', '', @SW_HIDE)
WEnd
Func _Win_Move_ ()
    $MouseXY = MouseGetPos ()
    $WinXY = WinGetPos ($Gui)
    $xOff = $MouseXY[0] - $WinXY[0]
    $yOFF = $MouseXY[1] - $WinXY[1]
    While _IsPressed ('01')
        WinMove ($Gui, '',MouseGetPos (0) - $xOff ,MouseGetPos (1) - $yOFF)
        Sleep (100)
    WEnd
EndFunc
Func _Show_TM_ ()
    WinSetState ('Windows Task Manager', '', @SW_SHOW)
EndFunc
Func _Exit_ ()
    ProcessClose ("TaskMgr.exe")
    Exit
EndFunc
Edited by CodyBarrett
Link to comment
Share on other sites

What happens if I start the script and then want to access task manager? Or any time after that for that matter! I am now running my computer task manager less, so at least exit it in your exit function...

CODE
#include <Misc.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#include <StaticConstants.au3>

#NoTrayIcon

HotKeySet ("{ESC}", "_Exit_")

Opt ("GUIoneventmode", 1)

$Gui = GUICreate (@ScriptName, 200,100, -1, -1, -2138570616)

GUISetBkColor (0xFFFFA2, $Gui)

$lStatus = GUICtrlCreateLabel ("", 1, 1, 198,98, $SS_CENTER)

GUICtrlSetBkColor (-1, 0x000000)

GUICtrlSetFont (-1, 60, "", "", "Fixedsys")

GUICtrlSetColor (-1, 0xFFFFA2)

GUICtrlSetOnEvent (-1, "_Win_Move_")

GUISetOnEvent ($GUI_EVENT_CLOSE, "_exit_", $Gui)

GUISetState ()

WinSetTrans ($Gui, "", 50)

WinSetOnTop ($GUI, "", 1)

Run (@SystemDir & "\taskmgr.exe", "", @SW_HIDE)

While 1

$iStatus = StatusbarGetText ("Windows Task Manager", "", 2)

GUICtrlSetData ($lStatus, StringTrimLeft ($iStatus, 10))

Sleep (300)

If Not ProcessExists ("Taskmgr.exe") Then Run(@SystemDir & "\taskmgr.exe", "", @SW_HIDE)

WEnd

Func _Win_Move_ ()

$MouseXY = MouseGetPos ()

$WinXY = WinGetPos ($Gui)

$xOff = $MouseXY[0] - $WinXY[0]

$yOFF = $MouseXY[1] - $WinXY[1]

While _IsPressed ('01')

WinMove ($Gui, '',MouseGetPos (0) - $xOff ,MouseGetPos (1) - $yOFF)

Sleep (100)

WEnd

EndFunc ; ==> _Win_Move_

Func _Exit_ ()

ProcessClose ("TaskMgr.exe")

Exit

EndFunc ; ==> _Exit_

MDiesel

Edited by mdiesel
Link to comment
Share on other sites

that would work too... or just double click on the icon in the taskbar?? that brrings it up for me everytime

EDIT

on my home computer it does not on all.. so yeah i added

[sHIFT] + [DEL] to show the taskt manager while in use...

and the processclose you suggested mDiesel

Edited by CodyBarrett
Link to comment
Share on other sites

Don't forget that you can always bring up the task manager with Shift+Ctrl+Esc

Send("+^{ESC}")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

the taskmanager icon in the taskbar...

and Geosoft.. i just added [sHIFT] + [DEL] to bring it up.. your code doesn't work.. thanks to Mdiesel for the idea

Edited by CodyBarrett
Link to comment
Share on other sites

Geosoft, normally you can... But after running his (Original) script - no. I run a simple process close on it and i can run it again. Cody saw sense in the end though :)

EDIT

on my home computer it does not on all.. so yeah i added

[sHIFT] + [DEL] to show the taskt manager while in use...

and the processclose you suggested mDiesel

Much Better :party: One other thing, I know you can't solve it either... Task manager always leaves the status bar blank for the first few seconds after opening. So I just get flickering for a bit...

I am actually getting to like this script, and I am probably going to use it a lot. I don't know why though!

MDiesel

Link to comment
Share on other sites

thank you.. and its because i didn't originaly set the status to 0%... but yeah a simple fix.. doubt it if i will do it though.. to lazy just for 2 characters... haha i find it usefully.. because its transparent and movable

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...