-
March 12th, 2014, 08:38 AM
#1
Prompt "New file" procedure
Hi,
I currently have a program where, by either pressing Ctrl+N or by going to "File->New" in the menu a new file is prompted.
However, there are cases in my program where I would also like the "new file" protocol to be called when a user presses a button.
Is there some way of accomplishing this, or can the "new file" protocol only be called by the standard Ctrl+N or "File->New" calls?
Thank you in advance.
-
March 12th, 2014, 08:51 AM
#2
Re: Prompt "New file" procedure
Code:
AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_FILE_NEW);
More info in TN022: Standard Commands Implementation
Victor Nijegorodov
-
March 12th, 2014, 08:54 AM
#3
Re: Prompt "New file" procedure
Nobody cares how it works as long as it works
-
March 12th, 2014, 09:13 AM
#4
Re: Prompt "New file" procedure
Originally Posted by VictorN
Wauw, thank you!
I was not aware it was possible to do that.
That's really great!
-
March 12th, 2014, 09:16 AM
#5
Re: Prompt "New file" procedure
You are welcome!
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|