views:

18

answers:

0

Hello SO,

I have an ExplorerBrowser COM object embedded in a wxPython Panel. I am looking for a way to use a horizontal scroll bar for the ExplorerBrowser, rather than the default vertical scrollbar.

I can't seem to find an option in the ExplorerBrowser documentation, and not sure where else to look; I have very little knowledge of the win32gui API.

My code looks like this:

class ExplorerWrapper(wx.Panel):
  def __init__(self, *args, **kwargs):
    super(ExplorerPanel, self).__init__(*args, **kwargs)
    self.eb = pythoncom.CoCreateInstance(shellcon.CLSID_ExplorerBrowser,
                                         None,
                                         pythoncom.CLSCTX_ALL,
                                         shell.IID_IExplorerBrowser)
    self.SetSize((700,200))
    self.event_cookie = self.eb.Advise(wrap(EventHandler()))
    self.hwnd = self.GetHandle()

    self.eb.Initialize(self.hwnd, win32gui.GetClientRect(self.hwnd),
                       (0, shellcon.FVM_DETAILS))
    self.eb.SetOptions(shellcon.EBO_SHOWFRAMES)
    self.eb.BrowseToIDList([], shellcon.SBSP_ABSOLUTE)

    self.Bind(wx.EVT_SIZE, self.OnResize)

def OnResize(self, e):
  self.eb.SetRect(None, win32gui.GetClientRect(self.hwnd))
  e.Skip()

if __name__ == "__main__":
  w = wx.App(False)
  f = wx.Frame(None, -1)
  p = ExplorerPanel(f, -1)
  f.Show(True)
  w.MainLoop()

I got the ExplorerBrowser initialisation stuff from the win32comext/demo folder.