Dialog loosing focus when called from Tree Control

Hello All,

In our application a dialog has to be invoke if user select any item
from the tree control(CTreeCtrl Class variable )

The dialog is created properly as a parent of tree control dialog but
its loosing focus , as per our requirement this dialog should be at the
top of the window but tree control is coming at the top.

Can anyone tell us where i am doing wrong.

I have tried all calls like ShowWindow, killFocus from the tree
control.. etc... but it didn't work. 

Regards
Amit

0
10/27/2006 12:29:36 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
685 Views

Similar Articles

[PageSpeed] 54

Let me see if got this correctly.
1. User selects an item from a tree control.
2. At that point you want to bring up a child dialog that is a child of the
tree control and place it on top of the tree control.

Is that right?

AliR.

<amit.dgupta@gmail.com> wrote in message
news:1161952175.999175.256530@k70g2000cwa.googlegroups.com...
> Hello All,
>
> In our application a dialog has to be invoke if user select any item
> from the tree control(CTreeCtrl Class variable )
>
> The dialog is created properly as a parent of tree control dialog but
> its loosing focus , as per our requirement this dialog should be at the
> top of the window but tree control is coming at the top.
>
> Can anyone tell us where i am doing wrong.
>
> I have tried all calls like ShowWindow, killFocus from the tree
> control.. etc... but it didn't work.
>
> Regards
> Amit
>


0
AliR3470 (3236)
10/27/2006 2:58:20 PM
amit.dgupta@gmail.com wrote:
> Hello All,
>
> In our application a dialog has to be invoke if user select any item
> from the tree control(CTreeCtrl Class variable )

Where is the TreeControl? Is it in a view or some dialog?

>
> The dialog is created properly as a parent of tree control dialog but
> its loosing focus , as per our requirement this dialog should be at the
> top of the window but tree control is coming at the top.

How is this tree control related to dialog? Who is parent of the dialog
that is being created?

---
Ajay

0
ajaykalra (6842)
10/27/2006 6:23:54 PM
Yes, its correct, the same case i wanted to implement, but its not
happening.

Regards
Amit
AliR (VC++ MVP) wrote:
> Let me see if got this correctly.
> 1. User selects an item from a tree control.
> 2. At that point you want to bring up a child dialog that is a child of the
> tree control and place it on top of the tree control.
>
> Is that right?
>
> AliR.
>
> <amit.dgupta@gmail.com> wrote in message
> news:1161952175.999175.256530@k70g2000cwa.googlegroups.com...
> > Hello All,
> >
> > In our application a dialog has to be invoke if user select any item
> > from the tree control(CTreeCtrl Class variable )
> >
> > The dialog is created properly as a parent of tree control dialog but
> > its loosing focus , as per our requirement this dialog should be at the
> > top of the window but tree control is coming at the top.
> >
> > Can anyone tell us where i am doing wrong.
> >
> > I have tried all calls like ShowWindow, killFocus from the tree
> > control.. etc... but it didn't work.
> >
> > Regards
> > Amit
> >

0
10/30/2006 4:03:40 AM
Hello

In the above scenario,

The parent of Dialog and tree control both are same window, its a
window in which tree control created and the same window is parent of
another dialog that should be on the top.

Ajay Kalra wrote:
> amit.dgupta@gmail.com wrote:
> > Hello All,
> >
> > In our application a dialog has to be invoke if user select any item
> > from the tree control(CTreeCtrl Class variable )
>
> Where is the TreeControl? Is it in a view or some dialog?
>
> >
> > The dialog is created properly as a parent of tree control dialog but
> > its loosing focus , as per our requirement this dialog should be at the
> > top of the window but tree control is coming at the top.
>
> How is this tree control related to dialog? Who is parent of the dialog
> that is being created?
> 
> ---
> Ajay

0
10/30/2006 4:05:17 AM
Reply:

Similar Artilces:

CFormView plus Splitter = Disabled Controls
Does anyone know what is needed to get the buttons and controls on the form view to be enabled again. I created a test app (In Visual Studio.Net 2003, MFC/SDI App) then verified that the buttons on the formview were enabled. So far, so good. Then I added the splitter bars and that's when the form controls became disabled permanently. Adding the ON_COMMAND_UI handlers for the buttons did not fix the problem. 1) After adding the CMDUI support manually and after verifying that all the CMDUI handlers were called, the buttons still were disabled. EnableWindow() does not unlock the buttons eit...

Resizing controls in a dialog
Hi there, I build an application with different dialogs which can be resized by the user. When this happens, I use OnSize to give new dimensions and positions to the controls in the dialog. I measure the window and put the controls to a special ratio of the whole screen; snippet: GetClientRect(&crClientRect); // complete window ...... cx = (iBorderHor * 4); cy = iBorderHor; sx = crClientRect.Height() - (crObject2Rect.Height() * 6); sy = (crClientRect.Width() / 4) - (iBorderHor); m_BrowseTree.SetWindowPos(&wndTop, cy, cx, sy, sx, 0); .... This ...

The ActiveX control "GridControl" ... requires a design-time license ???
This Active-X control is registered on all of my systems, not just the ones that have VC++6 installed, so I assume that it's part of the Windows run-time environment. Is this correct? Assuming that I would deem it useful, since all that happens if I try to instantiate it into a dialog is that I get the error message, how could I find out what sort of design-time license is required, who can issue these, etc...? TIA Norm Hi Norm, Thanks for your post. I'd like to share the following information with you: 1. By GridControl, do you mean the Grid OLE Control (grid32.ocx)? Based...

Components and Control Gallery missing in VS2005
I found using "Components and Control Gallery" very useful in exporting and importing classes with resources between projects in Visual C++6.0. How do I use this in Visual Studio 2005? Marathoner marathoner wrote: > I found using "Components and Control Gallery" very useful in exporting and > importing classes with resources between projects in Visual C++6.0. How do > I use this in Visual Studio 2005? Marothoner: It's pretty hard when it's not there. Long gone. -- David Wilkinson Visual C++ MVP Then, how do I export and import dialog resourc...

if picture is slightly out of focus can i fix it.
took a picture of a celeb and it is slightly out of focus,picture was taken using a nokia 6720 mobile phone.Is there a program or the like that can maybe auto focus?? In article <41C251A7-4E88-4B4A-A7E5-0456D54E0295@microsoft.com>, Animal wrote: > took a picture of a celeb and it is slightly out of focus,picture was taken > using a nokia 6720 mobile phone.Is there a program or the like that can maybe > auto focus?? Some image editing programs do what's called Sharpening. That can sometimes improve a slightly out of focus photo somewhat. If you don't h...

debug assertion when calling CAsyncSocket Create in native code from external managed C++/CLI wrapper
I found a thread here that describes my exact problem and a solution, but I still cannot get it working. This is the thread: http://groups.google.com/group/microsoft.public.dotnet.languages.vc/b... I have an unmanaged C++ shared mfc extension dll, and I have created a managed shared mfc C++/CLI wrapper to be able to access it's functions through a C# application. Within the unamanged dll is a call to CAsynSocket Create, and when I invoke this call through my C# app -> C++ wrapper -> C++ dll, I get a debug assertion that shows at the top of the call stack AfxGetInstanceHandle. ...

post again problem in creating tab control
What I want is like this: when I select the first page,one dialog is shown up(not automatically) and when I select the second page the other dialog is up. because I use DLL, it is not easy to process the message TCN_SELCHANGE. i use the macro TabCtrl_GetCurSel(), but I don't know why the return value is always zero. Please help me! (I set all the dialogs child style). The codes are like: //create tab control handler hwndTabCtrl=3DCreateWindow(WC_TABCONTROL,"", WS_CHILD|WS_CLIPSIBLINGS|WS_VISIBLE,0,0,rcClient.right,rcClient.bottom,hwnd= =ADParent,NULL,g_hinst,NUL...

Template or whatever you would call it?
Is there a way to create a drawing (using a base template, shape, ...) so that if you go back and change something in the template, it will get changed in all occurences in your main drawing. unfortunately there is no link from an original template to a drawing to perform that function. That said, have you considered going to the document stencil (via the file menu) and making your change there. The way visio works is when you copy something to a drawing it first copies it to the document stencil and from there to the drawing. So unless you have broken the link between document stencil ...

Sibling Mode not working on Menu Items when calling HtmlHelp?
I have a truly curious problem with HtmlHelp and Sibling Mode in Visual C++ ..Net 2003 in an MFC app. Sibling mode allows the help viewer to display on top of the app, but if the app is clicked, then the app becomes the top most window. The idea is to let the user switch back and forth between the help viewer and the application. For the case of Menu Items only, sibling mode does not appear to work correctly under normal running conditions. However, sibling mode does work for menu items, if you put a breakpoint on the HtmlHelp call and stop prior to executing the call. In this case the HtmlH...

