Programmatically determine if Toolbar is set for auto hide

  • Thread starter Thread starter Mickey Ferguson
  • Start date Start date
M

Mickey Ferguson

I'm trying to find a way to programmatically determine if the toolbar is set
to auto hide or not. I found the registry key that seems to be modified by
changing the setting from the properties window
(HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\Desktop\Components\0, 'Position' entry), but it appears to be a
large bitmask. I couldn't find any documentation that showed my how to
translate that setting.

Is there either an API call I can make to find this out (hopefully that will
cover Windows 2000, XP and subsequent OS versions? Barring that, can
someone provide technical detail that shows how to

Here is a diff script showing the difference in the captured registry of an
OS with auto hide turned off and then turned on:

8c8
<
"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,e4,02,00,00,00,\
---
"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,00,03,00,00,00,\

Alternatively, here is what CSDiff shows when I diff the two exported reg
files. (I hope the first 'Position' line shows up in strikethrough, with
the second line as the replacement.)

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\Desktop\Components\0]

"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,e4,02,00,00,00,\

"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,00,03,00,00,00,\

00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00
 
Hi Mickey

From what I can see, although the 17th and 18th hex values for that key both
change, as you say, when autohide is turned on or off, it's the 18th value
in that sequence, that seems to be the more signficant indicator of whether
autohide is on or off (the 17th value seems to vary with other factors, such
as altering the size of the taskbar).
When I tried it here, that 18th value oscillated between 01 (Autohide off)
and 02 (Autohide off). You also appear to have got a value of 03 for that
value.

This .vbs script seems to work for me, to determine whether autohide is on
or off, but you may need to play with it to determine precisely what the
flag is. Hope this helps.


Jon

*******************************************************************************************************
set WshShell = CreateObject("WScript.Shell")

'Read current state of key
current_state = _
WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\Desktop\Components\0\Position")

'Read 18th value in zero based array
if (current_state(17) and 1)<> 0 then status = "off" else status = "on"

'Or possibly
'if (current_state(17) and 2)<> 0 then status = "on" else status = "off"


WshShell.Popup "Autohide is " & status, 5, "Autohide status"

*******************************************************************************************************


Mickey Ferguson said:
I'm trying to find a way to programmatically determine if the toolbar is
set to auto hide or not. I found the registry key that seems to be
modified by changing the setting from the properties window
(HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\Desktop\Components\0, 'Position' entry), but it appears to be a
large bitmask. I couldn't find any documentation that showed my how to
translate that setting.

Is there either an API call I can make to find this out (hopefully that
will cover Windows 2000, XP and subsequent OS versions? Barring that, can
someone provide technical detail that shows how to

Here is a diff script showing the difference in the captured registry of
an OS with auto hide turned off and then turned on:

8c8
<
"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,e4,02,00,00,00,\
---
"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,00,03,00,00,00,\

Alternatively, here is what CSDiff shows when I diff the two exported reg
files. (I hope the first 'Position' line shows up in strikethrough, with
the second line as the replacement.)

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\Desktop\Components\0]

"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,e4,02,00,00,00,\

"Position"=hex:2c,00,00,00,4e,00,00,00,00,00,00,00,b2,03,00,00,00,03,00,00,00,\

00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00
 
Jon, from my limited testing on my Win2k and XP boxes, this script seems to
work on each of them. Thanks!!!
 
Back
Top