I found that RegOpenKeyEx will fail on Vista when the base path is
HKEY_LOCAL_MACHINE but my app need to check some key of driver.
Is there any api can ask admin priviledges when launching then I do
not need to click mouse right key and choose admin priviledges from
Vista pop-up menu ?
Thank you .
Yes there is (specify admin priviledges in the manifest) - but what if
you simply won't request _write_ access ?
-- pa
I am not sure this is the right group for your question, the
microsoft.public.win32.programmer.kernel seems to be more suitable.
Regarding your question. At startup your program can check SID of user and
if it limited admin, you can propose to re-run it via runas (ShellExecute
or CreateProcess). But the Pavel's suggestion with manifest seems to be
more elegant.
--
Volodymyr M. Shcherbyna, blog: http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no rights)