clipboard
('copy', data)
¶txt
= clipboard ('paste')
¶Insert or get data from the clipboard.
’copy’ or ’paste’ is the required operation to perform. where ’copy’ will copy data to the clipboard, and paste will paste data from the clipboard to a variable.
data is the data to copy to the clipboard.
txt is the text from the clipboard or an empty string it it can not convert to text..
Examples:
Copy a string to the clipboard:
clipboard('copy', 'hello world');
Get a string from the clipboard:
txt = clipboard('paste');
[x,y] =
grab (axis)
¶Grab positions of landmarks on the screen.
x is the x coordinates of the points.
y is the y coordinates of the points.
axis (optional) if specified then the first 2 clicks must be on the appropriate axes. x and y (or just x if only 2 points specified ) will then be normalised.
for example:
x=grab([1 10])
the first two clicks should correspond to x=1 and x=10 subsequent clicks will then be normalized to graph units.
for example:
[x,y]=grab;
gives x and y in screen pixel units (upper left = 0,0 )
Select points by positioning the cursor over the points and clicking <SPACE>. ’q’ or <ESC> quits
code =
win32_DeleteRegistry (key, subkey, valuename)
¶Delete a value from the Windows registry.
Example:
key='test\\\\temp'; # create key win32_WriteRegistry('HKLM',key,'test_value', 0) # delete it win32_DeleteRegistry('HKLM',key,'test_value')
key must be one of the following strings:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
subkey is the subkey to the registry value.
valuename is the name of the value to delete from the registry.
code is the success code. Values correspond to the codes in the winerror.h header file. The code of 0 is success, while other codes indicate failure
rv =
win32_MessageBox (title, text)
¶rv =
win32_MessageBox (title, text, MboxType)
¶Display a message box using the win32 API.
title MessageBox title string
text MessageBox text string
MBoxType can be an integer or a string.
For integer values, consult <windows.h>
The following string values are recognized:
MB_OK
MB_OKCANCEL
MB_ABORTRETRYIGNORE
MB_YESNOCANCEL
MB_YESNO
MB_RETRYCANCEL
Default is MB_OK
Returns a value rv:
User Clicked OK
User Clicked Cancel
User Clicked Abort i
User Clicked Retry
User Clicked Ignore
User Clicked Yes
User Clicked No
User Clicked Try Again
User Clicked Continue
[ rv, code ] =
win32_ReadRegistry (key, subkey, value)
¶Read a value from the Windows registry.
Example:
key='SOFTWARE\\\\Cygnus Solutions\\\\Cygwin\\\\mounts v2'; win32_ReadRegistry('HKLM',key,'cygdrive prefix')
key must be one of the following strings:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
rv is an octave string of the returned bytes. This is a natural format for REG_SZ data; however, if the registry data was in another format, REG_DWORD then the calling program will need to process them
code is the success code. Values correspond to the codes in the winerror.h header file. The code of 0 is success, while other codes indicate failure In the case of failure, ’rv’ will be empty
[ rv, code ] =
win32_RegEnumKey (key, subkey)
¶Read the keys of a given subkey from the Windows registry.
Example:
key='SOFTWARE\\\\Cygnus Solutions\\\\Cygwin\\\\mounts v2'; win32_RegEnumKey('HKLM',key)
key must be one of the following strings:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
rv is an array of value strings for the name of keys for a given key and subkey.
code is the success code. Values correspond to the codes in the winerror.h header file. The code of 0 is success, while other codes indicate failure In the case of failure, ’rv’ will be empty
See also: winqueryreg.
[ rv, code ] =
win32_RegEnumValue (key, subkey)
¶Read value names from from the Windows registry.
Example:
key='SOFTWARE\\\\Cygnus Solutions\\\\Cygwin\\\\mounts v2'; win32_RegEnumValue('HKLM',key)
key must be one of the following strings:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
rv is an array of value strings for the name of values for a given key and subkey.
code is the success code. Values correspond to the codes in the winerror.h header file. The code of 0 is success, while other codes indicate failure In the case of failure, ’rv’ will be empty
See also: winqueryreg.
code =
win32_WriteRegistry (key, subkey, valuename, value)
¶Write a value to the Windows registry.
Example:
key='test\\\\temp'; win32_WriteRegistry('HKLM',key,'test_value', 0)
key must be one of the following strings:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
subkey is the subkey to the registry value.
valuename is the name of the value to write to the registry.
value is the value to write. It must be a a string or an integer value.
code is the success code. Values correspond to the codes in the winerror.h header file. The code of 0 is success, while other codes indicate failure
rv =
win32_MessageBox (title, text)
¶rv =
win32_MessageBox (title, text, MboxType)
¶Display a message box using the win32 API.
title MessageBox title string
text MessageBox text string
MBoxType can be an integer or a string.
For integer values, consult <windows.h>
The following string values are recognized:
MB_OK
MB_OKCANCEL
MB_ABORTRETRYIGNORE
MB_YESNOCANCEL
MB_YESNO
MB_RETRYCANCEL
Default is MB_OK
Returns a value rv:
User Clicked OK
User Clicked Cancel
User Clicked Abort i
User Clicked Retry
User Clicked Ignore
User Clicked Yes
User Clicked No
User Clicked Try Again
User Clicked Continue
winopen
(name) ¶Open the file or directory name in the windows registered application for the file, using shell open command.
Examples:
Open file document.docx in the docx viewer:
winopen ("document.docx");
Open the current directory in explorer:
winopen (pwd);