dotnet / dotnet/winforms

Make Application.[Begin,End]ModalMessageLoop() public instead of internal

Open
#6,555 7 comments 6 reactions 1 assignee Claimed by @JeremyKuhne View on GitHub
api-needs-work api-suggestion
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

I must admit that I've been using these two methods, via reflection, for ... a very, very, very long time (15 years?). Paint.NET relies on them in order to create something called a _modal frame_, which is where the UI is doing some kind of processing, e.g. loading (an) image(s) and showing a progress bar in the status bar, and needs the UI to stay not-un-responsive (not ghosted, i.o.w.), but also to be disabled but not _visibly_ disabled (i.o.w., no input allowed, but don't change appearance). There's also some other weird (yet also very important!) places I use it, but that suffices for now.

As far as I can tell, this isn't achievable without resorting to reflection to call these two methods. At this point, even if someone has a better way of doing this, I'm not sure the risk is worth it because it could fundamentally break the app if even one tiny part didn't work in exactly the same way (the modal frame also involves some weird, esoteric message pumping stuff).

So I have 2 requests, mutually exclusive. Either 1) don't ever change these methods, as it'll fundamentally break Paint.NET, or 2) just make them public. Happy to craft up a PR for the second :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.