Posted: Tue Jun 01, 2004 4:16 pm
Search the forums. I've posted code previously to get the IID
Found it... viewtopic.php?t=7777
...is this what you wanted?
Found it... viewtopic.php?t=7777
...is this what you wanted?
http://www.purebasic.com
https://www.purebasic.fr/english/
Can you explain a little more please?Edwin Knoppert wrote:I think you'll need to query using the IID for these interfaces.
I don't think it's useful though.
Code: Select all
Interface myIShellWindows Extends IDispatch
get_Count(a)
Item(a,b,c,d,e)
_NewEnum(a)
Register(a,b,c,d)
RegisterPending(a,b,c,d,e)
Revoke(a)
OnNavigate(a,b)
OnActivated(a,b)
FindWindowSW(a,b,c,d,e,f)
OnCreated(a,b)
ProcessAttachDetach(a)
EndInterface
Global None.VARIANT
None\vt = #VT_ERROR
None\scode = #DISP_E_PARAMNOTFOUND
OnErrorGoto(?Finish)
oShell.IShellDispatch = CreateObject("Shell.Application")
;Debug oShell
oShell\Windows(@oShellWindows.myIShellWindows)
Debug oShellWindows
If oShellWindows
item.VARIANT\vt = #VT_UI4
item\iVal = 0
*item.pToVariant = item
CallDebugger
err.l = oShellWindows\Item(*item\a,*item\b,*item\c,*item\d,@objIE.IWebBrowser2)
If = #S_OK
Debug "OK"
Else
Debug err
EndIf
EndIf
Finish:
If oShellWindows
ReleaseObject(oShellWindows)
EndIf
If oShell
ReleaseObject(oShell)
EndIf
End
Code: Select all
Interface myIShellWindows Extends IDispatch
get_Count(a)
Item(a,b,c,d,e)
_NewEnum(a)
Register(a,b,c,d)
RegisterPending(a,b,c,d,e)
Revoke(a)
OnNavigate(a,b)
OnActivated(a,b)
FindWindowSW(a,b,c,d,e,f)
OnCreated(a,b)
ProcessAttachDetach(a)
EndInterface
Enumeration
#Popup
#Text
#Button
EndEnumeration
#CRLF = Chr(13) + Chr(10)
Global None.VARIANT
None\vt = #VT_ERROR
None\scode = #DISP_E_PARAMNOTFOUND
*None.pToVariant = None
OnErrorGoto(?Finish)
Procedure WinPopup()
If OpenWindow(#Popup,0,0,400,200,#PB_Window_ScreenCentered,"HTML Document Browser")
If CreateGadgetList(WindowID(#Popup))
TextGadget(#Text,0,0,WindowWidth(),WindowHeight()-30,"",#PB_Text_Center | #PB_Text_Border)
ButtonGadget(#Button,(WindowWidth()-30)/2,175,30,20,"OK",#PB_Button_Default)
HideWindow(#Popup,1)
ProcedureReturn #True
EndIf
EndIf
EndProcedure
Procedure Popup()
quitwindow = #False
HideWindow(#Popup,0)
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
;Debug "WindowID: " + Str(EventWindowID())
GadgetID = EventGadgetID()
If GadgetID = #Button
; Debug "GadgetID: #Button"
quitwindow = #True
EndIf
EndIf
Until quitwindow
HideWindow(#Popup,1)
EndProcedure
Procedure ExploreHTML(pHTML.l)
*HTML.IHTMLDocument2 = pHTML
outtxt.s=""
*HTML\get_URL(@URL.l)
*HTML\get_title(@title.l)
outtxt = Uni2Ansi(URL) + #CRLF
outtxt = outtxt + Uni2Ansi(title) + #CRLF
SetGadgetText(#Text,outtxt)
Popup()
EndProcedure
If WinPopup()
oShell.IShellDispatch = CreateObject("Shell.Application")
oShell\Windows(@oShellDisp.IDispatch)
oShellDisp\QueryInterface(?IID_IShellWindows,@oShellWindows.myIShellWindows)
If oShellWindows
oShellWindows\Item(*None\a,*None\b,*None\c,*None\d,@oFolder.IDispatch)
If oFolder<> 0
oFolder\QueryInterface(?IID_IWebBrowser2,@objIE.IWebBrowser2)
If objIE <> 0
objIE\get_Document(@oDocument.IDispatch)
If oDocument
oDocument\QueryInterface(?IID_IHTMLDocument2,@oHTML.IHTMLDocument2)
If oHTML
ExploreHTML(oHTML)
Else
MessageRequester("Document","Can't create HTML Interface",0)
EndIf
Else
MessageRequester("WebBrowser","Can't create Document",0)
EndIf
Else
MessageRequester("Folder","Can't create WebBrowser Interface",0)
EndIf
Else
MessageRequester("ShellWindows","There is no open browser window",0)
EndIf
Else
MessageRequester("Shell","Can't create ShellWindows Interface",0)
EndIf
EndIf
Finish:
CloseWindow(#Popup)
If oHTML
ReleaseObject(oHTML)
EndIf
If oDocument
ReleaseObject(oDocument)
EndIf
If objIE
ReleaseObject(objIE)
EndIf
If oFolder
ReleaseObject(oFolder)
EndIf
If oShellWindows
ReleaseObject(oShellWindows)
EndIf
If oShellDisp
ReleaseObject(oShellDisp)
EndIf
If oShell
ReleaseObject(oShell)
EndIf
End
DataSection
IID_IShellWindows:
Data.l $85CB6900
Data.w $4D95,$11CF
Data.b $96,$0C,$00,$80,$C7,$F4,$EE,$85
EndDataSection
DataSection
IID_IWebBrowser2:
Data.l $D30C1661
Data.w $CDAF,$11D0
Data.b $8A,$3E,$00,$C0,$4F,$C9,$E2,$6E
EndDataSection
DataSection
IID_IHTMLDocument2:
Data.l $332C4425
Data.w $26CB,$11D0
Data.b $B4,$83,$00,$C0,$4F,$D9,$01,$19
EndDataSection
Code: Select all
IncludeFile "msscript interface.pb" ;the one showed here before
object.IScriptControl = CreateObject("MSScriptControl.ScriptControl.1")
object\_AboutBox()
object\put_Language(Ansi2Uni("vbscript"))
object\ExecuteStatement(Ansi2Uni("Value = (3*3)+100"))
;how convert 'value' in pb-variable ???
ReleaseObject(object)
Yeah I still don't understand PB Interfaces yet, but that's my own fault.PB wrote:> The Interface Generator is finished
I'm probably the only one to ask this: but what is it for? I ran it and don't
understand what it's supposed to do...?
Code: Select all
MyTimer = CreateTimer()
SetTimerBase(MyTimer, 10)
ResetTimer(MyTimer)
Code: Select all
CreateTimer(@MyTimer.TimerInterface)
MyTimer\SetBase(10)
MyTimer\ResetTimer()