customizing a system menu: the RemoveMenu API call is broken

  • Thread starter Thread starter Bob
  • Start date Start date
....and some others.
There are also those that have bonus features such as free error messages
and unexpected program termination. I try not to submit those.

;-)
 
Bob,

Oh, that one. Personally, the only "API guide" I trust is the Platform
SDK docs and headers.

The code I posted works under Option Strict. It's always on in my IDE as
default.

Oops, right you are. I thought the fact that the MF_REMOVE const was a
Long would cause a narrowing conversion, and therefore fail under
strict semantics, but I guess the compiler is smarter than that and
realizes that the constant value can safely be truncated to 32 bits.

The following code still fails to remove any system menu items.

Mike nailed it, MF_REMOVE should be MF_BYPOSITION (or MF_BYCOMMAND
with SC_CLOSE).



Mattias
 
Back
Top