[英]Displaying Window on Logon Screen Using C# in Windows XP
I am trying to create a service with C# that launches a process that can be displayed on the Windows XP Logon screen. 我正在尝试使用C#创建一个服务,该服务启动一个可以在Windows XP“登录”屏幕上显示的进程。
I found some code that is doing this in C++. 我发现在C ++中正在执行此操作的一些代码。 The C++ code is for a service that creates another process with STARTUPINFO.lpDesktop set to "WinSta0\\WinLogon".
C ++代码用于服务,该服务使用STARTUPINFO.lpDesktop设置为“ WinSta0 \\ WinLogon”来创建另一个进程。 The created process is then displayed to the Windows Logon Screen.
然后,创建的过程将显示在Windows登录屏幕上。 I can't seem to find a way to specify the 'desktop' of a new process in C# using System.Diagnostic.Process class.
我似乎找不到使用System.Diagnostic.Process类在C#中指定新进程的“桌面”的方法。
Does anyone know how to do this with C#? 有谁知道如何使用C#做到这一点?
The solution was to call the C++ Win32 API function CreateProcess from kernel32.dll from the C# code. 解决方案是从C#代码的kernel32.dll调用C ++ Win32 API函数CreateProcess。 This site was very helpful in getting the correct function signature for C#:
该站点对于获取C#的正确函数签名非常有帮助:
http://www.pinvoke.net/default.aspx/kernel32/CreateProcess.html http://www.pinvoke.net/default.aspx/kernel32/CreateProcess.html
我认为您必须用C ++编写它,将其编译为DLL,然后从托管代码中调用DLL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.