I am using this script to open sidepanels in IE:


<script language="VBScript">

set objShell = CreateObject("Shell.Application")

bReturn = objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}",
true)

</script>


but I can only open panels, not close them, because I don't know how to
detect whether a panel is already open. I'd like to have it this way:

if panel=open then

objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}", true)

else

objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}", false)

end if

Is it possible to detect the state of side bars in IE? If yes, please
provide the necessary code.

Re: detect if a sidebar panel is open in IE by Joe

Joe
Mon Aug 14 03:20:44 CDT 2006

I didn't realise you could use Shell.Application directly to show a browser
bar, don't you have to use the windows method to get hold of the actual
instance of IE?

If your browser bar is a custom one I don't see how you can check. What
happens if you try to hide when it's not there or vice versa?


--

Joe Fawcett (MVP)

http://joe.fawcett.name
"Semjon Katatschkow" <skatatschkow@hotmail.com> wrote in message
news:OjNCrPxvGHA.4512@TK2MSFTNGP05.phx.gbl...
>I am using this script to open sidepanels in IE:
>
>
> <script language="VBScript">
>
> set objShell = CreateObject("Shell.Application")
>
> bReturn =
> objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}", true)
>
> </script>
>
>
> but I can only open panels, not close them, because I don't know how to
> detect whether a panel is already open. I'd like to have it this way:
>
> if panel=open then
>
> objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}", true)
>
> else
>
> objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}", false)
>
> end if
>
> Is it possible to detect the state of side bars in IE? If yes, please
> provide the necessary code.
>



Re: detect if a sidebar panel is open in IE by Alexander

Alexander
Mon Aug 14 05:15:04 CDT 2006

Joe Fawcett schrieb:
> I didn't realise you could use Shell.Application directly to show a browser
> bar, don't you have to use the windows method to get hold of the actual
> instance of IE?


IShellDispatch4 (the most recent extension to the Shell.Application)
also has a ShowBrowserBar-methode that automagically attaches to the
current IE-instance when executed inside an IE-script ... and unsafe
ActiveX is permitted for the zone the script is running in.

> If your browser bar is a custom one I don't see how you can check.

IIRC Custom browser bands basically don't differ from built-in bands,
both have to implement a small subset of interface and register
CATID_InfoBand under 'Implemented Categories', as for vertical bands.

> What happens if you try to hide when it's not there or vice versa?

Afaik there is no way in scripting at all to determine if a
browserbar is visible or not. One can simply force showing one or none.

MfG,
Alex

Re: detect if a sidebar panel is open in IE by Semjon

Semjon
Mon Aug 14 18:55:37 CDT 2006

If there is no way to determine through scripts whether a vertical sidebar
is open in IE, is it then maybe possible to use vbscript to read a registry
key in order to see whether a bar is open? I think, when a bar is opened in
IE, IE writes some info into the registry so that new instances of IE know
that they have to start with that bar open. If I only knew where to look in
the registry, it should be possible to write a script that checks for the
registry value. If the value is = open, then I could tell IE through a
script to close the bar and vice versa..

As far as ActiveX permission rights are concerned, you are right. Took me a
couple of hours to realise that in order to use Shell.Application, unsafe
activex has to be set to "allow". It seems "prompt" doesn't work for this.
Even if I set unsafe activex to "prompt", I still get a "permission denied"
from IE, only "allow" works. So I allowed the execution of unsafe activex
for LOCAL html files, created a vbscript html page and linked to it from my
favorites\links folder. Whenever I click the link in IE, it first redirects
itself to the local page on my harddisk and then that page executes the
vbscript and opens the vertical sidebar. for the internet zone unsafe
activex is still disabled.

"Alexander Mueller" <millerax@hotmail.com> schrieb im Newsbeitrag
news:OeeAEq4vGHA.4688@TK2MSFTNGP06.phx.gbl...
> Joe Fawcett schrieb:
>> I didn't realise you could use Shell.Application directly to show a
>> browser bar, don't you have to use the windows method to get hold of the
>> actual instance of IE?
>
>
> IShellDispatch4 (the most recent extension to the Shell.Application) also
> has a ShowBrowserBar-methode that automagically attaches to the
> current IE-instance when executed inside an IE-script ... and unsafe
> ActiveX is permitted for the zone the script is running in.
>
>> If your browser bar is a custom one I don't see how you can check.
>
> IIRC Custom browser bands basically don't differ from built-in bands, both
> have to implement a small subset of interface and register
> CATID_InfoBand under 'Implemented Categories', as for vertical bands.
>
>> What happens if you try to hide when it's not there or vice versa?
>
> Afaik there is no way in scripting at all to determine if a
> browserbar is visible or not. One can simply force showing one or none.
>
> MfG,
> Alex



