What do these WndProc codes mean?
Asked Answered
P

2

1

I'm trying to make a window that closes when you click outside it, and at the moment I'm looking into doing that by handling the WndProc function.

None of the messages I'm getting so far seem useful, but there are a few I don't understand at all. What do codes 0x0118, 0xC123, 0xC128 and 0xC12E represent?

Peisch answered 18/11, 2008 at 12:44 Comment(0)
O
4

0x0118: WM_SYSTIMER (undocumented) used for caret blinks

The other three should be application defined messages (anything in the range 0xC000 to 0xFFFF) so you won't find those defined anywhere.

Offbeat answered 18/11, 2008 at 13:22 Comment(0)
H
2

An easy way would be to just capture the mouse. When you have the mouse captured you get one click event outside your window, then capturing is turned off.

A harder way would be to set a low-level mouse windows hook. To do a global hook, you'll have to put your hook code in an unmanaged DLL.

A really easy way would be to just close your form when it's deactivated.

EDIT:

Oops. I just realized I didn't answer your direct question about the message IDs. Message 0x118 is not defined in winuser.h, so I assume it's an undocumented message ID. Message IDs in the range 0xC000 to 0xFFFF are application-defined messages. These IDs are returned by RegisterWindowMessage.

Holierthanthou answered 18/11, 2008 at 12:55 Comment(1)
Hmmm... looking for MouseCaptureChanged events and checking the position of the mouse does seem to be the best way to do it that I've seen so far. Pop over to my other question and I'll mark yours as the right answer.Peisch

© 2022 - 2024 — McMap. All rights reserved.