VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Task Manager Options

by Morpheous Dreams (3 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

This has 5 options don't seem like alot but it could help someone new maybe? This can disable Task Manager / Enable it | Hide / Show it and last of all can close it... Simple but people hideing there program could use a simple call to close windows task manager instead of useing App.TaskVisible = False that leaves the program in the processes tree view of windows task manager. Maybe it will help someone/Maybe Not

API Declarations
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Private Const WM_CLOSE = &H10

Rate Task Manager Options

'Enable windows task manager
Dim x As Long
x = FindWindow("#32770", vbNullString)
Call EnableWindow(x, 1)
'...................................

'Disable windows task manager
Dim x As Long
x = FindWindow("#32770", vbNullString)
Call EnableWindow(x, 0)
'....................................
'Hide windows task manager
Dim x As Long
x = FindWindow("#32770", vbNullString)
Call ShowWindow(x, SW_HIDE)
'......................................
'Show windows task manager
Dim x As Long
x = FindWindow("#32770", vbNullString)
Call ShowWindow(x, SW_SHOW)
'...................................
'Close windows task magager
Dim x As Long
x = FindWindow("#32770", vbNullString)
Call SendMessageLong(x, WM_CLOSE, 0&, 0&)
'..........................................

Download this snippet    Add to My Saved Code

Task Manager Options Comments

No comments have been posted about Task Manager Options. Why not be the first to post a comment about Task Manager Options.

Post your comment

Subject:
Message:
0/1000 characters