ReactOS  0.4.14-dev-49-gfb4591c
propsheet.cpp File Reference
#include "shellext.h"
#include <windows.h>
#include <strsafe.h>
#include <winternl.h>
#include <shlwapi.h>
#include <uxtheme.h>
#include "propsheet.h"
#include "resource.h"
Include dependency graph for propsheet.cpp:

Go to the source code of this file.

Classes

struct  _FILE_ACCESS_INFORMATION
 
struct  _FILE_STANDARD_INFORMATION
 

Macros

#define ISOLATION_AWARE_ENABLED   1
 
#define STRSAFE_NO_DEPRECATE
 
#define NO_SHLWAPI_STRFCNS
 
#define SUBVOL_ROOT_INODE   0x100
 
#define FileAccessInformation   (FILE_INFORMATION_CLASS)8
 
#define FileStandardInformation   (FILE_INFORMATION_CLASS)5
 
#define major(rdev)   ((((rdev) >> 8) & 0xFFF) | ((uint32_t)((rdev) >> 32) & ~0xFFF))
 
#define minor(rdev)   (((rdev) & 0xFF) | ((uint32_t)((rdev) >> 12) & ~0xFF))
 

Typedefs

typedef struct _FILE_ACCESS_INFORMATION FILE_ACCESS_INFORMATION
 
typedef struct _FILE_ACCESS_INFORMATIONPFILE_ACCESS_INFORMATION
 
typedef struct _FILE_STANDARD_INFORMATION FILE_STANDARD_INFORMATION
 
typedef struct _FILE_STANDARD_INFORMATIONPFILE_STANDARD_INFORMATION
 

Functions

static DWORD WINAPI global_search_list_thread (LPVOID lpParameter)
 
static ULONG inode_type_to_string_ref (uint8_t type)
 
static INT_PTR CALLBACK SizeDetailsDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static void set_check_box (HWND hwndDlg, ULONG id, uint64_t min, uint64_t max)
 
