I am currently working on a dos game menu system, that runs with ScummVM, DosBox and DosBox using Windows 3.11. I am writing it in Visual Studio 2011, below is the method I use to start DosBox. This code starts DosBox without the console been shown, it also hides the form when DosBox is started, and reshows the form when DosBox terminates. I hope this helps.
Public Declare Function apiFindWindow Lib "user32" Alias "FindWindowA" (ByVal strClass As String, ByVal lpWindow As String) As Long
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Function IsProcessRunning(ByVal ProcessName As String) As Boolean
Dim WMIServicesObject As Object, WMIServicesItems As Object
IsProcessRunning = False
WMIServicesObject = GetObject("winmgmts:\\.\root\cimv2")
WMIServicesItems = WMIServicesObject.InstancesOf("Win32_Process")
For Each WMIServicesProcess As Object In WMIServicesItems
If (Trim(LCase(WMIServicesProcess.Caption)) = Trim(LCase(ProcessName))) Then IsProcessRunning = True
Next WMIServicesProcess
WMIServicesObject = Nothing
WMIServicesItems = Nothing
End Function
Public Sub StartGame()
Dim DosBoxParameters as string = "-noconsole -conf game.conf"
Dim DosboxExecutable as string = "c:\program files (x86)\dosbox\dosbox.exe"
Me.hide()
ShellExecute(apiFindWindow("OPUSAPP", "0"), "open", DosBoxExecutable, DosBoxParameters, Mid(DosBoxExecutable, 1, InStrRev(DosBoxExecutable, "\")), 0)
Do
Loop Until (IsProcessRunning(Mid(DosBoxExecutable, InStrRev(DosBoxExecutable, "\") + 1)) = False)
Me.Show()
End Sub