1 // This file has been adapted to the Win32 version of Apcupsd
2 // by Kern E. Sibbald. Many thanks to ATT and James Weatherall,
3 // the original author, for providing an excellent template.
5 // Rewrite/Refactoring by Adam Kropelin
7 // Copyright (2007) Adam D. Kropelin
8 // Copyright (2000) Kern E. Sibbald
11 // Implementation of the About dialog
19 // Constructor/destructor
20 upsAbout::upsAbout(HINSTANCE appinst
)
30 // Dialog box handling functions
35 DialogBoxParam(_appinst
,
36 MAKEINTRESOURCE(IDD_ABOUT
),
43 BOOL CALLBACK
upsAbout::DialogProc(
49 // We use the dialog-box's USERDATA to store a _this pointer
50 // This is set only once WM_INITDIALOG has been recieved, though!
51 upsAbout
*_this
= (upsAbout
*)GetWindowLong(hwnd
, GWL_USERDATA
);
56 // Retrieve the Dialog box parameter and use it as a pointer
57 // to the calling vncProperties object
58 SetWindowLong(hwnd
, GWL_USERDATA
, lParam
);
59 _this
= (upsAbout
*)lParam
;
63 snprintf(tmp
, sizeof(tmp
), "Apctray %s (%s)", VERSION
, ADATE
);
64 SendDlgItemMessage(hwnd
, IDC_VERSION
, WM_SETTEXT
, 0, (LONG
)tmp
);
65 SetForegroundWindow(hwnd
);
66 _this
->_dlgvisible
= TRUE
;
70 switch (LOWORD(wParam
))
75 EndDialog(hwnd
, TRUE
);
76 _this
->_dlgvisible
= FALSE
;
82 EndDialog(hwnd
, FALSE
);
83 _this
->_dlgvisible
= FALSE
;