커맨드창을 띄워서 도스 커맨드를 실행하는 두가지 함수.
자꾸 잊어버리는구먼.
1.
system("cls");
2.
ShellExecute(NULL, "open", "iexplore.exe", "http://wiki.lge.com/lab3/autokeypad", NULL, SW_SHOWNORMAL);
3.
#include <shellapi.h>
void KShellExecute(HWND handle, LPCTSTR exe, LPCTSTR param, LPCTSTR dir)
{
DWORD ExitCode;
SHELLEXECUTEINFO SEInfo;
memset( &SEInfo, 0, sizeof(SEInfo));
SEInfo.cbSize = sizeof(SHELLEXECUTEINFO);
SEInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
SEInfo.hwnd = handle;
SEInfo.lpFile = exe;
SEInfo.lpParameters = param;
SEInfo.lpDirectory = dir;
SEInfo.nShow = SW_HIDE; // SW_SHOWNORMAL;
if (ShellExecuteEx(&SEInfo)==TRUE)
{
do
{
GetExitCodeProcess(SEInfo.hProcess, &ExitCode);
Sleep(500);
} while (ExitCode); // wait until the command is finished
}
}
Designed by sketchbooks.co.kr / sketchbook5 board skin
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5