Updating Dialog when lost focus

I have a non-modal dialog within my MFC app'.  Is it possible to
update the dialog when it hasnt got focus?

Thanks in advance.

Tim
0
tim182 (1)
4/8/2005 10:25:47 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
975 Views

Similar Articles

[PageSpeed] 30

Tim Woodburn wrote:

> I have a non-modal dialog within my MFC app'.  Is it possible to
> update the dialog when it hasnt got focus?
> 
> Thanks in advance.
> 
> Tim

Certainly.  Focus determines where keys go.  It has nothing to do with 
updating the display.  Send new data to the controls and they will update.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
4/9/2005 12:01:02 AM
It's just a window. You can do anything you want to it. Whether or not one of its controls
will receive keyboard input doesn't have anything to do with this.

For modeless dialogs, you should either call methods of the dialog, or send messages to
the dialog (each has advantages and disadvantages) but at no time should you ever "reach
into" the dialog and manipulate its controls from outside. In one of the poorer examples
of judgment, Microsoft made all the control variables 'public' when they should be
'protected'. If you ever touch a control from outside the dialog, you have made a mistake.
But call a method, and define its behavior in terms of an abstract idea, and ignore the
implementaiton outside the dialog (for example, I once changed the implementation of a set
of check boxes to a checked listbox and no piece of code outside the dialog ever noticed
this change)
				joe

On 8 Apr 2005 15:25:47 -0700, tim@robotcrazy.com (Tim Woodburn) wrote:

>I have a non-modal dialog within my MFC app'.  Is it possible to
>update the dialog when it hasnt got focus?
>
>Thanks in advance.
>
>Tim

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
4/9/2005 6:28:18 PM
Reply:

Similar Artilces:

Failed Updates 06-26-10
Usually when I try to install updates, a message will appear indicating that the process has failed. When I allow Windows to automatically install updates, however, my Internet connection fails and I then have to do a system restore to remove the updates so that I can use the Internet again. Can you please help me with this, as I do want to be able to update my computer with programs and anti-virus updates without losing my Internet connection each time? Thanks. Allen • Which version of the Windows operating system am I running? http://windows.microsoft.com/en-us/wi...

All links lost
Hi I have a very large database with about a hundred links. I have had to move all of my files to a new computer/server and have set the directory structure to be identical to the existing one. Unfortunately the database does not now automatically link to the files. Is there an easy way to reinstate the links without changing the source of each individually? (Excel 2000) -- DavidM ...

Autopopulate Case Resolution Dialog Box
Hi We are aware that we cannot populate the 'Case Resolution Dialog Box' so we have created custom attributes named 'Resolution' , 'Description' and 'Resolved' and inserted these fields on the Case form. We would not like to remove the Case Resolution record or button from CRM however we would like the fields on the 'Case Resolution Dialog Box' to be autopopulated with the information that was captured on the Case form. I attempted to do this using a workflow rule which of course did not work. Is there a supported way that we can achieve this bi...

Hide the Help button from Propertysheet dialog
Hello, Could you tell me, how can I hide the Help button from Propertysheet dialog in the wizard mode? I want to appeare just Back, Next, Cancel and Finish button in the dialog. I don't need to the Help button. By the way, PropertySheet.m_psh.dwFlags &= ~PSH_HASHELP; doesn't work. Thank you so much, Monica. Hello Monica, > By the way, PropertySheet.m_psh.dwFlags &= ~PSH_HASHELP; doesn't work. This should work. You need to remove it from each of the property pages as well. Here is the link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccor...

Update Links Slow
My supervisor just showed me a monthly process I am to inherit. Basically it involves these steps: 1. Copy Last month's files to This month's folder. 2. Rename the files. 3. Update the links to point to the new-name files instead of the files in last month's folder with last month's name. She says that to do this, it is faster if you copy everything to the local hard drive, update the links to refer to local files. Refresh the links. Then upload back to the network and change the links to refer to network files and then refresh the links again. She said t...

Is it possible to put a Dialog in a Parent Dialog
Hai Iam looking to put a dialog into a parent dialog and can any one help me in resolving this issue and can i use DialogBars inside a Dialog Thanks and Regards suresh Suresh wrote: > Hai > Iam looking to put a dialog into a parent dialog and can any one help me > in resolving this issue and can i use DialogBars inside a Dialog > Thanks and Regards > suresh > > Dialog-in-dialog is done frequently. What's your issue/problem? Typically one turns off the border and title...

Automatic OnLine Update at Start UP
The automatic online update at start up option was checked in the preferences/options screen. This option does not work. I have to manually click the circle with the arrows in the upper right of the screen to get the updates started. What is wrong with the setup? ...

