So what started out as a post wondering why focus can't be set on an MDI application has now turned into a single instance tray notify application?
.
I'll try to make a test project. The same result I got if I notify the user with a random system tray balloon and user click to that balloon, the behavior is the same. So, the issue is the same as I posted first time. I give you this extra details in order to have a clear image about this issue, that is all.
I have built a test program that illustrate the issue. Just start it and wait 5 seconds. Should see a system tray icon balloon. Click on that balloon, and you'll see that the main frame is shown, but doesn't get the focus.
Last edited by mesajflaviu; August 6th, 2020 at 07:17 AM.
I have built a test program that illustrate the issue. Just start it and wait 5 seconds. Should see a system tray icon balloon. Click on that balloon, and you'll see that the main frame is shown, but doesn't get the focus.
OK, I have tested your sample.
If I changed the CMainFrame::On0Restore() to
Yes, you are right, but please do this trial from Windows Explorer. I mean: go in Debug folder, and start the app from there, and wait 5 seconds, and then click on that balloon. This is the real situation.
Yes, you are right, but please do this trial from Windows Explorer. I mean: go in Debug folder, and start the app from there, and wait 5 seconds, and then click on that balloon. This is the real situation.
Hmm, in that case it doesn't get (or, maybe just loose) the focus.
Yes, you are right, but please do this trial from Windows Explorer. I mean: go in Debug folder, and start the app from there, and wait 5 seconds, and then click on that balloon. This is the real situation.
It's really frustrating when you tell somebody what the problem is and they ignore your post.
@GCDEF, thank you for your time and sorry if I cause you any issue. I did checked what you said, but in that location, CSystemTray::OnTrayNotification, I don't saw any problem. In that handler, is managed the tray notification, and that notification work fine. Please tell me if I miss understood something.
Last edited by mesajflaviu; August 6th, 2020 at 02:04 PM.
@GCDEF, thank you for your time and sorry if I cause you any issue. I did checked what you said, but in that location, CSystemTray::OnTrayNotification, I don't saw any problem. In that handler, is managed the tray notification, and that notification work fine. Please tell me if I miss understood something.
No, on icon single left button event is happen nothing. On icon double click the app is shown, on icon right click the context menu is shown and on click on tray balloon is calling CMainFrame::On0Restore method (which is not work well).
I used this code from another programming site, I used as I found it. I can clean up CE things, of course.
Last edited by mesajflaviu; August 7th, 2020 at 05:16 AM.
No, on icon single left button event is happen nothing. On icon double click the app is shown, on icon right click the context menu is shown and on click on tray balloon is calling CMainFrame::On0Restore method (which is not work well).
I used this code from another programming site, I used as I found it. I can clean up CE things, of course.
Which is exactly what I said. I showed you the messages you're processing, and they're all working. Add code to make the left button work.
Well, I would that, but it would help me ? Because the issue here is that CMainFrame is not activate it. Is shown at user click on tray balloon, but is not active . .. see my image and my sample project. Of course, I can try to call CMainFrame::On0Restore on icon left click, but right now this method is called from tray balloon, and is not working. Sorry if I miss understood what you are tried to say.
Well, I would that, but it would help me ? Because the issue here is that CMainFrame is not activate it. Is shown at user click on tray balloon, but is not active . .. see my image and my sample project. Of course, I can try to call CMainFrame::On0Restore on icon left click, but right now this method is called from tray balloon, and is not working. Sorry if I miss understood what you are tried to say.
I guess implementing and testing what GCDEF suggested would be much faster than posting this message and waiting for the replies.
Well, I would that, but it would help me ? Because the issue here is that CMainFrame is not activate it. Is shown at user click on tray balloon, but is not active . .. see my image and my sample project. Of course, I can try to call CMainFrame::On0Restore on icon left click, but right now this method is called from tray balloon, and is not working. Sorry if I miss understood what you are tried to say.
I wouldn't post it if I didn't think it would help. You have a function that handles tray notifications. CSystemTray::OnTrayNotification(UINT wParam, LONG lParam). Step through it and see how it works.
It handles some messages, all of which work. It doesn't handle a left button message so nothing is happening.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.