3 Replies - 341 Views - Last Post: 31 December 2012 - 01:09 PM Rate Topic: -----

#1 dgb3000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 30-December 12

Application relaunches outside of program!

Posted 30 December 2012 - 03:00 PM

I've tried to do this code below that runs on form load:
 
Declare Auto Function SetParent Lib "user32.dll" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
    Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    Private Const WM_SYSCOMMAND As Integer = 274
    Private Const SC_MAXIMIZE As Integer = 61488
    Dim proc As Process
    Private Sub LessonMap_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        proc = Process.Start("C:\Program Files (x86)\CoreUIPtest\Launcher.exe")
        proc.WaitForInputIdle()

        SetParent(proc.MainWindowHandle, Panel1.Handle)
        SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
    End Sub



The program has a splash form, and when the form disappears, the program opens outside of the program, but the splash form loads inside the application, can anyone help? This is a problem and I need to finish it soon.

Is This A Good Question/Topic? 0
  • +

Replies To: Application relaunches outside of program!

#2 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,507
  • Joined: 16-March 11

Re: Application relaunches outside of program!

Posted 30 December 2012 - 03:22 PM

What are you trying to accomplish exactly? There may be an easier route.
Was This Post Helpful? 0
  • +
  • -

#3 dgb3000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 30-December 12

Re: Application relaunches outside of program!

Posted 30 December 2012 - 03:56 PM

View Posttrevster344, on 30 December 2012 - 03:22 PM, said:

What are you trying to accomplish exactly? There may be an easier route.


Im trying to run the program inside my program, the program loads, but then it goes past the splash screen and it reopens outside of the parent.
Was This Post Helpful? 0
  • +
  • -

#4 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,507
  • Joined: 16-March 11

Re: Application relaunches outside of program!

Posted 31 December 2012 - 01:09 PM

What do you mean by run it inside your program? You mean you're trying to launch an application as a child form of your application?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1