![]() |
|
|
| Subject:
ToolBar Bands - Default positioning and sizing
Category: Computers > Programming Asked by: fatjoe10014-ga List Price: $25.00 |
Posted:
20 Jun 2002 06:27 PDT
Expires: 27 Jun 2002 06:27 PDT Question ID: 29711 |
Hello, I have recently built a toolbar band object for internet explorer, much like the google bar (toolbar.google.com). However, it appears that the googlebar has a default startup postion (the botton most lefthand corner of the toolbar region) and size. I would like to give my bar a similar startup position and size, but alas I do not know how? Does anyone know this? Joe | |
| |
|
|
| There is no answer at this time. |
|
| Subject:
Re: ToolBar Bands - Default positioning and sizing
From: aditya2k-ga on 20 Jun 2002 11:09 PDT |
I suspect that there are no such variables. The toolbars are positioned in order of installation. You can move the google toolbar by dragging it. |
| Subject:
Re: ToolBar Bands - Default positioning and sizing
From: krizz-ga on 24 Jun 2002 06:06 PDT |
When Internet Explorer calls your object's SetSite() method you obtain
a pointer to the IWebBrowser2 interface, and call it's
ShowBrowserBar() method:
STDMETHODIMP CDropBar::SetSite(IUnknown *newSite)
{
...
{
site = newSite;
if (! site.isNull())
{
// obtain pointer to IWebBrowser2
IServiceProviderPtr provider = site;
IUnknownPtr ieUnk;
provider->QueryService(SID_SInternetExplorer,
&ieUnk);
IE::IWebBrowser2Ptr ie = ieUnk;
LPOLESTR clsid;
StringFromCLSID(uuid_of(DropBar), &clsid);
// display DropBar
ie->ShowBrowserBar(&variant(clsid),
&variant(true), 0);
// free string
CoTaskMemFree(clsid);
...
}
...
}
...
}
concerning the layout and positioning issue: I have not tested myself
but I guess that a correct handling of your toolbar's
IDeskBand::GetBandInfo() method should solve that problem. |
| Subject:
Re: ToolBar Bands - Default positioning and sizing
From: fatjoe10014-ga on 25 Jun 2002 14:26 PDT |
krizz-ga,
I tried to implement your reccomendations using visual basic, however,
it does not appear to be working. Here is a copy of my SetSite
Implementation and two working functions I've created. Can you take a
look and see if I've done something wrong?
Private Sub IObjectWithSite_SetSite(ByVal pUnkSite As IUnknownVB)
Dim isp As IServiceProvider
Dim oleWnd As IOleWindow
Dim wba As GUID 'IWebBrowserApp
Dim wb2 As GUID 'IWebBrowser2
Dim dwStyle As Long
If Not (pUnkSite Is Nothing) Then
If Not (m_pSite Is Nothing) Then
Set m_pSite = Nothing
End If
Set m_pSite = pUnkSite
Set oleWnd = pUnkSite
'QueryInterface for IServiceProvider
Set isp = pUnkSite
'Query service provider to get IWebBrowser2 (InternetExplorer)
CLSIDFromString StrPtr(IID_IWebBrowserApp), wba
CLSIDFromString StrPtr(IID_IWebBrowser2), wb2
Load frmBand
'***************************Call showbrowserbar
Dim obj As Object
Set obj = isp.QueryService(VarPtr(wba), VarPtr(wb2))
obj.ShowBrowserBar GetStringCLSID, True, 0
'****************************
Set isp = Nothing
If Not (oleWnd Is Nothing) Then
m_ContainerWnd = oleWnd.GetWindow
m_bandWnd = frmBand.HWND
dwStyle = GetWindowLong(m_bandWnd, GWL_STYLE)
dwStyle = dwStyle Or WS_CHILD Or WS_CLIPSIBLINGS
SetWindowLong m_bandWnd, GWL_STYLE, dwStyle
SetParent m_bandWnd, m_ContainerWnd
End If
Set oleWnd = Nothing
Else
Set m_pSite = Nothing
End If
End Sub
Private Function GetStringCLSID() As String
Dim strProgID As String * 255
Dim pProgID As Long
Dim udtCLSID As GUID
Dim strCLSID As String * 255
Dim pCLSID As Long
Dim lngRet As Long
Dim strTemp As String
Dim i As Integer
Dim ByteArray(255) As Byte
Dim strout As String
'Take a ProgID.
strTemp = "<MY CLASS NAME - REMOVED FROM CODE NORMALLY:
SOMETHING.SOMETHING>"
'Get CLSID.
lngRet = CLSIDFromProgID(StrPtr(strTemp), udtCLSID)
'Convert CLSID to a string and get the pointer back.
lngRet = StringFromCLSID(udtCLSID, pCLSID)
'Get the CLSID string
StringFromPointer pCLSID, strCLSID
strCLSID = Trim(strCLSID)
GetStringCLSID = strCLSID
End Function
Private Sub StringFromPointer(pOLESTR As Long, strout As String)
Dim ByteArray(255) As Byte
Dim intTemp As Integer
Dim intCount As Integer
Dim i As Integer
intTemp = 1
'Walk the string and retrieve the first byte of each WORD.
While intTemp <> 0
CopyMemory intTemp, ByVal pOLESTR + i, 2
ByteArray(intCount) = intTemp
intCount = intCount + 1
i = i + 2
Wend
'Copy the byte array to our string.
CopyMemory ByVal strout, ByteArray(0), intCount
End Sub |
| Subject:
Re: ToolBar Bands - Default positioning and sizing
From: fatjoe10014-ga on 25 Jun 2002 14:36 PDT |
krizz-ga, I don't think this solution is going to work. The reason is, I added a msgbox() call with the CLSID I was passing to ShowBrowserBar. However, I noticed the msgbox was only called when the bar was visible in IE! Leading me to believe that the setSite method was is only called when the bar is already visible! |
| Subject:
Re: ToolBar Bands - Default positioning and sizing
From: fatjoe10014-ga on 25 Jun 2002 14:55 PDT |
I also noticed that when I run the showbrowser method, the menu item for my bar is checked. However, if I do not run the function the menu item is unchecked. I am using IE 6.0. What browser did you test your code under? |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |