-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWhatPulseLogitech.h
94 lines (71 loc) · 2.18 KB
/
WhatPulseLogitech.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* WhatPulse Logitech Gaming Keyboard Widget
*
* This widget uses the WhatPulse Client API to retrieve statistics from the WhatPulse Client
* and display them on a Logitech Gaming Keyboard LCD screen. It also serves as an open example
* of how the Client API can be used.
*
* This has been tested on a G19 and G510. It requires the WhatPulse Client and that the
* client API has been enabled in the Settings tab.
*
* WhatPulse (c) 2016 - http://whatpulse.org
*/
#pragma once
#include <GdiPlus.h>
#include "stdafx.h"
#include "EZ_LCD.h"
#include "resource.h"
#include "SettingsDialog.h"
std::string convertWStringToString(std::wstring sourceString);
std::wstring convertCharToWString(const char* sourceString);
class WhatPulseLogitech : public CDialog
{
// Construction
public:
WhatPulseLogitech(CWnd* pParent = NULL); // standard constructor
void restartStatsTimer();
// Dialog Data
enum { IDD = IDD_WHATPULSELOGITECH_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Our settings dialog
SettingsDialog *settingsDlg;
BOOL m_alertClientAPINotWorking;
HICON m_hIcon;
CEzLcd m_lcd;
// Monochrome
HANDLE m_keysTextMono;
HANDLE m_keysValueMono;
HANDLE m_clicksTextMono;
HANDLE m_clicksValueMono;
HANDLE m_downAndUploadTextMono;
HANDLE m_downAndUploadValueMono;
HANDLE m_uptimeTextMono;
HANDLE m_uptimeValueMono;
// Color
HANDLE m_titleText;
HANDLE m_keysText;
HANDLE m_keysValue;
HANDLE m_clicksText;
HANDLE m_clicksValue;
HANDLE m_downloadText;
HANDLE m_downloadValue;
HANDLE m_uploadText;
HANDLE m_uploadValue;
HANDLE m_uptimeText;
HANDLE m_uptimeValue;
VOID InitLCDObjectsMonochrome();
VOID InitLCDObjectsColor();
VOID refeshWhatPulseStats();
std::string formatDateTimeShort(long long diff, bool includeSeconds);
std::string FormatWithCommas(long long value);
std::string formatBandwidth(long long bytes);
// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnDestroy( );
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
DECLARE_MESSAGE_MAP()
};