let say i do a shell command,
example:
a=shell("format a:",VBHIDE)
and when i push a command button,
i want to put the a=shell("format a:,VBHIDE)
in VBNORMAL, so the process of dos pops in the user's face
is there a way to do that
thanxs
Printable View
let say i do a shell command,
example:
a=shell("format a:",VBHIDE)
and when i push a command button,
i want to put the a=shell("format a:,VBHIDE)
in VBNORMAL, so the process of dos pops in the user's face
is there a way to do that
thanxs
Hey, how are you doing?
use this code :)
Have fun with it man :)Code:Private Sub Form_Load()
a=shell("format a:",VBNORMAL)
ShowHideWindow("MYCLASSNAME", "ORMYCAPTION", False)
End Sub
Private Sub Command1_Click()
ShowHideWindow("MYCLASSNAME", "ORMYCAPTION", True)
End Sub
'[begin of code]
'Author: Jop
'Origin: Inspired by some post on this forum (can't remember who)
'Purpose: Show or hide a window without unloading it.
'Version: VB5+
'Api calls
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Dim Myhwnd As Long, showme As Integer
Private Sub ShowHideWindow(Classname As String, WindowCaption As String, Show As Boolean)
If Classname = "" Then Classname = vbNullString
If WindowCaption = "" Then WindowCaption = vbNullString
'Find the window by either his classname or caption
Myhwnd = FindWindow(Classname, WindowCaption)
'if found
If Myhwnd <> 0 Then
If Show = True Then
showme = 5
Else
showme = 0
End If
'Show or hide the window
ShowWindow Myhwnd, showme
End If
End Sub
'Usage:
'ShowHideWindow "MYHANDLE", "MYCAPTION", True/False
'[end of code]
hey man what's up,little problem
do u just write "MYCLASSNAME","ORMYCAPTION" in the parameter sent to the ShowHideWindow
The ORMYCAPTION = the caption of the window, the MYCLASSNAME is the classname of the window, so just choose between the 2, if the window you opened has an classname like Calculator then use
ShowHideWindow("","Calculator",false)
to hide the Calculator.
I believe the shelled Format a: has a classname called WinOldApp, so you could do:
ShowHideWindow("WinOldApp","",True)
to show the Format Dialog.
Have fun :)
what if my shell include batch files
example shell("c:\test.bat")
is there a class for that
thanxs for your time
That's probably the same as the caption name (Ended: test.bat or something :))