-
CreateDesktop() question
Has anybody got this to work?
I have:
Code:
Private Declare CreateDesktop Lib "user32" _
Alias "CreateDesktopA" ( ByVal lpszDesktop As String, _
ByVal lpszDevice As String, _
ByVal lpDevMode As Long, _
ByVal dwFlags As Long, _
ByVal dwDesiredAccess As Long,
ByVal lpSecAttrib As Long ) As Long
Public Const DESKTOP_FULLACCESS = &H1FF
Public Const DF_ALLOWOTHERACCOUNTHOOK = &H1
Which I use thus:
Code:
hDesk = CreateDesktop("Merrion Computing", _
vbNullString, _
vbNull, _
DF_ALLOWOTHERACCOUNTHOOK , _
DESKTOP_FULLACCESS, _
vbNull)
Which seems to return a valid desktop handle...but then when I call SwitchDesktop :
Code:
Private Declare SwitchDesktop(ByVal hDesk As Long) As Long
used thus
Code:
lRet = SwitchDesktop(hDesk)
Err.LastDllError is zero but nothing seems to happen.
Any ideas?
-
-
Windows 2000 (pro)
The dll entry poinst are correct. I'm logged in as an administrator so I should have sufficient rights...
-
Since I'm not running NT, I can't test this, but there is some downloadable source on this link that you might find useful.
http://www.developerfusion.com/show/1716/2