Click here to Skip to main content
15,887,328 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Here a problem puzzle me for a long time.
I want to start a process when user select a account to login at LogonUI.
I had tried to create it in LogonProvide.dll with API which normally create a process, such as CreateProcess, but all failed.(LogonProvide.dll is called winlogon.exe and run as system account)
Is there any way to solve this problem.
If somebody has any suggestion please reply me.
Thanks a lot.
Posted
Updated 11-Apr-11 21:09pm
v2

You can place the application to run in Registry using the key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run


I have my "secret weapon" I use to learn all I need about auto-start processes: Sysinternals AuroRuns application. Go to Sysinternals Web site: http://technet.microsoft.com/en-us/sysinternals[^], download Sysinternals Suite: http://technet.microsoft.com/en-us/sysinternals/bb842062[^], unpack and run AutoRuns.exe. Read help, browse auto-run categories and items — you will find out what is called from where and how you can add your application to it.

—SA
 
Share this answer
 
v2
Comments
JustForWords 12-Apr-11 3:42am    
Thanks for your response. But how can I stop user's operation, such as CTRL+ALT+DELETE, Or if want to rollback to the LogonUI. I think it may not correspond to my function. And could you provide some useful links about you "weapon"?
THX.
Sergey Alexandrovich Kryukov 12-Apr-11 10:58am    
As to the "weapon", the only two links in my Answer are about it. Sysinternals was acquired my Microsoft, so it is at Microsoft site now. Even if it does not help you right now, the Sysinternals Suite is a must-have collection of all kinds of free system utilities. Some source code is also available; I've leaned a lot from it.

Yoour follow-up question looks new to me (about Ctlr+Alt+Delete), so could you describe the scenario you want in detail, and the purpose if it? I would think about it, sounds interesting.
--SA
JustForWords 15-Apr-11 3:19am    
THX SAKryukov for your help. Sorry for reply late. I had try a solution that start an APP in service. But there are some problem.
So I will describe my goal clearly.
I had a process that want to start after user select the user to log on(but don't login).If you know that in windows vista we can make a COM dll to control the logon operation inherit from ICredentialProvider. The dll may be invoked by winlogon.exe, and run as system.
But the process I want to start must start as a user who I want to logon. I had try to use CreateProcessAsUser in DLL, but unfortunately, had not realized yet, also CreateProcessWithLogon will return a error (It can be success after login, and started in a test APP).
These is my status now.
Oh, and the "weapons" is very powerful, I can do a lot research.
Sergey Alexandrovich Kryukov 15-Apr-11 4:20am    
You will certainly need to do a serious research, not sure if you can succeed. At this moment, I have no idea how to help it, frankly; sorry.
May I ask you, our of curiosity, what's the ultimate goal of all this activity?
--SA
JustForWords 15-Apr-11 4:45am    
Change the user name. (:
Ultimate goal is that the process will do a operation register user information to system.
If want to let the operation success and correct, process need to run as the user who you want to register. And the process is run when windows logon, it may the most hard crux.
This could help you:

Start Your Windows Programs From An NT Service[^]

It is an article from Xiangyang Liu[^] that will allow you to start your application as if it was a service.

Easy to use and it can work for you.

Regarding the CTRL+ALT+DELETE, you should look at GINA.DLL (if you are using a prior to 7 windows version).

In windows 7 I don't know how to change it's behavior.

HTH!
 
Share this answer
 
Comments
JustForWords 12-Apr-11 4:34am    
Thanks a lot. It must be helpful for me. I will try.
Sergey Alexandrovich Kryukov 12-Apr-11 11:29am    
Unfortunately that's not it. The Service is started before logging and and keeps running while people log in and out.
--SA
JustForWords 15-Apr-11 3:28am    
I think the suggestion is helpful for me. THX.
And do you know how to use CreateProcessAsUser in service, and show process interface in current desktop?
I have a way what done at XP, but failed on win7. Service can start a process but will be show on session 0.
These two days I did research about this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900