Is there a way to go through all the controls on a MFC dialog?

hi,
    I need to get through all the controls in a MFC dialog without knowing
their ID at design time. That mean that the program must get the id and then
get the control. Is there a better solution? One thing is for sure, I have
to get the CWnd* of all of the controls on a dialog. How do I do this?

thanks

ThunderMusic


0
7/28/2003 3:14:39 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
778 Views

Similar Articles

[PageSpeed] 42

 > I need to get through all the controls in a MFC dialog without knowing
 > their ID at design time.

CWnd* pChild = MyDialog.GetWindow(GW_CHILD);
while (pChild)
{
	//	your code...
	pChild = pChild->GetWindow(GW_HWNDNEXT);
}

0
goony (13)
7/28/2003 3:23:42 PM
thanks, it works... I had the GetWindow, but I was not keeping the new
pointer, so it was always gaving me the same control. Now it works fine.

Thanks

ThunderMusic


"Patrik Stellmann" <goony@volleynet.de> wrote in message
news:bg3f7l$k9bgm$1@ID-194971.news.uni-berlin.de...
> > I need to get through all the controls in a MFC dialog without knowing
>  > their ID at design time.
>
> CWnd* pChild = MyDialog.GetWindow(GW_CHILD);
> while (pChild)
> {
> // your code...
> pChild = pChild->GetWindow(GW_HWNDNEXT);
> }
>


0
7/28/2003 3:37:07 PM
    Try the EnumWindows() API.

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
news:#c3vvqRVDHA.484@TK2MSFTNGP09.phx.gbl...
> hi,
>     I need to get through all the controls in a MFC dialog without knowing
> their ID at design time. That mean that the program must get the id and
then
> get the control. Is there a better solution? One thing is for sure, I have
> to get the CWnd* of all of the controls on a dialog. How do I do this?
>
> thanks
>
> ThunderMusic
>
>


0
CheckAbdoul
7/28/2003 3:49:59 PM
Reply:

Similar Artilces:

Controls on other form
I am trying to code on when a button is being click from other form, a combo box text from other form will check to "Close" where the job= 11111 is this the right way to code? Dim str1 As String Dim str2 As String str1 = Forms![WIPRaw]!txtJob.Text str2 = Me.txtJobOld If str2 = str1 Then Forms![WIPRaw]!combo1.Text = "Close" End If Simply can't get it works... -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1 Remove the .Text at the end. The control must have focus in order to refer to the Text p...

how to control size of a bound object
Please help me...... I need to generate a report with various figures that are contained in a bound table field. When the report is generated, I cannot get the shrink, grow command to work for a bound object, only for a text box. Does anyone know how to get around this, via macros or code? I would appreciate your help so very much. auntboo, I'm confoosed... is the field value a numeric or text? I assume by "various figures" that you mean numeric... You wrote... >I cannot get the shrink, grow command to work for a bound object, >only for a text box. If t...

Best Way ?
G'day All, Looking for some information. With Outlook you can have all your contacts...address, email address, yada, yada, yada. Can I use this information in to say mail merge with Word and email a letter to the ppl with email addresses? Or is this better done with a Access? The reason I ask is that we want to deliver an email to all our clients with the latest promotions. And want it to be a bit more automated? Any information or pointers in the right direction would be appreciated. Have a good one, Scott V You can use either Access or Outlook as the data source for a ma...

Context Menu in List Control #2
Hi all, I want to create a context menu called by a right mouse click on a multi-selection List Control in a report mode. So far I've managed to create the menu by handling NM_RCLICK, like this: void GetTLETab::OnNMRclickList(NMHDR *pNMHDR, LRESULT *pResult) { CMenu menu; CPoint pt; ::GetCursorPos( &pt); menu.CreatePopupMenu(); menu.AppendMenu( MF_STRING, 0, _T("Delete this item")); menu.AppendMenu( MF_STRING, 1, _T("View details")); menu.TrackPopupMenu( TPM_LEFTALIGN, pt.x, pt.y, this); *pResult = ...

A way to create sub-categories?
I want to group contacts by category and then a sub-category for easy viewing. Apart from creating a new field for sub-category is there a way of doing this? Outlook doesn't seem to support sub-categories. Thanks Nope. -- Patricia Cardoza Outlook MVP Author - Special Edition Using Microsoft Office Outlook 2003 Lead Author - Access 2003 VBA Programmer's Reference Author - Absolute Beginner's Guide to Microsoft OneNote 2003 http://blogs.officezealot.com/cardoza http://www.cardozasolutions.com "Casebase" <junkmail@casebase.net> wrote in message news:%23rx5a...

Is there a way to color code Outlook Contact File Folder Labels?
Is there a way to color code Outlook Contact File Folder Labels? No. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Join OneNote Tips mailing list: http://www.onenote-tips.net/ "isailhbca" <isailhbca@discussions.microsoft.com> wrote in message news:4DBD10F7-FAA0-4102-A4C3-E2697908EFE8@microsoft.com... >...

Control-Home key behaviour
Not neccessarily a coding issue but this forum has a far greater knowledge depth than others. Recently the above key combination rather than making cell A1 the active cell now makes the column A cell in the current row the active cell. Ctrl_Home in VBE achieves the correct result, that is, the cursor is relocated to the first line & character of the module. I have tried 'application.onkey "^{Home}" "" ' in the intermediate window but without any effect. I have also removed any add-ins and disabled auto opening macro files. Any clues ? -- Ken ...

is there a way to crop a corner out of a rectangular image in Visi
Using subtract on two shapes accomplishes what i want to do, but when the first shape is a .gif image, it does not work. No, the "boolean operations", as they're called, do not operate on foreign objects like bitmaps and controls. Visio has crop functionality for imported graphics, but it is only rectangular. You could draw a small white triangle and give it "no line". Then place it over the corner of your bitmap. -- Hope this helps, Chris Roth Visio MVP "doug" <doug@discussions.microsoft.com> wrote in message news:29D479A6-6099-4051-B7A0-1...

There should be controls, edit lists, and approvals in BankRec
Without controls in the bank rec module I am forced to have a more senior person prepare all my reconciliations. Junior people can post transactions without approval and this significantly effects internal controls for the most liquid asset. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree&qu...

is there a way to change the time card repor format?
i'm using activereports in RMS to generate a custome timecard report. for my timein and timeout colums, the datatype i have assigned to the columns is vbDate. when I generate the report, the columns only show the date as mm/dd/yyyy, they do not show the time of day piece for exactly when the cashier punched in or out. is there any way to change the formatting of this so that in the report the time shows up? for example, instead of showing 2/6/2005 in the time in column, it would show 2/5/2005 8:00:00 AM. thanks in advance, kevin There is a timecard report on the Reports Library...

Delay load an MFC extension dll
I have an MFC application with many mfc extension dlls. I would like to delay load some of the nonessential dlls. Is this possible? Yes its very possible. I did it long time ago. The issues were simply related to design of DLLs. Jeff Richter had an article in MSJ few years ago that discussed this for Win32. Same thing works fine. Keep in mind that if you extension dlls have resources that are needed for definition of doctemplates etc, delay loading will not make much sense for those Dlls. ---------- Ajay Kalra ajaykalra@yahoo.com Thanks Ajay. I thought it was possible, but I thoug...

