dcsimg
Results 1 to 5 of 5

Thread: Is possible to start an APP inside a VB Form?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    690

    Is possible to start an APP inside a VB Form?

    I want to launch the chrome browser, using the -kiosk mode, so it don't show addres bar, tittle bar, etc.

    But I want to tell to the app process, THIS is your desktop, so force the app to draw / paint & work with boundaries of inside the VB form surface.

    Is it possible?

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    3,246

    Re: Is possible to start an APP inside a VB Form?

    Have you tried the SetParent api?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    690

    Re: Is possible to start an APP inside a VB Form?

    set parent did it , but only for the first run of chrome, if I close it, an dre-open.... the second instance is floating outside.....mmmmmmmmmmmm......

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    690

    Re: Is possible to start an APP inside a VB Form?

    I wonder what happens if i open it, set it as parent, and then close the vb form. I will need a way to kill it or close it before unloading the form.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    690

    Re: Is possible to start an APP inside a VB Form?

    Code:
    lngReturn = CreateProcess(strProgram, strParams, udtSec, udtSec, _
                             True, ByVal 0, ByVal 0, vbNullString, _
                             udtStartup, _
                             udtProc)
                             
    lngReturn = GetAncestor(udtProc.hProcess, GA_PARENT)
    udtGUI.cbSize = Len(udtGUI)
    '
    ' Wait for an hWnd to be allocated
    '
    Do
        lngReturn = GetGUIThreadInfo(udtProc.dwThreadId, udtGUI)
        DoEvents
    Loop Until udtGUI.hwndactive <> 0
    
    StartProcess = udtGUI.hwndactive
    
    lngReturn = SetParent(udtGUI.hwndactive, FormDesktop.hWnd)
    
    Call PositionWindow(udtGUI.hwndactive)
    using this, but it won't work if there is another instance already.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width