Retail sales price automatically updated from landed cost
New implementation, new to GP. Was going to perform back office functions (PO & receiving) in RMS but we could not automatically create landed cost from supplier invoice cost at time of receiving, update retail sales price based on landed cost at time of receiving or receive multiple invoice for 1 PO. Now looking to perform back office in GP. One of many questions - when receiving against a PO, the landed cost will update based on the landed cost group. Is there a way to automatically update the retail sales price of the item at the same time based on landed cost x multiplication ...

Update logging possible?
Using the jet database (not my choice), I'd like to know it anybody has any ideas as to how to determine what/when tables are being updated. In SQLserver I could set a trigger, but not Jet. The reason is that I'm linking two back-end database together and I need to keep data synchorized and trying to find out what tables are being updated where is a nightmare in a large, complex application. Many of the record sources are queries or changed on the fly quit often, and some are with update and insert statements dynamically constructed. Any ideas? -- Posted via a free Usenet ...

Modeless Dialog from MFC Regular DLL opened from EXE problems
Hi, Resources for the MFC modeless dialog are in a Regular DLL with MFC statically linked, No message overrides are set with the dialog, it is a generic dialog with only the OK and Cancel buttons. I choose a MFC AppWizard(exe) Dialog based for the calling EXE and used Run-Time Dynamic Linking to the DLL. Tried a couple I different approaches base on what I found on the newsgroup and the usual help sites. I know that I need to keep the modeless dialog from going out of scope after it is created so this is what I tried two different methods so far but I still can't get the dialog to hang ar...

Some updates could not be installed
I have tried installing the following updates at least a dozen times since 15 Dec. The little yellow shield asks me to install updates, I click it, and after a few minutes this message comes up: AUTOMATIC UPDATES Some updates could not be installed The following updates were not installed: Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update for .NET versions 2.0 through 3.5 (KB951847) x86 Microsoft .NET Framework 2.0 Service Pack 2 Security Update for Windows 2000, Windows Server 2003, and Windows XP (KB974417) Sorry, forgot to mention my sys...

Consensus after the update
Just wondering what the consensus was after the Money 2005 update. Are you happy to be using it now or you'd wish you hadn't upgrade? I've been following the group and it appears the upgrade fixed a lot of issues. Thanks. It didn't change my mind. I'm still passing on M05. "Andrew" <xakedwax@xhotmail.comx> wrote in message news:5WEud.1043$Sq.145@fed1read01... > Just wondering what the consensus was after the Money 2005 update. Are > you happy to be using it now or you'd wish you hadn't upgrade? > > I've been following the...

National City auto-update
I used to be able to have Microsfot Money automatically download transactions from my accounts. Now whenever it goes to check it says it failed. I tried setting it up again but it prompts me "National City Requires a Password Change", but no matter what I enter in these boxes it says the password/pin is incorrect. I called National City and they said there wasn't anything wrong with my account. What should I do? In microsoft.public.money, Josh wrote: >I used to be able to have Microsfot Money automatically download transactions >from my accounts. Now whenever i...

How to get rid of the update now extra sceen
When I perform and update now function in Money 2005, it pops up a warning screen that has a check box to "hide the pop up" on future runs of the function. This does indeed occur for subsequent runs on the same Money 2005 session, but if I close Money and re-open it, the box re-appears. How can I permanently get rid of the box. I assumed that this would be in the FAQ, but was unable to find it. Thanks Art McClinton Hi, there's a registry fix to remove it. It can be gotten from http://money.mvps.org/patches.aspx -- Glyn Simpson, Microsoft MVP - Money http://money.mv...

Problem when running Exchange Calendar Update Tool
I ran the Exchange update tool against a few mailboxes, and I am noticing a problem. The tool appeared to work to some extent, but one of the mailboxes I ran it against has some items modified and some not modified. Two recurring meetings that this user created and invited other people to were modified properly and updates were sent out automatically to the other people in the meeting. However, two other recurring meetings that he initiated and invited other people to were not modified and no update messages were sent for those meetings. Appointments that he created just for himself...

Cells and Charts not updating!
I have created a large spreadsheet (80Megs), The charts and other cells just simply do not update when I make changes. Is this due to the size of the spreadsheet? Thanks, GH G Hood wrote: > I have created a large spreadsheet (80Megs), The charts > and other cells just simply do not update when I make > changes. Is this due to the size of the spreadsheet? Did you check the automatic recalculation? Tools | Options | Calculation tab | Automatic or Manual Calculation. Dave dvt at psu dot edu Yes, I have already checked, it is set to automatic calculation. >-----Original Mes...

