vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
NEU! sevCoolbar 3.0 - Professionelle Toolbars im modernen Design!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Fortgeschrittene
Re: DOS-Box in windows.form einbetten 
Autor: Maywood
Datum: 19.04.06 14:02

>> WindowsApplication1!WindowsApplication1.Form1::SetParent

Entwickelst du mit C++.Net?

Hier mal der komplette Vb-Code:
    Private Const SW_SHOWNORMAL As Int32 = 1
    Private Const GWL_STYLE = -16
    Private Const WS_CAPTION = &HC00000
    Private Const WS_BORDER = &H800000
 
    Private Declare Function SetParent Lib "user32.dll" ( _
                                               ByVal hWndChild As Int32, _
                                               ByVal hWndNewParent As Int32) As _
                                               Int32
 
    Private Declare Function SetWindowPos Lib "user32.dll" ( _
                                                  ByVal hwnd As Int32, _
                                                  ByVal hWndInsertAfter As _
                                                  Int32, _
                                                  ByVal x As Int32, _
                                                  ByVal y As Int32, _
                                                  ByVal cx As Int32, _
                                                  ByVal cy As Int32, _
                                                  ByVal wFlags As Int32) As _
                                                  Int32
 
    Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Int32, _
                                                        ByVal nCmdShow As _
                                                        Int32) _
                                                        As Int32
 
 
    Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" ( _
                                                                            ByV_
                                                                            al _
                                                                            hwn_
                                                                            d A_
                                                                            s I_
                                                                            ntP_
                                                                            tr, _
                                                                            ByV_
                                                                            al _
                                                                            nIn_
                                                                            dex _
                                                                            As _
                                                                            Int_
                                                                            ege_
                                                                            r, _
                                                                            ByV_
                                                                            al _
                                                                            dwN_
                                                                            ewL_
                                                                            ong _
                                                                            As _
                                                                            Int_
                                                                            ege_
                                                                            r) _
                                                                            As _
                                                                            Int_
                                                                            eger
 
    Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" ( _
                                                                            ByV_
                                                                            al _
                                                                            hwn_
                                                                            d A_
                                                                            s I_
                                                                            ntP_
                                                                            tr, _
                                                                            ByV_
                                                                            al _
                                                                            nIn_
                                                                            dex _
                                                                            As _
                                                                            Int_
                                                                            ege_
                                                                            r) _
                                                                            As _
                                                                            Int_
                                                                            eger
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
      System.EventArgs) Handles Button1.Click
        Dim f As String = System.Environment.GetEnvironmentVariable("COMSPEC")
        Dim hwnd As IntPtr = IntPtr.Zero
        Dim p As New Process
        Dim si As New System.Diagnostics.ProcessStartInfo(f)
        si.FileName = f
        si.WindowStyle = ProcessWindowStyle.Minimized
        p.StartInfo = si
        p.Start()
        System.Threading.Thread.Sleep(500)
        Application.DoEvents()
        hwnd = p.MainWindowHandle
        SetParent(hwnd.ToInt32, Me.Panel1.Handle.ToInt32)
        SetWindowPos(hwnd.ToInt32, 0, 0, 0, Me.Panel1.Width, Me.Panel1.Height, _
          0)
        ShowWindow(hwnd.ToInt32, SW_SHOWNORMAL)
    End Sub
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
      System.EventArgs) Handles MyBase.Load
        Me.Panel1.BorderStyle = BorderStyle.FixedSingle
    End Sub
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
DOS-Box in windows.form einbetten2.157Knackeback18.04.06 11:42
Re: DOS-Box in windows.form einbetten1.189Maywood18.04.06 13:02
Re: DOS-Box in windows.form einbetten1.155Knackeback19.04.06 08:20
Re: DOS-Box in windows.form einbetten1.130Iced-T19.04.06 13:26
Re: DOS-Box in windows.form einbetten1.055ModeratorDaveS19.04.06 13:44
Re: DOS-Box in windows.form einbetten983Iced-T19.04.06 14:02
Re: DOS-Box in windows.form einbetten1.104Maywood19.04.06 14:02

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel