Problem setting focus to dialog from main window

Hi All;

i'm working on an application that has been around for a while. in fact it 
was created in C and later converted to C++. i have to set focus to a 
specific dialog that is displayed and i'm not sure how to go about it. here 
is what happens.

we have a main application with a graphics overlay class that displayes user 
defined points. when you right click  on the overlay it allows you to enter a 
new point. this overlay class uses COM to access a dataserver that then calls 
the user point editor and the new point dialog. the new point dialog 
isinstantiated as part of the user point dialog which inturn is instantiated 
and registered to a menu button when the app is started. both dialogs are 
left hidden until needed and they are left in memory.
I need to set the focus to the new point dialog but can't see a way to do 
it. i have tried to set it within itself, within the user point dialog, and 
within the dataserver. all that happens is that the program will continue to 
run then set focus back to the Overlay.

thanks for any help
0
shawn1 (154)
4/12/2005 7:29:02 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
257 Views

Similar Articles

[PageSpeed] 44

Can you get the handle to the dialog in question?  Who is calling ShowWindow
for the dialogs? If you have the hWnd of the dialogs then you can call
SetFocus from the place where you are showing the dialogs, what is happening
is that when you press the toolbar button to bring the dialog up it comes up
it sets focus to itself, and then the button message from the toolbar will
set the focus back to the main view.

If for some reason you don't have the handle to the dialogs, then instead of
calling SetFocus within the dialogs, you can simply post a message from the
dialog back to the dialog to set focus to itself, and that should get
processed after the WM_LBUTTONUP of the toolbar gets processed. Simply put
you need to delay your setfocus for a few milliseconds to allow the button
click on the main view to get processed.

AliR.

"Shawn" <Shawn@discussions.microsoft.com> wrote in message
news:E77043E2-4A04-4EF6-A391-25C6D4995252@microsoft.com...
> Hi All;
>
> i'm working on an application that has been around for a while. in fact it
> was created in C and later converted to C++. i have to set focus to a
> specific dialog that is displayed and i'm not sure how to go about it.
here
> is what happens.
>
> we have a main application with a graphics overlay class that displayes
user
> defined points. when you right click  on the overlay it allows you to
enter a
> new point. this overlay class uses COM to access a dataserver that then
calls
> the user point editor and the new point dialog. the new point dialog
> isinstantiated as part of the user point dialog which inturn is
instantiated
> and registered to a menu button when the app is started. both dialogs are
> left hidden until needed and they are left in memory.
> I need to set the focus to the new point dialog but can't see a way to do
> it. i have tried to set it within itself, within the user point dialog,
and
> within the dataserver. all that happens is that the program will continue
to
> run then set focus back to the Overlay.
>
> thanks for any help


0
AliR1 (391)
4/12/2005 8:19:14 PM
Reply:

Similar Artilces:

Problem shortcuts in Word
Hello, I work with Word 2008. In the beginning there is no problem, but suddenly i have problem with shortcuts. When i want to do "cmd c" it make an other shortcuts same thing for "cmd s", "cmd v" and surly some other. But when i write there is no problem "c" is "c"... If somebody have an idea please help me. Thank you. Unless you indicate your specific update level of Office as well as OS X & describe what the keystrokes *are* doing contrary to what you expect there isn't much we can offer. -- Regards |:>)...

encoding problem in Outlook 2007 importing Outlook 2000 personal folders
I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese characters in the subject became unreadable but it's ok to display in message body. In Outlook 2000, there's no problem to display the Chinese characters in the subject. What's wrong with Outlook 2007? What setttings should I change to fix the problem? Thanks. cyl <u8526505@gmail.com> wrote: > I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese > characters in the subject became unreadable but it's ok to display in > message body. In Outlook 2000, there's no problem t...

having trouble with windows mail
The message could not be sent. The authentication setting might not be correct for your outgoing e-mail [SMTP] server. For help solving this problem, go to Help, search for "Troubleshoot Windows Mail", and read the "I'm having problems sending e-mail" section. If you need help determining the proper server settings, please contact your e-mail service provider. The rejected e-mail address was 'Foreverzetaclassy@live.com'. Subject 'Application Data For Mental Health Worker', Account: 'pop3.aol.com', Server: 'smtp.aol.com', Pr...

