Paul
Tue Feb 24 03:52:50 CST 2004
Hi.
The codes works great I can now create a new desktop and switch to this,
however the desktop shows blank with no icons and when I try to use the
CreateProcess API on open a new application on the desktop it says there was
an application fault. If I try CreateProceesWithLogon nothing happens. Any
ideas ?
Thanks
Paul
"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:%23su3Xy%239DHA.2404@TK2MSFTNGP11.phx.gbl...
> Paul,
>
> Try this
>
> Structure RECT
> Public left, top, right, bottom As Integer
> End Structure
>
> Structure GUITHREADINFO
> Public cbSize As Integer
> Public flags As Integer
> Public hwndActive As IntPtr
> Public hwndFocus As IntPtr
> Public hwndCapture As IntPtr
> Public hwndMenuOwner As IntPtr
> Public hwndMoveSize As IntPtr
> Public hwndCaret As IntPtr
> Public rcCaret As RECT
> End Structure
>
> Structure SECURITY_ATTRIBUTES
> Public nLength As Integer
> Public lpSecurityDescriptor As IntPtr
> Public bInheritHandle As Boolean
> End Strucure
>
> Declare Auto Function CreateWindowStation Lib "user32.dll" (lpwinsta
> As String, dwFlags As Integer, dwDesiredAccess As Integer, lpsa As
> IntPtr) As IntPtr
>
> Declare Function SetProcessWindowStation Lib "user32.dll" (hWinSta As
> IntPtr) As Boolean
>
> Declare Auto Function CreateDesktop Lib "user32.dll" (lpszDesktop As
> String, lpszDevice As IntPtr, pDevmode As IntPtr, dwFlags As Integer,
> dwDesiredAccess As Integer, lpsa As IntPtr) As IntPtr
>
> Declare Function SetThreadDesktop Lib "user32.dll" (hDesktop As
> IntPtr) As Boolean
>
> Declare Function GetGUIThreadInfo Lib "user32.dll" (idThread As
> Integer, ByRef lpgui As GUITHREADINFO) As Boolean
>
> For CreateWindowStation and CreateDesktop, you can change the lpsa
> parameter to ByRef lpsa As SECURITY_ATTRIBUTES if you actually want to
> specify it (not pass NULL).
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
>
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com
> Please reply only to the newsgroup.