Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10/11 dark mode #2604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 11 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,16 @@
## About ConEmu
# ConEmuDark

[![master build status](https://dev.azure.com/MaksimMoisiuk/conemu/_apis/build/status/Maximus5.ConEmu?branchName=master&label=master)](https://dev.azure.com/MaksimMoisiuk/conemu/_build/latest?definitionId=1&branchName=master&label=master)
[![daily build status](https://dev.azure.com/MaksimMoisiuk/conemu/_apis/build/status/Maximus5.ConEmu?branchName=daily&label=daily)](https://dev.azure.com/MaksimMoisiuk/conemu/_build/latest?definitionId=1&branchName=daily&label=daily)

[ConEmu-Maximus5](https://conemu.github.io) is a Windows console emulator with tabs, which represents
multiple consoles as one customizable GUI window with various features.

Initially, the program was created as a companion to
[Far Manager](http://en.wikipedia.org/wiki/FAR_Manager),
my favorite shell replacement - file and archive management,
command history and completion, powerful editor.

Today, ConEmu can be used with any other console application or simple GUI tools
(like PuTTY for example). ConEmu is an active project, open to
[suggestions](https://github.com/Maximus5/ConEmu/issues).

<a href="https://www.fosshub.com/ConEmu.html">![Fosshub.com ConEmu mirror](https://github.com/Maximus5/ConEmu/wiki/downloads-new.png)</a>
<a href="https://conemu.github.io/donate.html">![Donate](https://github.com/Maximus5/ConEmu/wiki/donate-new.png)</a>

Take a look at [screencast](http://dotnetsurfers.com/blog/2013/12/15/developer-tools-screencast-7-conemu/) about ConEmu.

This fork grew up from ConEmu by Zoin.


## License (BSD 3-clause)
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

See [Release/ConEmu/License.txt](https://github.com/Maximus5/ConEmu/blob/master/Release/ConEmu/License.txt) for the full license text.


## Some links
Wiki: https://conemu.github.io/en/TableOfContents.html
What's new: https://conemu.github.io/en/Whats_New.html
Release stages: https://conemu.github.io/en/StableVsPreview.html
Donate this project: <a ref="https://conemu.github.io/donate.html" rel="nofollow">https://conemu.github.io/donate.html</a>



## Description
ConEmu starts a console program in hidden console window and provides
an alternative customizable GUI window with various features:

* smooth window resizing;
* tabs and splits (panes);
* easy run old DOS applications (games) in Windows 7 or 64bit OS (DosBox required);
* quake-style, normal, maximized and full screen window graphic modes;
* window font anti-aliasing: standard, clear type, disabled;
* window fonts: family, height, width, bold, italic, etc.;
* using normal/bold/italic fonts for different parts of console simultaneously;
* cursor: standard console (horizontal) or GUI (vertical);
* and more, and more...

### Far Manager related features
* tabs for editors, viewers, panels and consoles;
* thumbnails and tiles;
* show full output (1K+ lines) of last command in editor/viewer;
* customizable right click behaviour (long click opens context menu);
* drag and drop (explorer style);
* and more, and more...

All settings are read from the registry or ConEmu.xml file, after which the
[command line parameters](https://conemu.github.io/en/CommandLine.html)
are applied. You may easily use several named configurations (for different PCs for example).


## Requirements
* Windows XP or later for 32-bit.
* Windows Vista or later for 64-bit.


## Installation
In general, ConEmu installation is easy.
Just unpack or install to any folder and run `ConEmu.exe`.

Read [Installation wiki](https://conemu.github.io/en/Installation.html)
about release stages, distro packets, some warnings and much more...


## Building from sources
https://github.com/Maximus5/ConEmu/blob/master/src/HowToBuild.md
This fork of [ConEmu](https://equalx.sourceforge.io/) adds dark mode/dark theme support (window titlebars, menus, scrollbars, tabbar, dialogs, controls) in Windows 10/11.

## Screenshots
![Splits and tabs in ConEmu](https://github.com/Maximus5/ConEmu/wiki/ConEmuSplits.png)
*ConEmuDark in Windows 11*
![ConEmuDark in Windows 11](screenshots/ConEmuDark_Win11.png)

*Settings dialog*
![Settings dialog](screenshots/Settings.png)

![ConEmu+Powershell inside Windows Explorer pane](https://github.com/Maximus5/ConEmu/wiki/ConEmuInside.png)
*About dialog*
![About dialog](screenshots/About.png)

[More screenshots](https://conemu.github.io/en/Screenshots.html)
## To-do
* Some dialogs still need to be handled
90 changes: 90 additions & 0 deletions README.org.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
## About ConEmu

[![master build status](https://dev.azure.com/MaksimMoisiuk/conemu/_apis/build/status/Maximus5.ConEmu?branchName=master&label=master)](https://dev.azure.com/MaksimMoisiuk/conemu/_build/latest?definitionId=1&branchName=master&label=master)
[![daily build status](https://dev.azure.com/MaksimMoisiuk/conemu/_apis/build/status/Maximus5.ConEmu?branchName=daily&label=daily)](https://dev.azure.com/MaksimMoisiuk/conemu/_build/latest?definitionId=1&branchName=daily&label=daily)

[ConEmu-Maximus5](https://conemu.github.io) is a Windows console emulator with tabs, which represents
multiple consoles as one customizable GUI window with various features.

Initially, the program was created as a companion to
[Far Manager](http://en.wikipedia.org/wiki/FAR_Manager),
my favorite shell replacement - file and archive management,
command history and completion, powerful editor.

Today, ConEmu can be used with any other console application or simple GUI tools
(like PuTTY for example). ConEmu is an active project, open to
[suggestions](https://github.com/Maximus5/ConEmu/issues).

<a href="https://www.fosshub.com/ConEmu.html">![Fosshub.com ConEmu mirror](https://github.com/Maximus5/ConEmu/wiki/downloads-new.png)</a>
<a href="https://conemu.github.io/donate.html">![Donate](https://github.com/Maximus5/ConEmu/wiki/donate-new.png)</a>

Take a look at [screencast](http://dotnetsurfers.com/blog/2013/12/15/developer-tools-screencast-7-conemu/) about ConEmu.

This fork grew up from ConEmu by Zoin.


## License (BSD 3-clause)
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

See [Release/ConEmu/License.txt](https://github.com/Maximus5/ConEmu/blob/master/Release/ConEmu/License.txt) for the full license text.


## Some links
Wiki: https://conemu.github.io/en/TableOfContents.html
What's new: https://conemu.github.io/en/Whats_New.html
Release stages: https://conemu.github.io/en/StableVsPreview.html
Donate this project: <a ref="https://conemu.github.io/donate.html" rel="nofollow">https://conemu.github.io/donate.html</a>



## Description
ConEmu starts a console program in hidden console window and provides
an alternative customizable GUI window with various features:

* smooth window resizing;
* tabs and splits (panes);
* easy run old DOS applications (games) in Windows 7 or 64bit OS (DosBox required);
* quake-style, normal, maximized and full screen window graphic modes;
* window font anti-aliasing: standard, clear type, disabled;
* window fonts: family, height, width, bold, italic, etc.;
* using normal/bold/italic fonts for different parts of console simultaneously;
* cursor: standard console (horizontal) or GUI (vertical);
* and more, and more...

### Far Manager related features
* tabs for editors, viewers, panels and consoles;
* thumbnails and tiles;
* show full output (1K+ lines) of last command in editor/viewer;
* customizable right click behaviour (long click opens context menu);
* drag and drop (explorer style);
* and more, and more...

All settings are read from the registry or ConEmu.xml file, after which the
[command line parameters](https://conemu.github.io/en/CommandLine.html)
are applied. You may easily use several named configurations (for different PCs for example).


## Requirements
* Windows XP or later for 32-bit.
* Windows Vista or later for 64-bit.


## Installation
In general, ConEmu installation is easy.
Just unpack or install to any folder and run `ConEmu.exe`.

Read [Installation wiki](https://conemu.github.io/en/Installation.html)
about release stages, distro packets, some warnings and much more...


## Building from sources
https://github.com/Maximus5/ConEmu/blob/master/src/HowToBuild.md

## Screenshots
![Splits and tabs in ConEmu](https://github.com/Maximus5/ConEmu/wiki/ConEmuSplits.png)

![ConEmu+Powershell inside Windows Explorer pane](https://github.com/Maximus5/ConEmu/wiki/ConEmuInside.png)

[More screenshots](https://conemu.github.io/en/Screenshots.html)
Binary file added screenshots/About.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/ConEmuDark_Win11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/Settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions src/ConEmu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@
<IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ConEmu</RootNamespace>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
Expand Down Expand Up @@ -155,7 +156,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;Dwmapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>
<GenerateMapFile>true</GenerateMapFile>
</Link>
Expand Down Expand Up @@ -185,7 +186,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;Dwmapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>
<GenerateMapFile>true</GenerateMapFile>
</Link>
Expand All @@ -210,7 +211,7 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;Dwmapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>
<GenerateMapFile>true</GenerateMapFile>
</Link>
Expand All @@ -235,7 +236,7 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;version.lib;gdiplus.lib;winmm.lib;netapi32.lib;Dwmapi.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>
<GenerateMapFile>true</GenerateMapFile>
</Link>
Expand Down Expand Up @@ -311,6 +312,7 @@
<ClInclude Include="ConEmu\ConfirmDlg.h" />
<ClInclude Include="ConEmu\CreateProcess.h" />
<ClInclude Include="ConEmu\CustomFonts.h" />
<ClInclude Include="ConEmu\Dark.h" />
<ClInclude Include="ConEmu\DebugMsgLog.h" />
<ClInclude Include="ConEmu\DefaultTerm.h" />
<ClInclude Include="ConEmu\DlgItemHelper.h" />
Expand Down Expand Up @@ -568,6 +570,7 @@
<ClCompile Include="ConEmu\ConfirmDlg.cpp" />
<ClCompile Include="ConEmu\CreateProcess.cpp" />
<ClCompile Include="ConEmu\CustomFonts.cpp" />
<ClCompile Include="ConEmu\Dark.cpp" />
<ClCompile Include="ConEmu\DefaultTerm.cpp" />
<ClCompile Include="ConEmu\DlgItemHelper.cpp" />
<ClCompile Include="ConEmu\DontEnable.cpp" />
Expand Down
6 changes: 6 additions & 0 deletions src/ConEmu.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,9 @@
<ClInclude Include="common\xmllite.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="ConEmu\Dark.h">
<Filter>Headers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ConEmu\AboutDlg.cpp">
Expand Down Expand Up @@ -1205,6 +1208,9 @@
<ClCompile Include="ConEmu\helper.cpp">
<Filter>Sources</Filter>
</ClCompile>
<ClCompile Include="ConEmu\Dark.cpp">
<Filter>Sources</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\Release\ConEmu\ConEmu.l10n">
Expand Down
62 changes: 50 additions & 12 deletions src/ConEmu/AboutDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../common/WObjects.h"
#include "../common/StartupEnvEx.h"

#include "Dark.h"

namespace ConEmuAbout
{
void InitCommCtrls();
Expand Down Expand Up @@ -197,6 +199,13 @@ INT_PTR WINAPI ConEmuAbout::aboutProc(HWND hDlg, UINT messg, WPARAM wParam, LPAR
HWND hTab = GetDlgItem(hDlg, tbAboutTabs);
INT_PTR nPage = -1;

if (gbUseDarkMode)
{
SetWindowTheme(hTab, L"", L"");
SetWindowLong(hTab, GWL_STYLE, GetWindowLong(hTab, GWL_STYLE) | TCS_OWNERDRAWFIXED);
SetClassLongPtr(hTab, GCLP_HBRBACKGROUND, (LONG_PTR)BG_BRUSH_DARK);
}

for (size_t i = 0; i < countof(Pages); i++)
{
TCITEM tie = {};
Expand All @@ -208,7 +217,6 @@ INT_PTR WINAPI ConEmuAbout::aboutProc(HWND hDlg, UINT messg, WPARAM wParam, LPAR
nPage = i;
}


if (nPage >= 0)
{
TabSelected(hDlg, static_cast<int>(nPage));
Expand All @@ -225,24 +233,54 @@ INT_PTR WINAPI ConEmuAbout::aboutProc(HWND hDlg, UINT messg, WPARAM wParam, LPAR

SetFocus(hTab);

if (gbUseDarkMode)
DarkDialogInit(hDlg);

return FALSE;
}

case WM_DRAWITEM:
// We only receive this message in dark mode (when TCS_OWNERDRAWFIXED was added to the TabCtrl's style).
DarkAboutOnDrawItem((DRAWITEMSTRUCT*)lParam);
break;

case WM_CTLCOLORDLG:
if (gbUseDarkMode)
return DarkOnCtlColorDlg((HDC)wParam);
break;

case WM_CTLCOLORSTATIC:
if (GetWindowLongPtr(reinterpret_cast<HWND>(lParam), GWLP_ID) == stConEmuUrl)
{
SetTextColor(reinterpret_cast<HDC>(wParam), GetSysColor(COLOR_HOTLIGHT));
HBRUSH hBrush = GetSysColorBrush(COLOR_3DFACE);
SetBkMode(reinterpret_cast<HDC>(wParam), TRANSPARENT);
return reinterpret_cast<INT_PTR>(hBrush);
}
if (gbUseDarkMode)
return DarkOnCtlColorStatic((HWND)lParam, (HDC)wParam);
else
{
SetTextColor(reinterpret_cast<HDC>(wParam), GetSysColor(COLOR_WINDOWTEXT));
HBRUSH hBrush = GetSysColorBrush(COLOR_3DFACE);
SetBkMode(reinterpret_cast<HDC>(wParam), TRANSPARENT);
return reinterpret_cast<INT_PTR>(hBrush);
if (GetWindowLongPtr(reinterpret_cast<HWND>(lParam), GWLP_ID) == stConEmuUrl)
{
SetTextColor(reinterpret_cast<HDC>(wParam), GetSysColor(COLOR_HOTLIGHT));
HBRUSH hBrush = GetSysColorBrush(COLOR_3DFACE);
SetBkMode(reinterpret_cast<HDC>(wParam), TRANSPARENT);
return reinterpret_cast<INT_PTR>(hBrush);
}
else
{
SetTextColor(reinterpret_cast<HDC>(wParam), GetSysColor(COLOR_WINDOWTEXT));
HBRUSH hBrush = GetSysColorBrush(COLOR_3DFACE);
SetBkMode(reinterpret_cast<HDC>(wParam), TRANSPARENT);
return reinterpret_cast<INT_PTR>(hBrush);
}
}
break;

case WM_CTLCOLORBTN:
if (gbUseDarkMode)
return DarkOnCtlColorBtn((HDC)wParam);
break;

case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX:
if (gbUseDarkMode)
return DarkOnCtlColorEditColorListBox((HDC)wParam);
break;

case WM_SETCURSOR:
{
Expand Down
Loading
Loading