3 * Copyright (C) 2004 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * PROJECT: ReactOS System Control Panel
22 * FILE: lib/cpl/system/general.c
23 * PURPOSE: General System Information
24 * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
36 ShowLastWin32Error(HWND hWndOwner
)
41 LastError
= GetLastError();
43 if((LastError
== 0) || !FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
|
44 FORMAT_MESSAGE_FROM_SYSTEM
, NULL
, LastError
,
45 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
),(LPTSTR
)&lpMsg
, 0,
51 MessageBox(hWndOwner
, lpMsg
, NULL
, MB_OK
| MB_ICONERROR
);
53 LocalFree((LPVOID
)lpMsg
);
59 } OSITINFO
, *POSITINFO
;
62 ObtainSystemInformationThread(POSITINFO posit
)
71 /* load license from resource */
72 if(!(hResInfo
= FindResource(hApplet
, MAKEINTRESOURCE(RC_LICENSE
),
73 MAKEINTRESOURCE(RTDATA
))) ||
74 !(hResMem
= LoadResource(hApplet
, hResInfo
)) ||
75 !(LicenseText
= LockResource(hResMem
)))
77 ShowLastWin32Error(posit
->hDlg
);
80 /* insert the license into the edit control (unicode!) */
81 SetDlgItemText(posit
->hDlg
, IDC_LICENSEMEMO
, LicenseText
);
82 SendDlgItemMessage(posit
->hDlg
, IDC_LICENSEMEMO
, EM_SETSEL
, 0, 0);
87 HeapFree(GetProcessHeap(), 0, posit
);
92 /* Property page dialog callback */
101 UNREFERENCED_PARAMETER(lParam
);
102 UNREFERENCED_PARAMETER(wParam
);
112 posit
= (POSITINFO
)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(OSITINFO
));
115 ShowLastWin32Error(hwndDlg
);
118 posit
->hDlg
= hwndDlg
;
119 Thread
= CreateThread(NULL
,
121 (LPTHREAD_START_ROUTINE
)ObtainSystemInformationThread
,