2 * PROJECT: ReactOS System Control Panel Applet
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/cpl/sysdm/general.c
5 * PURPOSE: General System Information
6 * COPYRIGHT: Copyright Thomas Weidenmueller <w3seek@reactos.org>
7 * Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
14 typedef struct _IMGINFO
23 ShowLastWin32Error(HWND hWndOwner
)
28 LastError
= GetLastError();
30 if((LastError
== 0) ||
31 !FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
|
32 FORMAT_MESSAGE_FROM_SYSTEM
,
35 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
),
43 MessageBox(hWndOwner
, lpMsg
, NULL
, MB_OK
| MB_ICONERROR
);
45 LocalFree((LPVOID
)lpMsg
);
50 InitImageInfo(PIMGINFO ImgInfo
)
54 ZeroMemory(ImgInfo
, sizeof(*ImgInfo
));
56 ImgInfo
->hBitmap
= LoadImage(hApplet
,
57 MAKEINTRESOURCE(IDB_ROSBMP
),
63 if (ImgInfo
->hBitmap
!= NULL
)
65 GetObject(ImgInfo
->hBitmap
, sizeof(BITMAP
), &bitmap
);
67 ImgInfo
->cxSource
= bitmap
.bmWidth
;
68 ImgInfo
->cySource
= bitmap
.bmHeight
;
74 GetSystemInformation(HWND hwnd
)
76 UNREFERENCED_PARAMETER(hwnd
);
82 /* Property page dialog callback */
84 GeneralPageProc(HWND hwndDlg
,
89 static IMGINFO ImgInfo
;
91 UNREFERENCED_PARAMETER(lParam
);
92 UNREFERENCED_PARAMETER(wParam
);
98 InitImageInfo(&ImgInfo
);
99 GetSystemInformation(hwndDlg
);
105 if (LOWORD(wParam
) == IDC_LICENCE
)
108 MAKEINTRESOURCE(IDD_LICENCE
),
118 LPDRAWITEMSTRUCT lpDrawItem
;
119 lpDrawItem
= (LPDRAWITEMSTRUCT
) lParam
;
120 if(lpDrawItem
->CtlID
== IDC_ROSIMG
)
125 /* position image in centre of dialog */
126 left
= (lpDrawItem
->rcItem
.right
- ImgInfo
.cxSource
) / 2;
128 hdcMem
= CreateCompatibleDC(lpDrawItem
->hDC
);
131 SelectObject(hdcMem
, ImgInfo
.hBitmap
);
132 BitBlt(lpDrawItem
->hDC
,
134 lpDrawItem
->rcItem
.top
,
135 lpDrawItem
->rcItem
.right
- lpDrawItem
->rcItem
.left
,
136 lpDrawItem
->rcItem
.bottom
- lpDrawItem
->rcItem
.top
,