Announcement

Collapse
No announcement yet.

Embedding apps in vb6

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Embedding apps in vb6

    VB6

    How do you embed another app like Coyote does?

    I launch the app using shell and get it's pid, then I've found some code to match up one of the open windows with the pid and then change the parent but it still doesn't work!

    The nearest I've got is capturing the splash screen of the app!!

    Can anyone point me to a code example?
    Laidback


    The ultimate CarPC - Wow!

  • #3
    here is a small c code I wrote which works.
    RECT rect;
    GetWindowRect(&rect);

    MoveWindow(m_hApp,0,0,0,0,TRUE);
    DWORD dwStyle = GetWindowLong(m_hApp,GWL_STYLE);
    dwStyle &= ~WS_OVERLAPPEDWINDOW;
    SetWindowLong(m_hApp,GWL_STYLE,dwStyle);
    HWND hAppParent = GetParent(m_hApp);
    SetParent(m_hApp,hWnd); //hWnd is the handle of the current App
    MoveWindow(m_hApp,0,0,rect.right - rect.left,rect.botton - rect.top,TRUE);

    Hope it helps
    Satish
    VOICES Status : Rework in Progress [||--------](20%)
    Preview Version at http://voices.techworldonline.com

    Comment


    • #4
      I don't know c but that looks like what I'm trying to do, get the window handle, set the parent, then move the window. It works for Notepad but I can't get it to work for other programs, so there must be something simple I'm missing! For Netstumbler it sometimes grabs the splash screen and moves that but not always and never the main window.
      Laidback


      The ultimate CarPC - Wow!

      Comment


      • #5
        Pic
        Attached Files
        [H]4 Life
        My next generation Front End is right on schedule.
        It will be done sometime in the next generation.
        I'm a lesbian too.
        I am for hire!

        Comment


        • #6
          This should get you started
          Attached Files
          [H]4 Life
          My next generation Front End is right on schedule.
          It will be done sometime in the next generation.
          I'm a lesbian too.
          I am for hire!

          Comment


          • #7
            Originally posted by Laidback
            I don't know c but that looks like what I'm trying to do, get the window handle, set the parent, then move the window. It works for Notepad but I can't get it to work for other programs, so there must be something simple I'm missing! For Netstumbler it sometimes grabs the splash screen and moves that but not always and never the main window.
            Because you are grabbing the wrong window. The handle you get back from shell will not always be the right one. With netstumbler it grabs the splash, but then the splash screen or some other process launches the main app, (different handle)

            Use my example will show you how to enumerate and search for the window you want.

            Frodo
            [H]4 Life
            My next generation Front End is right on schedule.
            It will be done sometime in the next generation.
            I'm a lesbian too.
            I am for hire!

            Comment


            • #8
              Thanks, I'll take a look
              Laidback


              The ultimate CarPC - Wow!

              Comment


              • #9
                Originally posted by Laidback
                Thanks, I'll take a look
                Yea, forgot to say on this thread but thanks, frodo, for the sample! Just what I needed
                Laidback


                The ultimate CarPC - Wow!

                Comment


                • #10
                  Originally posted by Laidback
                  Yea, forgot to say on this thread but thanks, frodo, for the sample! Just what I needed

                  I aim to please.
                  [H]4 Life
                  My next generation Front End is right on schedule.
                  It will be done sometime in the next generation.
                  I'm a lesbian too.
                  I am for hire!

                  Comment

                  Working...
                  X