Results 1 to 2 of 2

Thread: Switch to desktop

  1. #1

    Thread Starter
    Hyperactive Member Matt-D's Avatar
    Join Date
    Nov 1999
    Location
    Mettmann, Germany
    Posts
    305
    Is there a possibility to switch to the Windows (95,98
    NT 4-)desktop ?

    In Windows 3.1 my second system I can switch to the
    program-manager with a Shell. SEHLL("PROGMAN.EXE", 1)

    I need this (in VB 3), because my
    programm is a full-screen application with no 'start' button.

    If you've some questions, ask me via eMail

    Thanks fo some advice, Matt

  2. #2
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554

    Hi

    Try this

    In the declarations section
    Declare Function SetActiveWindow Lib "user32.dll" (ByVal hwnd As Long) As Long
    Declare Function GetDesktopWindow Lib "user32.dll" () As Long
    Sub DoTheSwitch()

    Dim DesktopHwnd as long
    Dim Dummy as long

    'get desktop window handle
    'this is a win api call
    DesktopHwnd=GetDesktopWindow()

    'do the switch actual
    'this is a win api call
    dummy = SetActiveWindow(DesktopHwnd)


    End Sub

    Note
    This technique will only work when the window doing/controlling the switching (the window executing this code) is the active window.

    Use the statement as:

    DOTHESWITCH

    or

    CALL DOTHESWITCH

    and voila

    DocZaf
    {;->

    [Edited by Zaf Khan on 04-04-2000 at 07:53 PM]

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