1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| 'Déclarations pour obtenir la fenetre KaraFun dans ma form
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
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 TRAVAIL_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
proc = Process.Start("C:\Musique\KaraFun Player\KaraFunPlayer.exe")
proc.WaitForInputIdle()
Dim hWnd As Long
hWnd = FindWindow("TPlayFrm", "KaraFun Player")
If hWnd <> 0 Then
SetParent(hWnd, Me.PAN_KARAFUNPLAYER.Handle)
SendMessage(hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
End If
End sub |
Partager