ReactOS  0.4.15-dev-4921-g25fcdc5
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
 
struct  _FILE_FS_SIZE_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
 
typedef struct _FILE_FS_SIZE_INFORMATION FILE_FS_SIZE_INFORMATION
 
typedef struct _FILE_FS_SIZE_INFORMATIONPFILE_FS_SIZE_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 918 of file propsheet.cpp.

◆ minor

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

Definition at line 919 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_FS_SIZE_INFORMATION

◆ FILE_STANDARD_INFORMATION

◆ PFILE_ACCESS_INFORMATION

◆ PFILE_FS_SIZE_INFORMATION

◆ PFILE_STANDARD_INFORMATION

Function Documentation

◆ global_search_list_thread()

static DWORD WINAPI global_search_list_thread ( LPVOID  lpParameter)
static

Definition at line 166 of file propsheet.cpp.

166  {
167  BtrfsPropSheet* bps = (BtrfsPropSheet*)lpParameter;
168 
169  return bps->search_list_thread();
170 }
DWORD search_list_thread()
Definition: propsheet.cpp:154

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 558 of file propsheet.cpp.

558  {
559  switch (type) {
560  case BTRFS_TYPE_FILE:
561  return IDS_INODE_FILE;
562 
564  return IDS_INODE_DIR;
565 
566  case BTRFS_TYPE_CHARDEV:
567  return IDS_INODE_CHAR;
568 
569  case BTRFS_TYPE_BLOCKDEV:
570  return IDS_INODE_BLOCK;
571 
572  case BTRFS_TYPE_FIFO:
573  return IDS_INODE_FIFO;
574 
575  case BTRFS_TYPE_SOCKET:
576  return IDS_INODE_SOCKET;
577 
578  case BTRFS_TYPE_SYMLINK:
579  return IDS_INODE_SYMLINK;
580 
581  default:
582  return IDS_INODE_UNKNOWN;
583  }
584 }
#define IDS_INODE_UNKNOWN
Definition: resource.h:27
#define BTRFS_TYPE_SOCKET
Definition: shellext.h:90
#define BTRFS_TYPE_BLOCKDEV
Definition: shellext.h:88
#define IDS_INODE_FIFO
Definition: resource.h:24
#define BTRFS_TYPE_FIFO
Definition: shellext.h:89
#define BTRFS_TYPE_CHARDEV
Definition: shellext.h:87
#define IDS_INODE_SOCKET
Definition: resource.h:25
#define IDS_INODE_SYMLINK
Definition: resource.h:26
#define BTRFS_TYPE_DIRECTORY
Definition: shellext.h:86
#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:85
#define IDS_INODE_CHAR
Definition: resource.h:22
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define BTRFS_TYPE_SYMLINK
Definition: shellext.h:91

Referenced by BtrfsPropSheet::init_propsheet().

◆ PropSheetDlgProc()

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

Definition at line 1087 of file propsheet.cpp.

