0

I've seen several code examples that test the value of a message to determine that it's between WM_KEYFIRST and WM_KEYLAST before calling IsDialogMessage.

I was wondering if that's technically necessary. Wouldn't IsDialogMessage inherently do that? Or is it more efficient perhaps to test the value before calling the function?

1 Answers1

0

Use the WM_KEYFIRST and WM_KEYLAST messages to filter for keyboard messages when using the GetMessage and PeekMessage functions.

When IsDialogMessage processes a message, it checks for keyboard messages and converts them into selections for the corresponding dialog box.

As far as I'm concerned, It is unnecessary to test the key value before calling IsDialogMessage.

For more details about IsDialogMessageA,I suggest you could refer to the doc:Why do we need IsDialogMessage at all?

Jeaninez - MSFT
  • 3,210
  • 1
  • 5
  • 20