I have to invoke the windows Hyperterminal from my application. How do i do it?
Printable View
I have to invoke the windows Hyperterminal from my application. How do i do it?
Call the function CreateProcess like so.
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWNORMAL;
if ( CreateProcess(_T("hypertrm.exe"),
NULL,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi)
{
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
Let me know if that helps.
Sorry, I typed before I tested. This does work on my machine.
// Path is found in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\hypertrm.exe
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWNORMAL;
if ( CreateProcess(NULL,
_T("\"E:\\Program Files\\Windows NT\\Hypertrm.exe\""),
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi) )
{
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
else
{
DWORD dwData = GetLastError();
}
Thanks for the code..I will try it out
wouldn't it be easier to use ShellExecute????
I may be wrong, I'm just a beginner..
please correct me if I am...