sagamusix / TBTray

Fixups for Thunderbird's tray icon for Windows
GNU General Public License v3.0
107 stars 13 forks source link

drawinTitleBar requirement #6

Open Mitusin opened 5 years ago

Mitusin commented 5 years ago

The program works flawless if the mail.tabs.drawintitlebar is set to false, which is not the default value. I have been trying to fix it to work with the default value, which I prefer, but I have not been able to capture the close messages :-( It seems the program hooks to the right window and it keeps receiving messages. In fact, I was able to capture clicks on the caption (HTCAPTION) but hitting the X button is not detected.

I think it would really nice to modify the code to work when mail.tabs.drawintitlebar is set to true.

sagamusix commented 5 years ago

To re-iterate my introduction of this tool in the mintrayr issue tracker:

I wrote this tool for myself to fix exactly the issue I was having. If it's useful to you as well, that's great! But please don't report any suggestions on how to improve it. Besides having a day job in software development I already maintain enough other open-source software that I have zero intention on spending any more work on TBTray apart from fixing serious bugs if any show up. Feel free to fork it and incorporate any changes you want, though.

That is: If you can find a way to solve the problem, please submit a pull request. But don't expect me to spend hours on debugging a feature I personally don't use. If you want to give it a try, I would suggest trying to subclass the window like mintrayr did, my approach is different and maybe that explains why it doesn't work.

TheGuardianWolf commented 5 years ago

I've solved this but with my own application using the UI Automation API. However, the specific problem you are trying to tackle (minimise on close) I have not implemented. This is because there is an add-on that does this (Minimise on Close).

Having a brief look through the UI Automation docs reveals that WindowClosed event or a Invoke event could possibly detect the click on close button, but unlike this application, it will not intercept the message. It's was therefore cleaner to not implement it and leave it to the user to install an add-on.

If you would like to fix this, have a look at what I have done, you can accomplish the task with .NET APIs without dll injections.

https://github.com/TheGuardianWolf/ThunderbirdTray/blob/master/lib/TrayBird.cs

dougbreaux commented 4 years ago

FYI, I just discovered that disabling the "Show Title Bar" option in Customize also causes the same behavior. I'm not complaining, just observing.

marcooosd commented 4 years ago

@sagamusix just wanted to say thank you so much for this. And thank you for the detailed installation instructions as well. You're a legend!

exspool commented 3 years ago

Good!! Thank you!