class Windows

Contains Windows API calls.

Functions in this class pose a security risk, so adding this class to the script runtime should be given careful consideration!

Global Functions

int CopyFiles (const string, const string, const int)Executes the shell file copy command.
int CreateDirectory (const string)Creates a new directory.
int DeleteFile (const string)Deletes a file.
int DeleteFiles (const string, const int)Executes the shell file delete command.
int Execute (const string, const int)Loads and runs an executable and optionally waits for it to quit.
string GetClipboardHtml ()Retrieves html code from the system clipboard.
string GetClipboardText ()Retrieves text from the system clipboard.
string GetCurrentDirectory ()Returns the current working directory.
string GetEnvironmentVariable (const string)Returns the value of the specified environment variable.
int GetFileSize (const string)Returns the size of the specified file in bytes.
string GetFullPathName (const string)Gets the full path name of the specified partial path name.
int MoveFiles (const string, const string, const int)Executes the shell file move command.
int RemoveDirectory (const string)Deletes an empty directory.
SetCurrentDirectory (const string)Changes the current working directory.
Sleep (const int)Puts the application to sleep for the specified number of milliseconds.
string Utf8ToAnsi (const int, const string)Converts a UTF-8 encoded string to the specified ANSI codepage.
string Utf8ToAscii (const string)Converts a UTF-8 encoded string to 7-bit ASCII.

Reference

function int CopyFiles (const string from, const string to, const int flags)

Executes the shell file copy command.


function int CreateDirectory (const string path)

Creates a new directory.


function int DeleteFile (const string path)

Deletes a file.


function int DeleteFiles (const string path, const int flags)

Executes the shell file delete command.


function int Execute (const string cmd, const int mode)

Loads and runs an executable and optionally waits for it to quit.

The following flags can be specified: kExecuteWait, kExecuteShow, kExecuteMinimized, kExecuteHide. Returns zero if the function succeeds. Any other return value indicates an error code.


function string GetClipboardHtml ()

Retrieves html code from the system clipboard.

If there is no html in the system clipboard, an empty string is returned. The returned string will be UTF-8 encoded.


function string GetClipboardText ()

Retrieves text from the system clipboard.

If there is no text in the system clipboard, an empty string is returned.


function string GetCurrentDirectory ()

Returns the current working directory.


function string GetEnvironmentVariable (const string name)

Returns the value of the specified environment variable.

If the specified variable is not part of the environment list, null is returned.


function int GetFileSize (const string path)

Returns the size of the specified file in bytes.

If the file is larger than 2 GB or no read access is granted, the function fails. If the function fails, the result is -1.


function string GetFullPathName (const string path)

Gets the full path name of the specified partial path name.


function int MoveFiles (const string from, const string to, const int flags)

Executes the shell file move command.


function int RemoveDirectory (const string path)

Deletes an empty directory.


function SetCurrentDirectory (const string path)

Changes the current working directory.


function Sleep (const int millisecs)

Puts the application to sleep for the specified number of milliseconds.


function string Utf8ToAnsi (const int codepage, const string utf8)

Converts a UTF-8 encoded string to the specified ANSI codepage.

If the conversion fails, this function returns null.


function string Utf8ToAscii (const string utf8)

Converts a UTF-8 encoded string to 7-bit ASCII.

If the conversion fails, this function returns null.