Focus to Child MessageBox from SysTray Message?

I have an application, with a seperate SysTray Icon.  The SysTray Icon has
an "Exit Application" option that opens the main application window, and
displays a MessageBox (with "Are you sure...").  The MessageBox does not
prevent the SysTray icon from working, so the user can select the "Exit
Application" option again. When this message comes to my app, and the
MessageBox is displayed, I want to set the focus to the MessageBox.

Does anyone have ideas on how to set the focus to a child window of the
application?

I have tried the following on the appliation window:
ShowWindow(SW_RESTORE);
BringWindowToTop();
SetForegroundWindow();
FlashWindow(TRUE);
SetActiveWindow();
SetFocus();

And, I tried them on the window returned from:
GetTopWindow();

Ideas?
Dan Baker


0
Dan
12/5/2003 11:33:55 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
297 Views

Similar Articles

[PageSpeed] 49

>... The MessageBox does not
>prevent the SysTray icon from working, so the user can select the "Exit
>Application" option again. When this message comes to my app, and the
>MessageBox is displayed, I want to set the focus to the MessageBox.


Dan,

Have you tried using GetLastActivePopup? Does that return you the
message box window handle?

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
12/6/2003 10:52:31 AM
Reply:

Similar Artilces:

List View with no focus
I want to create a list view whose items could never be selected. Although columns could be clicked to sort and those could be adjusted as well. How could i do that. See your post regarding "List view with no item selection". "Mubashir Khan" wrote: > I want to create a list view whose items could never be selected. Although > columns could be clicked to sort and those could be adjusted as well. How > could i do that. > > > ...

Messages from one e-mail address double in Outlook inbox
Every time I get a message from one particular e-mail address, I get it twice in my inbox. It may have something to do with the sort / sub-folder rule but I could use help on this ...

Exchange 2000 Instant Messaging. Internet client Problem
Hi everybody, We were using Exchange Instant Messaging service internally. I have enabled i.m. service for internet usage (created web site, im router, dns ._rvp service record etc.) Our users are able connect our Exchange Instant Messaging service via internet. They able to send message to the other users working in company lan but local users are not able to reply or send a new message to the internet connected exchange im. users Does anybody faced with this kind of problem? I will be happy if i find a solution. Thanks &Regards, Bayram Guldibi. Hi Everybody, can anybody help m...

logon unread message
every time i restart my computer i get a message saying that i have an unread email under the user icon but when i go check my email i have nothing there im using outlook 2003 its getting annoying i cant get rid of it thanks See if this helps: http://support.microsoft.com/?kbid=304148 -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP Roland Schorr & Tower http://www.rolandschorr.com Microsoft OneNote FAQ: http://www.factplace.com/onenotefaq.htm **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! &...

Outlook message delivery
An odd problem just appeared in Outlook 2002, connected to Exchange 5.5. Messages do not drop instantly into their Inbox. If they click on another folder then click on the Inbox, the messages will all appear. This has only just started to happen. Any clues? Cheers, PJ. 80) PJ <phillworboys@GLASSESlycos.co.uk> wrote: > An odd problem just appeared in Outlook 2002, connected to Exchange > 5.5. > > Messages do not drop instantly into their Inbox. If they click on > another folder then click on the Inbox, the messages will all appear. > This has only just started...

Message Tracking Access Denied #2
Ok, stuck on this one for a while now and I am not making any progress. Exchange Version 6.5 (Build 7638.2: Service Pack 2) System: MS W2k3 Standard w SP1 Hostname: Exchange Only one exchange server in the organization. Search on the subject has not been helpful ( reapply sp2 is all I can find, and already did but the problem persists). User is an Enterprise Admin and the Enterprise Admin group is a member of the Administrator group in the exchange box. When checking "Enable message tracking" --> "In order to successfully track messages, you will need to grant read access t...

Messages are sent normally but a copy always ends up in my Inbox.
Email messages are sent normally to the receipient but a copy always ends up in my Inbox. How can I prevent this please? I am using Outlook 2003. David ...

