Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Notepad File from VC++

Status
Not open for further replies.

moonoo

Programmer
May 17, 2000
62
US
Hi ,
I want to open a file in Notepad on a Event in VC++ .
At present i am using system() command to achive this.
But the command window is also being displayed with the
Notepad . I don't want the command window to be displayed
how do i achive this..
Regards
Dev
 
use CreateProcess:

STARTUPINFO startupInfo;
PROCESS_INFORMATION processInformation;
ZeroMemory( &startupInfo, sizeof(startupInfo) );

BOOL x = CreateProcess
(
(LPCTSTR) 0,
(LPTSTR) "notepad hello.txt",
0,
0,
FALSE,
NORMAL_PRIORITY_CLASS,
(LPVOID)0,
(LPCTSTR)"G:\\Documents and Settings\\Administrator\\Desktop", &startupInfo,
&processInformation
);

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top