[lazarus] Win32 menu does not work

Micha Nelissen mdvpost at hotmail.com
Tue Jun 24 03:53:39 EDT 2003


Hi.

> After some debugging I found out that MENUINFO.WID is a 32 bit
> integer, but it contains a 16 bit application defined value. It seems
> the application is responsible for providing an increasing set of
> numbers in this identifier. Currently (see win32object.inc:2610) it
> is assigned a pointer which is a 32 bit value and thus too wide. It
> could be that the upper 16 bits are used for the
> WM_COMMAND.wNotifyCode but I am not sure.

I have confirmed my above statements. The attached (very ugly) patch shows
how to make the menus work. It basically cuts off the high part of the
pointer, forcing it to be a 16 bit value as windows expects. Ideally, one
would keep a counter of some sort to keep track of used menu item ids (also
known as commands).

The patch attached proves that using 16 bit integers, the menus will work.
Apply it in the lazarus/lcl/interfaces/win32 directory.

I would like to hear your comments in the patch (probably not correct coding
style), it's a bit ugly (using pointers for the item ids), but the current
code is just wrong (with respect to the menu item ids).

HTH,

Micha.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00028.bin
Type: application/octet-stream
Size: 18142 bytes
Desc: "win32object.patch"
Url : http://localhost/pipermail/lazarus/attachments/20030624/84b54e52/bin00028.bin


More information about the Lazarus mailing list