Program
In the dual sense, all visual programming tools, VB should be the simplest, quickest, most convenient, I have used it to do the application, edited the game, developed a small plug-in and so on, feel the use of VB although weak point, but through the API can really very convenient to complete a lot of work, Today, I have some experience and methods of adapting my DOS console program to a window application:
1 The simplest way to make a DOS console windowing is to use a shell function, as in MSDN:
Syntax: Shell (pathname [, WindowStyle]), executes an executable file, returns a Variant (Double), if successful, represents the task ID of the program, if unsuccessful, returns 0.
Only need an executable path and Run-time window state on the line, such as the net SEND command to do a windowing program, you can create a new form, and then place two text control and a command button, where Text1 said to fill out the IP address, Text2 fill out the message to send, Finally, this is called in the command's Click event:
Dim Rtn as Variant
RTN = Shell ("Net send" & "& Text1.Text &" & Text2.text, 0) ' parameter 0 indicates hidden DOS window
Here, a net Send window version is done, everyone as long as the interface slightly beautify the OK ~ ~ ~
2) Calling API functions
This way should be said to be the most perfect, after all, is the operating system to provide the function ~ here to use API functions, so to be stated, we will declare it in GM: Private Declare Function winexec Lib "kernel32" (ByVal lpCmdLine as String, ByVal nCmdShow as Long
The next step is similar to the previous, just so called in the command control's Click event:
Dim cmd as String
Dim HWnd as Integer
cmd = "net send" & "& Text1.Text &" "& Text2.text
HWnd = winexec (cmd, 0)
In this way, you can complete the call to the net send command, very convenient, I have done several DOS console program Windows version