Re: detect if a sidebar panel is open in IE by Michael

Michael
Mon Aug 14 23:51:19 CDT 2006

> ...
> As far as ActiveX permission rights are concerned, you are right.
> Took me a couple of hours to realise that in order to use
> Shell.Application, unsafe activex has to be set to "allow". It seems
> "prompt" doesn't work for this. Even if I set unsafe activex to
> "prompt", I still get a "permission denied" from IE, only "allow"
> works. ...

IIRC the Shell.Application class/object is marked safe at the component
level and at some method/property interface levels, but unsafe at selected
method/property interface levels. Prompt apparently only applies at the
time an unsafe object instance is created, not when a selecively unsafe
method is called on an otherwise safe object. It can't point to definitive
docs, just based on personal observation of behavior and some distant past
recollection of seeing it documented *somewhere*.

--
Michael Harris
Microsoft MVP Scripting



Re: detect if a sidebar panel is open in IE by Fosco

Fosco
Tue Aug 15 19:59:12 CDT 2006

"Semjon Katatschkow"
> If I only knew where to look in the registry, it should be possible
> to write a script that checks for the registry value.

RegShot 1.61e
http://www.pcworld.com/downloads/file_description/0,fid,19540,00.asp
http://www.snapfiles.com/get/regshot.html
o
Inctrl5
http://snipurl.com/u94n

with regshot >> start it >> 1shot make changes in your application
regshot >> 2shot >>> compare

--
Fosco



Re: detect if a sidebar panel is open in IE by Semjon

Semjon
Wed Aug 16 05:29:16 CDT 2006

You are right, however, it seems that the only way to check for those values
is to loop through every value:

<script language="VBScript">

Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Internet Explorer\Toolbar\WebBrowser"
strValueName = "ITBarLayout"
oReg.GetBinaryValue HKEY_CURRENT_USER,strKeyPath, _
strValueName,strValue

sub OPENBAR()
set objShell = CreateObject("Shell.Application")
bReturn = objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}",
true)
end Sub
sub CLOSEBAR()
set objShell = CreateObject("Shell.Application")
bReturn = objShell.ShowBrowserBar("{FF059E31-CC5A-4E2E-BF3B-96E929D65503}",
false)
end Sub

For i = &H214 to &H223
If strValue(i) > 0 Then
CLOSEBAR()
Else
OPENBAR()
End If
NEXT

</script>

It may be more efficient (and faster) to check for just one value, since it
seems that if a bar is closed, all of those values are set to 0:

i = 532 instead of For i = 532 to 547 ... Next





"Alexander Mueller" <millerax@hotmail.com> schrieb im Newsbeitrag
news:44e19248$0$6979$9b4e6d93@newsspool1.arcor-online.net...
> 15.08.2006 01:55, Semjon Katatschkow schrieb:
>
>> If there is no way to determine through scripts whether a vertical
>> sidebar
>> is open in IE,
>
> A simple solution could be, to compare document-width to IE-width.
> If a bar is open the offset is likley significant ...
>
> is it then maybe possible to use vbscript to read a registry
>> key in order to see whether a bar is open? I think, when a bar is opened
>> in
>> IE, IE writes some info into the registry so that new instances of IE
>> know
>> that they have to start with that bar open. If I only knew where to look
>> in
>> the registry, it should be possible to write a script that checks for the
>> registry value. If the value is = open, then I could tell IE through a
>> script to close the bar and vice versa..
>
> I noticed that under HKEY_CURRENT_USER\Software\Microsoft\Internet
> Explorer\Toolbar\WebBrowser
> there is a binary entry named 'ITBarLayout' that changes its value when
> you
> open/close/change the sidebar panel in IE.
> It's not a simple yes/no or 0/1 value but ~560 bytes long.
> The bytes-sequence affected goes from byte 0x214 to 0x223 (HEX-notation,
> 532-547 as decimal).
> If no panel is open, the sequence is padded with 00's, otherwise by
> 'hieroglyphes',
> that denote the kind of bar opened.
> So for detecting if a bars is open or not you have to extract these bytes
> and check
> for non 00's.
>
>
> HTH,
> Alex
>
>
>