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

Opening a file without OpenFile Dlg

Status
Not open for further replies.

bnhshallow

Programmer
Dec 14, 2001
12
US
hello, I have made a dialog based text file editer for my friends a while back, and now it is getting annoying that the user has to open the file they want from an open file dialog box. What I need is to just double click on the file i want to open from the desktop, and it will open my file editer and make it open the file that was clicked on. (Like a .txt file with notepad.) I already know alot about registry, the problem is that i dont know how to make my program pick up the filename and put it into a variable.
Any help would be appreiciated.

BNHShallow
 
When an associated file is double-clicked, the filename comes across as part of the lpszCmdLine parameter passed into the WinMain function. In an MFC dialog app, this parameter is stored in a member variable of your CDialog-derived class (I can't remember offhand what that variable is called, but it's rather obvious once you start looking through the members of your class). Try looking in there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top