tab control #10
hello I am very new in programming I have added a tab control in the main dialog that allow me to put different controls in each tab. I have about 5 tabs my problem is I want the controls on the tabs to communicate with the main dialog. I am able to call the controls and the functions of the main dialog from any of the tabs by using eg void CTab1::Onbuttom() { ((CMainDlg *)GetParent())->m_msg.SetWindowText("Hello"); } with this code if I click on a button on one of the tab page, it will write "hello" in the edit box in the main dialog. Now my problem is how do...

Web sites called from isv.config to open in a new window
This is part of my isv.conf <NavBarItem Icon="/_imgs/ico_18_1.gif" Title="Business Portal" Url="http://cpdata/businessportal" Id="navIsv1"/> <NavBarItem Icon="/_imgs/ico_18_1.gif" Title="CPSS Support" Url="http://Support.computer-plus.com" Id="navIsv2"/> </Home> What I'd like to do is open the web sites in a new window instead of in CRM and size the window so the browser buttons are there. Help is appreciated. Jeff, <NavBar> elements will appear in the frame adjacent to the...

ClassWizard does not include some controls' ID
Dear all, I designed a dialog with controls in VC++6 MFC. I wanted to add viarials to them, but I could not find some IDs of them in ClassWizard, even I could see all IDs in Resource Symbols. Also, I add new controls into dialog, they can not be shown in ClassWizard as well. Does anyone know what reason it is. Many thanks, Yuchun Xu wrote: > Dear all, > > I designed a dialog with controls in VC++6 MFC. I wanted to add viarials to > them, but I could not find some IDs of them in ClassWizard, even I could see > all IDs in Resource Symbols. Also, I add new controls into...

Loosing Chart colour in preview
Hi, Am having difficulties printing particular charts in colour. Initially when copying a chart and pasting it in word, although the preview came up in colour, some charts wouldn't print in colour whilst others would. I then changed all the backgroud/fill effects within word and was able to print most charts in colour - but there are a couple which I can't. Now - i have just created a new chart in excel and used the same fill effects (I saved a new colour in the pallette and am using that) as all the others - but even in excel the preview comes up in B&W. Have been playing aro...

ActiveX control in Word 2007 problem ( PX_Blob() ) #2
Hi, I am having problems to make my MFC ActiveX control work on Word 2007. Inside my control, I use PX_Blob() to serialize data. Here are the steps to reproduce the problem: 1. Create a MFC ActiveX control and use PX_Blob() to serialize data. 2. Insert the control in a Word 2007 document. 3. Save the document as .docx - the new word format. 4. Quit Word 2007 5. Open the Word 2007 and open the file you just saved. 6. The PX_Blob() will NOT return the data you just saved. I found PX_Long() and PX_String() work fine in the above scenario. Also if I save the file as Word 2003 format (.doc) fro...

