Skip to content

Commit 211ad00

Browse files
committed
Added AutoRun capability
1 parent b8fe8d6 commit 211ad00

5 files changed

Lines changed: 435 additions & 17 deletions

File tree

App.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ bool MyApp::OnInit()
3838
wxMessageBox("There appears to be no system tray support in your current environment. This sample may not behave as expected.", "Warning", wxOK | wxICON_EXCLAMATION);
3939
}
4040

41+
m_isDarkMode = locCheckDarkMode();
42+
4143
//needed to load the taskbar icon, as it's a PNG file
4244
wxImage::AddHandler(new wxPNGHandler());
4345

4446
//create the taskbar icon object/logic
4547
m_taskBarIcon = new MyTaskBarIcon(this);
4648

47-
//load the icon from resources, depending on the system theme
48-
bool isDark = locCheckDarkMode();
49-
if(!m_taskBarIcon->SetIcon(wxBitmapBundle::FromResources((isDark)?"IDI_PNG2":"IDI_PNG1"), "Capture device properties\nRight click to show a list of devices"))
49+
//load the icon from resources, depending on the system theme
50+
if(!m_taskBarIcon->SetIcon(wxBitmapBundle::FromResources((IsDarkMode())?"IDI_PNG2":"IDI_PNG1"), "Capture device properties\nRight click to show a list of devices"))
5051
{
5152
wxLogError("Could not set icon.");
5253
}

App.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ class MyApp : public wxApp
88
public:
99
virtual bool OnInit() wxOVERRIDE;
1010
virtual int OnExit() wxOVERRIDE;
11+
12+
bool IsDarkMode() const { return m_isDarkMode; }
13+
1114
private:
12-
MyTaskBarIcon* m_taskBarIcon;
13-
private:
15+
MyTaskBarIcon* m_taskBarIcon = nullptr;
16+
bool m_isDarkMode = false;
1417
};

0 commit comments

Comments
 (0)