How to close a file opened using ShellExecute
-
Hi, I am woking with a dialog based application.On click of a button I opened a text file using ShellExecute(NULL, "C:\\Text.txt", szPath, NULL, NULL, SW_MAXIMIZE ); On clicking another button I should be able to close this file. Can anyone please help with some function that automatically closes a file when passed the file path to it. Thanks
-
Hi, I am woking with a dialog based application.On click of a button I opened a text file using ShellExecute(NULL, "C:\\Text.txt", szPath, NULL, NULL, SW_MAXIMIZE ); On clicking another button I should be able to close this file. Can anyone please help with some function that automatically closes a file when passed the file path to it. Thanks
Send that window (e.g., Notepad) a
WM_CLOSE
message.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
Send that window (e.g., Notepad) a
WM_CLOSE
message.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
Interesting..question and a more interesting answer...But how to get the window handle for the opened file using shellexecute?
ArtiGujare wrote:
But how to get the window handle for the opened file using shellexecute?
First you'll need to use
ShellExecuteEx()
. Then, see here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb