What Windows API functions are available to execute command prompt's functionality? For example, I like to execute dir command and want to show the output in GUI without using cmd.exe in Windows.
The dir command is built into the cmd.exe, it's not a separate executable. There's no way of executing it short of running cmd.exe.
EDIT: As for the displaying of results, you need to fill in the STARTUPINFO.hStdXXX members, probably using an anonymous pipe. See this example.
You can start cmd /c dir S:\ome\Path
from your process and grab the output. Otherwise it's not possible. But if you're not interested in particular formatting details of dir
then you're probably better off just enumerating files/directories and display them.
For a console app you can use popen(), but things are by no means so easy from a GUI app. See http://msdn.microsoft.com/en-us/library/ms682499%28VS.85%29.aspx for one approach.
Everything the Windows command line does is done through the Win32 APIs.
For example, with regard to "dir", FindFirstFile() and FindNextFile() will give you the contents of a directory.
For any given command, you will need to figure out which APIs/function calls are in use and then learn how to use them yourself in your own code.