ReactOS  0.4.14-dev-593-g1793dcc
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 916 of file propsheet.cpp.

◆ minor

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

Definition at line 917 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  {
168 
169  return bps->search_list_thread();
170 }
DWORD search_list_thread()
Definition: propsheet.cpp:154
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 555 of file propsheet.cpp.

555  {
556  switch (type) {
557  case BTRFS_TYPE_FILE:
558  return IDS_INODE_FILE;
559 
561  return IDS_INODE_DIR;
562 
563  case BTRFS_TYPE_CHARDEV:
564  return IDS_INODE_CHAR;
565 
566  case BTRFS_TYPE_BLOCKDEV:
567  return IDS_INODE_BLOCK;
568 
569  case BTRFS_TYPE_FIFO:
570  return IDS_INODE_FIFO;
571 
572  case BTRFS_TYPE_SOCKET:
573  return IDS_INODE_SOCKET;
574 
575  case BTRFS_TYPE_SYMLINK:
576  return IDS_INODE_SYMLINK;
577 
578  default:
579  return IDS_INODE_UNKNOWN;
580  }
581 }
#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
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#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
#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 1085 of file propsheet.cpp.

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

854  {
855  if (min && max) {
856  SendDlgItemMessage(hwndDlg, id, BM_SETCHECK, BST_CHECKED, 0);
857  } else if (!min && !max) {
858  SendDlgItemMessage(hwndDlg, id, BM_SETCHECK, BST_UNCHECKED, 0);
859  } else {
860  LONG_PTR style;
861 
862  style = GetWindowLongPtr(GetDlgItem(hwndDlg, id), GWL_STYLE);
864  style |= BS_AUTO3STATE;
865  SetWindowLongPtr(GetDlgItem(hwndDlg, id), GWL_STYLE, style);
866 
868  }
869 }
#define max(a, b)
Definition: svc.c:63
#define SendDlgItemMessage
Definition: winuser.h:5817
#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 1351 of file propsheet.cpp.

1351  {
1352  try {
1353  BtrfsPropSheet bps;
1354  PROPSHEETPAGEW psp;
1355  PROPSHEETHEADERW psh;
1356  wstring title;
1357 
1358  set_dpi_aware();
1359 
1361 
1362  bps.set_cmdline(lpszCmdLine);
1363 
1364  psp.dwSize = sizeof(psp);
1365  psp.dwFlags = PSP_USETITLE;
1366  psp.hInstance = module;
1368  psp.hIcon = 0;
1371  psp.pfnCallback = nullptr;
1372  psp.lParam = (LPARAM)&bps;
1373 
1374  memset(&psh, 0, sizeof(PROPSHEETHEADERW));
1375 
1376  psh.dwSize = sizeof(PROPSHEETHEADERW);
1377  psh.dwFlags = PSH_PROPSHEETPAGE;
1378  psh.hwndParent = hwnd;
1379  psh.hInstance = psp.hInstance;
1380  psh.pszCaption = title.c_str();
1381  psh.nPages = 1;
1382  psh.ppsp = &psp;
1383 
1384  PropertySheetW(&psh);
1385  } catch (const exception& e) {
1386  error_message(hwnd, e.what());
1387  }
1388 }
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:414
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:785
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:2905
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:127
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2871
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:1085
#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 809 of file propsheet.cpp.

809  {
810  try {
811  switch (uMsg) {
812  case WM_INITDIALOG:
813  {
815 
816  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)bps);
817 
818  bps->update_size_details_dialog(hwndDlg);
819 
820  if (bps->thread)
821  SetTimer(hwndDlg, 1, 250, nullptr);
822 
823  return true;
824  }
825 
826  case WM_COMMAND:
827  if (HIWORD(wParam) == BN_CLICKED && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)) {
828  EndDialog(hwndDlg, 0);
829  return true;
830  }
831  break;
832 
833  case WM_TIMER:
834  {
836 
837  if (bps) {
838  bps->update_size_details_dialog(hwndDlg);
839 
840  if (!bps->thread)
841  KillTimer(hwndDlg, 1);
842  }
843 
844  break;
845  }
846  }
847  } catch (const exception& e) {
848  error_message(hwndDlg, e.what());
849  }
850 
851  return false;
852 }
#define IDOK
Definition: winuser.h:824
void update_size_details_dialog(HWND hDlg)
Definition: propsheet.cpp:793
#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:785
#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:175
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().