Page 1 of 1 1
Topic Options
#117215 - 2004-04-02 02:17 AM taskmgr - automating "hide when minimized"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Me and my buddy at work were working on this earlier today and didn't get very far ... if anyone's bored and wants a challenge, here goes:

Under Windows Xp taskmgr, when one selects "hide when minimized" from the options menu ... where in the heck does taskmgr store this setting ?! My buddy informs me he didn't have much luck with regmon, I looked at it as well and saw nothing "obvious" in the registry ... he was config-safing last thing I heard (no luck last time I checked) ...

I want to configure taskmgr to autostart from the run key for our users - but for "new" user profiles, I want to force (poke) this taskmgr setting for the hide in minmized ...

Might have to script the RUN and sendkeys to taskmgr but cripes, this flag must be somewhere.

Any help/thoughts appreciated.

Top
#117216 - 2004-04-02 02:49 AM Re: taskmgr - automating "hide when minimized"
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
this is going to be long....

but this worked for me....If there are other non default settings you will probably want to change them first then grab the key from below.

Code:
$null = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\TaskManager","Preferences",

"9c020000e8030000020000000100000001000000a6030000350100003a0500008c030000010000000000000002000000030000000400"+
"0000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"+
"00000000000000000000000000000000000000000000000000000000000000000000000000000000600060003c006000ffffffffffff"+
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000100000002000000"+
"03000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"+
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff010000000000000000000000"+
"0100000000000000010000000000000000000000020000000400000006000000ffffffff000000000000000000000000000000000000"+
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"+
"0000000000000000000000006b0000006b0000002300000046000000ffffffffffffffffffffffffffffffffffffffffffffffffffff"+
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"+
"ffffffffffffffff00000000010000000200000003000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"+
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"+
"ffffffff67000000000000000000000001000000","REG_BINARY")



Edited by CitrixMan (2004-04-02 06:07 PM)

Top
#117217 - 2004-04-02 03:41 AM Re: taskmgr - automating "hide when minimized"
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Great googly moogly! Ever hear of "blah" +
"blah" (e.g. breaking long lines)?


Top
#117218 - 2004-04-02 05:17 AM Re: taskmgr - automating "hide when minimized"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Shane - you tried this on XP eh ? Will give a shot tomorrow. thx dude.
Top
#117219 - 2004-04-02 07:42 AM Re: taskmgr - automating "hide when minimized"
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
What you talking about Chris?

It's only about 1,337 characters long

Top
#117220 - 2004-04-02 09:57 AM Re: taskmgr - automating "hide when minimized"
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Chris,

Maybe you are right, Shane could use $null = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\TaskManager","Preferences","blah","REG_BINARY")...

But i disagree with your comment. First of all he has told us it is going to be long...

Second I have search this board and there is a little bit documented about breaking long lines. There is nothing about it in the BB Faq


E. Don't paste long lines of code between [CODE] tags. It will cause the entire thread to go real wide making it difficult to read (sidewards scrolling). Break and indent them instead. Doing so will not harm the code.

Note: If you fall victim to someone else's indiscretion on this matter, all is not lost... you can still salvage the situation. If you look down at the bottom you will see a link to "Print Thread" which is more than just "printer" friendly. It will make all lines that are not between [CODE] tags wrap at the edge of the screen.



When Shane had read the above part of the ABC's of KiXtart board etiquette and message to new forum users He should know pasting his code between code tags causes these long lines. But that isn't part of your comment. Besides the "print thread" doesn't work anymore. (not for this thread)


After a search for "blah" there are a few threads in which it is used like the code above.

I'm not sure but I believe that since this BB is migrated to another version postprep doesn't work anymore.



So it is a very long line and it makes this thread not pleasant to read. But your reply doesn't helps Shane or other memebers to do it next time the right way ...
_________________________
Co


Top
#117221 - 2004-04-02 10:07 AM Re: taskmgr - automating "hide when minimized"
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Okay Shawn,

This works on my home Windows XP SP1 system, but have not tested it on any other systems yet.

It should take whatever you're current TaskManager preferences are and keep them and only change the SHOW/HIDE portion of the registry flag.

Simply use either SHOW or HIDE in SetTaskManager('show or hide') No matter what you put, unless it is hide it will become show.

