From 18f3ea2529365de54838b7a1a877322b3f98552d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 27 Jul 2022 19:06:48 +0200 Subject: Change WM_MENUSELECT handling. This has two benefits: 1. The for loop is avoided. 2. It is shorter. The drawback is that it is a bit opaque. The order of the array elements still matter, but now it is coupled to what is declared in resource.h, a completely separate file. This makes it harder to change resource.h. --- c/resource.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'c/resource.h') diff --git a/c/resource.h b/c/resource.h index fe0daa7..8cf2230 100644 --- a/c/resource.h +++ b/c/resource.h @@ -12,6 +12,9 @@ #define ID_SUBGROUP(i) ((i) & 0xf000) #define IDG_CTX_RATE 0x1000 +/* Index within resource group. */ +#define ID_INDEX(i) ((i) & 0x00ff) + /* Resources, timers, menus. */ #define IDR_STATUS 0x0100 #define IDR_TIMER 0x0101 -- cgit v1.2.3