Dialog Focus problem

Hello everyone,

I am implementing a Popup window (like Outlook's new message or
messenger's someone-signed-in window) based on a CDialog derived
window.

In order not to interfere with the user's experience, I don't want my
dialog window to capture the focus when it shows, so I return FALSE in
OnInitDialog.

This is working well, until I click a button on the popup window that,
in turn, closes the window.

The next time the popup window appears after this, it is capturing the
focus.

I already tried to send a window message to another window when the
user clicks the button, and on the message handler close the popup
window (so that i don't close it on the same event of the popup
window), but this doesn't help.

Does anyone have an idea?

Thanks!

0
twb2000 (3)
9/8/2007 6:22:24 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
545 Views

Similar Articles

[PageSpeed] 43

On Sep 8, 9:22 pm, twb2...@gmail.com wrote:
> Hello everyone,
>
> I am implementing a Popup window (like Outlook's new message or
> messenger's someone-signed-in window) based on a CDialog derived
> window.
>
> In order not to interfere with the user's experience, I don't want my
> dialog window to capture the focus when it shows, so I return FALSE in
> OnInitDialog.
>
> This is working well, until I click a button on the popup window that,
> in turn, closes the window.
>
> The next time the popup window appears after this, it is capturing the
> focus.
>
> I already tried to send a window message to another window when the
> user clicks the button, and on the message handler close the popup
> window (so that i don't close it on the same event of the popup
> window), but this doesn't help.
>
> Does anyone have an idea?
>
> Thanks!

Ok,
It turns out that if I set my dialog's style to WS_CHILD and not
WS_POPUP (I create it it as a modeless child of the desktop) it
doesn't capture the focus anymore.

If anyone has any tips or warning, I will greatly appreciate it.

Thanks

0
twb2000 (3)
9/8/2007 7:53:38 PM
Reply:

Similar Artilces:

Big Problem Sending #2
Out of the blue on Thursday, Outlook stopped sending my email. It's just racking up in my outbox. I checked all the regular stuff several times (tools-accounts-servers- smtp) and that all seems correct. I even spent over an hour on the phone with SBC today, and they say the server is fine and tried some troubleshooting activities to try to help, to no avail. I'm losing my mind and I NEED HELP! I'm going to start losing clients if I can't get my email sent out. Please Help! (if no one can halp, can someone tell me who to ask or where to go to ask in Microsoft) I'm ...

Modeless dialog in IE through ATL/COM dll
Hello, I am creating a ATL/COM component(dll) which adds the context menu in IE. After clicking on that menu it calls annother ATL/COM componet which shows the Modeless HTML dialog box. The problem is everything opens fine but suppose when i right click conext menu and that opens the other HTML Modeless dialog. as it is Modeless I can also click on IE's any web page. When i click on any link it open another instance of IE. And when I closes that 2nd intance of IE i got exception of memory in my dll workspace. [Unhandled exception at 0x777849cc in iexplore.exe: 0xC0000005: Access violatio...

Copy Picture problems
I've written a macro which copies a selected range in Excel 2000 and and paste it as picture in Power Point. CopyPicture is used and the macro works OK apart from that all columns are not always included in the pasted picture. Grouped columns and selection of visible cells only is used in Excel. e.g from Range A1:Z15 12 visble columns are selected. A different number of columns can be included in the pasted picture when different users runs the macro. Thanks in advance for any help. Mats "MatsN" <MatsN@discussions.microsoft.com> wrote in message news:2A8F...

Problem about the data refer path.
Hi All, I do all the work on the network driver, says L:. For example, I have a excel file on the L driver, named XXX.xls. One field in the file is refer to a field in another file on the L driver in following path: L:\aaa\bbb\ccc.xls. But do not know when i find that this field in XXX.xls refer to a local file : C:\documents and setting\username\application data\microsoft\excel\xlstart\aaa\bbb\ccc.xls. Anybody who knows that problem, could help me. Thanks so much in advance!!!! Thanks a lot. Yue One way to handle this (if it's possible) is to have all of your related files in...

Selecting a directory or folder in Hyperlink dialog box
I am building a macro that will automate the first few steps of building a hyperlink. Because I don't know the location or name of the file to which the hyperlink will point, I would like the user to complete the process past a certain point. So, I have the following items in the macro thus far (for 2007): Application.SendKeys ("%NI") Application.SendKeys ("%L") This opens the Hyperlink dialog box and then activates the Look In block. Now I would like to direct it to a certain directory in the Look In block allowing the user to complete the h...

any problems getting msnhotmail messages through outlooK?
I'm going away and want an out of office feature. I'm thinking of setting myself up through outlook but have msn hotmail. Are there any problems with doing this? Sandy Hirsch If you're a new hotmail 'customer' you wont be able to get your messages with Outlook. If you've had a hotmail account for at least a few months you should be able to get all your email with outlook. Its real simple, even easier than setting up a regular account. -James "Schwartz" <Schwartz@discussions.microsoft.com> wrote in message news:7B7EA122-7661-4350-8709-0376C1885EAC...

SmartList Builder problem with go to on SOP Entry
I've followed the steps from KB914894 to build a go to for the SOP Transaction Entry window. When that window opens it shows the SOP Type and SOP Number values that were passed and it shows the line item info but no other header info is shown. Any ideas? Additionally we have the Ship-To Address ID field disabled through Field Level Security for some users. When those users try to use this go to they get an error message about permissions on this field. Any options here? Thanks. -- Jim@TurboChef ------=_NextPart_0001_A4B6268B Content-Type: text/plain Content-Transfer-Encoding:...

Windows 7 64 bit and shortcuts problem
Sometimes when I install a program, I try to make a desktop shortcut, but it wont appear on the desktop. I try to create one myself, but when I drag it to the desktop it seems to go into never, never land. What could cause this? Tony Tony, Please describe exactly what happens when you drag the exe file to the desktop so that we can think of a creative answer. I assume you are "right" dragging the exe to the desktop and choosing "create shortcut", right? What happens then? :) Carlos "Anthony Lisanti" wrote: > > > Some...

upgrade problems from 1.0 to 1.2
After upgrading from 1.0 to 1.2 CRM I now received the following error, see bottom of message. The upgrade seem to run smoothly - no visible errors. I noticed that the framework still shows 1.0 shouldn't it be 1.1? Server Error in '/' Application. ----------------------------------------------------------- --------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Me...

Data refresh problem
I downloaded an xl template worksheet which has links to MSN Money website (for updating stock prices) As I have xl97, and the worksheet was created in a later version, I saved it as a xl97 worksheet. When I 'refresh data' it downloads the latest prices.........sometimes. More usually I get the message 'xl has encountered a problem, and needs to close..' Any ideas on what might be causing this? If I knew how the link works, I could start with a new worksheet, but I can't find any web queries relating to this worksheet. Brickcounter Brickcounter, If you know where a...

Portfolio Manager the same old Problem
Hi After opening 2 tickets, number of unanswered emails and waiting for 2 months I still didn't received final respond from MS Tech Support. So much for free support. This is how we leaned ... See problem description below. This problem starts some where around Money 2003. I am thinking about going back from my 2006 version to 2003 or 2004 version. I found a couple of messages on this site, from people who had the same problem. Does any body know for sure, what was the last version that didn't have this problem - 2002, 2003, 2004, so I can try to reinstall it in place of 2006? Pr...

font printing problem of imported visio file inside power point file
I am having a problem with VISIO 2002 with PowerPoint 2000. I made a drawing with some fonts with VISIO 2002. Then I copied the drawing and pasted into PowerPoint file. In screen, I can clearly see the font. When I print the file, drawings are there but there are no font from printed paper. Would you please help me out regarding this problem? ...

GP10 Security Problem with HR
I have a user set up as HRDEFAULTUSER, HR MANAGER and HR STAKEHOLDER. When he tries to log in he gets a GET/CHANGE eoor on coProcess. And it says it can not perform operation in this security context. GP closes, but the user is added to the activity table. Where is the security setting for coProcess? ...

Compatibility Checker dialog box needs to state workbook referred
The Excel Compatibility Checker dialog box in Excel 2007 (which warns of features in a workbook which aren't supported by earlier versions of Excel which may be lost if the file is saved in an earlier format, e.g. Excel 2003) currently doesn't say which workbook it is referring to. This is a problem when using a .net or VBA program from Excel to manipulate other Excel files. In our case we have a custom toolbar that reads in data from another Excel file of the user's choice, and writes to this file, the Excel Compatibility Checker dialog box pops up to warn "minor loss...

Problem with hyperlink
Hi, When attempting to activate a web page using a hyperlink in Excel 2003, I get a message: "Opening"javascript:OWSize ("PR_Popup",http://racingpost.co.uk/horses/trainer_form.sd?trainer_id=693&code=Flat,620,480,'no','yes','yes')" Hyperlinks can be harmful to your computer data. To protect your computer, click only those hyperlinks from trusted sources. Do you want to continue. YES NO When I click YES a web page appears for a split second and then closes. I turned off Pop up blocker but this did not solve the problem. Why am I havi...

Problem with records affected
I'm inserting into a database and need to know the number of records that where entered and the number of errors, using this With CurrentDb .Execute strSQL_insert If Line_Number = 80 Then MsgBox (.RecordsAffected) End If If .RecordsAffected = 1 Then Good_Records = Good_Records + 1 Else Bad_Records = Bad_Records + 1 End If End With But the recordaffected comes out with 0. Thanks Suggestions: 1. Use a Database variable, so you can set it to Nothing again at the end. 2. Use dbFailOnError so you can...

problems with outlook 2003 #4
outlook 2003 keeps restarting, stating that it has encountered a problem and is restarting... any suggestions ? ...

Date Serial Problem
I have a querry in which I am using the Date Serial in the querry criteria as follows Between DateSerial([Enter Year:],[Enter Month:],1) And DateSerial([Enter Year:],[Enter Month:]+1,0) the result i get is for a a perticular month in a year. What I want is: 1. if i want to get the results between june to november 2009. how can i do it? 2. If i want to get the restult of 2008 only e.g. from 01 Jan 2008 (or any year) upto 31 December 2008. This should give result only for 1 year only. not by months like from june 2008 to june 2009 Please help me fix this querry ...

Exchange 2003 Security problems
Hi there, Can anyone please tell me what security permissions the exchange enterprise servers must have to Active Directory AND where I can look to verify that it is there? My 3 exchange servers loose there security rights and must do a domainprep every 8 hours to restore the security. I get the following on the exchange servers: Process STORE.EXE (PID=3456). Exchange Server sample.local does not have Audit Security Privilege on Domain Controller sample.local This Domain Controller will not be used by DSAccess. . PLEASE HELP?? Thanks Hens Hens You need to find out why this is happe...

Outlook 2003 Sent item problem
My problem is I can send a new message, it goes to the outbox, it is not assigned a date, when send recieve is carried out it does not go. If I forward this same message it transmits properly. What are your send/receive settings for this account? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Greg D asked: | My problem is I can send a new message, it goes to the...

Creeping Oulook connectivity problems
Hey folks, Looking for help/ideas here. Smallish office, 25 users or so. Exchange 5.5 running on NT4 (we can't/won't deal with AD) on good hardware--dual 2 Ghz Xeon Dell with 4 GB of RAM, mirrored RAID for the OS RAID 5 for the mail store. We spam filter on our mail relay (in our DMZ) using spamassassin and a few other tools and use Trend Scanmail on the Exchange server to scan for viruses. Clients are all XP Pro SP2, Outlook 2002, firewall off (we have a Cisco PIX that we know better than some relatives), and our network is remarkably high performing and clean. Management is very goo...

OLE Problem on Opening
Hi All, I have searched everywhere but cannot find a solution to this. I have a c.6mb .xlsb file (c.60mb in .xls) which I am trying to open in xl 2003. However everytime I try to open it it starts to convert the file then just gives me the following warning "microsft Excel is waiting for another application to complete an OLE action" I have no other programs open when I try this, any help would be greatly apprecaited. Thanks. Chris Are there macros in the workbook? First try to open the workbook with macros disabled (using medium security mode) and see if the ...

How can I hide the main window / dialog
Hi, I use MFC to paint a picture(.bmp file) on screen. But I want the application main window not to show on screen. How can I do that? I tried to use dialog and doc/view mode, the best I can do is to call a SendMessage(WM_CLOSE,0,0) on OnInitDialog(). But there is still a flash screen of showing the main dialog then close. How can I prevent it from showing? Thanks. "Victor Lai" <VictorLai@discussions.microsoft.com> wrote in message news:0C00076F-B3D0-4EA0-8C6A-09425ADF3D0A@microsoft.com... > Hi, > I use MFC to paint a picture(.bmp file) on screen. But I want th...

text mask problem
A2k. I'm using the following to mask an unbound text box so that the user can ONLY enter 50 characters: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC I seem to recall this is a problem with access since this also means that editing in that control means that typing in the middle of the string overwrites characters regardless of the how the keyboard key "Insert" is set (on or off). I need to limit the # of charactes AS the user types. I do NOT want to Trim the characters afterward, nor do I want to pop up some lame warning in the BeforeUpdate event or in the ValidationRul...

Problem shutting down Outlook 2003
OL 2003 SP2 MS XP Pro SR2, All updates installed... Upon doing a File-->Exit, Outlook.exe stills appears in task manager, jumps to 99% CPU, Mem Usage exceeds 14k. Outlook appears to close properly at UI level. Machine slows down due to Outlook.exe not "ending". I must manually kill Outlook.exe via task manager. At first, I thought I got nailed with spyware/adware/virus ... turns out that Outlook.exe will not shut down. Did Spybot sweep/ virus sweep ... all clean... Any ideas? Thank you in advance for your input. -- Grumpy Aero Guy Grumpy Aero Guy <fb@beerme....