Attention PARENT [windows] -- You aren't me and you don't own me, so I'm not going to tell you about all of the characters that visit me here

by Michael S. Kaplan, published on 2008/02/05 09:31 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/02/05/7457411.aspx


In Windows, as in life, it is important to keep a bit of independence from one's parents.

They may have  lot to do with your initial placement, sure. But beyond that, they don't get to be too involved....

I remembered this a while back when Naga asked:

Hi,

My application has an edit box in a dialog. Who will get the message WM_CHAR when user enters characters or tab etc.. when the focus is on the edit box?

I am presuming that the message WM_CHAR will come to parent. But it seems that message is not coming to parent.

Do I need to handle WM_CHAR messages for child controls separately in their own dialog proc?

Can’t we handle them in the parent, Dialog proc itself?

Regards,
Nag

I shudder to think about what it would mean if one's parent's were notified about all of the random characters one had spending time in one's room -- I didn't even always do this when I lived in their house, if you must know!

Thus my response to Naga's question:

The EDIT box's own WNDPROC gets the WM_CHAR notification; this is the EDIT control's bread and butter, and like in life our parents don't have to be quite *that* involved with our core work....

Now although the truth is that there are times that a parent can have a subtle effect on things, in Window just as in life, it is usually someone else that decides things.

Like when Jeffrey asked the other day, based on a newsgroup thread:

My customer configured his Windows XP for Arabic using MUI, and we can see IE drawing its file open dialog mirrored.

Then, he called SetProcessDefaultLayout( LAYOUT_RTL) in his win32 C++ app, but still the file open dialog is drawn LTR, ie. not mirrored as we would like.(Everything is RTL except for the OPENFILENAME dialog)

Any ideas what more we need to do?

Thanks in advance!

After a bunch of work, it turned out that the directionality of the hwndOwner window of the OPENFILENAME structure was the deciding factor for whether or not the dialog would be mirrored.

Do we need better proof that our parents don't own us and have no say in the characters that live with us?

Or does it all point to the immaturity of the windows themselves -- don't we look at phrases

I'm not a child for you to control the characters I hang out with!

or

I am not a child for you to control what direction my life takes!

and shake our heads at these children who just don't understand that we do not wish to hem our children in way such as this?

On the other hand, I could simply be over anthropomorphizing an already way too over-extended metaphor to try to tie two disparate points together in a single blog.

Yes, on reflection that is what is going on here.

Never mind.... :-)

 

This post brought to you by(U+2f57, aka KANGXI RADICAL FATHER)


no comments

go to newer or older post, or back to index or month or day