WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

API List


It would be a useful to have an 'api database' which would output a correct WinBatch DllCall() - as a first step, the following script will iterate the AllApi web pages and produce an html file with links to over 975 API calls. The links have extended information about each api, including the syntax for calling it in Visual basic.

Assuming, one created an XML reference file with fields for

API function
Library
NumParameters
ForEach Param
ParamType
ParamDefault
Next
ReturnValue
DescriptionOfApi
WB_Syntax
[and whatever else one would suggest] - then a second step would be to reference each link from the html file the script screated and fill in the XML file. Would make a nice project.

It would be easy to extend the script to produce a PDF with links intact (like I did for the WB tech articles) - if anyone is interested. - stan

;////////////////////////////////////////////////////////////////// 
; 2004B -  WinBatch - collect API function listing 
;          uses pages from the AllAPI reference URL
;          places output to apilist.htm
;
;  Caution: This script runs with the Explorer Object Hidden
;           You can override this when testing by uncommenting
;           a line in the IENav() subroutine
;
; Stan Littlefield, May 28, 2004  [please keep this header]
;////////////////////////////////////////////////////////////////// 

#DefineSubroutine IENav(B,url)
B.navigate(url)
While B.ReadyState <> 4
   TimeDelay(.5)
EndWhile
; uncomment next line to watch while gathering link references
;B.visible = 1
While B.Document.ReadyState <> "complete" ; not really needed, but useful
   TimeDelay(.5)
Endwhile
Return
#EndSubroutine

#DefineFunction isInReg(cProg)
Return( RegExistKey(@RegClasses,cProg) )
#EndFunction


IntControl(73, 1, 0, 0, 0)

AddExtender("WWINT34i.DLL")
For i = 1 To 5
   If iGetConState(0) 
      break
   Else
      Display(1,"Internet","Not Sensing Active Connection")
   Endif
   TimeDelay(1)
   If i==4 Then Exit
Next
constate=iGetConState(1)

If constate & 1
   Display(2,"DIAL-UP","Data Retrieval Will Be Slow")
Else
   Display(2,"LAN","T-1,Cable Modem, or DSL")
Endif

;not used
;lAcro=@TRUE
;If ! isInReg("AcroExch.App")
;   lAcro=@FALSE
;   Message(1,"Cannot Create PDF File",StrCat("The Full Version of Adobe Acrobat",@CRLF,"does not appear to be installed.",@CRLF,"Will prepare the HTML File Only") )
;Endif

;start data gathering
BoxOpen("Please Do Not Interrupt","Collecting API function list")
B=0
B = ObjectCreate("InternetExplorer.Application")
nErr=1
B.addressbar = 0
B.statusbar = 0
B.menubar = 0
B.toolbar = 0
B.visible = 0
cHTM = StrCat(dirget(),"apilist.htm")
;cPDF = StrCat(dirget(),"apilist.pdf")
cOut = ""
cOut = StrCat(cOut,"<HTML>",@CRLF,"<HEAD>",@CRLF,"<TITLE>WIN32 API List</TITLE>",@CRLF,"</HEAD>",@CRLF,"<BODY>",@CRLF,"<BLOCKQUOTE>")
base = "http://www.mentalis.org/apilist/"
var = "apilist.php|
For i = 1 to 25
   var = StrCat(var,StrLower(Num2Char( (65+i) )),".shtml|")
Next
nTop = 26

For i = 1 To nTop
   url = StrCat(base,ItemExtract( i, var, "|" ))
   IENav(B,url) 
   BoxText(StrCat("[Processing URL %i% of %nTop%]",@CRLF,B.Document.Title))
   cOut = StrCat(cOut,"<br><br><H2>",url,"</H2><br><br>",@CRLF)
   If B.Document.links.length >0 Then
      ForEach l In B.Document.links
         If StrIndex( l.innerHTML,"size=2>",0,@FWDSCAN ) Then cOut = StrCat( cOut,StrCat( '<a href="',l.href,'">',l.innerHTML,'</a><br>' ),@CRLF)   
      Next
   Endif
Next

cOut = StrCat(cOut,"</BLOCKQUOTE>",@CRLF,"</BODY>",@CRLF,"</HTML>")
FilePut(cHTM,cOut)
B.Quit()
B = 0
Exit

:WBERRORHANDLER          ; from Detlev
IntControl(73,1,0,0,0)
If B<>0
   B.Quit()
   B=0
Endif
WbError = LastError()
WbTextcode = WbError
If WbError==1668||WbError==2669||WbError==3670
   ; 1668 ; "Minor user-defined error"
   ; 2669 ; "Moderate user-defined error"
   ; 3670 ; "Severe user-defined error"
   WbError = ItemExtract(1,IntControl(34,-1,0,0,0),":")
   WbTextcode = -1
EndIf
WbErrorString = IntControl(34,WbTextcode,0,0,0)
WbErrorDateTime = StrCat(TimeYmdHms(),"|",StrFixLeft(GetTickCount()," ",10))

WbErrorFile = StrCat(DirWindows(0),"WWWBATCH.INI")
IniWritePvt(WbErrorDateTime,"CurrentScript",WbErrorHandlerFile      ,WbErrorFile)
IniWritePvt(WbErrorDateTime,"ErrorValue"   ,WbError                 ,WbErrorFile)
IniWritePvt(WbErrorDateTime,"ErrorString"  ,WbErrorString           ,WbErrorFile)
IniWritePvt(WbErrorDateTime,"ScriptLine"   ,WbErrorHandlerLine      ,WbErrorFile)
IniWritePvt(WbErrorDateTime,"ScriptOffset" ,WbErrorHandlerOffset    ,WbErrorFile)
IniWritePvt(WbErrorDateTime,"VarAssignment",WbErrorHandlerAssignment,WbErrorFile)
IniWritePvt("","","",WbErrorFile)

WbErrorMsgText = StrCat(WbErrorDateTime,@CRLF)
WbErrorMsgText = StrCat(WbErrorMsgText,"Current Script: ",WbErrorHandlerFile,@CRLF)
WbErrorMsgText = StrCat(WbErrorMsgText,"LastError #:",WbError,@CRLF)
WbErrorMsgText = StrCat(WbErrorMsgText,"Error Text: ",wberrortextstring,@CRLF)
WbErrorMsgText = StrCat(WbErrorMsgText,"[Additional] ",wberroradditionalinfo,@CRLF,@CRLF)
; Line in script that caused Error.
WbErrorMsgText = StrCat(WbErrorMsgText,"WbErrorHandlerLine:",@CRLF,WbErrorHandlerLine,@CRLF)
; Offset into script of error line, in bytes.
WbErrorMsgText = StrCat(WbErrorMsgText,"WbErrorHandlerOffset: ",WbErrorHandlerOffset,@CRLF)
; Variable being assigned on error line, or "" if none.
WbErrorMsgText = StrCat(WbErrorMsgText,"WbErrorHandlerAssignment: ",WbErrorHandlerAssignment,@CRLF)
If (WbErrorHandlerAssignment>"") Then %WbErrorHandlerAssignment% = "UNKNOWN"
ClipPut(WbErrorMsgText)
WbErrorMsgText = StrCat(WbErrorMsgText,"[Error Copied To Clipboard]")
Message("wbErrorHandler",WbErrorMsgText)

Exit
;/////////////////////////////////////////////////////////////////////////////////////

Article ID:   W16680
File Created: 2005:02:18:12:21:52
Last Updated: 2005:02:18:12:21:52