Giter Site home page Giter Site logo

Comments (2)

tannerhelland avatar tannerhelland commented on August 9, 2024

This has been an absolutely hideous issue to debug, and after four hours of fighting it I'm simply implementing a cheap workaround.

The problem occurs because "Classic Theme" changes the behavior of a bunch of API calls related to menu icon placement, in essence "mimicking" an unthemed environment from the Win 2K era. PhotoDemon accounts for this and automatically falls back to a subclassing-based menu icon system, which is required on XP anyway, and which works quite well in an unthemed environment.

The subclassing system relies upon intercepting WM_DRAWITEM messages and responding accordingly. This works without incident on XP. Under the "Classic Theme" it also works fine, except in the case of disabled and non-hovered menus. For reasons I do not understand (and cannot find documentation on), the hDC included in the window message for disabled and non-hovered menus is completely invalid. Because it is invalid, any paint operations applied to it silently fail. If disabled AND hovered, the returned hDC is valid and drawing is fine - as you can see with the "ghosted upon hover" behavior.

Because I've already wasted half a day on this and can't find any rational explanation for the behavior, I'm just disabling drawing of disabled icons if the "classic" theme is in use.

from photodemon.

tannerhelland avatar tannerhelland commented on August 9, 2024

Well... there is another workaround, but I'm not sure I like it better. Instead of falling back to the subclassing method, we can still use the theming-based API calls to set menu icons. The spacing is very cramped, but upon further investigation, this appears to be the behavior that other applications adopt when run under the "Classic Theme."

Given the choice between a workaround that doesn't draw disabled icons at all, or one that draws all icons but with minimal margins BUT is the same behavior as other applications, I'm probably inclined to go with the second workaround.

Commit incoming.

from photodemon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.