1087  {
1088  try {
1089  switch (uMsg) {
1090  case WM_INITDIALOG:
1091  {
1093  BtrfsPropSheet* bps = (BtrfsPropSheet*)psp->lParam;
1094 
1096 
1097  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)bps);
1098 
1099  bps->init_propsheet(hwndDlg);
1100 
1101  return false;
1102  }
1103 
1104  case WM_COMMAND:
1105  {
1107 
1108  if (bps && !bps->readonly) {
1109  switch (HIWORD(wParam)) {
1110  case BN_CLICKED: {
1111  switch (LOWORD(wParam)) {
1112  case IDC_NODATACOW:
1114  break;
1115 
1116  case IDC_COMPRESS:
1118 
1120  break;
1121 
1122  case IDC_USERR:
1123  bps->change_perm_flag(hwndDlg, S_IRUSR, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1124  break;
1125 
1126  case IDC_USERW:
1127  bps->change_perm_flag(hwndDlg, S_IWUSR, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1128  break;
1129 
1130  case IDC_USERX:
1131  bps->change_perm_flag(hwndDlg, S_IXUSR, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1132  break;
1133 
1134  case IDC_GROUPR:
1135  bps->change_perm_flag(hwndDlg, S_IRGRP, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1136  break;
1137 
1138  case IDC_GROUPW:
1139  bps->change_perm_flag(hwndDlg, S_IWGRP, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1140  break;
1141 
1142  case IDC_GROUPX:
1143  bps->change_perm_flag(hwndDlg, S_IXGRP, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1144  break;
1145 
1146  case IDC_OTHERR:
1147  bps->change_perm_flag(hwndDlg, S_IROTH, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1148  break;
1149 
1150  case IDC_OTHERW:
1151  bps->change_perm_flag(hwndDlg, S_IWOTH, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1152  break;
1153 
1154  case IDC_OTHERX:
1155  bps->change_perm_flag(hwndDlg, S_IXOTH, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1156  break;
1157 
1158  case IDC_SETUID:
1159  bps->change_perm_flag(hwndDlg, S_ISUID, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1160  break;
1161 
1162  case IDC_SETGID:
1163  bps->change_perm_flag(hwndDlg, S_ISGID, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1164  break;
1165 
1166  case IDC_STICKY:
1167  bps->change_perm_flag(hwndDlg, S_ISVTX, IsDlgButtonChecked(hwndDlg, LOWORD(wParam)));
1168  break;
1169 
1170  case IDC_SUBVOL_RO:
1171  switch (IsDlgButtonChecked(hwndDlg, LOWORD(wParam))) {
1172  case BST_CHECKED:
1173  bps->ro_subvol = true;
1174  bps->ro_changed = true;
1175  break;
1176 
1177  case BST_UNCHECKED:
1178  bps->ro_subvol = false;
1179  bps->ro_changed = true;
1180  break;
1181 
1182  case BST_INDETERMINATE:
1183  bps->ro_changed = false;
1184  break;
1185  }
1186 
1187  SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
1188  break;
1189 
1190  case IDC_OPEN_ADMIN:
1191  bps->open_as_admin(hwndDlg);
1192  break;
1193  }
1194 
1195  break;
1196  }
1197 
1198  case EN_CHANGE: {
1199  switch (LOWORD(wParam)) {
1200  case IDC_UID: {
1201  WCHAR s[255];
1202 
1203  GetDlgItemTextW(hwndDlg, LOWORD(wParam), s, sizeof(s) / sizeof(WCHAR));
1204 
1205  bps->change_uid(hwndDlg, _wtoi(s));
1206  break;
1207  }
1208 
1209  case IDC_GID: {
1210  WCHAR s[255];
1211 
1212  GetDlgItemTextW(hwndDlg, LOWORD(wParam), s, sizeof(s) / sizeof(WCHAR));
1213 
1214  bps->change_gid(hwndDlg, _wtoi(s));
1215  break;
1216  }
1217  }
1218 
1219  break;
1220  }
1221 
1222  case CBN_SELCHANGE: {
1223  switch (LOWORD(wParam)) {
1224  case IDC_COMPRESS_TYPE: {
1225  auto sel = SendMessageW(GetDlgItem(hwndDlg, LOWORD(wParam)), CB_GETCURSEL, 0, 0);
1226 
1227  if (bps->min_compression_type != bps->max_compression_type) {
1228  if (sel == 0)
1229  bps->compress_type_changed = false;
1230  else {
1231  bps->compress_type = (uint8_t)(sel - 1);
1232  bps->compress_type_changed = true;
1233  }
1234  } else {
1235  bps->compress_type = (uint8_t)sel;
1236  bps->compress_type_changed = true;
1237  }
1238 
1239  SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
1240 
1241  break;
1242  }
1243  }
1244 
1245  break;
1246  }
1247  }
1248  }
1249 
1250  break;
1251  }
1252 
1253  case WM_NOTIFY:
1254  {
1255  switch (((LPNMHDR)lParam)->code) {
1256  case PSN_KILLACTIVE:
1257  SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, false);
1258  break;
1259 
1260  case PSN_APPLY: {
1262 
1263  bps->apply_changes(hwndDlg);
1265  break;
1266  }
1267 
1268  case NM_CLICK:
1269  case NM_RETURN: {
1270  if (((LPNMHDR)lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_SIZE_ON_DISK)) {
1271  PNMLINK pNMLink = (PNMLINK)lParam;
1272 
1273  if (pNMLink->item.iLink == 0)
1275  }
1276  break;
1277  }
1278  }
1279  }
1280 
1281  case WM_TIMER:
1282  {
1284 
1285  if (bps) {
1286  bps->set_size_on_disk(hwndDlg);
1287 
1288  if (!bps->thread)
1289  KillTimer(hwndDlg, 1);
1290  }
1291 
1292  break;
1293  }
1294  }
1295  } catch (const exception& e) {
1296  error_message(hwndDlg, e.what());
1297  }
1298 
1299  return false;
1300 }
static INT_PTR CALLBACK SizeDetailsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.cpp:811
#define IDC_USERW
Definition: resource.h:214
void change_uid(HWND hDlg, uint32_t uid)
Definition: propsheet.cpp:777
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define IDC_GROUPR
Definition: resource.h:212
#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:786
#define IDC_UID
Definition: resource.h:209
uint8_t max_compression_type
Definition: propsheet.h:179
#define IDC_USERR
Definition: resource.h:211
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
int iLink
Definition: commctrl.h:4753
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4809
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_SUBVOL_RO
Definition: resource.h:320
#define IDC_USERX
Definition: resource.h:217
#define CB_GETCURSEL
Definition: winuser.h:1930
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:224
void change_inode_flag(HWND hDlg, uint64_t flag, UINT state)
Definition: propsheet.cpp:586
#define IDC_GID
Definition: resource.h:210
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:783
#define PSN_KILLACTIVE
Definition: prsht.h:116
uint8_t min_compression_type
Definition: propsheet.h:179
#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:220
#define GWLP_USERDATA
Definition: treelist.c:63
struct tagNMLINK * PNMLINK
#define ETDT_ENABLETAB
Definition: dxdiag.c:30
#define IDC_COMPRESS_TYPE
Definition: resource.h:318
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDC_GROUPX
Definition: resource.h:218
#define S_IWGRP
Definition: propsheet.h:45
#define S_IXGRP
Definition: propsheet.h:49
#define IDC_OTHERW
Definition: resource.h:216
#define S_IWUSR
Definition: propsheet.h:33
void set_size_on_disk(HWND hwndDlg)
Definition: propsheet.cpp:720
bool compress_type_changed
Definition: propsheet.h:181
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:1729
#define BN_CLICKED
Definition: winuser.h:1912
#define PSNRET_NOERROR
Definition: prsht.h:129
HANDLE thread
Definition: propsheet.h:175
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDC_GROUPW
Definition: resource.h:215
#define S_IXUSR
Definition: propsheet.h:37
#define IDC_STICKY
Definition: resource.h:234
#define S_IROTH
Definition: propsheet.h:53
LPARAM lParam
Definition: prsht.h:227
#define IDC_OPEN_ADMIN
Definition: resource.h:276
GLdouble s
Definition: gl.h:2039
#define WM_COMMAND
Definition: winuser.h:1727
Definition: inflate.c:139
#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:761
uint8_t compress_type
Definition: propsheet.h:179
#define S_IWOTH
Definition: propsheet.h:57
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_SETUID
Definition: resource.h:228
#define NM_RETURN
Definition: commctrl.h:132
HWND WINAPI GetParent(_In_ HWND)
#define IDC_SIZE_ON_DISK
Definition: resource.h:225
#define uint8_t
Definition: nsiface.idl:59
#define IDC_SETGID
Definition: resource.h:231
#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:1966
void apply_changes(HWND hDlg)
Definition: propsheet.cpp:688
#define IDC_OTHERR
Definition: resource.h:213
#define BST_CHECKED
Definition: winuser.h:197
#define HIWORD(l)
Definition: typedefs.h:247
void init_propsheet(HWND hwndDlg)
Definition: propsheet.cpp:921
#define SetWindowLongPtrW
Definition: winuser.h:5326
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
void open_as_admin(HWND hwndDlg)
Definition: propsheet.cpp:873
#define WM_INITDIALOG
Definition: winuser.h:1726
LPARAM lParam
Definition: combotst.c:139
#define IDC_OTHERX
Definition: resource.h:219
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
#define S_ISVTX
Definition: propsheet.h:73
#define EN_CHANGE
Definition: winuser.h:2009

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 856 of file propsheet.cpp.

856  {
857  if (min && max) {
858  SendDlgItemMessageW(hwndDlg, id, BM_SETCHECK, BST_CHECKED, 0);
859  } else if (!min && !max) {
861  } else {
862  LONG_PTR style;
863 
864  style = GetWindowLongPtrW(GetDlgItem(hwndDlg, id), GWL_STYLE);
866  style |= BS_AUTO3STATE;
868 
870  }
871 }
#define max(a, b)
Definition: svc.c:63
#define GetWindowLongPtrW
Definition: winuser.h:4809
#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:1908
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#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 SetWindowLongPtrW
Definition: winuser.h:5326
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 1353 of file propsheet.cpp.

1353  {
1354  try {
1355  BtrfsPropSheet bps;
1356  PROPSHEETPAGEW psp;
1357  PROPSHEETHEADERW psh;
1358  INITCOMMONCONTROLSEX icex;
1359  wstring title;
1360 
1361  set_dpi_aware();
1362 
1364 
1365  bps.set_cmdline(lpszCmdLine);
1366 
1367  icex.dwSize = sizeof(icex);
1368  icex.dwICC = ICC_LINK_CLASS;
1369 
1370  if (!InitCommonControlsEx(&icex))
1372 
1373  psp.dwSize = sizeof(psp);
1374  psp.dwFlags = PSP_USETITLE;
1375  psp.hInstance = module;
1377  psp.hIcon = 0;
1380  psp.pfnCallback = nullptr;
1381  psp.lParam = (LPARAM)&bps;
1382 
1383  memset(&psh, 0, sizeof(PROPSHEETHEADERW));
1384 
1385  psh.dwSize = sizeof(PROPSHEETHEADERW);
1386  psh.dwFlags = PSH_PROPSHEETPAGE;
1387  psh.hwndParent = hwnd;
1388  psh.hInstance = psp.hInstance;
1389  psh.pszCaption = title.c_str();
1390  psh.nPages = 1;
1391  psh.ppsp = &psp;
1392 
1393  if (PropertySheetW(&psh) < 0)
1394  throw last_error(GetLastError());
1395  } catch (const exception& e) {
1396  error_message(hwnd, e.what());
1397  }
1398 }
HWND hwndParent
Definition: prsht.h:295
HMODULE module
Definition: main.cpp:47
void set_cmdline(const wstring &cmdline)
Definition: propsheet.cpp:414
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
LPCWSTR pszTemplate
Definition: prsht.h:218
#define IDD_PROP_SHEET
Definition: resource.h:15
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define IDS_INITCOMMONCONTROLSEX_FAILED
Definition: resource.h:205
struct _PROPSHEETHEADERW PROPSHEETHEADERW
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:783
DWORD dwSize
Definition: prsht.h:214
LPCWSTR pszCaption
Definition: prsht.h:301
DLGPROC pfnDlgProc
Definition: prsht.h:226
#define e
Definition: ke_i.h:82
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
LPCWSTR pszTitle
Definition: prsht.h:225
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
LPARAM lParam
Definition: prsht.h:227
HINSTANCE hInstance
Definition: prsht.h:216
#define PSP_USETITLE
Definition: prsht.h:26
#define IDS_STANDALONE_PROPSHEET_TITLE
Definition: resource.h:127
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2876
HICON hIcon
Definition: prsht.h:222
#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
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
#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:215
static INT_PTR CALLBACK PropSheetDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.cpp:1087
#define ICC_LINK_CLASS
Definition: commctrl.h:74
#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 811 of file propsheet.cpp.

811  {
812  try {
813  switch (uMsg) {
814  case WM_INITDIALOG:
815  {
817 
818  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)bps);
819 
820  bps->update_size_details_dialog(hwndDlg);
821 
822  if (bps->thread)
823  SetTimer(hwndDlg, 1, 250, nullptr);
824 
825  return true;
826  }
827 
828  case WM_COMMAND:
829  if (HIWORD(wParam) == BN_CLICKED && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)) {
830  EndDialog(hwndDlg, 0);
831  return true;
832  }
833  break;
834 
835  case WM_TIMER:
836  {
838 
839  if (bps) {
840  bps->update_size_details_dialog(hwndDlg);
841 
842  if (!bps->thread)
843  KillTimer(hwndDlg, 1);
844  }
845 
846  break;
847  }
848  }
849  } catch (const exception& e) {
850  error_message(hwndDlg, e.what());
851  }
852 
853  return false;
854 }
#define IDOK
Definition: winuser.h:824
void update_size_details_dialog(HWND hDlg)
Definition: propsheet.cpp:795
#define GetWindowLongPtrW
Definition: winuser.h:4809
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:783
#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:1729
#define BN_CLICKED
Definition: winuser.h:1912
HANDLE thread
Definition: propsheet.h:175
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define WM_COMMAND
Definition: winuser.h:1727
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HIWORD(l)
Definition: typedefs.h:247
#define SetWindowLongPtrW
Definition: winuser.h:5326
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1726
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by PropSheetDlgProc().