Multiple Child Links
Hi I have a main form which has 2 tables set as record set. There are 2 combo box, cboStoreNo, cboReferenceID and I would like the subform to show all the data based on which ever combo box has the data in it. Code has been created for the combobox before update to set the other combobox as null so only one combobox has data at one time. One solution I tried was to have a hide text box in the main form which works great but I cannot get any code to set the child link as it can be either StoreNo or ReferenceID depending on the combobox selected. Any thoughts would be appreciated. Thanks...

I can not send e-mail using window mail i received the message bel
The connection to the server has failed. Subject 'Read: Robert Half - Hiring Internal Accounting Roles', Account: 'plus.pop.mail.yahoo.com', Server: 'plus.smtp.mail.yahoo.com', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket Error: 10060, Error Number: 0x800CCC0E "guaregua" <guaregua@discussions.microsoft.com> wrote in message news:BE248C16-AECB-4CEB-A45D-5F33BFA39DB4@microsoft.com... > The connection to the server has failed. Subject 'Read: Robert Half - > Hiring > Internal Accounting Roles', Account: 'plus.pop.mai...

displaying images in html messages
When I receive html email, I see only placeholders instead of images. I've ensured the checkbox is set in tools/options/security which chooses to display images rather than links, but they still don't appear. Is there anything else I can try? Thanks WinXP SP2 OUTLOOK 2003 ...

Outlook 2003: No "AND" "OR" operator in message rules
I just upgraded from Outlook Express to Outlook 2003, and found this issue to be particularly bothersome. In Outlook Express, I could save time by using the "OR" operator when I make rules where an action takes place if the message matches any one of the criteria I list. However, when I imported those rules (and made new ones) in Outlook 2003, there is only an "AND" operator when I have several criteria. Thus my mail doesn't sort correctly. Is there any way to regain the "OR" functionality? I know it exists within each criteria (for example, if th...

Unable to read messages in Outlook Webmail
I am unable to read or respond to my e mail from work that I am accessing through Outlook webmail. I can see the messages but when I click on them to read or act on them, I am automatically directed to a "Page Unavailable" message off my companies internet site. I feel it must be a setting on my desktop browser. Can anyone help ? Doubtful - it's possible someone ran URLScan (a security feature) on your Exchange/IIS server and didn't modify it for use on Exchange. Ask the Exchange/systems admin to take a look at MS knowledgebase article 309508 Bruce wrote: > I am u...

Why are extra newlines added to Plain Text messages I receive?
Every time a message arrives in my inbox (Outlook 2003), it contains 2 line breaks for every line ending. What do I do to correct this? Thanks, Mike ...

Message Test
Message Test ...

How to delete messages from server after download
Hi, I have both MS Outlook and WLM on my Windows 7 computer. After downloading my emails with WLM from my ISP which is Cox, if I open up Outlook it downloads the same emails. I looked in Tools-Options in WLM, but can't find or don't see the option to "delete messages from server after downloading. Kindly help with this matter. Thanks in advance. If you do not want the messages downloaded to Outlook at all, you can remove the account from Outlook. Or as you are asking: In WLMail | Tools | Accounts | Mail Account | Properties | Advanced. Uncheck: "Leave a...

New messages don't display in Outlook
In our Exchange 5.5 environment, we frequently have Outlook 2002 clients that will not received a refreshed view of their inbox when messages arrive. A message is delivered to their inbox, and can be seen from another client on another machine, but the problem client won't see a copy of it until they perform some action in Outlook that will refresh their view, such as change folders, or start a new message. We are NOT using offline files. We do NOT have "disable automatic send/receive" checked. Some computers have an automatic send/receive set, most do not....it doesn&#...

