How to make my form a desktop window

Posted on 2007-10-18
Last Modified: 2010-04-23
Hi, I want to ask how can I make my form in visual basic become a desktop windows. Cause I want to make a shell replacement for windows. Does any body know how to make it? Thank you.
Question by:zmartnet
    LVL 8

    Expert Comment

    The form is a desktop windows without the need of doing nothing special.
    What kind of Form do you want? a MDI form for multiple documents?
    LVL 15

    Accepted Solution

    here you go...

    Option Explicit

    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

    Private Const GW_CHILD = 5
    Private Sub Form_Load()
        Dim lngHandle As Long
        lngHandle = FindWindow("ProgMan", vbNullString)
        lngHandle = GetWindow(lngHandle, GW_CHILD)
        lngHandle = GetWindow(lngHandle, GW_CHILD)
        Call SetParent(Me.hwnd, lngHandle)
    End Sub

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now