Code:
Break On

Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')
 
SetTaskManager('hide')
 
Function SetTaskManager($Flag)
Dim $Settings,$Count,$i,$x
$Flag = IIF($Flag='hide','67','47')
$Settings = ReadValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\TaskManager', 'Preferences')
Dim $Regstring[(Len($Settings)/2)-1]
For $i = 1 To Len($Settings) Step 2
$Regstring[$Count] = SubStr($Settings,$i,2)
$Count = $Count + 1
Next
$Regstring[652]=$Flag
$x = WriteValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\TaskManager', 'Preferences',Join($Regstring,''),'REG_BINARY')
EndFunction




Once you find out what all the values do, you coud easily modify this UDF to use the key and value as input for changing.

Top
#117222 - 2004-04-02 10:19 AM Re: taskmgr - automating "hide when minimized"
ChristopheM Offline
Hey THIS is FUN
*****

Registered: 2002-05-13
Posts: 309
Loc: STRASBOURG, France
instead of changing the preferences, you should try this command line in the run key :
cmd /C start /MIN taskmgr.exe

i have tested it on a Windows XP SP1 workstation and it's OK
_________________________
Christophe

Top
#117223 - 2004-04-02 10:22 AM Re: taskmgr - automating "hide when minimized"
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Not sure why Tim (Shawn)

Wants to hide it, but hide and minimize are two different things.

Why would you even want to load or launch the Task Manager during startup? What does it do for the user?

Also, MCA did some kind of script work with this key in a cleanup script.

http://home.wanadoo.nl/scripting/download/cleanup.kix


Edited by NTDOC (2004-04-02 10:29 AM)

Top
#117224 - 2004-04-02 03:15 PM Re: taskmgr - automating "hide when minimized"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Thx dudes, going to give this stuff a try later today. Why do I want to do
this ? We did do this on our old NT platform (using the preferences key) and
what it gives our users is taskmgr running in the system tray, without showing
on the taskbar ... we do this so that when there is "trouble" (we have about
50 custom application running on our wkstns) trouble like hanging apps etc,
our users have been "trained" to simply double-click on the taskmgr icon in
the tray and kill the process (most times with help desk assistance/approval
etc) ... we dont want our users ctrl+alt+deleting taskmgr, and they don't have
right-click on taskbar enabled, so this is a handy way of doing it.

Now we're moving to XP, we want to provide this exact same "feature" on our new
platform ...

-Shawn

Top
#117225 - 2004-04-02 05:10 PM Re: taskmgr - automating "hide when minimized"
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
what about using ctrl + shift + esc

Top
#117226 - 2004-04-02 05:24 PM Re: taskmgr - automating "hide when minimized"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hey - good one Bryce. Well, its a bit of a political issue as well because "we"
want to minimize the amount of user re-training on the new platform.

Top
#117227 - 2004-04-02 05:56 PM Re: taskmgr - automating "hide when minimized"
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Hey Chris....

Sorry for the line lines...I warned you.

The reason I did not break them is because I tried breaking them in the script and it resulted in the the registry write not working correctly. Therefore I didnt want to break the lines and then have Shawn copy and paste and it not work.

So I did have good intentions of not breaking the long line law but in this case I figured it was better off just being long.

*edit*
Got the line breaks to work now...Must have been a typo before. Sorry...
*/edit*


Edited by CitrixMan (2004-04-02 06:08 PM)

Top
#117228 - 2004-04-02 07:36 PM Re: taskmgr - automating "hide when minimized"
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Heh heh, no problem, Shane. I was just yankin' your chain a little anyway.
Top
#117229 - 2004-04-02 10:56 PM Re: taskmgr - automating "hide when minimized"
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
hmmm.. Tried this on a Windows 2003 Server and it works, but the behavior for hide is weird. It HIDES, it does not become visible in the tray like it does on XP.

Well, I've confirmed though that the code I've supplied does modify the correct hex value and sets the check mark.

Top
#117230 - 2004-04-27 10:16 AM Re: taskmgr - automating "hide when minimized"
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Hey Shawn,

How did this turn out? Did you ever get this task accomplished? Did one of these methods work out for you?

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.075 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org