1 more question!
So I have a GUI that has a list box that contains 10 scripts or so. I figured I could put all the scripts and GUI files into the same folder so I could use #include inside of the GUI file.
All of my scripts start like this, as they are currently in a different folder then my GUI file:
Code: Select all
WBGet(WinTitle="ahk_class IEFrame", Svr#=1)
{ ; based on ComObjQuery docs
static msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
, IID := "{0002DF05-0000-0000-C000-000000000046}" ; IID_IWebBrowserApp
; , IID := "{332C4427-26CB-11D0-B483-00C04FD90119}" ; IID_IHTMLWindow2
SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle%
if (ErrorLevel != "FAIL") {
lResult:=ErrorLevel, VarSetCapacity(GUID,16,0)
if DllCall("ole32\CLSIDFromString", "wstr","{332C4425-26CB-11D0-B483-00C04FD90119}", "ptr",&GUID) >= 0 {
DllCall("oleacc\ObjectFromLresult", "ptr",lResult, "ptr",&GUID, "ptr",0, "ptr*",pdoc)
return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc)
}
}
}
#f::
pwb := WBGet()
So I tried the #include within my GUI file and I got the following error:
Error at line 3 in #include file
"C:\users.....hardwarerequest.ahk".
Line Text: WBGet(WinTitle="ahk_class IEFrame", Svr#=1)
Error: Duplicate function definition.
The program will exit.
Now I understand all my scripts start out the same and I think I know why I got that error message, but would there be anyway to edit my above code that it will load that top part IF ONLY it hasn't loaded it already from an already included loaded script?