1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-23 23:21:08 +01:00

GUI: Increase buffer size of section names to 64 (#3461)

This commit is contained in:
Amrsatrio 2024-07-15 22:40:04 +07:00
parent 016214a381
commit c69eb5f11a
2 changed files with 99 additions and 99 deletions

View File

@ -1284,7 +1284,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
GUI_SubstituteLocalizedString(text, MAX_LINE_LENGTH); GUI_SubstituteLocalizedString(text, MAX_LINE_LENGTH);
if (_this->sectionNames[currentSection + 1][0] == 0) if (_this->sectionNames[currentSection + 1][0] == 0)
{ {
wcscpy_s(_this->sectionNames[currentSection + 1], 32, text); wcscpy_s(_this->sectionNames[currentSection + 1], 64, text);
} }
if (hDC) if (hDC)
{ {

View File

@ -1,98 +1,98 @@
#ifndef _H_GUI_H_ #ifndef _H_GUI_H_
#define _H_GUI_H_ #define _H_GUI_H_
#define _CRTDBG_MAP_ALLOC #define _CRTDBG_MAP_ALLOC
#include <stdlib.h> #include <stdlib.h>
#include <crtdbg.h> #include <crtdbg.h>
#pragma comment(linker,"\"/manifestdependency:type='win32' \ #pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include <Windows.h> #include <Windows.h>
#pragma comment(lib, "Version.lib") #pragma comment(lib, "Version.lib")
#include <Shlwapi.h> #include <Shlwapi.h>
#pragma comment(lib, "Shlwapi.lib") #pragma comment(lib, "Shlwapi.lib")
#include <windowsx.h> #include <windowsx.h>
#include <tlhelp32.h> #include <tlhelp32.h>
#include <shellscalingapi.h> #include <shellscalingapi.h>
#pragma comment(lib, "Shcore.lib") #pragma comment(lib, "Shcore.lib")
#include <conio.h> #include <conio.h>
#include <stdio.h> #include <stdio.h>
#include <Uxtheme.h> #include <Uxtheme.h>
#pragma comment(lib, "UxTheme.lib") #pragma comment(lib, "UxTheme.lib")
#include <dwmapi.h> #include <dwmapi.h>
#pragma comment(lib, "Dwmapi.lib") #pragma comment(lib, "Dwmapi.lib")
#include "resources/resource.h" #include "resources/resource.h"
#include "../ExplorerPatcher/getline.h" #include "../ExplorerPatcher/getline.h"
#include "../ExplorerPatcher/fmemopen.h" #include "../ExplorerPatcher/fmemopen.h"
#include "../ExplorerPatcher/Localization.h" #include "../ExplorerPatcher/Localization.h"
#include "../ExplorerPatcher/utility.h" #include "../ExplorerPatcher/utility.h"
#include "../ep_weather_host/ep_weather.h" #include "../ep_weather_host/ep_weather.h"
#include "../ep_weather_host/ep_weather_host_h.h" #include "../ep_weather_host/ep_weather_host_h.h"
#define MAX_LINE_LENGTH 2000 #define MAX_LINE_LENGTH 2000
extern HMODULE hModule; extern HMODULE hModule;
#define GUI_POSITION_X CW_USEDEFAULT #define GUI_POSITION_X CW_USEDEFAULT
#define GUI_POSITION_Y CW_USEDEFAULT #define GUI_POSITION_Y CW_USEDEFAULT
#define GUI_POSITION_WIDTH 367 #define GUI_POSITION_WIDTH 367
#define GUI_POSITION_HEIGHT 316 #define GUI_POSITION_HEIGHT 316
#define GUI_WINDOWSWITCHER_THEME_CLASS "ControlPanelStyle" #define GUI_WINDOWSWITCHER_THEME_CLASS "ControlPanelStyle"
#define GUI_CAPTION_FONT_SIZE -12 #define GUI_CAPTION_FONT_SIZE -12
#define GUI_SECTION_FONT_SIZE -12 #define GUI_SECTION_FONT_SIZE -12
#define GUI_SECTION_HEIGHT 32 #define GUI_SECTION_HEIGHT 32
#define GUI_TITLE_FONT_SIZE -12 #define GUI_TITLE_FONT_SIZE -12
#define GUI_LINE_HEIGHT 26 #define GUI_LINE_HEIGHT 26
#define GUI_CAPTION_LINE_HEIGHT_DEFAULT 42 #define GUI_CAPTION_LINE_HEIGHT_DEFAULT 42
#define GUI_TEXTCOLOR RGB(0, 0, 0) #define GUI_TEXTCOLOR RGB(0, 0, 0)
#define GUI_TEXTCOLOR_SELECTED RGB(255, 0, 0) #define GUI_TEXTCOLOR_SELECTED RGB(255, 0, 0)
#define GUI_TEXTCOLOR_DARK RGB(240, 240, 240) #define GUI_TEXTCOLOR_DARK RGB(240, 240, 240)
#define GUI_TEXTCOLOR_SELECTED_DARK RGB(255, 150, 150) #define GUI_TEXTCOLOR_SELECTED_DARK RGB(255, 150, 150)
#define GUI_MAX_TABORDER 9999 #define GUI_MAX_TABORDER 9999
#define GUI_PADDING 5 #define GUI_PADDING 5
#define GUI_PADDING_LEFT GUI_PADDING * 3 #define GUI_PADDING_LEFT GUI_PADDING * 3
#define GUI_SIDEBAR_WIDTH 150 // 110 #define GUI_SIDEBAR_WIDTH 150 // 110
#define GUI_PADDING_RIGHT GUI_PADDING * 3 #define GUI_PADDING_RIGHT GUI_PADDING * 3
#define GUI_PADDING_TOP GUI_PADDING #define GUI_PADDING_TOP GUI_PADDING
#define GUI_PADDING_BOTTOM GUI_PADDING #define GUI_PADDING_BOTTOM GUI_PADDING
#define GUI_STATUS_PADDING 10 #define GUI_STATUS_PADDING 10
#define GUI_TIMER_READ_HELP 1 #define GUI_TIMER_READ_HELP 1
#define GUI_TIMER_READ_HELP_TIMEOUT 1000 #define GUI_TIMER_READ_HELP_TIMEOUT 1000
#define GUI_TIMER_READ_REPEAT_SELECTION 2 #define GUI_TIMER_READ_REPEAT_SELECTION 2
#define GUI_TIMER_READ_REPEAT_SELECTION_TIMEOUT 1000 #define GUI_TIMER_READ_REPEAT_SELECTION_TIMEOUT 1000
#define GUI_TIMER_REFRESH_FOR_PEOPLEBAND 2 #define GUI_TIMER_REFRESH_FOR_PEOPLEBAND 2
#define GUI_TIMER_REFRESH_FOR_PEOPLEBAND_TIMEOUT 1000 #define GUI_TIMER_REFRESH_FOR_PEOPLEBAND_TIMEOUT 1000
typedef struct _GUI typedef struct _GUI
{ {
POINT location; POINT location;
SIZE size; SIZE size;
RECT padding; RECT padding;
UINT sidebarWidth; UINT sidebarWidth;
HBRUSH hBackgroundBrush; HBRUSH hBackgroundBrush;
HTHEME hTheme; HTHEME hTheme;
POINT dpi; POINT dpi;
MARGINS extent; MARGINS extent;
UINT tabOrder; UINT tabOrder;
DWORD bCalcExtent; DWORD bCalcExtent;
SIZE_T section; SIZE_T section;
DWORD dwStatusbarY; DWORD dwStatusbarY;
HICON hIcon; HICON hIcon;
RECT border_thickness; RECT border_thickness;
UINT GUI_CAPTION_LINE_HEIGHT; UINT GUI_CAPTION_LINE_HEIGHT;
long long LeftClickTime; long long LeftClickTime;
long long LastClickTime; long long LastClickTime;
HMODULE hExplorerFrame; HMODULE hExplorerFrame;
void* pAccPropServices; void* pAccPropServices;
HWND hAccLabel; HWND hAccLabel;
BOOL bShouldAnnounceSelected; BOOL bShouldAnnounceSelected;
WCHAR sectionNames[20][32]; WCHAR sectionNames[20][64];
BOOL bRebuildIfTabOrderIsEmpty; BOOL bRebuildIfTabOrderIsEmpty;
int dwPageLocation; int dwPageLocation;
DWORD last_section; DWORD last_section;
} GUI; } GUI;
static BOOL GUI_Build(HDC hDC, HWND hWnd); static BOOL GUI_Build(HDC hDC, HWND hWnd);
static LRESULT CALLBACK GUI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK GUI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
__declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow); __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
#endif #endif