Skip to content

Commit

Permalink
Add official 64-bit support
Browse files Browse the repository at this point in the history
  • Loading branch information
sagamusix committed Oct 28, 2019
1 parent f1ba60e commit 3edcdb7
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 18 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
TBTray - Native Win32 Thunderbird tray icon
===========================================

After the x-th reincarnation of the MinimizeToTray add-on for Thunderbird broke in Thunderbird 68,
it seems like it becomes more and more difficult, if not impossible, to solve the issue at hand -
keeping Thunderbird minimized in the notification area when closing or minimizing it -
using Web Extensions.
After the x-th reincarnation of the MinimizeToTray add-on for Thunderbird broke
in Thunderbird 68, it seems like it becomes more and more difficult, if not
impossible, to solve the issue at hand - keeping Thunderbird minimized in the
notification area when closing or minimizing it - using Web Extensions.

I know that [BirdTray](https://github.com/gyunaev/birdtray) exists, and it's even cross-platform.
However, it tries to solve way more problems than I have and uses Qt, so it's not
quite as light-weight as I think a background process should be.
I know that [BirdTray](https://github.com/gyunaev/birdtray) exists, and it's
even cross-platform. However, it tries to solve way more problems than I have
and uses Qt (no offense, I really like the framework), so it's not quite as
light-weight as I think a background process should be.

So I decided to fork a program a friend of mine wrote - [traktouch](https://github.com/dop3j0e/traktouch),
as it solves a very similar problem. I could have written it from scratch, but
Expand All @@ -25,6 +26,15 @@ it finds the window, injects a library into the Thunderbird process to hook into
the message queue. TBTray keeps running in the background, in case you want to
restart Thunderbird at some point.

It doesn't work for me!
-----------------------

The most likely cause is that you have `mail.tabs.drawInTitlebar` set to `true`
(which is the default value) - setting it to `false` should solve that problem.

Note: If you want to get this fixed, consider submitting a pull request - I do
not have the time required to debug and fix a feature I am not using.

Halp, how do I quit Thunderbird?
--------------------------------

Expand All @@ -41,4 +51,4 @@ Autostart
---------

To automatically start TBTray on Windows startup, run `register.cmd`.
To uninstall, run `unregister.cmd`.
To uninstall, run `unregister.cmd`.
17 changes: 13 additions & 4 deletions copy_binaries.cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
mkdir bin
copy Release\dll.dll bin\TBTray.dll
copy Release\loader.exe bin\TBTray.exe
copy README.md bin
copy LICENSE.txt bin
echo TBTray register > bin\register.cmd
echo TBTray unregister > bin\unregister.cmd

mkdir bin\32-bit
copy Win32\Release\dll.dll bin\32-bit\TBTray.dll
copy Win32\Release\loader.exe bin\32-bit\TBTray.exe
echo TBTray register > bin\32-bit\register.cmd
echo TBTray unregister > bin\32-bit\unregister.cmd

mkdir bin\64-bit
copy x64\Release\dll.dll bin\64-bit\TBTray.dll
copy x64\Release\loader.exe bin\64-bit\TBTray.exe
echo TBTray register > bin\64-bit\register.cmd
echo TBTray unregister > bin\64-bit\unregister.cmd

pause
3 changes: 3 additions & 0 deletions dll/dll.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LIBRARY TBTray
EXPORTS
EntryHook @1
15 changes: 13 additions & 2 deletions dll/dll.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,22 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>$(SolutionName)</TargetName>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>$(ProjectName)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>$(SolutionName)</TargetName>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand All @@ -97,6 +101,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>dll.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -110,6 +115,7 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>dll.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -127,6 +133,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>dll.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -145,6 +152,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>dll.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -159,6 +167,9 @@
<ItemGroup>
<ResourceCompile Include="dll.rc" />
</ItemGroup>
<ItemGroup>
<None Include="dll.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
5 changes: 5 additions & 0 deletions dll/dll.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="dll.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>
12 changes: 10 additions & 2 deletions loader/loader.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,18 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>$(SolutionName)</TargetName>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>$(SolutionName)</TargetName>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion loader/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void CALLBACK TimerProc(HWND, UINT, UINT_PTR idTimer, DWORD)
int dllNameLen = GetModuleFileName(nullptr, dllName, _countof(dllName));
lstrcpy(dllName + dllNameLen - 3, _T("dll"));
HMODULE dll = LoadLibrary(dllName);
HOOKPROC hookProc = (HOOKPROC)GetProcAddress(dll, "_EntryHook@12");
HOOKPROC hookProc = (HOOKPROC)GetProcAddress(dll, "EntryHook");
if(!dll || !hookProc)
{
MessageBox(nullptr, _T("Could not find the companion DLL. Make sure it's in the same directory as the EXE and has the same name."), _T("TBTray"), MB_ICONEXCLAMATION);
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#define MAJORVER 0
#define MINORVER 10
#define FIXVER 1
#define FIXVER 2

#define PRODUCTVER MAJORVER,MINORVER,FIXVER,0
#define _STR(x) #x
Expand Down

0 comments on commit 3edcdb7

Please sign in to comment.