|
|
|
|
Functions
Events
MioScript Reference
|
|
Syntax
| app.openAtStartup(ProductID, Value) |
Parameters
| ID | ProductID | Product ID.
| | BOOL | Value | Optional. true to enable auto-start, false to disable auto-start. Do not set this parameter if you want to get the actual value. |
Return value
| If Value is not set, the function returns true if auto-start is enabled, false otherwise. |
Description
Enables or Disables auto-start.
When auto-start is enabled, the application is loaded when windows starts.
To enable auto-start, the file _shortcut.lnk is copied from the application folder to the windows auto-start menu.
If the value of the key installedForAllUsers in the registry database is set to true, the shortcut is checked or updated for all users. If the value is 0 or the key is not found, the shortcut is checked or updated for the current user.
Call this function with no parameter to check if the application shortcut is in the auto-start menu..
This function can be called from JavaScript with mio_openAtStartup.
When called from JavaScript, the product ID cannot be specified. The current one is used.
Note: If you call this function to set a new value and if you are using JavaScript in your application, you should update the application data to reflect the new value. The key for this setting is OPEN_AT_STARTUP and can be set from JavaScript with mio_data_set.
Hiding application from the auto-start Windows menu
You can keep the application running at startup and hide the icon in the auto-start menu. This can be useful in a corporate environment to prevent users from removing the application manually.
To hide the application from the auto-start menu, do not use the app.openAtStartup function. Instead, add your application in the following location:
HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run
To read, write or delete values in the registry database, please check reg.read.ROOT, reg.write.ROOT and reg.deleteValue.ROOT.
Note: This function is defined in the library klib.k and is linked automatically. |
|
|
|