Can You Count This Way?
I have some cells with note type data: For ex: ax,3b7,22,xy,zz, Is there a way to count every item between the commas? Thanks. Hi try =LEN(A1)-LEN(SUBSTITUTE(A1,",","")+LEN(A1)>0 -- Regards Frank Kabel Frankfurt, Germany Timothy Wright wrote: > I have some cells with note type data: > > For ex: > > ax,3b7,22,xy,zz, > > Is there a way to count every item between the commas? > > Thanks. On Wed, 19 May 2004 20:13:53 +0200, "Frank Kabel" <frank.kabel@freenet.de> wrote: >Hi >try >=LEN(A1)-LEN(SUBSTITUTE(A1,&q...

best way to deserialize xml
I'm at a quandry as to what's the best/fastest way to deserialize an incoming xml stream? I ran a small test on xmlserializer and on a small file it performed 10 times worse then when I used the XMLDocument and deserialized the values myself. Is the xmlserializer really that slow? I'm expecting a file about 1 MB in length and if it's that slow on a 2 K file then I can't phantom how it's going to behave on a 1 MB file. Should I just skip the xmlserializer and XML Dom and go straight to xmlreader and do the deserialization myself? This has been discussed a few times...

Is there a way to Sort data by color in Excel?
I am trying to sort data by color, is that possible? see http://www.xldynamic.com/source/xld.ColourCounter.html#sorting -- HTH Bob Phillips "SRTUC" <SRTUC@discussions.microsoft.com> wrote in message news:B5121232-FB1D-46AF-94F8-04B7EAA2D90C@microsoft.com... > I am trying to sort data by color, is that possible? You're gonna need a User defined function to get the value of a color. See Chip Pearson's site for a nice version: http://www.cpearson.com/excel/colors.htm Look for: Returning The ColorIndex Of A Cell Then you could use that UDF in a separate colu...

Position form near control that called it
Howdy: I would like to position a form (a calendar) near the control that issued a call to open the calendar form. So, wherever on my calling form there is a control that requires a date, the calendar form will open just beneath that control. Is this a job for MoveSize? Any examples around to show the way? I look forward to your input. Thanks, Barry "Barry" <Barry@discussions.microsoft.com> wrote in message news:B23F347F-C87D-4636-9237-5D101E7B629D@microsoft.com... > Howdy: > I would like to position a form (a calendar) near the control that issued ...

No to instant message; make it go away!
That's it. How did I get MSN instant messenger and how do I make it go away? It seems to be part of MSN Explorer which attached itself to everything I am doing. I don't want any of it on my outlook mail or anywhere else. I can't find it to uninstall it and I don't want to affect my outlook mail, because I am taking classes there. Open MSN Messenger, go to Tools, Options, Preferences and uncheck every single box. Then go to the other tabs and uncheck all those, too. Leave any info boxes blank. "Jill Woodruff" wrote: > That's it. How did I get MSN ins...

Emails that were in Inbox suddenly go blank?????
I am running Outlook 2007 on Windows XP ME. Emails from yesterday are suddenly blank. There is a date and time, but nothing else is present. When I click on the emails it shows "sent none" and everything is blank. No email body, no subject line, now who it was from, nothing. I had previously viewed these emails and all was fine. What would cause some of the emails to go blank? I have one from yesterday that is just fine, but the other 11for today, plus all of Saturday, Friday, and some of Wednesday are gone? Is this for a Hotmail account? See http://www.msoutloo...

Is there a convenient way to save data
Is there a convenient way to save dialog data so it remembers the users last selection? I have a dialog based application that only has three user variables all of which are ints. What is the best way to make theses variables persistent for a given user on a given machine? Thanks "Jeff B" <jb@nospan.net> wrote in message news:fpDif.10451$Ay6.2336@fe13.lga... > > Is there a convenient way to save dialog data so it remembers the users last > selection? I have a dialog based application that only has three user > variables all of which are ints. What is the best w...

Combobox controlled search
I have a form with a combobox giving the options of a list of people "Custodian". On update I wish for the option selected to be used to open a report with filtered information. the report is a full list of books held by everybody in my company. instead of writing a query and report for each person (this an ever expanding list) I wish it to be filtered. I have used the folloowing code in the past, buit for some reason the report opens blank (only with headings). I am not sure what each part of the code represents, can anyone shed light on this for me Private Sub Combo0_A...

Fastest way to load an xml file into an array in .net
Hi All VS 2005 SP1 (C#, VB.NET) I need the absolut fastest way of loading an xml-file of about 700KB into an array. I need to load about 1500 of those xml-Files into arrays on startup of my application. Therefore it needs to be as fast as possible. Please also tell me if the xml structure can be improved. the xml looks like: y: Year m: Month h: Hour value <data> <v y="1998" m="1" h="1">0.227777109151971</v> <v y="1998" m="1" h="2">0.206573903224972</v> <v y="1998" m="1"...

Is there a way
G'Day, Is there a way to turn off NDR's in Ex5.5 SP4 on an NT server running SP6a ? Also, can the ability for the server to receive TELNET connections be turned off? My server isn't an open relay, but, I know it's being used to SPAM using DNR's and I can see TELNET connections in the log files.... Thank You, Admin_In_Syd i know that u can turn off the ndrs to be sent from exchange at the standard poliy setting, thats how i configured it at exchange 2000 .... there must be also a setting at exch 5.5, actually i dont remeber it .... "Steve@Home" <sprob@...

MFC custom window message parameters
I need to send a message from C++ class, using SendMessage(hWin, WM_MY, wParam, lParam) to one of MFC class. Please, give me an example where afx message has parameters wParam, and lParam, like this: void OnMyMessage(wParam, lParam) { } How to declare, and to manage the parameters if different from LOWORD and HIWORD. Thanks ??? Robert wrote: > I need to send a message from C++ class, using SendMessage(hWin, WM_MY, > wParam, lParam) to one of MFC class. > > Please, give me an example where afx message has parameters wParam, and > lParam, like this: > void OnMyMes...

enterabel form (data going into multiple tables)
Hello I am currently designing a database for my company, and I keep on running into problems when I want to create an enterable form using multiple tables. This means that when i create the form, I will be using fields from different tables, and when it is entered into the form is should go to the tables. However, when I create this, there seems to be problems, It works if I input information into every field. However, if this is not done than the record is not remembered. I would like to know how to fix this problem. Regards Graeme As a general rule, queries with joins to multiple tables...

How to add the show time for Tooltip control
I want to add the show time (for example 5 minutes) or alway show tip until mouse leave the control, but seem the tooltip control can not do that. Thank you To have the ToolTip visible remain until the user moves the mouse off the control, use the Show method of the ToolTip control to show the tool tip when teh mouse enters the control, and use the Hide method to remove the ToolTip when the mouse leaves the control. "yxq" <gayxq@163.net> wrote in message news:OmHVbzreKHA.6096@TK2MSFTNGP02.phx.gbl... >I want to add the show time (for example 5 minutes) ...

way to verify time stamp?
Is there a way to verify when a forwarded message to you had originally been sent? I suspect someone is mis- representing themselves and simply typed new fields into the "original message" time and date. If not - is it possible (or at all likely) that someone sent me two emails days ago and they never bounced back and never made it to my inbox, while all other email functions appear completely normal?? Thanks! "Julie" <anonymous@discussions.microsoft.com> wrote in message news:27d701c49d00$dd3315d0$a401280a@phx.gbl... > Is there a way to verify when a for...