Script2EXE --- The External Interface
The External interface is for Windows program.
Properties
- argc([out, retval] long *pVal); (Number of command arguments)
- argv([in] long index, [out, retval] BSTR *pVal); (Retrive command line arguments)
- SHW([out, retval] VARIANT_BOOL *pVal);
Note: : This property always returns true.
You can use this property to check whether the HTML page is being displayed by a Script2EXE program or a Web browser.
Methods - Primary
- SetTopMostWindow([in] VARIANT_BOOL topMost);
- SetWindowRgn([in] BSTR points, [in,defaultvalue(-1)] VARIANT_BOOL beClientPoints, [out,retval] VARIANT_BOOL * ok);
- SetWindowRgnFromImage([in] BSTR resourceNameOrFilePath, [in,defaultvalue(-1)] VARIANT_BOOL adjustWindowSize, [out,retval]VARIANT_BOOL *ok);
- GetScreenWidth([out,retval] long * width);
- GetScreenHeight([out,retval] long * height);
- FullScreenClient();
- CenterFrameWindow();
- ResizeClientTo([in] long width, [in] long height, [out,retval] VARIANT_BOOL * ok);
- CreateMenu([out,retval] IDispatch * * menu);
- GetResourceName([in] long index, [out,retval] BSTR * name);
- GetResourceData([in] long index, [out,retval] BSTR * dat);
- CopyResourceToFile([in] long index, [in,defaultvalue("")]BSTR tgtDir, [in,defaultvalue(-1)] VARIANT_BOOL expandSubFolder, [out, retval] VARIANT_BOOL * ok);
- FindResource([in] BSTR name, [out,retval] long * index);
- GetWebBrowser([in,defaultvalue(0)] IDispatch * win, [out,retval] IDispatch** pWB);
- GetChildWindow([in] IDispatch * parentWin, [in] long index, [out,retval] IDispatch ** childWin);
- GetChildWindowByID([in] IDispatch * parentWin, [in] BSTR frameID, [out,retval] IDispatch ** childWin);
- GetParentWebBrowser([in] IDispatch * web, [out,retval] IDispatch** parentWeb);
- GetChildWebBrowser([in] IDispatch * parentWeb, [in] long index, [out,retval] IDispatch ** childWeb);
- CreateScripts([in] BSTR scriptsText, [in,defaultvalue("javascript")] BSTR language, [in,defaultvalue(0)] IDispatch * win, [out,retval] IDispatch ** scriptObject);
- AllowContextMenu([in] unsigned long allowedItems);
- AllowResizeWindow([in] VARIANT_BOOL allow);
- ShowStatusBar([in] VARIANT_BOOL show);
- MessageBox([in] BSTR txt, [in,defaultvalue("ok")] BSTR buttonType, [in,defaultvalue("information")] BSTR iconType, [in,defaultvalue("SCRIPT2EXE")] BSTR caption, [out,retval] BSTR * retVal);
- CreateObject([in] BSTR progIDorCLSID, [out,retval] IDispatch ** pobj);
- LoadScript([in]BSTR scriptEntryName, [out,retval]IDispatch**obj);
- HRESULT SetHelpDocument([in] BSTR filePathOrURL);
- Exit();
Methods - Shell & System
- EnableShellTray([in]BSTR iconResourceName, [in] BSTR tipText, [in,defaultvalue(0)] VARIANT_BOOL hideAppWindow);
- ShellExecute([in] BSTR pathOrURL, [out,retval] VARIANT_BOOL *ok);
- SHBrowseForFolder([in, defaultvalue("")] BSTR defaultFolder, [in,defaultvalue("")] BSTR title, [out,retval] BSTR * folder);
- SHGetSpecialFolderPath([in] long id, [out,retval] BSTR *path);
- GetOpenFileName([in,defaultvalue("")] BSTR defExt, [in,defaultvalue("")] BSTR defFileName, [in,defaultvalue("")] BSTR filter, [in,defaultvalue(0)] VARIANT_BOOL multiFiles, [out,retval] BSTR * path);
- GetSaveFileName([in,defaultvalue("")] BSTR defExt, [in,defaultvalue("")] BSTR defFileName, [in,defaultvalue("")] BSTR filter, [out,retval] BSTR * path);
- GetCommandLine([out,retval] BSTR *cmdline);
- LockWorkStation([out,retval] VARIANT_BOOL *ok);
- LogOff([out,retval]VARIANT_BOOL*ok);
- RestartWindows([out,retval]VARIANT_BOOL*ok);
- ShutDown([out,retval]VARIANT_BOOL*ok);
- DllRegisterServer([in] BSTR dllPath, [out,retval] long * result);
- DllUnregisterServer([in] BSTR dllPath, [out,retval] long * result);
Methods - File and Folders
- GetEXEPath([out,retval]BSTR * path);
- GetCurrentDirectory([out,retval]BSTR * path);
- GetTempDirectory([out,retval] BSTR *path);
- GetSystemDirectory([out,retval] BSTR * dir);
- GetWindowsDirectory([out,retval] BSTR *dir);
- GetProgramDirectory([out,retval] BSTR * dir);
- CreateDirectory([in] BSTR path, [out,retval] VARIANT_BOOL *ok);
- DeleteDirectory([in] BSTR path, [out,retval] VARIANT_BOOL *ok);
- DeleteFile([in] BSTR path, [out,retval] VARIANT_BOOL *ok);
- CopyFile([in] BSTR srcFilePath, [in] BSTR targetFilePathOrFolder, [out,retval] VARIANT_BOOL * ok);
- GetFileAttributes([in] BSTR path, [out,retval] long * a);
- TrimPath([in] BSTR path, [out,retval] BSTR * path2);
Methods - Window
- GetDesktopWindow([out,retval]long* hwnd);
- GetForegroundWindow([out,retval]long *hwnd);
- SetForegroundWindow([in]long hwnd, [out,retval]VARIANT_BOOL * ok);
- SendMessage([in]long hwnd, [in]long msg, [in]long wParam, [in]long lParam, [out,retval]long * result);
- PostMessage([in]long hwnd, [in]long msg, [in]long wParam, [in]long lParam, [out,retval]VARIANT_BOOL * ok);
- GetWindowText([in]long hwnd, [out,retval]BSTR * text);
- SetWindowText([in]long hwnd, [in]BSTR text, [out,retval]long * ok);
- EnableWindow([in]long hwnd, [in]VARIANT_BOOL enabled, [out,retval]VARIANT_BOOL * ok);
- IsWindowEnabled([in]long hwnd, [out,retval]VARIANT_BOOL * enabled);
- ShowWindow([in]long hwnd, [in]long nCmdShow, [out,retval]VARIANT_BOOL * ok);
- IsWindowVisible([in]long hwnd, [out,retval]VARIANT_BOOL * visible);
- EnumWindow([in]long index, [out,retval]long * hwnd);
- GetClassName([in]long hwnd, [out,retval]BSTR * windowClassName);
- GetFrameWindow([out,retval] long * hwndFrame);
- ModifyStyle([in] LONG hwnd, [in] LONG styleAdd, [in] LONG styleRemove, [in, defaultvalue(0)] LONG flags);
- ModifyStyleEx([in] LONG hwnd, [in] LONG styleAdd, [in] LONG styleRemove, [in, defaultvalue(0)] LONG flags);
- SetNewWindowSize([in] ULONG style, [in] ULONG width, [in] ULONG height);
Methods - Process
- GetWindowProcessID([in] long hwnd, [out,retval] long * pid);
- GetWindowThreadID([in] long hwnd, [out, retval] long * tid);
- TerminateProcess([in] long processID, [in,defaultvalue(0)] long exitCode, [out, retval] VARIANT_BOOL * ok);
- GetCurrentProcessID([out, retval] long * pid);
- GetCurrentThreadID([out, retval] long * tid);
Methods - Others
- Download([in]BSTR url, [in]BSTR filePath, [in,defaultvalue(0)]IDispatch* callBack, [out,retval]long *result);