
I do not go along with "hokey". That's a pejorative and
disrespectful term. Granted ms did not have calling api's
in mind when they offered up vbs, but they clearly "left-
the-door-open" by providing vbs with the ability to interface
with com objects. Once the com door is opened, anything is
fair game.
The usual suggestion here for calling api's is the DynaCall/
DynaWrap approach, courteously hosted by Guenter Born,
(DynaCall originally written by Tom Plooy, and the wrapper
by Jeff Strong). An "improved" version is offered by Yuri
Popov called "DynamicWrapperX" (with the "X" presumably
meaning "extended"). Yuri's version is an improvement over
the Plooy/Strong version, but is a bit more risky because
no source is offered.
http://www.script-coding.info/dynwrapx_eng.html
There are other possibilities. For example, "XNeat"
(do not ask me what that stands for):
http://www.xneat.com/doc/call_win32_api.html
Finally, my favorite (other than my own API Toolkit) is
something called "sfcMini" (do not ask why) and it was found
posted on Source Forge (Japan), written by "Katsumi" (no
indication as to whether that is his/her first or last name?).
Also, the documentation is part Japanese, and part English:
http://kandk.cafe.coocan.jp/sfcmini/catid-19.html
However, google will do a reasonable translation into
fractured English, if you click on "translate this page".
So go to google and search for "sfcmini". You will get
a number of hits. Pick out a url that points to:
kandk.cafe.coocan.jp/sfcmini/item...
and select "translate this page". That will send you
into the middle of the documentation under the control
of google's translator, and you may then navigate through
the rest using the left-hand menu. Google will follow
you along translating as you go.
If you wish to try out sfcmini, you may download the
source, binaries, samples (demo code), and libraries
(class code) from this page:
http://sourceforge.jp/projects/sfcmini/files/
Download the "sfcmini-1.0.1.zip" file, dated 17Feb07.
Unzip the file into a folder of your choosing. Then
LEAVE THAT FOLDER AND ITS INCLUDED SUB-FOLDERS ALONE.
The successful operation of SFCmini depends on retaining
the structure that the zip file installs. Run the
installation vbs script. That will register the
sfcmini(i/a).dll. The sfcminii.dll is supposedly for
intel systems, and the sfcminia.dll is supposedly for
AMD systems. You may choose the INTEL installation
(as I did) if you have an intel processor. That will
get you into a morass of "DEP" (data execution prevention)
errors. For some reason, even though I have admin privileges
I could not bypass the DEP error checking. And so, I
un-installed INTEL and installed the AMD version.
Against all common sense, the AMD version DOES work
on an intel processor (miracles never cease).
If successful, you will find the following progID's
in your registry:
SfcMini.ClassEx
SfcMini.DynaCall (obviously to call api's)
SfcMini.MachineCode
SfcMini.Structure (for typedefs)
SfcMini.Tools
You may then try running the demo scripts in the "samples"
folder. One little bothersome item. There are THREE
I eventually sorted it out. The "winform.vbs" script in
the samples folder is a demo script. The "winform.vbs"
script in the "lib" folder is class code (used by other
demo scripts for creating "forms" a.k.a., windows). And
the "winform.vbs" in the consts folder is just an
enumeration of the windows system api constants used.
Still in all, if it were up to me, I would have given
those different entities different names.
The sfcmini actX objects in question all come with source,
so if you are handy with a c/c++ compiler, you can create
your own binary (just in case you are a suspicious person).
If you do not wish to compile-yer-own, the binaries come
with the download.
One final thought. Although it is fun to bend-and-twist vbs
to do your will (as in calling api's), if you have "real work"
to do, there are countless other -- and probably much more