|
JfwAPI, MS Windows JAWS , . JAWS OLE-Automation, , IJawsApi , , JfwAPI. IJawsApi , , JScript, VBScript, AutoIt , , OLE-Automation. IJawsApi , JfwApi. , IJawsApi. IJawsApi IJawsApi .
IJawsApi OLE-Automation. , . , (VersionIndependentProgID), : "FreedomSci.JawsApi". . JScript AutoIt. , . JScript// : hello.js // IJawsApi. // var jawsApi = new ActiveXObject("FreedomSci.JawsApi"); // jawsApi.SayString("Hello, world!"); // , jawsApi.RunScript("SaySystemTime"); // jawsApi.RunFunction("TypeKey(\"Ctrl+Esc\")"); jawsApi.RunFunction("Delay(10)"); jawsApi.RunFunction("TypeKey(\"Esc\")"); AutoIt; hello.au3 ; IJawsApi. $oJawsApi= ObjCreate("FreedomSci.JawsApi") if @error then Msgbox(0,"JawsApi Test","Failed to create OLE-Object. Error code: " & hex(@error,8)) exit endif ; $oJawsApi.SayString("Hello, world!") ; , $oJawsApi.RunScript("SaySystemTime") ; $oJawsApi.RunFunction('TypeKey("Ctrl+Esc")') $oJawsApi.RunFunction("Delay(10)") $oJawsApi.RunFunction('TypeKey("Esc")') exit C#C# JfW API, . API // .Net 3.5: Type jfwApi = Type.GetTypeFromProgID("FreedomSci.JawsApi"); object o = Activator.CreateInstance( jfwApi); jfwApi.InvokeMember("SayString", System.Reflection.BindingFlags.InvokeMethod, null, o, new Object[1] {"Hello"}); ... // .net 4.0 .Net 3.5, // : Type jfwApi = Type.GetTypeFromProgID("FreedomSci.JawsApi"); dynamic o= Activator.CreateInstance( jfwApi); o.SayString("hello"); ... IJawsApi C++IJawsApi C++ GUID IID . #import, , Fsapi.dll. , : HKEY_CLASSES_ROOT\CLSID\{CCE5B1E5-B2ED-45D5-B09F-8EC54B75ABF4}\ InprocServer32. #import, . jawsapi.h guids.cpp, , , " COM". // : jawsapi.h // IJawsApi. #ifndef __JAWSAPI_H__ #define __JAWSAPI_H__ #include // : guids.cpp. #include guids.cpp ( ) . jawsapi.h #include , IJawsApi. : extern const CLSID CLSID_JAWSCLASS ; extern const IID IID_IJAWSAPI ; IJawsApi C++ . , JAWS. // : main.cpp #includeBorland Builder C++ 5.5 command line tools C++- MinGW ( : -lole32 -loleaut32). |
|||
|