Fixed multi-monitor screen picking. (Builds not updated; fixes issue #1) #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should fix issue #1. It's not the best approach, but it works.
Honestly, I don't exactly know why you're using the Windows API directly. Windows Forms already does half of what you're doing, and it's nicer. Not sure about mouse/keyboard button detection, though.
Whatever the case, I also cleaned up the 'ColorConverter' class. Not sure why it's not static, but now it has a debug-assert (Feel free to remove that), and it should check the number of color channels safely. That may still need to be tested, though. This also means you aren't allocating a bunch of bytes for no reason.
Neat little program, though. Not that this isn't a cool hobby project in its own right, but a cool alternative tool to checkout is ShareX, which has a color picker built in (Didn't actually know that before).