Outlook 2003 PST problems
I just installed Office 2003 professional on a new computer & am having problems with outlook. I copied my Outlook.pst file into the appropriate directory & although it is recognized the calendar is not working properly. I cannot attach any of the colored labels to my appointments - so everything is pretty much in black & white. I totally uninstalled & reinstalled office... first removing my pst file... but there appears to be an ini file... or something that is retaining some information... does anyone know of a fix for the labels... or how to TOTALLY uninstall office (so I...

Outlook 2007 and Windows 7
After installing Office 2007 on Windows 7 machine, I get no new mail sound, pop up notifications or the new unread mail icon in task bar. Every thing else seems to work fine. Any hints? are the icons in the overflow? -- -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM Poll: What v...

Missing windows
Hi Can anyone let me know what I have to do to get the windows back that show's the cell reference for where you are. This has gone missing along with the window that's used to type the formula into Sorry to be a pain on a triviality, but I can't find the answer anywhere TIA Steve View>Formula Bar The cell reference "window" is called the Name Box. Also, you can type formulas into a cell, not only into the formula bar. Gord Dibben MS Excel MVP On Mon, 29 Jan 2007 21:29:57 -0000, "Steve" <sr2000{at}talk21{dot}com> wrote: >Hi > >C...

Problem with Authentication
The CRM application was running smooth. But now I can't logging. It ask my credentials and than return a 401.1 error. I had already reinstalled the CRM server but it won't work. I'm accessing it in the same local network. I'm running CRM 3.0 in SBS. Best regards, Erico Hi When you open a Internet explorer and type the name of the CRM server, it prompts for user and password ? Are you logged in with domain credentials ( AD user ) ? If you are, so add url of the crm server in Local intranet. Enable "Automatic logon only in intranet", this is under security,c...

Settings for removable media?
At some point I chose an option that was supposed to improve performance for removable media at the expense of (IIRC) having to wait longer before such devices could be removed. Now I want to reverse that choice, but I cannot find it. Yes, I have Googled but so far have not found what I want. Anyone? Perce Percival P. Cassidy wrote: > At some point I chose an option that was supposed to improve performance > for removable media at the expense of (IIRC) having to wait longer > before such devices could be removed. > > Now I want to reverse that choice, bu...

Vista blue screen problem...please help!
I've seen some other threads, here are the dump files: 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' (http://rapidshare.com/files/347103149/Minidump.rar.html) Please, help me out here. -- ceVil It might be better to know at what point the bsod occurs and what the actual err.msg given is "ceVil" <guest@unknown-email.com> wrote in message news:0b9a0c60b90bf6c0be88bda30f2820ab@nntp-gateway.com... > > I've seen some other threads, here are the dump files: > 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' > (...

calendar problem
Dear all, I am using both mail and calendar function in outlook 2002. Everything is ok until recently, when I try to make a new appointment or checking any old appointments, an error message "out of memory or resource, try to close some windows..." pop up. The mail function is still ok. Can anyone tell me how can I solve this? I have already installed sp2. The version of office is the professional one with frontpage. Thanks. tp ...

problem #4
Hi, I am facing this new problem... i.e a user has installed Office 2003 on win2k prof platform.. whenever she is working on a outlook.. she gets a Microsoft error message... saying to send the report or don't send the report... Usually I have seen this problem in IE... But for outlook it is new to me... after clicking on send or don't send report.. the outlook closes. And there are no IE open..... and if atall it is open.. the IE does not close... Need your help regards, KAH What is logged to the Event Viewer regarding this? Try one of the following already; http://www.howt...

95 and 97 problem
For some unknown reason there is Excel 95 and 97 on this pc.When i double click on an Excel file, the pc defaults to the 95 program (Which incidently doesn't work properly). So my question is how do i get the pc to default to 97. Cheers Craig Craig, Have a look at Windows Help. From Windows 2000 Help (Index under Programs Associating with File Types) To change which program starts when you open a file In My Computer or Windows Explorer, on the View menu, click Folder Options. Click the File Types tab. In the list of file types, click the one you want to change. Click Edit. In Act...

Date problem
I can't believe there's no post on this, but I can't find it. I've tried the solutions I could find (see below) and still get the error: "The expression is typed incorrectly or it is too complex to be evaluated. For example....Try simplifying...." I have a date field, formatted as Date/Time, General Date, default Value = Now(). I like having the date and the time - in case we need it. I want to run a report on calls taken just for one day. I have CallDate: CallDateAndTime in my query, with "criteria" as Between ([Forms]![frmReports]![txtStartDate]) A...

sync problems
I have all of my info on an HP Ipac. I had to reformat the hard drive and I did not make a back-up file. I am trying to move everything back to the computer but it says there is an error with syncing it. How can I move everything from the PDA back to Outlook again? Please help- thanks ...

Extender-Create a new data entry window
Is it possible to create a new extender form or window (not sure of the terminology) to enter data into Dynamics? Specifically the Sales Forecast Window in Manufacturing is terrible for entering data, everytime you move to the right, it the scrolling window jumps back to the top and you have to find the item again. Anyway, I would like a new window to enter a sales forecast, is this possible? thanks -- Doug Unfortunately Extender data is stored in Extender tables and cannot be stored in the Sales Forecast tables. I agree with you that the data entry screen is horrible. I am tal...

Office 2007 - HELP
I have used Word for many years and love it - not too thrilled with the changes in Office 2007, but my bigger issue is with Publisher 2007. I have an image that I have used in Word just fine - meaning, the on screen colors are correct and when printed the colors are correct. Someone sent me a Publisher file and asked me to add the image - I did this - now the image is messed up - the colors are correct on screen, but when printed FROM MY computer the image colors are all wrong - but if I transport the file to a different computer it prints fine I have reinstalled Office - no good Any id...

Installation Problem!!
I am having a problem installing MSCRM 1.2. My configuration consists of a Domain Controller running Win 2000 Server SP4 . I am trying to install MSCRM on a member of the domain running Windows 2000 Server SP4. There is a DNS Server on the DC which is integrated with AD, and a SQL Server 2000 running on the Win 2K machine. The install errors out when CRM creates the root business with the message: Setup was unable to install Microsoft CRM Server. Setup was unable to provision your organization. Setup was unable to create the root business. The configuration of ASP.NET seems to be ok, the pr...

Outlook 2003 won't save password in pop3 account settings
I am trying to set my email account settings to remember my password and it still prompts me everytime I send or receive email for the password. If I type it in, I have no trouble connecting and getting mail though. I am working through a citrix terminal to connect to outlook 2003 running on our company server. Is this a known bug? Is there a patch? Help! Sean Cartwright ...

How to get a Dial-up Connection dialog box?
I just got Outlook 2003 with new laptop which I carry back and forth to work. I use the same ISP at both locations, but with different dial-up phone numbers. When I launch Internet Explorer, I get a "Dial-up Connection" dialog box that lets me select which phone number to use. I want to get that same dialog box if I'm not already online and I launch Outlook 2003, but I can't figure out a way to get Outlook to give it to me. I had Outlook Express on my old laptop, and it gave me the same dialog box as IE. Is that function no longer available? -- Friday714 Set th...

Problems Creating a disclaimer in Exchange 2003
I am trying to create a server based disclaimer that will stamp all of my smtp emails going to the internet. I have been following KB article 317680 with no luck. I get an error like the one below. Binding Display Name Specified: smtpscriptinghost ** Registration Failed ** Err.Number (HRESULT) = 0x1AD Err.Description = ActiveX component can't create object ProgID = cdo.ss_smtponarrival COM Category = {FF3CAA23-00B9-11d2-9DFB-00C04FA322BA} Corresponding Event = onarrival ** Have you registered your sink COM class on this machine? I am puttin...

Resource editor problems
Hello all, Under VC++ 7.1... Please consider these two lines: IDC_ARROW_ADD_CANCEL DISCARDABLE "res\\cur00004.cur" IDC_ARROW_ADD_CANCEL CURSOR DISCARDABLE "res\\cur00004.cur" The second is a hand-edited change to the first. Both will compile just fine in the resource compiler. However, after I use a text editor to make this change, I cannot open the .rc file in the resource editor. The resource editor issues the following error open attempting to open the .rc file: error RC2135 : file not found: CURSOR Can anyone shed light on what's going on here? Thanks, Dave ...

Outlook won't open after reinstalling it after installing Windows
My computer crashed. I installed Windows 7, and then reinstalled Office 2007. Outlook will not open. Any suggestions? Margye Hixson Suggest providing information. Include what you did, what happened and any and all error messages. Be detailed as if we weren't there and don't know what happened. -- Russ Valentine "Margye" <Margye@discussions.microsoft.com> wrote in message news:9F85CAAC-2042-4CAB-A329-EF6B3A682189@microsoft.com... > My computer crashed. I installed Windows 7, and then reinstalled Office > 2007. > Outlook will not open....

Directory Replication Problem #2
Hi, recently my Exchange Server directory database receives changes from other servers but does not send out its own changes. Check from the knowledge base, to correct the USN discrepancy need to use Authrest.exe (need to amke changes for about 100+ users). Does anybody know where to get this file 'Authrest.exe' for exchange server 5.5? Exchange server 5.5 CD only provide this file for ver.4.0. Have anyone use it before? Regards, "Sharon Tan" <sharon_tansk@yahoo.com.sg> wrote: >Hi, recently my Exchange Server directory database >receives changes from ot...

Cell Format
I have a spreadsheet with cells that I'm trying to type the date into. I type in the date exactly like this: 09/26/03. When I hit "enter" MS Excel displays "37890" in the cell. No matter what I do I can't the cell to show: 09/26/03. I think that somehow I need to "strip" the cell of what it's original format is, but I can't figure out how. I try to use the Date option in the format cell screen but it doesn't work. Curtis I tried this and it didn't work. I also tried the "Text to columns" feature. No success. >...

User Defined Variables in MS query cause a problem to import data
If I use user defined variables in MS query to import data into excel sheet, the query executes but no data gets imported into the excel sheet. If I get rid of the variable the results can be imported into the Excel sheet. ...