Jump to content

persistent windows task manager


Recommended Posts

I needed something that would reopen Windows Task Manager for me whenever i accidentally close it.

Got tired of pressing Ctrl+Shift+Esc all the time, and then having to move the window to an out-of-the-way corner.

Wrote this and configured Windows to run it at startup.

;~ Written for Win7 x64

Opt("SendKeyDelay",125)
Opt("MouseClickDelay",125)

While 1
If ProcessExists("taskmgr.exe") Then
Sleep(125)
Else
$resX=@DesktopWidth
$resY=@DesktopHeight
;~ $cascadeX=Round((101/118)*$resX,0)
;~ $cascadeY=Round((77/116)*$resY,0)

$desktopY=$resY-40 ; Where -N is the height of the taskbar
$winX=412 ; Desired width of Windows Task Manager
$winY=459 ; Desired height of Windows Task Manager

$posX=$resX-$winX
$posY=$desktopY-$winY

$drive="C:\"
$path="Windows\SysWOW64\"
$file="taskmgr.exe"

Run($drive&$path&$file)
WinWait("[CLASS:#32770;TITLE:Windows Task Manager]","",6)
If WinExists("[CLASS:#32770;TITLE:Windows Task Manager]") Then
WinMove("[CLASS:#32770;TITLE:Windows Task Manager]","",$posX,$posY,$winX,$winY,1)
ControlClick("[CLASS:#32770;TITLE:Windows Task Manager]","","[CLASS:SysTabControl32;INSTANCE:1]","left",1,280,8)
Else
MsgBox(32,"AutoIt3","Cannot find Windows Task Manager.")
Exit
EndIf
EndIf
WEnd
Link to post
Share on other sites

Changed the executable path after discovering that "C:\Windows\SysWOW64\taskmgr.exe" on my Win7 x64 system is the 32-bit version.

Removed the AutoIt tasktray icon.

#NoTrayIcon

#cs
Written for WinXP(x86/x64), WinVista(x86/x64), Win7(x86/x64)
#ce

Opt("SendKeyDelay",125)
Opt("MouseClickDelay",125)

While 1
If ProcessExists("taskmgr.exe") Then
Sleep(125)
Else
$resX=@DesktopWidth
$resY=@DesktopHeight
;~ $cascadeX=Round((101/118)*$resX,0)
;~ $cascadeY=Round((77/116)*$resY,0)

$desktopX=$resX-0 ; Where -N is the width of the sidebar
$desktopY=$resY-40 ; Where -N is the height of the taskbar
$winX=412 ; Desired width of Windows Task Manager
$winY=459 ; Desired height of Windows Task Manager

$posX=$desktopX-$winX
$posY=$desktopY-$winY

$drive="C:\"
$path="Windows\System32\"
$file="taskmgr.exe"

Run($drive&$path&$file)
WinWait("[CLASS:#32770;TITLE:Windows Task Manager]","",6)
If WinExists("[CLASS:#32770;TITLE:Windows Task Manager]") Then
WinMove("[CLASS:#32770;TITLE:Windows Task Manager]","",$posX,$posY,$winX,$winY,1)
ControlClick("[CLASS:#32770;TITLE:Windows Task Manager]","","[CLASS:SysTabControl32;INSTANCE:1]","left",1,260,8)
Else
MsgBox(32,"AutoIt3","Cannot find Windows Task Manager.")
Exit
EndIf
EndIf
WEnd
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...