Jump to content

embed dll in a tab - possible?


Recommended Posts

Hi,

Thanks to everyone who has helped with my previous posts.... im a newbie to autoit so excuse all my questions.

I have a GUI form with 4 tabs - everything on the GUI is within these tabs. I want to add a new tab and embed cwebpage.dll to it. I attemped to do this but the dll loads in the background behind all the tabs. Is this an error on my part or is it not possible to load dll elements within tabs?

If this is not possible - is there a way to have a button which opens an extended form with the dll in it? for example on windows some problems have a button like 'more>' which when clicked opens a new part to the existing form (a another kind of hidden element). (sorry I dont think I explained that to well).

Stuart

Link to comment
Share on other sites

It's possible. Try this code:

#include <GUIConstants.au3>
Global $cweb = DLLOpen(@ScriptDir & "\cwebpage.dll")
If $cweb = -1 Then Exit

$hGUI = GUICreate("GUI", 200, 200)
GUICtrlCreateTab(5, 5)
GUICtrlCreateTabItem("Tab1")
$holder1 = GUICtrlCreateLabel("", 10, 35, 100, 100)
$holder1hwnd = ControlGetHandle($hGUI, "", $holder1)
GUICtrlCreateTabItem("Tab2")
GUICtrlCreateTabItem("")
DLLCall($cweb, "long","EmbedBrowserObject", "hwnd", $holder1hwnd)
DLLCall($cweb, "long", "DisplayHTMLStr", "hwnd", $holder1hwnd, "str", "Have a nice day!")
GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
        ExitLoop
    EndSelect
WEnd

Func OnAutoitExit()
    DLLCall($cweb, "long", "UnEmbedBrowserObject", "hwnd", $holder1hwnd)
    DLLClose($cweb)
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...