Results 1 to 10 of 10

Thread: Embedding apps in vb6

  1. #1
    Raw Wave Laidback's Avatar
    Join Date
    Oct 2003
    Location
    Madrid
    Posts
    1,984

    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?

  2. #2

  3. #3
    Variable Bitrate SilentAdmirer's Avatar
    Join Date
    Jul 2003
    Location
    Linz Am Rhein , DE
    Posts
    276
    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

  4. #4
    Raw Wave Laidback's Avatar
    Join Date
    Oct 2003
    Location
    Madrid
    Posts
    1,984
    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.

  5. #5
    I'm sorry, and you are....? frodobaggins's Avatar
    Join Date
    Jan 2003
    Location
    Ruston, LA
    Posts
    8,846
    Pic
    Attached Images Attached Images  
    [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!

  6. #6
    I'm sorry, and you are....? frodobaggins's Avatar
    Join Date
    Jan 2003
    Location
    Ruston, LA
    Posts
    8,846

    Talking

    This should get you started
    Attached Files 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!

  7. #7
    I'm sorry, and you are....? frodobaggins's Avatar
    Join Date
    Jan 2003
    Location
    Ruston, LA
    Posts
    8,846
    Quote 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!

  8. #8
    Raw Wave Laidback's Avatar
    Join Date
    Oct 2003
    Location
    Madrid
    Posts
    1,984
    Thanks, I'll take a look

  9. #9
    Raw Wave Laidback's Avatar
    Join Date
    Oct 2003
    Location
    Madrid
    Posts
    1,984
    Quote 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

  10. #10
    I'm sorry, and you are....? frodobaggins's Avatar
    Join Date
    Jan 2003
    Location
    Ruston, LA
    Posts
    8,846
    Quote 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!

Similar Threads

  1. Screwy docked toolbox in VB6!!
    By deadweasel in forum Software & Software Development
    Replies: 5
    Last Post: 02-12-2004, 02:06 AM
  2. Adding apps
    By craigyb in forum MediaCar
    Replies: 4
    Last Post: 12-01-2003, 06:52 AM
  3. external apps
    By reda4 in forum MediaCar
    Replies: 6
    Last Post: 11-20-2003, 03:46 AM
  4. How to remove winamp AVS border. - Sample VB6 code
    By Fusion-One in forum Software & Software Development
    Replies: 1
    Last Post: 10-03-2003, 07:55 PM
  5. 2 or more external apps option...
    By cyrocr in forum ME Archive
    Replies: 0
    Last Post: 03-27-2003, 08:37 AM

Bookmarks

Posting Permissions

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