Displaying a window on a login screen using C # in Windows XP

I am trying to create a service with C # that starts a process that can appear on the login screen in Windows XP.

I found code that does this in C ++. C ++ code is for a service that creates another process with the STARTUPINFO.lpDesktop parameter set to "WinSta0 \ WinLogon". The created process is then displayed on the Windows login screen. It seems I can’t find a way to specify the "desktop" of the new process in C # using the System.Diagnostic.Process class.

Does anyone know how to do this using C #?

+4
source share
2 answers

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

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

+3
source

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

-1
source

Source: https://habr.com/ru/post/1276940/


All Articles