Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

launching dialog from Command line is going to background in MFC application

$
0
0
I have an MFC application.
Which can display the dialog using systemtray menu and command lne option.
When i am openieng the dialog from systemtray it is always coming into foreground.
But when  iam opening from command line it is always going to background.

When the command is entered from command line,i am posting the message to display the dialog.
while posting it is going to background.In thi case also,when iam opening the dailog for first instance of the applciation it is coming to foreground.
But if the application inastance is already running,that time if i give the command again it is going to background always.
sample command is:
sampleApp.exe  -aboutdialog

If the application instance is already is running, if the command is given gain,then one more app instance will be launched and closed after process.
So is it related to any priority?.

Instead of Postmessage() if i create the object of the dialog every time it is coming to foreground in command line  also.
But the second insatnce of app is running upto when i close the dialog.so we have used postmessage.

So which one is better or is there any other thing  i have to modify
Please share if any ideas..

Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>