anyone can help with my project?
hello, anyone can help me with vb project about dos -> vb?
VB Code:
Private Sub cmdGO_Click()
Text2.Text = "C:\pm.exe"
loader
End Sub
Private Sub loader()
Dim CommandWindowName As String
Dim SendToDos As String
Clipboard.Clear
SendToDos = Text1.Text
Clipboard.SetText SendToDos + Chr$(13)
Dim lFoundWindow As Long
Dim manu As Long
Dim lOK As Long
Dim lOK1 As Long
Dim X As Variant
z = Text2.Text
Shell z, vbHide
lFoundWindow = FindWindow(vbNullString, z)
manu = FindWindow(vbNullString, "Form1")
lOK1 = ShowWindow(lFoundWindow, 9)
lOK1 = ShowWindow(lFoundWindow, 10)
SendKeys "% ee", 1
SendKeys "% ep", 1
lOK = SetForegroundWindow(manu)
lFoundWindow = 0
lOK = 0
lOK1 = 0
End Sub
This is the code.. when you enter in a textbox and the result will show in the dos prompt... i want this dos prompt not to be displayed anymore then i want the result to be displayed in listbox or textbox (multiline)
p.s for my english...
thanks..
Re: anyone can help with my project?
I really don't see the point of showing the result in a dos prompt. can u explain me why are you trying do?
Re: anyone can help with my project?
@wiz126
i have here a dos.exe
so in the text1.text: you will enter a number then
it will automatically execute the dos.exe then it will show the result it the dos prompt and i wanted this not to show anymore the dos prompt... i want
the result to show in the listbox or textbox
Thanks
Re: anyone can help with my project?
this is the module
VB Code:
Public Const SW_HIDE = 0
Public Const SW_SHOWNORMAL = 1
Public Const SW_NORMAL = 1
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_MAXIMIZE = 3
Public Const SW_SHOWNOACTIVE = 4
Public Const SW_SHOW = 5
Public Const SW_MINIMIZE = 6
Public Const SW_SHOWINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_RESTORE = 9
Public Const SW_SHOWDEFAULT = 10
Public Const SW_MAX = 10
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowsName As String) As Long
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal cCmdShow As Long) As Long
Re: anyone can help with my project?
Dont you have the source of that dos.exe so you could just convert it altogether to vb?
Re: anyone can help with my project?
Or, just explain what it returns, and how it does it, and we could probably recreate it using vb.
1 Attachment(s)
Re: anyone can help with my project?
ok this is the program
you may try this...
Re: anyone can help with my project?
That is not a DOS program. That is a compiled .exe, and nobody here will run an exe. I'd bet that it gets removed by the mods, as they don't want anybody downloading .exe's from this site.
Re: anyone can help with my project?
@dglienna
what do u mean? the dos.exe is only running on dos prompt ryt?
i posted here the file because
dee-u, want to see what im saying here...
Thanks :)
Re: anyone can help with my project?
@dglienna
what do u mean? the dos.exe is only running on dos prompt ryt?
i posted here the file because
dee-u, want to see what im saying here...
Thanks :)
Re: anyone can help with my project?
A DOS program is a text program. You can EDIT it or you can run it. I wanted to EDIT it to see what it does. I found an .exe, which you can't make in DOS.
Sorry.
Re: anyone can help with my project?
@dglienna
sorry...
can we call this console?
Re: anyone can help with my project?
I won't run an exe. I need source code. If you don't have the source code, all we need is to know what the program does. If it is simple, it can probably be done with a few lines of VB code. Sorry, I can't take the chance of running unknown exe's on this system.
Re: anyone can help with my project?
the info of this dos.exe is:
when u enter a number it will generate the key... so i want this to be in vb
calling the dos.exe it is possible? like Text1.Text u enter a number
then u make a button say "GENERATE" when i click the button will
show up the generated key and its a "command prompt" window
then i want not to show anymore the "command prompt" i want only
to be displayed in the list box...
Text1.Text: Enter Number -> GENERATE -> "now they generated the code
and it will display in command prompt"
the displayed code in command prompt (i want to hide this) -> send to list1box
that's all
thanks.. :)
br,
Re: anyone can help with my project?
Take a look at this example It will call a shelled program, and write the output to a text file. You would have to read it back to display it.
VB Code:
Option Explicit
Private Sub Form_Load()
Shell ("C:\Windows\System32\cmd.exe /c C:\Windows\System32\netstat -n >> D:\myfile.txt"), vbNormalFocus
End Sub
Re: anyone can help with my project?
@dglienna
it works...
btw, if i want to enter number into TExt1.Text? not enter cmd.exe?
thanks...
Re: anyone can help with my project?
Just read the file, and place it in a textbox.
VB Code:
dim s as string
Read "D:\myfile.txt" for input as #1
input #1, s
close #1
s = text1.text
Re: anyone can help with my project?
@dglienna
Shell ("C:\Windows\System32\cmd.exe /c <- how to hide this?
Re: anyone can help with my project?
How about this?
VB Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Shell "C:\dos.exe"
Sleep 100
DoEvents
AppActivate "C:\dos.exe"
DoEvents
SendKeys "{1}"
DoEvents
SendKeys "{ENTER}"
End Sub