Remove WS_BORDER style from CEdit control by programmitically
void CMyEdit::PreSubclassWindow() { // Remove the WS_BORDER style DWORD dwStyle = ::GetWindowLong(this->m_hWnd, GWL_EXSTYLE); if(dwStyle & WS_EX_CLIENTEDGE) { ModifyStyleEx(WS_EX_CLIENTEDGE,0); SetWindowPos(NULL, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); } CEdit::PreSubclassWindow(); } Well, it would make a lot more sense to do this at design time. Also, you can use GetStyle and ModifyStyle and you don't need to revert to the GetWindowLong API (also, you don't need this->, since m_hWnd is unambiguou...

Make button on the dialog currently selected programmatically
I have dialog-based MFC application. There are 2 buttons at the bottom of the dialog - "Start" and "Finish". After I press "Start" lengthy operation is performed. At the end of this operation I want "Finish" button to become selected automatically. Using GetDlgItem(IDFINISH)->SetActiveWindow(); does make "Finish" button active. That is if after lengthy operation is completed and I press "Space" the effect is the same as when I pressed "Finish" button. However, "Finish" button doesn't look like it was tab...

Bug 1 mdb With Tab Control works fine. Bugs with mde
Me.RecordsetClone.FindFirst "[ID] = " & Me![LstDoctor] Me.Bookmark = Me.RecordsetClone.Bookmark This code does not seem to work in the MDE Me.LstDoctor.value should be the ID value Rewrite the code slightly like this: With Me.RecordsetClone .FindFirst "[ID] = " & Me![LstDoctor] If Not .NoMatch Then Me.Bookmark = .Bookmark End If End With Including the .NoMatch test is always a good idea when using FindFirst Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Avid Fan" <me@privacy...

Government Applications One Focus of XML 2004
XML 2004 to Focus on Government XML Applications Expanded Government Track to Highlight XML Applications in U.S. and Abroad; XML.gov, KM.gov, CIO Council, and SICoP to Co-Host Event Alexandria, Va. – Oct. 6, 2004 – IDEAlliance, a leading industry association dedicated to fostering XML and other information technology standards, today announced that XML Conference and Exposition 2004 will feature a full track of presentations and topics focused on government-related XML applications and solutions. XML 2004 is slated for Nov. 15-19 at the Marriott Wardman Park Hotel in Washington, D.C. Ma...

dialog template from one project to another
How the heck do you "export" a dialog template from a project for use in another project? >How the heck do you "export" a dialog template from a project for use in >another project? If you open both project's RC files in the IDE, you should be able to copy/paste the dialogs. Dave -- MVP VC++ FAQ: http://www.mvps.org/vcfaq BobF wrote: > How the heck do you "export" a dialog template from a project for use in > another project? If the dialog template is in project_2, open its resource file in project_1 and copy/paste. It's kind of trick...

Problems with CHtmlEditCtrl control
I should have cross-posted this, answer in whatever NG you want (mfc or mfcole), I read both, thanks... I am having "funny" problems with this control. I derived from it and created my own subclass method that basicaly takes an existing editbox, creates HTML control in the same place and tab order and destroys the editbox. This works fine in a test project, but when I move it into my real project, the HTML control is displayed only if it is first in the tab order (I derive only from MFC classes right now, to avoid any problems from my existing code). Calling SetFocus() and ShowWind...

Brainwaves Warfare
Since Allison is still in NY thru Sunday, it's best if I goto Island on Friday (rather than today Thursday). To combine several things in 1 day. FYI: A simple noise-remover for Brain Waves is a Lowpass Filter at approx. 30Hz, b/c brainwaves end at approx 13-15Hz, maximum 20Hz, so a filter at 30Hz will cut much noise. Such filter doesn't need to be hardware - software implementation is basic, and you probably even use it without knowing it - it's included with most Soundcards & Audio software on most multimedia computers. There's a lowpass filter there for...

Text control won't expand
I have text controls that are word wrapped and a 250 size. Can enter the text, and it does wrap, but the size of the control won't expand to see all the text that is entered. Some people will enter 3 words, some a paragraph, so the text control needs to expand the cell instead of having to lock the cell size to the largest needed. Any ideas how to overcome? Why not add scroll bars in the textbox properties rather than resizing the box and whatever else its in on the fly. Linda;707474 Wrote: > I have text controls that are word wrapped and a 250 size. Can enter t...

Is it possible to have more control on context help window?
Hi all... I have created using the MFC Wizard an MDI application with context sensitive help support. The problem is that each option in the menu is shown with white background, and the whole menu bar has the default background. I think this happens because I'm using in my application a control that changes the menu to Office XP look. To avoid that in the child frame, I needed to call a member function of that XP Menu class so that the menu bar is shown flat. Is it possible to get the hwnd of the help window so that I can call that member function on the help window? or.. how can I avoi...

Word object in a control
I want to add a word document based on a template in a bound object as embedded documet to be saved in my database field. -- VH Lars Gotlieb If you know what you need, you could create it yourself in about an hour, even with very little Access experience. "Lars Gotlieb Nielsen" wrote: > I want to add a word document based on a template in a bound object as > embedded documet to be saved in my database field. > > -- > VH Lars Gotlieb Ok I admit my question was a bit to short ;-) What I have is a form with an bound object that should contain a word file. What...

VBA causing Excel to max out 100% CPU when opening the Font Property dialog box
Hi, I'm trying to solve an issue that a client at work got with VBA in Excel 2003. The Client has a SS that got a few 'Combo Boxes' on it, if he select just 1 of the Boxes, anyone and tries to change the 'FONT PROPERTY' as soon as the ellipse ' 3 ... ' is clicked on XL then max's out the CPU sometimes talking 10 - 20 minutes before opening the 'FONT PROPERTY ' dialog box, or you can end the VBA task, this give error that it can't close XL, you OK this and then the 'FONT PROPERTY ' dialog box opens, once it finally open you can go on and ed...