Recorset not updateable in a crosstab query
I have created a crosstab query based on just one linked table using the Access wizard and when I finished I get the erro "The recorset is not updateable", clicking on OK it shows me the tahe results in the corresponding table, but if I try to see the structure of the query it shows me the structure mask but saying that in the expression "Format([DPC]:"aaaa")" there to many closing brackets. I copied the table to the current DB to avoid any links problems but the result is the same. Can anybody tell me how to solve the problem? Thanks very muc...

How to show a Dialog that is in maximed state initially
I am trying to show a dialog when a button is pressed. I know that call Dialog d; d.DoModal(); What else show be do be done in order to show the dialog in a maximized state. I added the properties Minimize/Maximize from the properties . Psl guide. Bhargavi You could use a ShowWindow() call in the OnInitDialog() function for the dialog to show it maximized. http://msdn2.microsoft.com/en-us/library/72szh9c7.aspx Tom "Bhargs" <bhargavi_ks2001@yahoo.com> wrote in message news:1150301229.668141.55560@y43g2000cwc.googlegroups.com... >I am trying to show a dialog when a bu...

Creating a CDialog derived class for a Dialog??
I am trying to convert a project from Win32 to MFC. I created a new dialog resource, but when I try to do the right-click add class thing from the dialog editor, it doesn't do anything. I am using VS.NET 2003 Pro. In the dialog that pops up to create the new class, I change it to derive from CDialog, it already has the ID for my dialogbox resource selected, and I enter a new class name, and it generates the .h and .cpp names. I click Finish and NOTHING happens. I try it again from the main menu, but this time it pops an error box saying "Object Required". I am stumpe...

How do I set the focus for a field after new (blank) record ?
Hi When I click the "new (blank) record" icon at the bottom of a form, the cursor disappears. How can I make the cursor go to the first field on the form like it does when I first go to the form. Thanks in advance Mark Thornblad Use the form's Current event to run a macro that contains the GoToControl action, and use that to set the focus to the desired field. -- Ken Snell <MS ACCESS MVP> <mthornblad@gmail.com> wrote in message news:d7aa0f3c-adbc-4f30-8e2b-f82b121f5876@a28g2000hsc.googlegroups.com... > Hi > > When I click the "new (bla...

Lose focus on CEdit when mouse click with csplitter active
Could someone explain to me, why when I have a split view with a treeview in one pane and a form in the other pane with cedit controls on it, that when I click on the cedit control I lose focus and then regain focus. This will occur even if the cedit has focus and I click on the cedit again, it will lose focus and the regain focus? View deactiveates and then reactivates, can I stop this? Thanks, EK ...

change all controllers' font in a dialog
Env: WindowsXP, VC+6.00 There are any easy ways to change all controllers' font in a dialog(NOT one by one)? TIA William If you mean to change font for the controls in a dialog, you can enumerate over all the children of the dialog and call SetFont on each of them(Use EnumChildWindows). Another option is to use SendMessageToDescendants. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "William" <port@mx15.freecom.ne.jp> wrote in message news:u0W39WplHHA.4848@TK2MSFTNGP05.phx.gbl... > Env: WindowsXP, VC+6.00 > > There are any easy ways to change all contro...

Lost email folders when upgrading
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: pop I just upgraded from Office X to 2008, and some of my email file folders are missing as well as addresses in my address book. How can I recover these? <FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>On 1/7/10 7:41 AM, in article <a href="59bb03e0.-1@webcrossing.JaKIaxP2ac0">59bb03e0.-1@webcrossing.JaKIaxP2ac0</a>, &quot;<a href="Blucey@officeformac.com">Blucey@officeformac.com</a>&quot; &l...

Resizing dialogs
Hi. I have an MFC dialog based app. I want the user to be able to resize the dialog horizontally only. How can I do this? I have tried changing the onsize(...) function without success. The is a very important feature for my application. Please help. Thanks, Blair Blair wrote: >Hi. I have an MFC dialog based app. I want the user to be able to resize the >dialog horizontally only. How can I do this? I have tried changing the >onsize(...) function without success. The WM_SIZE message informs you of a size change that's already occurred, so it comes too late to help. >The is...

Update Hyperlinks easily
Hi, I have a work book that has hyperlinks to PDF files. Now the problem is the name of the folder that these PDF files are stored in has changed. Is it possible to somehow automatically update these hyperlinks to reflect this? I dont fancy trawling through 400 diffrernet links and manually updating them. Kind Regards Andy ...