![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Запись в автозапуск
Степан © (2007-01-22 14:11:00)Мне интересно, какие есть еще способы записи в автозапуск, кроме записи в реестр, использование служб и запись в системные ini-файлы?
tesseract (2007-01-22 17:23:00) [1]
HRESULT SHGetFolderPath( HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwFlags,
LPTSTR pszPath
);
hwndOwner
[in] Handle to an owner window. This parameter is typically set to NULL. If it is not NULL, and a dial-up connection needs to be made to access the folder, a user interface (UI) prompt will appear in this window.
nFolder
[in] A CSIDL value that identifies the folder whose path is to be retrieved. Only real folders are valid. If a virtual folder is specified, this function will fail. You can force creation of a folder with SHGetFolderPath by combining the folder's CSIDL with CSIDL_FLAG_CREATE.
hToken
[in]
An access token that can be used to represent a particular user. For systems earlier than Microsoft® Windows® 2000, it should be set to NULL. For later systems, hToken is usually set to NULL. However, you may need to assign a value to hToken for those folders that can have multiple users but are treated as belonging to a single user. The most commonly used folder of this type is My Documents.
The caller is responsible for correct impersonation when hToken is non-NULL. It must have appropriate security privileges for the particular user, including TOKEN_QUERY and TOKEN_IMPERSONATE, and the user's registry hive must be currently mounted. See Access Control for further discussion of access control issues.
Assigning the hToken parameter a value of -1 indicates the Default User. This allows clients of SHGetFolderPath to find folder locations (such as the Desktop folder) for the Default User. The Default User user profile is duplicated when any new user account is created, and includes special folders such as My Documents and Desktop. Any items added to the Default User folder also appear in any new user account.
dwFlags
[in] Flags to specify which path is to be returned. It is used for cases where the folder associated with a CSIDL may be moved or renamed by the user.
SHGFP_TYPE_CURRENT
Return the folder's current path.
SHGFP_TYPE_DEFAULT
Return the folder's default path.
pszPath
[out] Pointer to a null-terminated string of length MAX_PATH which will receive the path. If an error occurs or S_FALSE is returned, this string will be empty.
CSIDL смотри
> CSIDL_COMMON_STARTUP (0x0018)
The file system directory that contains the programs that appear in the Startup folder for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs\Startup. Valid only for Windows NT systems.
>CSIDL_STARTUP (0x0007)
The file system directory that corresponds to the user's Startup program group. The system starts these programs whenever any user logs onto Windows NT or starts Windows 95. A typical path is C:\Documents and Settings\username\Start Menu\Programs\Startup.
А то язык оси можешь перепутать.
Игорь Шевченко (2007-01-22 15:51:00) [2]
> а теоретически можно записывать в автозапуск каким-либо
> способом под любыми правами пользователя?
Нельзя. Ты же сам пишешь - отказано в доступе.
zdm (2007-01-22 15:14:00) [3]Заметил, если ставить прогу под админом инстолятор спрашивает. Для конкретного юзера или для всех? И если ставит админ , то прописывается соответсвенно в "Stepan" или в "AllUsers"
zdm (2007-01-22 15:11:00) [4]Как, обычный юзер может управлять запуском программ для всех юзеров включая админа, ты об этом не думал?
zdm (2007-01-22 15:09:00) [5]каждый юзер кидает в автозгрузку себе сам!
zdm (2007-01-22 15:08:00) [6]Блин, заходишь под админом, кидаешь в ALLUSERSи работать дальше будет у всех.
Степан (2007-01-22 15:06:00) [7]Нет, WinXP, и не под админом. Но если пользователь проги не будет админом,
ему надо просить у админа записать программу в автозапуск? А по другому? Если заходить через администратора, то все способы работают, а теоретически можно записывать в автозапуск каким-либо способом под любыми правами пользователя?
zdm (2007-01-22 15:02:00) [8]Либо поработали любители Твикеров различных.
zdm (2007-01-22 15:01:00) [9]ОС какая? не Vista случаем? Ты под админом заходишь?
Степан (2007-01-22 14:59:00) [10]"Не удается скопировать ... Нет доступа". Неработает.
zdm (2007-01-22 14:53:00) [11]C:\Documents and Settings\All Users\Главное меню\Программы\Автозагрузка
zdm (2007-01-22 14:51:00) [12]
> Степан (22.01.07 14:49) [6]
> Надо записать в программу в автозапуск, чтоб на всех правах
> пользователя она шла, такой метод, чтобы везде и всегда
> работал.
Если ты админ. то пишешь её в автозагрузку-для AllUsers. И у всех даже у самых не "power users" она будет запускатья. В чём проблема-то?
zdm (2007-01-22 14:49:00) [13]Можешь еще назначить задание и выполнять его со входом в систему. Хотя это все равно запись в реестр.
Степан (2007-01-22 14:49:00) [14]Надо записать в программу в автозапуск, чтоб на всех правах пользователя она шла, такой метод, чтобы везде и всегда работал.
zdm (2007-01-22 14:43:00) [15]Не совсем не бывает!!! Ты что-то вокруг да около ходишь, объясни конкретней задачу.
Степан (2007-01-22 14:41:00) [16]А если она не совсем моя? Есть еще способы?
zdm (2007-01-22 14:39:00) [17]В смысле заблокирована? "Твоя" автозагрузка всегда доступна.
Степан (2007-01-22 14:36:00) [18]А если она заблокирована?
Джо (2007-01-22 14:15:00) [19]Папка «Автозагрузка».