VB can not be controlled on DOS standard output

Updated on healthy 2024-04-19
10 answers
  1. Anonymous users2024-02-08

    Yes, no problem at all. I wrote you a ping command. The DOS window can be in the background.

    vb declares private function postmessage lib"user32" alias "postmessagea" (

    byval hwnd as long, byval wmsg as long, _

    byval wparam as long, byval lparam as long) as long

    private declare function findwindow lib "user32" alias "findwindowa" (

    byval lpclassname as string, byval lpwindowname as string) as long

    private declare sub sleep lib "kernel32" (byval dwmilliseconds as long)

    private sub command1_click()

    dim myhandle as long, cmd as string

    dim i as long

    Open the console, which can run in the background.

    shell "", vbnormalfocus

    sleep (1000) 'Pause for a second.

    myhandle = findwindow("consolewindowclass", vbnullstring)

    cmd = "ping

    t"Send the command.

    for i = 1 to len(cmd) 'Send the command.

    postmessage myhandle, wm_char, asc(mid(cmd, i, 1)),0

    next i

    postmessage myhandle, wm_keydown, 13, 0 'Send Enter.

    end sub

  2. Anonymous users2024-02-07

    That's how I solved it, the idea is to make a bat file, which is stored in dos**, and then run this bat file, stupid is a little stupid, but it works.

    For example, I'm going to delete a c:

    private sub command1_click()open "c:\" for output as #1print #1, "del c:\"

    close #1 'Generate batch text.

    shell "c:\" 'Run it.

    end sub

  3. Anonymous users2024-02-06

    Yes, the same way you would open a file.

  4. Anonymous users2024-02-05

    Just choose black in the backcolor palette of form,The same is true for other controls,Just remember the position to click on it,As for the command control,In addition to the backcolor attribute as above,There is also a style attribute that needs to be modified to 1 (style is one of the read-only properties.) can't ** come out), other colors can also be.

  5. Anonymous users2024-02-04

    DOS uses the console window cui... But VB6 only provides a GUI compiler...

    But in the selected "Console Applications" is the CUI window of DOS.

    to control the input and output, just like the cin and cout of vc++

  6. Anonymous users2024-02-03

    Why do you want to make it like DOS?You can call DOS!

  7. Anonymous users2024-02-02

    shell "cmd /c dir",1'c indicates that the window is closed when the execution is complete.

    shell "cmd /k dir",1'k indicates that the stay has been completed.

    shell "cmd /c dir &&pause",1'Multiple statements are available &&& Connect.

    For specific usage of cmd, you can type cmd ?. in the command promptLook.

    There are too many, just to name a few typical ones:

    cmd [/a | /u] [/q] [/d] [/e:on | /e:off] [/f:on | /f:off] [/v:on | /v:off]

    /s] [/c | /k] string]

    c Executes the command specified by the string and then terminates.

    k executes the command specified by the string but retains it.

    s modifies string processing after c or k (see below).

    q Close the response.

    d Disable the execution of the autorun command from the registry (see below).

    a Makes the output to an internal pipeline or file command ansi

    u makes the output to an internal pipeline or file command unicode

    t:fg sets the foreground background color (see color ?, for more information.))

    e:on enables command extensions (see below).

    e:off deactivates the command extension (see below).

    f:on enables file and directory name completion characters (see below).

    f:off deactivates the file and directory name completion character (see below).

    v:on will !Starts as a delimiter to delay the expansion of environment variables. For example: v:on Yes.

    Allowed!var!Allowed on execution!var!Extended Variable syntax.

    Expanding variables at input time is not the same as within a for loop.

    v:off deactivates deferred environment scaling.

  8. Anonymous users2024-02-01

    Friend, you don't need any simulation,,, you go to VB and look at this to know the "shell".

    Executable directly! Use this!

  9. Anonymous users2024-01-31

    1. It is best to use api::

    declare function shellexecute lib "" 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

    b=shellexecute(0, "open", external file name, a, a, 1).

    With shell:

    shell external file name, vbhide

    If you are running DoS purely, try to use a VB statement, such as a VB statement

    copyfile File 1, File 2'Copy file name file 1 as file 2'File renaming.

  10. Anonymous users2024-01-30

    Actually, I think using api functions is the best solution.

Related questions
7 answers2024-04-19

Dreams are uncontrollable, and it's okay to dream less.

11 answers2024-04-19

Build a module.

Set the project's startup to sub main >>>More

15 answers2024-04-19

Does 50w yen spend half a year in Japan? If you don't have a good language, you can't make much money by working, and when you arrive in Japan, you will desperately pass the language, don't fight with Koreans when you study in language school, don't fool around with the little k in the past in China, you have time to work, whether you can earn money depends on whether you work hard or not, you will be very hard this year, you can't eat anything, you don't dare to buy anything, because everything is super expensive, even instant noodles are expensive, cook your own food, steamed steamed buns or something, think about sympathizing with you, come on.

15 answers2024-04-19

Yes, c(s, diamond) ===c(s, graphite) h<0 The reaction is reversible, and the reaction conditions are high temperature and high pressure catalysts. In other words, graphite and diamond can be converted into each other under the same conditions.

13 answers2024-04-19

The first birthday party can be in the evening, as long as you feel good on your birthday, whether it is noon or night.