Solved

Opening a File with Notepad from VC++

Posted on 2003-11-05
3
231 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:moonoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 9691586
Hum, the easiest way (if it is a .txt file) would be to

ShellExecute ( NULL, "open", "myfile.txt", NULL, NULL, SW_SHOW);
0
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 9691597
BTW, if you want to enforce the usage of notepad if it is a file not registered with it,

ShellExecute ( NULL, "open", "notepad.exe", "myfile.sth", NULL, SW_SHOW);

would work also.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 102
unable to delete all specified values regedit 38 724
tripleUp challenge 7 93
Trying to run powershell  in a batch file. How do I do this? 8 117
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question