ReactOS  0.4.13-dev-479-gec9c8fd
DefragDialog.cpp File Reference
#include "DefragDialog.h"
#include "Defragment.h"
#include "resource.h"
Include dependency graph for DefragDialog.cpp:

Go to the source code of this file.

Functions

void UpdateDefragInfo (HWND Dlg)
 
INT_PTR CALLBACK DefragDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam)
 

Function Documentation

◆ DefragDialogProc()

INT_PTR CALLBACK DefragDialogProc ( HWND  Dlg,
UINT  Msg,
WPARAM  WParam,
LPARAM  LParam 
)

Definition at line 23 of file DefragDialog.cpp.

24 {
25  switch (Msg)
26  {
27  case WM_INITDIALOG:
28  SetWindowLongPtr (Dlg, GWLP_USERDATA, (LONG_PTR)LParam);
29  UpdateDefragInfo (Dlg);
30  return (1);
31 
32  case WM_UPDATEINFO:
33  UpdateDefragInfo (Dlg);
34  return (1);
35  }
36 
37  return (0);
38 }
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
#define WM_UPDATEINFO
Definition: MainDialog.h:8
void UpdateDefragInfo(HWND Dlg)
Definition: DefragDialog.cpp:6
struct @1574 Msg[]
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_INITDIALOG
Definition: winuser.h:1715

◆ UpdateDefragInfo()

void UpdateDefragInfo ( HWND  Dlg)

Definition at line 6 of file DefragDialog.cpp.

7 {
9  HWND PercentItem;
10  char PercentText[100];
11 
13 
14  sprintf (PercentText, "%6.2f%%", Defrag->GetStatusPercent());
15  PercentItem = GetDlgItem (Dlg, IDC_PERCENT);
16  SendMessage (GetDlgItem (Dlg, IDC_PERCENT), WM_SETTEXT, 0, (LPARAM) PercentText);
17  SendMessage (GetDlgItem (Dlg, IDC_STATUS_TEXT), WM_SETTEXT, 0, (LPARAM) Defrag->GetStatusString().c_str());
18 
19  return;
20 }
Defragment * Defrag
Definition: Fraginator.cpp:20
#define sprintf(buf, format,...)
Definition: sprintf.c:55
double GetStatusPercent(void)
Definition: Defragment.cpp:145
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SendMessage
Definition: winuser.h:5709
#define IDC_PERCENT
Definition: resource.h:15
#define GetWindowLongPtr
Definition: treelist.c:73
wstring GetStatusString(void)
Definition: Defragment.cpp:133

Referenced by DefragDialogProc().