Results 1 to 19 of 19

Thread: anyone can help with my project?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    anyone can help with my project?

    hello, anyone can help me with vb project about dos -> vb?

    VB Code:
    1. Private Sub cmdGO_Click()
    2. Text2.Text = "C:\pm.exe"
    3. loader
    4. End Sub
    5.  
    6. Private Sub loader()
    7.  Dim CommandWindowName As String
    8.    Dim SendToDos As String
    9.    Clipboard.Clear
    10.    
    11.    SendToDos = Text1.Text
    12.    
    13.    Clipboard.SetText SendToDos + Chr$(13)
    14.  
    15. Dim lFoundWindow As Long
    16. Dim manu As Long
    17. Dim lOK As Long
    18. Dim lOK1 As Long
    19. Dim X As Variant
    20. z = Text2.Text
    21.   Shell z, vbHide
    22.      
    23. lFoundWindow = FindWindow(vbNullString, z)
    24. manu = FindWindow(vbNullString, "Form1")
    25.      
    26.        
    27.        
    28.             lOK1 = ShowWindow(lFoundWindow, 9)
    29.             lOK1 = ShowWindow(lFoundWindow, 10)
    30.               SendKeys "% ee", 1
    31.               SendKeys "% ep", 1
    32.              
    33.       lOK = SetForegroundWindow(manu)
    34.        
    35.         lFoundWindow = 0
    36.         lOK = 0
    37.         lOK1 = 0
    38.  
    39. 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..

  2. #2
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    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?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    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

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: anyone can help with my project?

    this is the module

    VB Code:
    1. Public Const SW_HIDE = 0
    2. Public Const SW_SHOWNORMAL = 1
    3. Public Const SW_NORMAL = 1
    4. Public Const SW_SHOWMINIMIZED = 2
    5. Public Const SW_SHOWMAXIMIZED = 3
    6. Public Const SW_MAXIMIZE = 3
    7. Public Const SW_SHOWNOACTIVE = 4
    8. Public Const SW_SHOW = 5
    9. Public Const SW_MINIMIZE = 6
    10. Public Const SW_SHOWINNOACTIVE = 7
    11. Public Const SW_SHOWNA = 8
    12. Public Const SW_RESTORE = 9
    13. Public Const SW_SHOWDEFAULT = 10
    14. Public Const SW_MAX = 10
    15.  
    16.  
    17. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowsName As String) As Long
    18. Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
    19. Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal cCmdShow As Long) As Long

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    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?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: anyone can help with my project?

    ok this is the program

    you may try this...
    Attached Files Attached Files

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    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

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    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

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: anyone can help with my project?

    @dglienna

    sorry...

    can we call this console?

  13. #13
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    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,

  15. #15
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Shell ("C:\Windows\System32\cmd.exe /c  C:\Windows\System32\netstat -n >> D:\myfile.txt"), vbNormalFocus
    5. End Sub

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    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...

  17. #17
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: anyone can help with my project?

    Just read the file, and place it in a textbox.


    VB Code:
    1. dim s as string
    2. Read "D:\myfile.txt" for input as #1
    3. input #1, s
    4. close #1
    5. s = text1.text

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: anyone can help with my project?

    @dglienna

    Shell ("C:\Windows\System32\cmd.exe /c <- how to hide this?

  19. #19
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: anyone can help with my project?

    How about this?

    VB Code:
    1. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    2.  
    3. Private Sub Command1_Click()
    4.     Shell "C:\dos.exe"
    5.     Sleep 100
    6.     DoEvents
    7.     AppActivate "C:\dos.exe"
    8.     DoEvents
    9.     SendKeys "{1}"
    10.     DoEvents
    11.     SendKeys "{ENTER}"
    12. End Sub
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width