static INT_PTR CALLBACK PropSheetDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void CALLBACK ShowPropSheetW (HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
 

Macro Definition Documentation

◆ FileAccessInformation

#define FileAccessInformation   (FILE_INFORMATION_CLASS)8

Definition at line 51 of file propsheet.cpp.

◆ FileStandardInformation

#define FileStandardInformation   (FILE_INFORMATION_CLASS)5

Definition at line 61 of file propsheet.cpp.

◆ ISOLATION_AWARE_ENABLED

#define ISOLATION_AWARE_ENABLED   1

Definition at line 18 of file propsheet.cpp.

◆ major

#define major (   rdev)    ((((rdev) >> 8) & 0xFFF) | ((uint32_t)((rdev) >> 32) & ~0xFFF))

Definition at line 879 of file propsheet.cpp.

◆ minor

#define minor (   rdev)    (((rdev) & 0xFF) | ((uint32_t)((rdev) >> 12) & ~0xFF))

Definition at line 880 of file propsheet.cpp.

◆ NO_SHLWAPI_STRFCNS

#define NO_SHLWAPI_STRFCNS

Definition at line 35 of file propsheet.cpp.

◆ STRSAFE_NO_DEPRECATE

#define STRSAFE_NO_DEPRECATE

Definition at line 19 of file propsheet.cpp.

◆ SUBVOL_ROOT_INODE

#define SUBVOL_ROOT_INODE   0x100

Definition at line 42 of file propsheet.cpp.

Typedef Documentation

◆ FILE_ACCESS_INFORMATION

◆ FILE_STANDARD_INFORMATION

◆ PFILE_ACCESS_INFORMATION

◆ PFILE_STANDARD_INFORMATION

Function Documentation

◆ global_search_list_thread()

static DWORD WINAPI global_search_list_thread ( LPVOID  lpParameter)
static

Definition at line 158 of file propsheet.cpp.

158  {
160 
161  return bps->search_list_thread();
162 }
DWORD search_list_thread()
Definition: propsheet.cpp:146
LPVOID lpParameter
Definition: kernel32.h:241

Referenced by BtrfsPropSheet::Initialize(), and BtrfsPropSheet::set_cmdline().

◆ inode_type_to_string_ref()

static ULONG inode_type_to_string_ref ( uint8_t  type)
static

Definition at line 534 of file propsheet.cpp.

534  {
535  switch (type) {
536  case BTRFS_TYPE_FILE:
537  return IDS_INODE_FILE;
538 
540  return IDS_INODE_DIR;
541 
542  case BTRFS_TYPE_CHARDEV:
543  return IDS_INODE_CHAR;
544 
545  case BTRFS_TYPE_BLOCKDEV:
546  return IDS_INODE_BLOCK;
547 
548  case BTRFS_TYPE_FIFO:
549  return IDS_INODE_FIFO;
550 
551  case BTRFS_TYPE_SOCKET:
552  return IDS_INODE_SOCKET;
553 
554  case BTRFS_TYPE_SYMLINK:
555  return IDS_INODE_SYMLINK;
556 
557  default:
558  return IDS_INODE_UNKNOWN;
559  }
560 }
#define IDS_INODE_UNKNOWN
Definition: resource.h:27
#define BTRFS_TYPE_SOCKET
Definition: shellext.h:85
#define BTRFS_TYPE_BLOCKDEV
Definition: shellext.h:83
#define IDS_INODE_FIFO
Definition: resource.h:24
#define BTRFS_TYPE_FIFO
Definition: shellext.h:84
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define BTRFS_TYPE_CHARDEV
Definition: shellext.h:82
#define IDS_INODE_SOCKET
Definition: resource.h:25
#define IDS_INODE_SYMLINK
Definition: resource.h:26
#define BTRFS_TYPE_DIRECTORY
Definition: shellext.h:81
#define IDS_INODE_BLOCK
Definition: resource.h:23
#define IDS_INODE_DIR
Definition: resource.h:20
#define IDS_INODE_FILE
Definition: resource.h:18
#define BTRFS_TYPE_FILE
Definition: shellext.h:80
#define IDS_INODE_CHAR
Definition: resource.h:22
#define BTRFS_TYPE_SYMLINK
Definition: shellext.h:86

Referenced by BtrfsPropSheet::init_propsheet().

◆ PropSheetDlgProc()

static INT_PTR CALLBACK PropSheetDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1045 of file propsheet.cpp.

1045  {
1046  try {
1047  switch (uMsg) {
1048  case WM_INITDIALOG:
1049  {
1051  BtrfsPropSheet* bps = (BtrfsPropSheet*)psp->lParam;
1052 
1054 
1055  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)bps);
1056 
1057  bps->init_propsheet(hwndDlg);
1058 
1059  return false;
1060  }
1061 
1062  case WM_COMMAND:
1063  {
1065 
1066  if (bps && !bps->readonly) {
1067  switch (HIWORD(wParam)) {
1068  case BN_CLICKED: {
1069  switch (LOWORD(wParam)) {
1070  case IDC_NODATACOW:
1072  break;
1073 
1074  case IDC_COMPRESS:
1076 
1078  break;
1079 
1080  case IDC_USERR:
1081  bps->change_perm_flag(hwndDlg, S_IRUSR, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1082  break;
1083 
1084  case IDC_USERW:
1085  bps->change_perm_flag(hwndDlg, S_IWUSR, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1086  break;
1087 
1088  case IDC_USERX:
1089  bps->change_perm_flag(hwndDlg, S_IXUSR, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1090  break;
1091 
1092  case IDC_GROUPR:
1093  bps->change_perm_flag(hwndDlg, S_IRGRP, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1094  break;
1095 
1096  case IDC_GROUPW:
1097  bps->change_perm_flag(hwndDlg, S_IWGRP, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1098  break;
1099 
1100  case IDC_GROUPX:
1101  bps->change_perm_flag(hwndDlg, S_IXGRP, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1102  break;
1103 
1104  case IDC_OTHERR:
1105  bps->change_perm_flag(hwndDlg, S_IROTH, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1106  break;
1107 
1108  case IDC_OTHERW:
1109  bps->change_perm_flag(hwndDlg, S_IWOTH, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1110  break;
1111 
1112  case IDC_OTHERX:
1113  bps->change_perm_flag(hwndDlg, S_IXOTH, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1114  break;
1115 
1116  case IDC_SETUID:
1117  bps->change_perm_flag(hwndDlg, S_ISUID, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1118  break;
1119 
1120  case IDC_SETGID:
1121  bps->change_perm_flag(hwndDlg, S_ISGID, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1122  break;
1123 
1124  case IDC_STICKY:
1125  bps->change_perm_flag(hwndDlg, S_ISVTX, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1126  break;
1127 
1128  case IDC_SUBVOL_RO:
1129  switch (IsDlgButtonChecked(hwndDlg, LOWORD(wParam))) {
1130  case BST_CHECKED:
1131  bps->ro_subvol = true;
1132  bps->ro_changed = true;
1133  break;
1134 
1135  case BST_UNCHECKED:
1136  bps->ro_subvol = false;
1137  bps->ro_changed = true;
1138  break;
1139 
1140  case BST_INDETERMINATE:
1141  bps->ro_changed = false;
1142  break;
1143  }
1144 
1145  SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
1146  break;
1147 
1148  case IDC_OPEN_ADMIN:
1149  bps->open_as_admin(hwndDlg);
1150  break;
1151  }
1152 
1153  break;
1154  }
1155 
1156  case EN_CHANGE: {
1157  switch (LOWORD(wParam)) {
1158  case IDC_UID: {
1159  WCHAR s[255];
1160 
1161  GetDlgItemTextW(hwndDlg, LOWORD(wParam), s, sizeof(s) / sizeof(WCHAR));
1162 
1163  bps->change_uid(hwndDlg, _wtoi(s));
1164  break;
1165  }
1166 
1167  case IDC_GID: {
1168  WCHAR s[255];
1169 
1170  GetDlgItemTextW(hwndDlg, LOWORD(wParam), s, sizeof(s) / sizeof(WCHAR));
1171 
1172  bps->change_gid(hwndDlg, _wtoi(s));
1173  break;
1174  }
1175  }
1176 
1177  break;
1178  }
1179 
1180  case CBN_SELCHANGE: {
1181  switch (LOWORD(wParam)) {
1182  case IDC_COMPRESS_TYPE: {
1183  int sel = SendMessageW(GetDlgItem(hwndDlg, LOWORD(wParam)), CB_GETCURSEL, 0, 0);
1184 
1185  if (bps->min_compression_type != bps->max_compression_type) {
1186  if (sel == 0)
1187  bps->compress_type_changed = false;
1188  else {
1189  bps->compress_type = (uint8_t)(sel - 1);
1190  bps->compress_type_changed = true;
1191  }
1192  } else {
1193  bps->compress_type = (uint8_t)sel;
1194  bps->compress_type_changed = true;
1195  }
1196 
1197  SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
1198 
1199  break;
1200  }
1201  }
1202 
1203  break;
1204  }
1205  }
1206  }
1207 
1208  break;
1209  }
1210 
1211  case WM_NOTIFY:
1212  {
1213  switch (((LPNMHDR)lParam)->code) {
1214  case PSN_KILLACTIVE:
1215  SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, false);
1216  break;
1217 
1218  case PSN_APPLY: {
1220 
1221  bps->apply_changes(hwndDlg);
1223  break;
1224  }
1225 
1226  case NM_CLICK:
1227  case NM_RETURN: {
1228  if (((LPNMHDR)lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_SIZE_ON_DISK)) {
1229  PNMLINK pNMLink = (PNMLINK)lParam;
1230 
1231  if (pNMLink->item.iLink == 0)
1233  }
1234  break;
1235  }
1236  }
1237  }
1238 
1239  case WM_TIMER:
1240  {
1242 
1243  if (bps) {
1244  bps->set_size_on_disk(hwndDlg);
1245 
1246  if (!bps->thread)
1247  KillTimer(hwndDlg, 1);
1248  }
1249 
1250  break;
1251  }
1252  }
1253  } catch (const exception& e) {
1254  error_message(hwndDlg, e.what());
1255  }
1256 
1257  return false;
1258 }
static INT_PTR CALLBACK SizeDetailsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.cpp:772
#define IDC_USERW
Definition: resource.h:215
void change_uid(HWND hDlg, uint32_t uid)
Definition: propsheet.cpp:738
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2208
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define IDC_GROUPR
Definition: resource.h:213
#define BTRFS_INODE_NODATACOW
Definition: propsheet.h:77
#define S_ISGID
Definition: propsheet.h:69
void change_gid(HWND hDlg, uint32_t gid)
Definition: propsheet.cpp:747
#define IDC_UID
Definition: resource.h:210
uint8_t max_compression_type
Definition: propsheet.h:176
#define IDC_USERR
Definition: resource.h:212
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
int iLink
Definition: commctrl.h:4724
UINT_PTR WPARAM
Definition: windef.h:207
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_SUBVOL_RO
Definition: resource.h:318
#define IDC_USERX
Definition: resource.h:218
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1925
WPARAM wParam
Definition: combotst.c:138
#define BST_INDETERMINATE
Definition: winuser.h:198
#define DWLP_MSGRESULT
Definition: winuser.h:864
#define IDD_SIZE_DETAILS
Definition: resource.h:8
#define IDC_COMPRESS
Definition: resource.h:225
void change_inode_flag(HWND hDlg, uint64_t flag, UINT state)
Definition: propsheet.cpp:562
#define IDC_GID
Definition: resource.h:211
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:738
#define PSN_KILLACTIVE
Definition: prsht.h:116
uint8_t min_compression_type
Definition: propsheet.h:176
#define BTRFS_INODE_COMPRESS
Definition: propsheet.h:87
#define e
Definition: ke_i.h:82
#define S_IRGRP
Definition: propsheet.h:41
#define S_IXOTH
Definition: propsheet.h:61
#define IDC_NODATACOW
Definition: resource.h:221
#define GWLP_USERDATA
Definition: treelist.c:63
struct tagNMLINK * PNMLINK
#define ETDT_ENABLETAB
Definition: dxdiag.c:30
#define IDC_COMPRESS_TYPE
Definition: resource.h:316
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDC_GROUPX
Definition: resource.h:219
#define S_IWGRP
Definition: propsheet.h:45
#define S_IXGRP
Definition: propsheet.h:49
#define IDC_OTHERW
Definition: resource.h:217
#define S_IWUSR
Definition: propsheet.h:33
void set_size_on_disk(HWND hwndDlg)
Definition: propsheet.cpp:695
bool compress_type_changed
Definition: propsheet.h:178
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
HRESULT WINAPI EnableThemeDialogTexture(_In_ HWND hwnd, _In_ DWORD dwFlags)
Definition: uxthemesupp.c:55
#define WM_TIMER
Definition: winuser.h:1724
#define BN_CLICKED
Definition: winuser.h:1907
#define PSNRET_NOERROR
Definition: prsht.h:129
HANDLE thread
Definition: propsheet.h:172
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDC_GROUPW
Definition: resource.h:216
#define S_IXUSR
Definition: propsheet.h:37
#define IDC_STICKY
Definition: resource.h:235
#define S_IROTH
Definition: propsheet.h:53
#define IDC_OPEN_ADMIN
Definition: resource.h:276
GLdouble s
Definition: gl.h:2039
#define WM_COMMAND
Definition: winuser.h:1722
#define BST_UNCHECKED
Definition: winuser.h:199
#define NM_CLICK
Definition: commctrl.h:130
void change_perm_flag(HWND hDlg, ULONG perm, UINT state)
Definition: propsheet.cpp:722
uint8_t compress_type
Definition: propsheet.h:176
#define S_IWOTH
Definition: propsheet.h:57
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_SETUID
Definition: resource.h:229
#define NM_RETURN
Definition: commctrl.h:132
HWND WINAPI GetParent(_In_ HWND)
#define IDC_SIZE_ON_DISK
Definition: resource.h:226
#define uint8_t
Definition: nsiface.idl:59
#define IDC_SETGID
Definition: resource.h:232
#define S_ISUID
Definition: propsheet.h:65
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define S_IRUSR
Definition: propsheet.h:29
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define PSM_CHANGED
Definition: prsht.h:164
#define CBN_SELCHANGE
Definition: winuser.h:1961
void apply_changes(HWND hDlg)
Definition: propsheet.cpp:663
#define IDC_OTHERR
Definition: resource.h:214
#define BST_CHECKED
Definition: winuser.h:197
#define HIWORD(l)
Definition: typedefs.h:246
void init_propsheet(HWND hwndDlg)
Definition: propsheet.cpp:882
#define SetWindowLongPtrW
Definition: winuser.h:5247
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
void open_as_admin(HWND hwndDlg)
Definition: propsheet.cpp:834
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define IDC_OTHERX
Definition: resource.h:220
#define LOWORD(l)
Definition: pedump.c:82
#define PROPSHEETPAGE
Definition: prsht.h:371
#define WM_NOTIFY
Definition: richedit.h:61
#define S_ISVTX
Definition: propsheet.h:73
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by BtrfsPropSheet::AddPages(), and ShowPropSheetW().

◆ set_check_box()

static void set_check_box ( HWND  hwndDlg,
ULONG  id,
uint64_t  min,
uint64_t  max 
)
static

Definition at line 817 of file propsheet.cpp.

817  {
818  if (min && max) {
819  SendDlgItemMessage(hwndDlg, id, BM_SETCHECK, BST_CHECKED, 0);
820  } else if (!min && !max) {
821  SendDlgItemMessage(hwndDlg, id, BM_SETCHECK, BST_UNCHECKED, 0);
822  } else {
823  LONG_PTR style;
824 
825  style = GetWindowLongPtr(GetDlgItem(hwndDlg, id), GWL_STYLE);
827  style |= BS_AUTO3STATE;
828  SetWindowLongPtr(GetDlgItem(hwndDlg, id), GWL_STYLE, style);
829 
831  }
832 }
#define max(a, b)
Definition: svc.c:63
#define SendDlgItemMessage
Definition: winuser.h:5743
#define SetWindowLongPtr
Definition: treelist.c:70
#define BST_INDETERMINATE
Definition: winuser.h:198
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define BS_AUTO3STATE
Definition: pedump.c:657
#define BM_SETCHECK
Definition: winuser.h:1903
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define BST_UNCHECKED
Definition: winuser.h:199
#define GWL_STYLE
Definition: winuser.h:846
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define min(a, b)
Definition: monoChain.cc:55
#define BST_CHECKED
Definition: winuser.h:197
#define GetWindowLongPtr
Definition: treelist.c:73
Arabic default style
Definition: afstyles.h:93

Referenced by BtrfsPropSheet::init_propsheet().

◆ ShowPropSheetW()

void CALLBACK ShowPropSheetW ( HWND  hwnd,
HINSTANCE  hinst,
LPWSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 1311 of file propsheet.cpp.

1311  {
1312  try {
1313  BtrfsPropSheet bps;
1314  PROPSHEETPAGEW psp;
1315  PROPSHEETHEADERW psh;
1316  wstring title;
1317 
1318  set_dpi_aware();
1319 
1321 
1322  bps.set_cmdline(lpszCmdLine);
1323 
1324  psp.dwSize = sizeof(psp);
1325  psp.dwFlags = PSP_USETITLE;
1326  psp.hInstance = module;
1328  psp.hIcon = 0;
1331  psp.pfnCallback = nullptr;
1332  psp.lParam = (LPARAM)&bps;
1333 
1334  memset(&psh, 0, sizeof(PROPSHEETHEADERW));
1335 
1336  psh.dwSize = sizeof(PROPSHEETHEADERW);
1337  psh.dwFlags = PSH_PROPSHEETPAGE;
1338  psh.hwndParent = hwnd;
1339  psh.hInstance = psp.hInstance;
1340  psh.pszCaption = title.c_str();
1341  psh.nPages = 1;
1342  psh.ppsp = &psp;
1343 
1344  PropertySheetW(&psh);
1345  } catch (const exception& e) {
1346  error_message(hwnd, e.what());
1347  }
1348 }
HWND hwndParent
Definition: prsht.h:277
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HMODULE module
Definition: main.cpp:47
void set_cmdline(const wstring &cmdline)
Definition: propsheet.cpp:393
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:290
LPCWSTR pszTemplate
Definition: prsht.h:209
#define IDD_PROP_SHEET
Definition: resource.h:15
struct _PROPSHEETHEADERW PROPSHEETHEADERW
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:738
DWORD dwSize
Definition: prsht.h:205
LPCWSTR pszCaption
Definition: prsht.h:283
DLGPROC pfnDlgProc
Definition: prsht.h:217
#define e
Definition: ke_i.h:82
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2902
LPCWSTR pszTitle
Definition: prsht.h:216
HINSTANCE hInstance
Definition: prsht.h:278
DWORD dwSize
Definition: prsht.h:275
DWORD dwFlags
Definition: prsht.h:276
LPARAM lParam
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:207
#define PSP_USETITLE
Definition: prsht.h:26
#define IDS_STANDALONE_PROPSHEET_TITLE
Definition: resource.h:126
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2870
HICON hIcon
Definition: prsht.h:213
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
Definition: muireg.c:10
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define memset(x, y, z)
Definition: compat.h:39
void set_dpi_aware()
Definition: main.cpp:50
static char title[]
Definition: ps.c:92
DWORD dwFlags
Definition: prsht.h:206
static INT_PTR CALLBACK PropSheetDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.cpp:1045
#define IDS_PROP_SHEET_TITLE
Definition: resource.h:16

◆ SizeDetailsDlgProc()

static INT_PTR CALLBACK SizeDetailsDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 772 of file propsheet.cpp.

772  {
773  try {
774  switch (uMsg) {
775  case WM_INITDIALOG:
776  {
778 
779  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)bps);
780 
781  bps->update_size_details_dialog(hwndDlg);
782 
783  if (bps->thread)
784  SetTimer(hwndDlg, 1, 250, nullptr);
785 
786  return true;
787  }
788 
789  case WM_COMMAND:
790  if (HIWORD(wParam) == BN_CLICKED && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)) {
791  EndDialog(hwndDlg, 0);
792  return true;
793  }
794  break;
795 
796  case WM_TIMER:
797  {
799 
800  if (bps) {
801  bps->update_size_details_dialog(hwndDlg);
802 
803  if (!bps->thread)
804  KillTimer(hwndDlg, 1);
805  }
806 
807  break;
808  }
809  }
810  } catch (const exception& e) {
811  error_message(hwndDlg, e.what());
812  }
813 
814  return false;
815 }
#define IDOK
Definition: winuser.h:824
void update_size_details_dialog(HWND hDlg)
Definition: propsheet.cpp:756
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:738
#define e
Definition: ke_i.h:82
#define GWLP_USERDATA
Definition: treelist.c:63
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_TIMER
Definition: winuser.h:1724
#define BN_CLICKED
Definition: winuser.h:1907
HANDLE thread
Definition: propsheet.h:172
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define WM_COMMAND
Definition: winuser.h:1722
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by PropSheetDlgProc().