2021-10-02 03:02:07 +02:00
|
|
|
#ifndef _H_GUI_H_
|
|
|
|
#define _H_GUI_H_
|
2021-10-15 12:50:52 +02:00
|
|
|
#define _CRTDBG_MAP_ALLOC
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <crtdbg.h>
|
2021-10-02 18:26:59 +02:00
|
|
|
#pragma comment(linker,"\"/manifestdependency:type='win32' \
|
|
|
|
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
|
|
|
|
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
2021-10-02 03:02:07 +02:00
|
|
|
#include <Windows.h>
|
|
|
|
#pragma comment(lib, "Version.lib")
|
2021-10-02 18:46:01 +02:00
|
|
|
#include <Shlwapi.h>
|
|
|
|
#pragma comment(lib, "Shlwapi.lib")
|
2021-10-02 03:02:07 +02:00
|
|
|
#include <windowsx.h>
|
|
|
|
#include <tlhelp32.h>
|
|
|
|
#include <shellscalingapi.h>
|
|
|
|
#pragma comment(lib, "Shcore.lib")
|
|
|
|
#include <conio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <Uxtheme.h>
|
|
|
|
#pragma comment(lib, "UxTheme.lib")
|
|
|
|
#include <dwmapi.h>
|
|
|
|
#pragma comment(lib, "Dwmapi.lib")
|
|
|
|
#include "resource.h"
|
|
|
|
#include "getline.h"
|
|
|
|
#include "fmemopen.h"
|
|
|
|
#include "utility.h"
|
2022-01-27 03:35:27 +01:00
|
|
|
#include "../ep_weather_host/ep_weather.h"
|
2022-03-14 03:53:48 +01:00
|
|
|
#include "../ep_weather_host/ep_weather_host_h.h"
|
2021-10-02 03:02:07 +02:00
|
|
|
|
|
|
|
#define MAX_LINE_LENGTH 2000
|
|
|
|
extern HMODULE hModule;
|
|
|
|
|
|
|
|
#define GUI_POSITION_X CW_USEDEFAULT
|
|
|
|
#define GUI_POSITION_Y CW_USEDEFAULT
|
2021-10-10 05:14:23 +02:00
|
|
|
#define GUI_POSITION_WIDTH 367
|
2021-10-15 12:50:52 +02:00
|
|
|
#define GUI_POSITION_HEIGHT 316
|
2021-10-02 03:02:07 +02:00
|
|
|
#define GUI_WINDOWSWITCHER_THEME_CLASS "ControlPanelStyle"
|
2021-12-24 01:06:08 +01:00
|
|
|
#define GUI_CAPTION_FONT_SIZE -12
|
2021-10-15 12:50:52 +02:00
|
|
|
#define GUI_SECTION_FONT_SIZE -12
|
|
|
|
#define GUI_SECTION_HEIGHT 32
|
2021-10-02 03:02:07 +02:00
|
|
|
#define GUI_TITLE_FONT_SIZE -12
|
2021-10-02 18:30:49 +02:00
|
|
|
#define GUI_LINE_HEIGHT 26
|
2021-12-24 01:06:08 +01:00
|
|
|
#define GUI_CAPTION_LINE_HEIGHT_DEFAULT 42
|
2021-10-02 03:02:07 +02:00
|
|
|
#define GUI_TEXTCOLOR RGB(0, 0, 0)
|
2021-10-02 20:57:19 +02:00
|
|
|
#define GUI_TEXTCOLOR_SELECTED RGB(255, 0, 0)
|
2021-10-10 05:14:23 +02:00
|
|
|
#define GUI_TEXTCOLOR_DARK RGB(240, 240, 240)
|
|
|
|
#define GUI_TEXTCOLOR_SELECTED_DARK RGB(255, 150, 150)
|
2021-10-02 20:57:19 +02:00
|
|
|
#define GUI_MAX_TABORDER 9999
|
2021-10-02 03:02:07 +02:00
|
|
|
#define GUI_PADDING 5
|
|
|
|
#define GUI_PADDING_LEFT GUI_PADDING * 3
|
2021-10-15 12:50:52 +02:00
|
|
|
#define GUI_SIDEBAR_WIDTH 110
|
2021-10-02 03:02:07 +02:00
|
|
|
#define GUI_PADDING_RIGHT GUI_PADDING * 3
|
|
|
|
#define GUI_PADDING_TOP GUI_PADDING
|
|
|
|
#define GUI_PADDING_BOTTOM GUI_PADDING
|
2021-10-15 12:50:52 +02:00
|
|
|
#define GUI_STATUS_PADDING 10
|
2022-01-05 04:02:25 +01:00
|
|
|
|
|
|
|
#define GUI_TIMER_READ_HELP 1
|
|
|
|
#define GUI_TIMER_READ_HELP_TIMEOUT 1000
|
|
|
|
#define GUI_TIMER_READ_REPEAT_SELECTION 2
|
|
|
|
#define GUI_TIMER_READ_REPEAT_SELECTION_TIMEOUT 1000
|
2022-02-20 17:35:33 +01:00
|
|
|
#define GUI_TIMER_REFRESH_FOR_PEOPLEBAND 2
|
|
|
|
#define GUI_TIMER_REFRESH_FOR_PEOPLEBAND_TIMEOUT 1000
|
2021-10-02 03:02:07 +02:00
|
|
|
typedef struct _GUI
|
|
|
|
{
|
|
|
|
POINT location;
|
|
|
|
SIZE size;
|
|
|
|
RECT padding;
|
2021-10-15 12:50:52 +02:00
|
|
|
UINT sidebarWidth;
|
2021-10-02 03:02:07 +02:00
|
|
|
HBRUSH hBackgroundBrush;
|
|
|
|
HTHEME hTheme;
|
|
|
|
POINT dpi;
|
|
|
|
MARGINS extent;
|
2021-10-02 20:57:19 +02:00
|
|
|
UINT tabOrder;
|
2022-02-17 22:05:06 +01:00
|
|
|
DWORD bCalcExtent;
|
2021-10-15 12:50:52 +02:00
|
|
|
SIZE_T section;
|
|
|
|
DWORD dwStatusbarY;
|
|
|
|
HICON hIcon;
|
2021-12-24 01:06:08 +01:00
|
|
|
RECT border_thickness;
|
|
|
|
UINT GUI_CAPTION_LINE_HEIGHT;
|
|
|
|
long long LeftClickTime;
|
|
|
|
long long LastClickTime;
|
2021-12-28 15:06:37 +01:00
|
|
|
HMODULE hExplorerFrame;
|
2022-01-05 04:02:25 +01:00
|
|
|
void* pAccPropServices;
|
|
|
|
HWND hAccLabel;
|
|
|
|
BOOL bShouldAnnounceSelected;
|
|
|
|
WCHAR sectionNames[20][20];
|
|
|
|
BOOL bRebuildIfTabOrderIsEmpty;
|
|
|
|
int dwPageLocation;
|
2022-02-21 01:42:35 +01:00
|
|
|
DWORD last_section;
|
2021-10-02 03:02:07 +02:00
|
|
|
} GUI;
|
|
|
|
|
|
|
|
static HRESULT GUI_AboutProc(
|
|
|
|
HWND hwnd,
|
|
|
|
UINT uNotification,
|
|
|
|
WPARAM wParam,
|
|
|
|
LPARAM lParam,
|
|
|
|
LONG_PTR lpRefData
|
|
|
|
);
|
|
|
|
|
|
|
|
static BOOL GUI_Build(HDC hDC, HWND hWnd);
|
|
|
|
|
2021-10-02 18:17:24 +02:00
|
|
|
static LRESULT CALLBACK GUI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2021-10-02 03:02:07 +02:00
|
|
|
|
|
|
|
__declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
|
|
|
|
#endif
|