News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

WM_CLOSE vs WM_DESTROY

Started by Don57, February 16, 2013, 04:29:14 AM

Previous topic - Next topic

RuiLoureiro

Quote from: Don57 on February 16, 2013, 04:29:14 AM
... Don't child windows close automatically when the parent window is closed.

Hi Don57,
                Yes i think it is correct and we dont need to close them

RuiLoureiro

Quote from: dedndave on February 16, 2013, 08:17:53 AM
Quote from: RuiLoureiro on February 16, 2013, 08:14:54 AM
              Well suppose we create our main window which has his own message loop.
Now when we click one button we call ProcX that creates another window of another class and then it enters into a second msg loop. This second loop is not the first. What happen ? Are you saying all the messages are posted into the first window ?

a single message loop handles all messages for all windows in that process
you can create any number of windows in a process, and the messages are all dispatched by 1 loop

however, if you create another process, with its' own window(s) and own loop, those are seperate

Dave,

From Platform SDK:

»Elements of a Window Class
The elements of a window class define the default behavior of windows belonging to the class.
The application that registers a window class assigns elements to the class by setting appropriate members in a WNDCLASSEX structure and passing the structure to the RegisterClassEx function

Element Purpose
Class Name Distinguishes the class from other registered classes.
Window Procedure Address Pointer to the function that processes all messages sent to windows in the class and defines the behavior of the window

qWord

Message queues are assigned* to threads and not processes! So a message loop only handles notifications for windows that has been created from the same thread.

*queues are only created, if the corresponding functions are used for that thread  (e.g. SendMessage, GetMessage, ... --> "GUI-thread")
MREAL macros - when you need floating point arithmetic while assembling!

RuiLoureiro

Quote from: qWord on February 16, 2013, 08:34:49 AM
Message queues are assigned* to threads and not processes! So a message loop only handles notifications for windows that has been created from the same thread.

*queues are only created, if the corresponding functions are used for that thread  (e.g. SendMessage, GetMessage, ... --> "GUI-thread")

                Yes thanks qWord 

dedndave


RuiLoureiro

Quote from: dedndave on February 16, 2013, 08:40:24 AM
sorry about that one   :P

Dave,
          tomorrow i will try to create OverlappedWndY in another thread
See you  :biggrin:

Don57

Thanks for the help everybody.  :greenclp:

RuiLoureiro

Don57:

This is about child windows:

From SDK:

«A window can own, or be owned by, another window.
An owned window always appears in front of its owner window, is hidden when its owner window is minimized, and is destroyed when its owner window is destroyed