0
votes

Or are these terms used to refer to the same thing?

I'm trying to implement some custom buttons showing a bitmap image, into my Win32 app. One tutorial indicates I should be creating child windows using CreateWindow().

However, I have downloaded a bunch of source code from another tutorial on creating "child controls", and no reference is made to CreateWindow() (other than the one that creates the main/parent window).

Can anyone help with what a button is classed as? A control or a Window?

3
Perhaps the tutorial was discussing windowless controls, blogs.msdn.com/oldnewthing/archive/2005/02/11/371042.aspxMichael
Hmm could be - I found it near impossible to understand! [relisoft.com/win32/dialog.html] (sorry - don't know how to put hyperlinks in comments)BeeBand
@Michael: I forgot to mention windowless controls, which makes my answer a bit inaccurate - thanks for the link!Mark Ransom

3 Answers

1
votes

Every control is a window, but not every window is a control. Controls have a parent and are usually one of the window classes that are appropriate in that context, such as a Button.

1
votes

In the world of Win32, nearly everything on the screen has an underlying HWND associated with it. One of the ways these can be created is via CreateWindow. Other methods include loading resources and having the OS built out pre-specified HWNDs via a different mechanism, and I'm sure there are even more.

But yes, to answer your initial question, they're all referring to the same thing: HWNDs that are children of other HWNDs.

0
votes

According to Charles Petzold's bible, he makes it very clear that every thing is a window, from child controls to windows itself. He asserts that is because a call to CreateWindow using a handle which is a pointer to the window structure. This is a holdover from the pre Win 3 days.

Hope this helps, Best regards, Tom.