none
On top on browser

    Question

  • Hello,

     

    1.

    I developing win form application.

    I would like my application will be on top of the browser.

    What I means is like application that configure to be always on top but I would like my application will be always on top of the browser, means if I open other application other then the browser e.g. Microsoft word, my application will not be on top of word.

    2.

    How can I get the current URL from IE 7 tabs ?

    I currently success to get only the first tab

    Tuesday, January 30, 2007 10:17 AM

All replies

  • Hi,

    VB6 snippet

    Property Let WindowOnTop(byval New_Value as Boolean)

    Dim lFlag as Long

    m_WindowOnTop = New_Value

    If m_WindowOnTop then

        lFlag = HWND_TOPMOST

       else

       lFlag = HWND_NOTOPMOST

    end if

    If not myWB Is Nothing then ' MyWB is a reference to the WebBrowser Object

         Call SetWindowPos(Me.hwnd, lFlag, 0&, 0&, 0&, 0&, (SWP_NOSIZE Or SWP_NOMOVE)) ' Place your winform on top

         Call SetWindowPos(myWB.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, (SWP_NOSIZE Or SWP_NOMOVE)) ' Place the webbrowser underneath it

    else

         Call SetWindowPos(Me.hwnd, lFlag, 0&, 0&, 0&, 0&, (SWP_NOSIZE Or SWP_NOMOVE)) ' Place your winform on top

    End if

    End Property

    You will have to modify this for .net, possibly replace the API calls (SetWindowPos) with manipulations of the Zorder of the WinForm window and the WebBrowser window, but basically the pseudo code is

    On loading your Winform - Find the WebBrowser window, Place your Winform on top of it (ZOrder value)

    On activating your Winform - set focus to your winform... the zorder set above will be retained.

    Regards.

     

     

    Tuesday, January 30, 2007 9:13 PM