Local Delivery Message Queue
I have 7 messages in the Local Delivery Message Queue that showed up this morning. All are in a retry state. The sender is Exch5.5-PubIS@domain.com and the recipient is Exch2k3-IS@domain.com. Can someone please explain what these messages are? Should I delete them? I'm not sure why they are not being delivered. If more information is needed, please let me know. THanks. -- DLove Sounds like public folder replication. Your public folders replicate traffic via the Exchange queues. This replication could be several things like content, back fill request, ect… Are you running Exc...

Send/Receive Messages
I am using Outlook 2002 on an XP platform. I cannot get Outlook to check for Email at regular intervals. I have the my Outlook set to Send and Receive all my accounts every 10 minutes but nothing happens. The only way I can receive Emails is by manually using the Send/Recv button or pressing F9. Can anyone offer any help. In case it is relevant I am using Norton Internet Security 2003. PWS ...

Messages showing up as enclosures?
Hi - When I send messages from my office email (Outlook 2000, Exchange 2000) to 2 specific people, my messages show up as an enclosure or an attachment to a message. Any attachments I had sent are gone. When I send that same message to others, including my personal email address, they are fine. They both use Outlook, one uses 2000, not sure about the other. Also, if I paste a table from Word into the email, they see a string of text, the table is gone. Any suggestions as to what I can look for to fix this? Thanks - Brian ...

Clients can't send messages
I'm running Exchange Server 5.5 on my own domain and on a Windows 2000 server. I have given my kids accounts on the server. They can log in and get their mail, but they can't reply to any address other than to an address on the same domain. They get a "relay not allowed" message. They are logging into their own ISP and then connecting to my server if that makes a difference. Any insights into how I can configure the server so they can reply to their mail would be appreciated. Thank you. Hi,Bob This article maybe can help you!! How to Configure SMTP Relay for Domains an...

Resending Messages
Win XP HE, OL 2002 Hi, I have some emails in my "sent" folder that I would like to resend. I would like to be able to do somthing similar to: Drag the 15 messages that I select from my "Sent" folder and Drop to the Outbox--however it does not work. They just "sit" there. Is there an easy and quick way to re-send (not forward) several emails? Tx a lot, S open the message, look on the actions menu. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Ot...

keyboard messages in Modal dialog box
I know andI have used pretranslate() but I want keyboard messages in Modal dialog box without creating any control on the Modeless dialog box so how i can get the keyboard message. "kotakmayurr@gmail.com" wrote: > I know andI have used pretranslate() but I want keyboard messages in > Modal dialog box without creating any control on the Modeless dialog > box so how i can get the keyboard message. The question is a bit confusing... ? You should use CWnd::PreTranslateMessage BOOL CMyDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { ...

Editing the code for windows command message for tiling
hello, In a normal MDI application there is a option for TILE/CASCADE in WINDOWS menu.Normally whatever windows are there in the mainframe opened up,those are "tiled" along the mainframe.Can we edit the windows command code for this?for example -i want to tile the child windows but such that they should occupy only certain portion of MDI window and not go below it.That is on tiling they shouldnt occupy the whole of MainFrame window I need an urgent solution for this please help Here is a quick way of doing what you want. You need to change the id of the menu item to some...

message routing from differend domain
I need to know, how i can create rules or routing groupe if the sender domain not the own domain. e.g. We get mails from example.de and they will relay this mails via our server to external recipient. The problem is, if the recepient outside the company do an reverse lookup, our server has no mx entry for example.de. Our mx record is for example-europe.de. teh messages come back with relay denied message. How can i create a rule that our server send all mails from example.de to the correspondig server for exaplme.de. If the messages will deliverd to expample.de, i have a connector for t...

Child emails
Hi, I have a form that sends an email based on the info on the form via a button press. I have just changed to a parent and child forms. The button is current on the child form and works fine. The only problem is that if I have multiple children for one parent then I have to navigate to each child, press the button, and then combine the email messages. I would like to create something that will process the Parent and multilple Children and create only one email. My query prompts for the Parent key and obtains all the info needed for forms. I looked in this forum for an example but was...