Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I kept one button on XP Gina logon screen and am trying to execute an c#.net windows Form exe using that button using this code

ShellExecute(NULL, NULL, L"C:\\WINDOWS\\system32\\ReadFile.exe", NULL, NULL, SW_SHOWNORMAL);

where ReadFile.exe is made in c#.net , when i pressed that button then it unable to show that windows form

i tried to execute cmd.exe also but its not showing that cmd windows also

i used system("start C:\\WINDOWS\\system32\\cmd.exe"); also but unable to show command window.
i also used CreateProcess() to execute this exe this,
in this exe i write one code to delete one off registry is able to delete that registry but its unable to show that windows form on login screen after pressing that button .

please tell me how can i execute an external exe in XP gina code that code for Gina i download from http://msdn.microsoft.com/en-us/magazine/cc163786.aspx here.

please tell me ...... if there are any solution to execute an external exe
Posted
Updated 22-Jan-12 3:34am
v2

I see you have read:
Customizing GINA, Part 1[^]
Customizing GINA, Part 2[^]

The difficulties you are experiencing are there by design.

You should execute your ReadFile.exe under a logged on user account - and logging on can be done in code from a windows service.

It's pretty hard to imagine why you need to execute a separate executable from gina - a hint or two might help ... basically I'm fairly certain that what you are trying to do should be done differently.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Yogendra gangwar 23-Jan-12 7:23am    
thanks Espen Hrlinn,

that ReadFile.exe i have to execute because there i am keeping one button which inform that you have been enter domain name is correct or not.If entered domain name is correct then it will show on C#.net window form else if domain name is incorrect it will show what is the current domain name.
and i tried to write one registry data using this C#.net exe it able to write data in registry but its not showing only window form on login screen.
And i tried to execute cmd.exe, notepad.exe(for testing purpose) all these exe also not showing any window.
please help me....

thanks a lot....
Yogendra gangwar 23-Jan-12 7:28am    
Hi Espen Harlinn,

that same process i did on windows 7 and windows vista credential provider also on that i am able to get that c#.net window-form on login screen,but in XP Gina i am getting trouble...
Espen Harlinn 23-Jan-12 7:34am    
Your design is a bit different from how I would try to do it. My guess is that the process lacks required the permissions to execute the process using CreateProcess. I'd try to use mixed mode C++/CLI and just show the form directly.
Yogendra gangwar 24-Jan-12 5:33am    
Hi,
if i gives you my code and exe file then you can try that, if you required i tried too much but i am unable to get that windows form when i pressed that button..
please..
there are no way to show .net application if you be try to execute any exe,xp gina dont allow any permission to show other windows ,but there are way to resolve it if we make that in form dll that it could be resolved and you can get C#.net application window at the time of logon window of windows xp...
 
Share this answer
 
please any one cant help me to short out my problem
Start c# program before windows logon as description i had given above
 
Share this answer
 
Comments
Dave Kreskowiak 2-Mar-12 21:55pm    
It's pretty simple really. You can NOT launch a process and have it show on the Login desktop. There is no way around this because of security concerns. This is by design!

Why? Because you're not going to get the chance to replace the login credentials window (or overlay it) with your own login form, thereby capturing the users credentials for your own use.

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