The Windows package must be loaded each time a GNU Octave session is started:
pkg load windows
The Windows toolkit provides 2 main types of functionality:
These are functions that allow interfacing to COM objects.
Functions that provide additional functions for windows
To create a COM object, you use the actxserver function with the name of the object to create.
wshell = actxserver ("WScript.Shell");
A octave_com_object type will be returned that provides an interface to the functions and properties of the object.
To get a list of properties for the object, use the get function. Assuming we have the wshell object from the previous example:
get(wshell)
A list of the properties of the object will be displayed.
To get a list of the methods available for the object, use the methods function.
methods(wshell)
Once a object is created using the actxserver function, and you know the methods and properties available, call the properties of methods using the dot notation.
The following example will display the current directory.
wshell = actxserver ("WScript.Shell"); wshell.CurrentDirectory
Calling functions is performed in the same way.
wshell = actxserver ("WScript.Shell"); wshell.Exec("notepad.exe");
A COM object should be released when it is not going to be used anymore to free any resources it may have allowed.
release(wshell);
A number of utility functions are available. See the reference for their usage.