Displaying Window on Logon Screen Using C# in Windows XP

和自甴很熟 提交于 2019-11-29 15:24:15

问题


I am trying to create a service with C# that launches a process that can be displayed on the Windows XP Logon screen.

I found some code that is doing this in C++. The C++ code is for a service that creates another process with STARTUPINFO.lpDesktop set to "WinSta0\WinLogon". The created process is then displayed to the Windows Logon Screen. I can't seem to find a way to specify the 'desktop' of a new process in C# using System.Diagnostic.Process class.

Does anyone know how to do this with C#?


回答1:


The solution was to call the C++ Win32 API function CreateProcess from kernel32.dll from the C# code. This site was very helpful in getting the correct function signature for C#:

http://www.pinvoke.net/default.aspx/kernel32/CreateProcess.html




回答2:


I think you'll have to write it in C++, compile that to a DLL and then call the DLL from your managed code.



来源:https://stackoverflow.com/questions/103427/displaying-window-on-logon-screen-using-c-sharp-in-windows-xp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!