C# or C++ How to make program to run when user password asked? -
i've such problem, need program run when user password asked(when computer switched on). know there class registrykey in both c++ , c# make program start when user logged in. there can that?
you might want have @ function createservice in msdn:
sc_handle winapi createservice( _in_ sc_handle hscmanager, _in_ lpctstr lpservicename, _in_opt_ lpctstr lpdisplayname, _in_ dword dwdesiredaccess, _in_ dword dwservicetype, _in_ dword dwstarttype, _in_ dword dwerrorcontrol, _in_opt_ lpctstr lpbinarypathname, _in_opt_ lpctstr lploadordergroup, _out_opt_ lpdword lpdwtagid, _in_opt_ lpctstr lpdependencies, _in_opt_ lpctstr lpservicestartname, _in_opt_ lpctstr lppassword );
for dwstarttype use service_auto_start
for lpservicestartname can either use null make use localsystem account, or of following: nt authority\localservice or nt authority\networkservice. find out more different accounts can offer, read on service user accounts in msdn.
for lppassword can use null if used of values above.
for lpbinarypathname must put file path service.
if unsure other should have @ sample code "a basic windows service in c++ (cppwindowsservice)" in msdn. sample code starting point.
Comments
Post a Comment