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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching notepad from VC++ 1

Status
Not open for further replies.

fromkc

Programmer
Jan 10, 2002
10
0
0
US
I would like to launch a file in notepad from my C code using Visual Studio as the environment, how do i do that?
I know there are direct commands in VB to do the same.
Any help is really appreciated.

Thanks.
 
take a look at _exec function in MSDN might be what you are looking for.

HTH,
JC
 
Here it is:
#include <windows.h>
#include <shellapi.h>
.....
...
ShellExecute( HWND_DESKTOP, &quot;open&quot;, &quot;C:\\windows\\notepad.exe&quot;, NULL, NULL, SW_SHOWNORMAL )
 
Leibnitz ,Mongooses.
Thank you for the prompt replies.

ShellExecute - helped in solving my problem.

Thanks.





 
#include <windows.h>
#include <shellapi.h>
CReportView::OnReports() // Report Button Pressed
{
::ShellExecute( HWND_DESKTOP, &quot;open&quot;, &quot;C:\\windows\\notepad.exe&quot;, NULL, NULL, SW_SHOWNORMAL )
}

can u Pls tell me Why this is not working FROM MFC ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top