Открытие приложения в форме после flashscreen? - Vb.net
Привет :)
I'm creating a kind of virtualbox (I'm just trying to learn with mini-projects and stuff). I've found a way to open applications within the dimensions of the windows form. So once I thought I had found a solution for this, I began testing it on different applications; it works with notepad, firefox, etc (they all open within the form itself). However, I tried it on a video game (RuneScape [don't judge lel]) and only the splash screen opened in the form. Once the splash screen had loaded the game's resourced, and the main client/game process started, the client opened outside of the box. In the task manager, it seems like the launcher and the client process rely on one another (i.e. if I kill rs2client.exe and leave runescape.exe running, both kill themselves and the game dies - and vice versa). How do I make it so that the window (main game client) that opens after the splash screen remains inside the form, just as the splash screen did?
Это мой текущий код:
Option Strict On Option Explicit On Public Class Form1 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 Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load proc = Process.Start("C:\Program Files\Jagex\RuneScape Launcher\runescape.exe") proc.WaitForInputIdle() proc.WaitForExit(1000) SetParent(proc.MainWindowHandle, Panel1.Handle) End Sub End Class
Что я уже пробовал:
Я пробовал это (вероятно, очень плохая попытка найти решение):
Option Strict On Option Explicit On Public Class Form1 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 Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load proc = Process.Start("C:\Program Files\Jagex\RuneScape Launcher\runescape.exe") proc.WaitForInputIdle() proc.WaitForExit(1000) SetParent(proc.MainWindowHandle, Panel1.Handle) proc = Process.Start("C:\ProgramData\Jagex\Launcher\rs2client.exe") proc.WaitForInputIdle() proc.WaitForExit(1000) SetParent(proc.MainWindowHandle, Panel1.Handle) End Sub End Class
Большое спасибо за любую помощь! Если вы дадите действительно сложный ответ, который я не знаю, как на самом деле реализовать, будьте готовы терпеть мою неопытность (я пытаюсь научиться xD)!