Next: XML, Previous: Standard, Up: Extensions
Retrieve entry from the system registry entry pointed to by key, subkey
Parameters
- key [constant]
- One of the predefined HKEY_* constants.
- subkey [string]
- A string specifying the path of the key.
- entry [string]
- The specific entry to retrieve. If it is not specified, the default entry is used.
Return Value [mixed]
The specified key, or
falseif not found.Example
$wallpaper = win_get_registry_key(HKEY_CURRENT_USER, "Control Panel\\Desktop", "Wallpaper");
Return a string from the operating system containing a description of the last error that occured.
Return Value [string]
String containing the error message.
Example
$msg = win_getlasterror(); echo "Windows said: $msg";
Display a popup message box to the user.
Parameters
- text [string]
- The text to show in the popup window.
- caption [string]
- The caption of the popup window.
- type [int]
- Flags that affect the type of message box shown. This argument should be created from the MB_ constants, binary OR'd together.
Return Value [int]
The return value will depend on the type flags passed to the message box. The value will match one of the ID_* constants, depending on which button the user clicked on to close the message box.
Example
$ret = win_messagebox('This is the test of the messagebox','Box Caption',MB_YESNOCANCEL|MB_ICONINFORMATION); echo "ret was $ret "; switch ($ret) { case IDYES: win_messagebox('You pressed Yes','Good'); break; case IDNO: win_messagebox('You pressed No', 'Bad'); break; case IDCANCEL: win_messagebox('You pressed Cancel', 'Indifferent'); break; }
Set entry in system key key, subkey in the system registry.
Parameters
- key [constant]
- One of the predefined HKEY_* constants
- subkey [string]
- A string specifying the path of the key
- entry [string]
- The specific entry to write to. If it is not specified, the default entry is used
- value [string]
- The new value for the specified registry key. If it is not passed, the specified key will be removed.
Return Value [bool]
trueon success orfalseon failureExample
win_set_registry_key(HKEY_LOCAL_MACHINE, "SOFTWARE\Super Software Company\ActiveProduct\". "1.0" "my-integer", 25);
Perform an operation on the specified file, such as opening a web browser to a URL or opening Notepad on a text file.
Parameters
- operation [string]
- The action to be performed. It may be any of the following strings:
- 'edit'
- Launches an editor and opens the document for editing.
- 'explore'
- Explores the folder specified by file.
- 'find'
- Initiates a search starting from the specified directory.
- 'open'
- Opens the file specified by file. The file can be an executable file, a document file, or a folder.
- 'print'
- Prints the document file specified by file. If file is not a document file, the function will fail.
- file [string]
- The file on which to execute the verb.
- params [string]
- If file is an executable file, params will be passed as parameters when the file is executed.
- workdir [string]
- The default working directory.
- showcmd [constant]
- Flags that specify how the application is displayed when it is opened. These should be one or more of the SW_* constants binary OR'd together.
Return Value [int]
A value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise.
Example
// launch a web browser $ret = win_shellexecute('open','http://www.google.com', '', '', SW_SHOWMAXIMIZED); echo "return: $ret\n";For more information, see the Microsoft API.