Hello all,
I'm using SetWindowsHook around a simple messageBox, and would like to change both the text as well as the Dialog-IDs of the buttons.
I'm getting HCBT_CREATEWND messages, which point to CREATESTRUCT structures. The thing is that when I change the psName and/or hMenu (DlgID) fields they get ignored (overwritten).
MSDN webpages does not seem to contain any information about the above.
Questions:
Is there information available about which fields in the CREATESTRUCT structure may be changed ?
Is there perhaps something special I need to do to get some of the changes accepted ?
Remark: I have found an example which does all the changes when the HCBT_ACTIVATE message is received. iow, I can already make the changes. I'm looking for information.
Regards,
Rudy Wieser
Read the `HCBT_CREATEWND` description carefully.
JJ,
Read the `HCBT_CREATEWND` description carefully.
Where and what part please ?
If you mean the parts about it on the MSDN "CBTProc callback function" webpage, all it does is mentioning a few fields while saying nothing about the others.
Thats the whole problem.
Also, there is no logic in those mentioned fields being changable*, but none(?) of the others. And no explanation is provided for it. :-(
* I can change both the buttons texts and Dialog-IDs** in the HCBT_ACTIVATE callback, so why not in HCBT_CREATEWND ?
** a nice gotya : when the "X" close button is not grayed out it will still refuse to work if there is no button with the IDCANCEL dialog-ID present.
Regards,
Rudy Wieser
[quote]
At the time of the HCBT_CREATEWND notification, the window has been
created, but its final size and position may not have been determined
and its parent window may not have been established.
[/quote]
JJ,
[quote]
At the time of the HCBT_CREATEWND notification, the window has been
created, but its final size and position may not have been determined
and its parent window may not have been established.
[/quote]
Yes, I read that. Whats your point ?
And for the record : I can, in the HCBT_CREATEWND event, change both the Dialog-ID and name of the control using SetWindowLong GWL_ID and SetWindowText calls (verified by reading both back just after setting them), but they get overwritten - just not with whats in CREATESTRUCT.
And thats the whole thing. Which fields of CREATESTRUCT are (effectivily) Read-only, and which ones carry over to the finished control ?
If the coordinates, size and z-order are the /only/ ones than why isn't that mentioned ?
It's right there in plain sight:
"At the time of the HCBT_CREATEWND notification, the window has been
created"
So, anything which you changed in the CREATESTRUCT structure, won't do anything.
It also says
"Contains information passed to a WH_CBT hook procedure, CBTProc, *before a window is created*."
and
"A pointer to a CREATESTRUCT structure that contains initialization parameters for the window *about to be created*."
and
"It is possible to send messages to *the newly created window*,"
So, we have a Schr0|A0+<ger's cat window which, in the HCBT_CREATEWND event, is at the same time both created and not created ?
Yeah, that really gives me confidence about the correctness/completeness of the rest of the provided information. :-(
Also,
"Specifies a long pointer to a CBT_CREATEWND structure containing *initialization parameters for the window*."
Which is *at best* vague. At face value it seems to indicate that *all* of those parameters are used.
Which is followed by
"The parameters *include* the coordinates and dimensions of the window."
And pardon me, but as far as I know "include" doesn't translate to "with the exclusion of everything else" in *any* language.
Again : do you perhaps have any information, MSDN or otherwise, about which fields in that CREATESTRUCT may be changed (are carried on to the resulting window) ?
If that information is not available than I will just determine them empirically.
And by the way: I just tried to change the Style and ExStyle fields, but those also get ignored.
Regards,
Rudy Wieser
It's documentation problem, that I agree. One of many.
The truth lies in the actual test result itself.
On Sat, 15 Nov 2025 08:50:49 +0100, R.Wieser wrote:[]
So, we have a SchrN++N++N++N++N++N++ger's cat window which, in the HCBT_CREATEWND event,
What's puzzling me is why (a) the "din" characters got converted,
(b) why there are _six_ of the substitute character.
The first question is how a single multi-byte leading byte has caused *two* multi-byte character sequences to be emitted. That should never have happened.
The first question is how a single multi-byte leading byte has
caused *two* multi-byte character sequences to be emitted.
That should never have happened.
I think that would be due to a bug in MSOE.
Can you post the same word again along with different words
with the o-umlaut character from your MSOE?
You're suspecting my newsgroup reader ? I already checked the message I posted and the one in the newsgroup, and those just have a single 0xF6 character in it.
Can you check at your end what my message looks like (save message to disk, look at it with a hex editor) ? If it there also contains a single 0xF6 char ...
Can you post the same word again along with different words
with the o-umlaut character from your MSOE?
Your wish is my command :-)
text0|e0#udef
text0|a0#nefg
text0|e0|Nfgh
text0|A0|aghi
text0|A0|ohij
text0|u0|?ijk
text0|U0+-jkl
Remark: I just saved the to-be-send message to disk and looked at it with an hex editor, and all I see is one 0xF6 char per above line. iow, no pre-post conversions that I can see.
Regards,
Rudy Wieser
On Mon, 17 Nov 2025 10:01:46 +0100, R.Wieser wrote:[attribution line had been snipped]
If it helps: I am using Thunderbird. When I viewed the above block inCan you post the same word again along with different words
with the o-umlaut character from your MSOE?
Your wish is my command :-)
textN++N++N++N++N++N++def
textN++N++N++N++N++N++efg
textN++N++N++N++N++N++fgh
textN++N++N++N++N++N++ghi
textN++N++N++N++N++N++hij
textN++N++N++N++N++N++ijk
textN++N++N++N++N++N++jkl
You're right! It's not MSOE fault. It's my fault![]
You're right! It's not MSOE fault. It's my fault!
My 40tude Dialog default settings was set to UTF-8....
MSOE doesn't emit `Content-Type` header
and only use system's ANSI locale.
And I quoted the message which is already misinterpreted
JJ,[]
You're right! It's not MSOE fault. It's my fault!
You're taking the blame for what one of your programs did and not throw them under the bus ? As their manager thats big of you. :-)
My 40tude Dialog default settings was set to UTF-8....
MSOE doesn't emit `Content-Type` header
After my previous post I thought of checking just that, and noticed the same. I have absolutily no idea what the default encoding of MSOE in its "Plain text" mode is
and only use system's ANSI locale.
Thats sounds logical.
And I quoted the message which is already misinterpreted
That was what I assumed happened. Now there is only the question why J.P. sees every-over-0x7F(?) char displayed seperatily and as unrecognised.
That was what I assumed happened. Now there is only the question
why J.P. sees every-over-0x7F(?) char displayed seperatily and as
unrecognised.
Well, I haven't looked at what's there in raw, but I often see
characters like the % exactly as intended.
Your wish is my command :-)
text0|e0#udef
text0|a0#nefg
text0|e0|Nfgh
text0|A0|aghi
text0|A0|ohij
text0|u0|?ijk
text0|U0+-jkl
Remark: I just saved the to-be-send message to disk and looked at it with an hex editor, and all I see is one 0xF6 char per above line. iow, no pre-post conversions that I can see.
Regards,
Rudy Wieser
If it helps: I am using Thunderbird. When I viewed the above block in
RW's post (2025/11/17, 9:1:46 my time), it appeared as seven "words", starting with "text" and an o umlaut, then six more letters, the first
"word" being text%abcdef. When I viewed it as quoted in JJ's post
(14:18:49 my time), and in my compose editor as I am typing now, each
"word" starts with text, then six identical characters, then three
letters (def for the first one). The identical characters are here a
vertical diamond with a background coloured question mark inside them.
On Mon, 17 Nov 2025 10:01:46 +0100, R.Wieser wrote:
Your wish is my command :-)
textN++N++N++N++N++N++def
textN++N++N++N++N++N++efg
textN++N++N++N++N++N++fgh
textN++N++N++N++N++N++ghi
textN++N++N++N++N++N++hij
textN++N++N++N++N++N++ijk
textN++N++N++N++N++N++jkl
text|!-|rCU|!-#-udef
text|!-|rCa|!-#-nefg
text|!-|+a|!-|-Nfgh
text|!-|++|!-|-aghi
text|!-|rCO|!-|-ohij
text|!-|rCo|!-|-?ijk
text|!-|+i|!-+--jkl
It shows correctly as I view your post and in this reply; in raw, it
Remark: I just saved the to-be-send message to disk and looked at it with an
hex editor, and all I see is one 0xF6 char per above line. iow, no pre-post
conversions that I can see.
Regards,
Rudy Wieser
This got me wondering...
Does MSOE only emit the `Content-Type` header if there's actually a Unicode character outside of system's ANSI character set in the message body?
What will happen if the message include Unicode characters outside of system's ANSI character set? e.g. the U+2602 Umbrella character (rye) from `Symbols & Dingbats` Unicode subrange copied from Character Map.
I suppose the Umbrella character above is shown properly in MSOE?
J.P. ,
That was what I assumed happened. Now there is only the question
why J.P. sees every-over-0x7F(?) char displayed seperatily and as
unrecognised.
Well, I haven't looked at what's there in raw, but I often see
characters like the % exactly as intended.
It might have something to do with that my posts doesn't include a character encoding (in the headers), but JJ's advertised his as being UTF-8.
Regards,
Rudy Wieser
I've just done "view raw" on that as received, and this is what it shows
- of course, I don't know if _this_ will get corrupted!:
text|!-|rCU|!-#-udef
text|!-|rCa|!-#-nefg
text|!-|+a|!-|-Nfgh
text|!-|++|!-|-aghi
text|!-|rCO|!-|-ohij
text|!-|rCo|!-|-?ijk
text|!-|+i|!-+--jkl
(In case it _does_ get corrupted: the first one looks to me like "text",
i grave, mu [micro], what looks like a comma, i grave again, plusminus, pound, then "def".)
Does MSOE only emit the `Content-Type` header if there's actually a
Unicode character outside of system's ANSI character set in the message
body?
e.g. the U+2602 Umbrella character (?)...
I suppose the Umbrella character above is shown properly in MSOE?
40tude corrupted characters end up as two Low Surrogates.
2 Unicode characters. 6 raw UTF-8 characters.
I think Thunderbird sees the 6 raw UTF-8 characters as invalid
(after decoded)
I've just done "view raw" on that as received, and this is what it...
shows of course, I don't know if _this_ will get corrupted!:
(In case it _does_ get corrupted: the first one looks to me like "text",
i grave, mu [micro], what looks like a comma, i grave again, plusminus, pound, then "def".)
The quoted o-umlaut should be copied properly.
but I often see characters like the % exactly as intended.
AFAIK, Usenet is initially for OEM/ANSI character set anyway.
JJ,
Does MSOE only emit the `Content-Type` header if there's actually a
Unicode character outside of system's ANSI character set in the message
body?
I have no idea. And it will be hard to test it, as I can only paste ANSI into my posts.
e.g. the U+2602 Umbrella character (?)....
I suppose the Umbrella character above is shown properly in MSOE?
All I see there is a single "unknown character" rectangle (which /does/ means that MSOE recognises it as an UTF-8 sequence. Odd).
I wanted to suggest that that is perhaps becaused my fonts are old, but checking that character (as "☂") in a webpage in Firefox does show it.
Regards,
Rudy Wieser
JJ,
Seems like MSOE's Unicode support is for HTML content only.
That would not at all surprise me, seeing that the mode I'm composing it is called "plain text". You're not getting any plainer than ASCII. :-)
But I just remebered that in Windows you can enter special chars using ALT 0{number} on the numeric keypad. Testing ... Nope, doesn't work either .
Regards,
Rudy Wieser
...But I just remebered that in Windows you can enter special chars using
ALT 0{number} on the numeric keypad. Testing ... Nope, doesn't work
either .
You have to have Num Lock on - or did in earlier versions of Windows;
I've just tried (in Windows 10) and it works whether you do or don't.
(I don't know when that changed.)
There are also two (maybe more?) sets of code sequences; I remember
the code for mu - the micro sign, | - as Alt-230; the ones CharMap tell
you
about have a leading 0, e. g. for | Alt-0181.
You have to have Num Lock on - or did in earlier versions of Windows;
I've just tried (in Windows 10) and it works whether you do or don't. (I don't know when that changed.)
There are also two (maybe more?) sets of code sequences; I remember the
code for mu - the micro sign, | - as Alt-230; the ones CharMap tell you
about have a leading 0, e. g. for | Alt-0181.
(Trying them adjacent, in case they're actually different: ||. Those
look identical to me in this compose window.)
Alt+### generate OEM character from decimal character code. Supported by BIOS.
J.P. ,
...But I just remebered that in Windows you can enter special chars using
ALT 0{number} on the numeric keypad. Testing ... Nope, doesn't work
either .
You have to have Num Lock on - or did in earlier versions of Windows;
In my version of Windows, off. Otherwise I get the cursor keys mode.
I've just tried (in Windows 10) and it works whether you do or don't.
(I don't know when that changed.)
I'm working with a full, external keyboard here. It might differ for build-in laptop keyboards.
There are also two (maybe more?) sets of code sequences; I remember
the code for mu - the micro sign, -+ - as Alt-230; the ones CharMap tell
you
about have a leading 0, e. g. for -+ Alt-0181.
The one without the leading zero is for ANSI (local) chars, while the one with the "0" prefix is for Unicode chars.
Regards,
Rudy Wieser
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (1 / 5) |
| Uptime: | 20:58:41 |
| Calls: | 742 |
| Files: | 1,218 |
| D/L today: |
6 files (8,794K bytes) |
| Messages: | 185,811 |
| Posted today: | 1 |