Getting hWnd

Started by
8 comments, last by Ademan555 20 years, 4 months ago
Ok, i want to get the hWnds for three contols within my window (note, not mfc) two edits and a button, i know of a way, but this seems to be...unflexible (GetWindow()) then get next and stuff, is there a better way? and how do you use the EnumChildWindows() ?? because this seems to be the answer -Dan Yes I realize im a n00b...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Advertisement
If it''s within your window you might also be able to use GetDlgItem() if you have the IDs of the controls.

Colin Jeanne | Invader''s Realm
Ok, how do i get teh ID''s?? sri total winapi newb

-Dan

Yes I realize im a n00b...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
When you create them you have to specify an ID, whether or not you create them on the fly or in a resource editor (or in a resource by hand). When you create controls on the fly the ID is what you pass casted to an HMENU. When you use an editor the ID is the name you give to the control.

Colin Jeanne | Invader''s Realm
Really? cuz i thought that was a handle to a menu...or is that just for parent windows? see told yah im a n00b :-D

-Dan

Yes I realize im a n00b...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Sometimes it''s a handle to a menu, sometimes it''s a window id. In the case of top level windows it''s typically a menu. In the case of child windows, such as edit controls and buttons, it''s an id.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Ok, sweet, but how do i get the ID''s from the wndproc to the winmain? or is it that IDs are usually constants, and thus you can acess them from the winmain that way? if so....this seems at least a little bit unflexible, but ill take what i can get, i suppose another way would be enumeration? well anyways... thanx

-Dan

Yes I realize im a n00b...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Yeah, IDs are generally constants (#defines) when they are created at compile time. We are talking about C++ here so flexibility is not always at its highest level. It is the programmer''s position to find ways around any of these limitations!
You might want to look through MSDN or WinProg.Org for some answers. If you are on a newbie level, WinProg will help a lot. You might have heard of MSDN, it is the Microsoft Software Development Network, and a complete reference is on the MSDN website.

Scott Simontis
e-mail:ageofscott@comcast.net
AIM:ssimontis
Scott SimontisMy political blog
Thanx, msdn is great, but the only thing i come up with when i search msdn for controls.... is mfc... and right now im asking more application than what the prototype is anyways, as for wndprog, sounds like a plan, thanx

-Dan

Yes I realize im a n00b...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."

This topic is closed to new replies.

Advertisement