Skip to content

Commit

Permalink
Merge pull request ladislav-zezula#19 from jeffbromberger/master
Browse files Browse the repository at this point in the history
Added FlushViewOfFile button to the mapped data editor
  • Loading branch information
ladislav-zezula authored Feb 19, 2023
2 parents 1857c0c + 0ea5e73 commit b193c93
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
23 changes: 21 additions & 2 deletions DlgDataEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ static void OnDestroy(HWND hDlg)
}
}

static int OnFlushViewOfFileClick(HWND hDlg)
{
TDialogData* pData = ((TDialogData*)GetWindowLongPtr(hDlg, DWLP_USER));

FlushViewOfFile(pData->pbFileData, pData->cbFileData);

return TRUE;
}

static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
UINT nIDCtrl;
Expand Down Expand Up @@ -130,8 +139,18 @@ static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
nIDNotify = HIWORD(wParam);
nIDCtrl = LOWORD(wParam);

if(nIDNotify == BN_CLICKED)
EndDialog(hDlg, nIDCtrl);
if (nIDNotify == BN_CLICKED)
{
switch (nIDCtrl)
{
case IDC_FLUSH_VIEW:
OnFlushViewOfFileClick(hDlg);
break;

default:
EndDialog(hDlg, nIDCtrl);
}
}
break;

case WM_DESTROY:
Expand Down
1 change: 1 addition & 0 deletions FileTest.rc
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
CONTROL "",IDC_FILE_DATA,"DataEditor",0x20,7,7,431,255,WS_EX_CLIENTEDGE
LTEXT "",IDC_INFORMATION,7,268,376,14,SS_CENTERIMAGE
PUSHBUTTON "FlushViewOfFile", IDC_FLUSH_VIEW, 7, 268, 80, 14
DEFPUSHBUTTON "Close",IDOK,388,268,50,14
END

Expand Down
1 change: 1 addition & 0 deletions resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
#define IDC_ALLOCATION_TYPE 1204
#define IDC_MAP_VIEW 1205
#define IDC_UNMAP_VIEW 1206
#define IDC_FLUSH_VIEW 1206
#define IDC_MEM_COPY_READ 1207
#define IDC_DATA_EDITOR 1207
#define IDC_MEM_COPY_READ2 1208
Expand Down

0 comments on commit b193c93

Please sign in to comment.