|
-
Jan 14th, 2005, 11:36 PM
#1
Thread Starter
Member
Minimize or hide this DOS window
hi,
when i run a batch file it always pop up a DOS window on my windows 2000 computer.
how can i Minimize or hide this DOS window?
thanks
-
Jan 15th, 2005, 10:26 PM
#2
Re: Minimize or hide this DOS window
You would have to try the other parameters with SHELL, as I am not sure which ones work, but they should be the same or similar.
Or you can use ShellExecute, found here
http://www.mentalis.org/apilist/ShellExecute.shtml
-
Jan 15th, 2005, 10:54 PM
#3
Thread Starter
Member
Re: Minimize or hide this DOS window
can i not do this in VB ?
-
Jan 15th, 2005, 11:10 PM
#4
-
Mar 24th, 2005, 05:33 PM
#5
Re: Minimize or hide this DOS window
Ive got the perfect code for you ; )
VB Code:
Option Explicit
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Dim tWnd As Long
Dim frmname As String
Private Sub Form_Load()
frmname = "ConsoleWindowClass"
tWnd = FindWindow(frmname, vbNullString) ' Change stuff in quotes so it will shrink it!! i.e. for paint it would be "paint"
MsgBox tWnd
If tWnd <> 0 Then
SetWindowPos tWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW
Else: MsgBox frmname & " not found!"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
SetWindowPos tWnd, 0, 200, 0, 100, 100, SWP_SHOWWINDOW
MsgBox tWnd
End Sub
Last edited by |2eM!x; Mar 24th, 2005 at 05:37 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|