News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Default window

Started by vanjast, August 30, 2011, 06:05:20 PM

Previous topic - Next topic

vanjast

I was fiddling around today and it got me thinking... I'm cannot remember if I've missed something here  :red

What is the parent window of an application - the hWndParent of the first CreateWindowEx.
I don't mean the NULL or any handle value.. but there must be an 'object' controlling all application windows, or something like this..

dedndave

i get a picture in my head that is related to processes and threads

a "parent window" is a top-level window that presumably has child windows
i guess it could be any window that does not have WS_CHILD set
if you create child windows, you have to specify the parent handle as one of the parameters  :bg

what glues everything together is the message loop
a message loop handles all messages for the process thread
you can create more than one parent per thread, but they have to share the message loop

if you want more than one message loop in a process - CreateThread

maybe you are thinking of hInstance ?

baltoro

#2
A Window Can Have a Parent or an Owner But Not Both
What's So Special About the Desktop Window?

Quote from: RAYMOND CHEN"An owned window is not a child window. Disabling a parent also disables children, but it does NOT disable owned windows. The desktop is the parent of all top-level windows, so disabling the desktop disables everybody. The desktop is special that way."
Baltoro

vanjast

Dave I realise what you've mentioned, but I'm thinking of the exact window/process that controls all the applications, that connects the apps into the message loop.

On the first CreateWindowEx, hWndParent = NULL

Is this NULL the core system controller process of all running applications
:8)

baltoro

The Windows system manages the window objects. Both Windows and Processes are kernel objects.
In Mark Russinovich's book, "Microsoft Windows Internals", the authors describe both Processes and Windows in great depth. And, they describe the Windows Manager (a kernel component) as the part of the system responsible for managing windows and other User graphics resources.
Baltoro

vanjast

This is what I thought..
I made a mistake with my 'parent' assignment, and on testing my app ran ok, but it wasn't there.. Digging through the process manager and other utils, I eventually found it, alive and well ...interesting - I'll dig a little deeper to make sure I'm not talking boulderdash  :green2

dedndave

kernel32 - DOH !!! 

no fair, Baltoro - it was a trick question   :lol

baltoro

...sputter...blink...blink...
Baltoro

raleeper

In     Re: FormatMessage Error
« Reply #8 on: August 14, 2011, 01:44:28 am »

Gunner said:
Quote
Well, the parent of your main windows, is the desktop..  there is an equate for that... HWND_DESKTOP which is 0

ral

PBrennick

Remember this. A child DOES not have to declare a parent. When you do not declare a parent the parent of the parent becomes the parent of the child.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Gunner

Quote from: PBrennick on August 30, 2011, 10:26:03 PM
Remember this. A child DOES not have to declare a parent. When you do not declare a parent the parent of the parent becomes the parent of the child.

Paul

Isn't that always the case, the grandparent becomes a parent all over again?  :toothy
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

hutch--

Van,

basically the desktop is the parent for CreateWindowEx() and this is what you are doing when you set the parent of a CreateWindowEx() to 0. You can do the same with a modal dialog, set its parent to 0 and it is a top level window in its own running thread.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php