Merhaba arkadaşlar yapmakta olduğum bir proje var panel icine bilgisayarımda bulunan bir exe dosyası ekledim.Fakat program calıştığında bu exe dosyasını panel sınırları icerisinde hareket ettirebiliyorum ve exe dosyasının sağ ust koşesinde kapatma,simge durumunu kucultme işaretleri bulunuyor yani ayrı bir pencere kontrol ediyormuşum gibi bunu nasıl engelleyebilirim panel icerisinde sabit kalsın hareket etmesin istiyorum.Kodlar şu şekilde
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
_
Private Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As Boolean
End Function
_
Public Shared Function MoveWindow(ByVal hWnd As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Boolean) As Boolean
End Function
Structure RECT
Dim Left As Integer ' // x position of upper-left corner
Dim Top As Integer ' // y position of upper-left corner
Dim Right As Integer ' // x position of lower-right corner
Dim Bottom As Integer ' // y position of lower-right corner
End Structure
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim proc As Process
Dim AppPath As String
Dim strPath As String
AppPath = "C:\Users\Kamil Uzun\Documents\Visual Studio 2012\Projects\WindowsApplication3\CarCounting_v1.0 (source and exe)\Bin\VideoPlayer.exe"
strPath = "C:\Users\User\Documents\Visual Studio 2010\Projects\3d_tictac.bin"
proc = Process.Start(AppPath, " -v10 -M0 " & Chr(34) & strPath & Chr(34))
proc.WaitForInputIdle()
Me.Cursor = Cursors.WaitCursor
Threading.Thread.Sleep(2000)
Me.Cursor = Cursors.Default
SetParent(proc.MainWindowHandle, Panel1.Handle)
Dim wRect As RECT = New RECT
GetWindowRect(proc.MainWindowHandle, wRect)
MoveWindow(proc.MainWindowHandle, 0, 0, wRect.Right - wRect.Left, wRect.Bottom - wRect.Top, True)
' SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
End Sub
__________________
Panel icinde exe dosyası
Programlama0 Mesaj
●24 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- Panel icinde exe dosyası