Results 1 to 4 of 4

Thread: CreateDesktop() question

  1. #1

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616

    Question 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?
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Are you running NT?

  3. #3

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Windows 2000 (pro)

    The dll entry poinst are correct. I'm logged in as an administrator so I should have sufficient rights...
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width