From a54e551b708ac776cf440d150251454d0c31f59a Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Thu, 16 Feb 2006 23:18:11 +0000 Subject: [PATCH] move some files into base/applications svn path=/trunk/; revision=21018 --- reactos/base/applications/devmgr/devmgr.c | 723 +++ reactos/base/applications/devmgr/devmgr.rc | 6 + .../base/applications/devmgr/devmgrapp.xml | 12 + reactos/base/applications/getfirefox/De.rc | 44 + reactos/base/applications/getfirefox/En.rc | 44 + reactos/base/applications/getfirefox/Fr.rc | 45 + reactos/base/applications/getfirefox/Hu.rc | 45 + .../base/applications/getfirefox/firefox.ico | Bin 0 -> 22486 bytes .../base/applications/getfirefox/getfirefox.c | 383 ++ .../applications/getfirefox/getfirefox.rc | 28 + .../applications/getfirefox/getfirefox.xml | 17 + .../base/applications/getfirefox/precomp.h | 19 + .../base/applications/getfirefox/resource.h | 17 + reactos/base/applications/hostname/hostname.c | 58 + .../base/applications/hostname/hostname.rc | 4 + .../base/applications/hostname/hostname.xml | 7 + reactos/base/applications/ibrowser/De.rc | 148 + reactos/base/applications/ibrowser/En.rc | 161 + reactos/base/applications/ibrowser/Es.rc | 122 + reactos/base/applications/ibrowser/Fr.rc | 151 + reactos/base/applications/ibrowser/Hu.rc | 81 + reactos/base/applications/ibrowser/Ja.rc | 140 + .../base/applications/ibrowser/Makefile.MinGW | 67 + .../base/applications/ibrowser/Makefile.PCH | 72 + reactos/base/applications/ibrowser/Ro.rc | 122 + reactos/base/applications/ibrowser/Sv.rc | 140 + .../base/applications/ibrowser/expat.license | 22 + .../base/applications/ibrowser/favorites.cpp | 496 ++ .../base/applications/ibrowser/favorites.h | 104 + .../base/applications/ibrowser/ibrowser.cpp | 550 ++ .../base/applications/ibrowser/ibrowser.dsp | 346 ++ .../base/applications/ibrowser/ibrowser.dsw | 41 + reactos/base/applications/ibrowser/ibrowser.h | 231 + .../base/applications/ibrowser/ibrowser.rc | 13 + .../base/applications/ibrowser/ibrowser.xml | 31 + .../applications/ibrowser/ibrowser_intres.h | 52 + .../applications/ibrowser/ibrowser_intres.rc | 107 + .../base/applications/ibrowser/mainframe.cpp | 791 +++ .../base/applications/ibrowser/mainframe.h | 125 + .../applications/ibrowser/make_ibrowser.dsp | 172 + .../base/applications/ibrowser/precomp.cpp | 28 + reactos/base/applications/ibrowser/precomp.h | 32 + reactos/base/applications/ibrowser/readme.txt | 9 + .../base/applications/ibrowser/res/dot.ico | Bin 0 -> 3750 bytes .../applications/ibrowser/res/dot_red.ico | Bin 0 -> 3750 bytes .../applications/ibrowser/res/dot_trans.ico | Bin 0 -> 3750 bytes .../applications/ibrowser/res/favorites.ico | Bin 0 -> 9374 bytes .../applications/ibrowser/res/ibrowser.ico | Bin 0 -> 50534 bytes .../applications/ibrowser/res/network.ico | Bin 0 -> 9062 bytes .../applications/ibrowser/res/reactos.ico | Bin 0 -> 25214 bytes .../applications/ibrowser/res/toolbar.bmp | Bin 0 -> 4440 bytes .../applications/ibrowser/utility/comutil.h | 321 ++ .../applications/ibrowser/utility/utility.cpp | 419 ++ .../applications/ibrowser/utility/utility.h | 1022 ++++ .../applications/ibrowser/utility/window.cpp | 1206 ++++ .../applications/ibrowser/utility/window.h | 1100 ++++ .../ibrowser/utility/xmlstorage.cpp | 623 +++ .../ibrowser/utility/xmlstorage.h | 1733 ++++++ .../base/applications/ibrowser/webchild.cpp | 309 ++ reactos/base/applications/ibrowser/webchild.h | 1103 ++++ reactos/base/applications/msconfig/De.rc | 155 + reactos/base/applications/msconfig/En.rc | 155 + reactos/base/applications/msconfig/Fr.rc | 96 + reactos/base/applications/msconfig/Hu.rc | 98 + .../base/applications/msconfig/freeldrpage.c | 17 + .../base/applications/msconfig/freeldrpage.h | 3 + .../base/applications/msconfig/generalpage.c | 17 + .../base/applications/msconfig/generalpage.h | 3 + reactos/base/applications/msconfig/msconfig.c | 198 + reactos/base/applications/msconfig/msconfig.h | 2 + .../base/applications/msconfig/msconfig.rc | 19 + .../base/applications/msconfig/msconfig.xml | 26 + reactos/base/applications/msconfig/precomp.h | 19 + reactos/base/applications/msconfig/resource.h | 104 + reactos/base/applications/msconfig/srvpage.c | 251 + reactos/base/applications/msconfig/srvpage.h | 4 + .../base/applications/msconfig/startuppage.c | 123 + .../base/applications/msconfig/startuppage.h | 4 + .../base/applications/msconfig/systempage.c | 17 + .../base/applications/msconfig/systempage.h | 3 + .../base/applications/msconfig/toolspage.c | 124 + .../base/applications/msconfig/toolspage.h | 5 + reactos/base/applications/sc/control.c | 61 + reactos/base/applications/sc/create.c | 58 + reactos/base/applications/sc/delete.c | 42 + reactos/base/applications/sc/query.c | 327 ++ reactos/base/applications/sc/sc.c | 212 + reactos/base/applications/sc/sc.h | 30 + reactos/base/applications/sc/sc.rc | 4 + reactos/base/applications/sc/sc.xml | 17 + reactos/base/applications/sc/start.c | 111 + reactos/base/applications/sc/usage.c | 204 + reactos/base/applications/servman/De.rc | 121 + reactos/base/applications/servman/En.rc | 182 + reactos/base/applications/servman/about.c | 54 + reactos/base/applications/servman/control.c | 138 + reactos/base/applications/servman/geterror.c | 33 + reactos/base/applications/servman/progress.c | 45 + reactos/base/applications/servman/propsheet.c | 295 + reactos/base/applications/servman/query.c | 619 +++ .../base/applications/servman/res/system.ico | Bin 0 -> 29926 bytes .../base/applications/servman/res/toolbar.bmp | Bin 0 -> 3638 bytes reactos/base/applications/servman/resource.h | 105 + reactos/base/applications/servman/servman.c | 552 ++ reactos/base/applications/servman/servman.h | 40 + reactos/base/applications/servman/servman.rc | 17 + reactos/base/applications/servman/servman.xml | 27 + reactos/base/applications/servman/start.c | 132 + reactos/base/applications/winefile/Doxyfile | 1213 ++++ .../base/applications/winefile/Makefile.MinGW | 56 + reactos/base/applications/winefile/Sv.rc | 209 + reactos/base/applications/winefile/cs.rc | 212 + reactos/base/applications/winefile/de.rc | 262 + .../applications/winefile/doxy-footer.html | 16 + .../applications/winefile/doxy-footer.htmt | 16 + .../base/applications/winefile/drivebar.bmp | Bin 0 -> 742 bytes reactos/base/applications/winefile/en.rc | 266 + reactos/base/applications/winefile/es.rc | 258 + reactos/base/applications/winefile/fr.rc | 266 + reactos/base/applications/winefile/hu.rc | 164 + reactos/base/applications/winefile/images.bmp | Bin 0 -> 1158 bytes reactos/base/applications/winefile/it.rc | 183 + reactos/base/applications/winefile/license.c | 56 + .../base/applications/winefile/make-docu.sh | 2 + .../applications/winefile/make_winefile.dsp | 93 + .../base/applications/winefile/makel-docu.bat | 3 + reactos/base/applications/winefile/nl.rc | 160 + reactos/base/applications/winefile/pl.rc | 183 + reactos/base/applications/winefile/pt.rc | 335 ++ reactos/base/applications/winefile/resource.h | 146 + .../base/applications/winefile/resource.rc | 293 + reactos/base/applications/winefile/ru.rc | 160 + reactos/base/applications/winefile/si.rc | 161 + .../base/applications/winefile/splitpath.c | 155 + .../base/applications/winefile/toolbar.bmp | Bin 0 -> 1438 bytes reactos/base/applications/winefile/winefile.c | 4880 +++++++++++++++++ .../base/applications/winefile/winefile.dsp | 274 + .../base/applications/winefile/winefile.dsw | 41 + reactos/base/applications/winefile/winefile.h | 170 + .../base/applications/winefile/winefile.ico | Bin 0 -> 2734 bytes .../base/applications/winefile/winefile.rc | 44 + .../base/applications/winefile/winefile.xml | 19 + reactos/base/applications/winefile/zh.rc | 161 + 143 files changed, 28968 insertions(+) create mode 100644 reactos/base/applications/devmgr/devmgr.c create mode 100644 reactos/base/applications/devmgr/devmgr.rc create mode 100644 reactos/base/applications/devmgr/devmgrapp.xml create mode 100644 reactos/base/applications/getfirefox/De.rc create mode 100644 reactos/base/applications/getfirefox/En.rc create mode 100644 reactos/base/applications/getfirefox/Fr.rc create mode 100644 reactos/base/applications/getfirefox/Hu.rc create mode 100755 reactos/base/applications/getfirefox/firefox.ico create mode 100644 reactos/base/applications/getfirefox/getfirefox.c create mode 100644 reactos/base/applications/getfirefox/getfirefox.rc create mode 100644 reactos/base/applications/getfirefox/getfirefox.xml create mode 100644 reactos/base/applications/getfirefox/precomp.h create mode 100644 reactos/base/applications/getfirefox/resource.h create mode 100644 reactos/base/applications/hostname/hostname.c create mode 100644 reactos/base/applications/hostname/hostname.rc create mode 100644 reactos/base/applications/hostname/hostname.xml create mode 100644 reactos/base/applications/ibrowser/De.rc create mode 100644 reactos/base/applications/ibrowser/En.rc create mode 100644 reactos/base/applications/ibrowser/Es.rc create mode 100644 reactos/base/applications/ibrowser/Fr.rc create mode 100644 reactos/base/applications/ibrowser/Hu.rc create mode 100644 reactos/base/applications/ibrowser/Ja.rc create mode 100644 reactos/base/applications/ibrowser/Makefile.MinGW create mode 100644 reactos/base/applications/ibrowser/Makefile.PCH create mode 100644 reactos/base/applications/ibrowser/Ro.rc create mode 100644 reactos/base/applications/ibrowser/Sv.rc create mode 100644 reactos/base/applications/ibrowser/expat.license create mode 100644 reactos/base/applications/ibrowser/favorites.cpp create mode 100644 reactos/base/applications/ibrowser/favorites.h create mode 100644 reactos/base/applications/ibrowser/ibrowser.cpp create mode 100644 reactos/base/applications/ibrowser/ibrowser.dsp create mode 100644 reactos/base/applications/ibrowser/ibrowser.dsw create mode 100644 reactos/base/applications/ibrowser/ibrowser.h create mode 100644 reactos/base/applications/ibrowser/ibrowser.rc create mode 100644 reactos/base/applications/ibrowser/ibrowser.xml create mode 100644 reactos/base/applications/ibrowser/ibrowser_intres.h create mode 100644 reactos/base/applications/ibrowser/ibrowser_intres.rc create mode 100644 reactos/base/applications/ibrowser/mainframe.cpp create mode 100644 reactos/base/applications/ibrowser/mainframe.h create mode 100644 reactos/base/applications/ibrowser/make_ibrowser.dsp create mode 100644 reactos/base/applications/ibrowser/precomp.cpp create mode 100644 reactos/base/applications/ibrowser/precomp.h create mode 100644 reactos/base/applications/ibrowser/readme.txt create mode 100644 reactos/base/applications/ibrowser/res/dot.ico create mode 100644 reactos/base/applications/ibrowser/res/dot_red.ico create mode 100644 reactos/base/applications/ibrowser/res/dot_trans.ico create mode 100644 reactos/base/applications/ibrowser/res/favorites.ico create mode 100644 reactos/base/applications/ibrowser/res/ibrowser.ico create mode 100644 reactos/base/applications/ibrowser/res/network.ico create mode 100644 reactos/base/applications/ibrowser/res/reactos.ico create mode 100644 reactos/base/applications/ibrowser/res/toolbar.bmp create mode 100644 reactos/base/applications/ibrowser/utility/comutil.h create mode 100644 reactos/base/applications/ibrowser/utility/utility.cpp create mode 100644 reactos/base/applications/ibrowser/utility/utility.h create mode 100644 reactos/base/applications/ibrowser/utility/window.cpp create mode 100644 reactos/base/applications/ibrowser/utility/window.h create mode 100644 reactos/base/applications/ibrowser/utility/xmlstorage.cpp create mode 100644 reactos/base/applications/ibrowser/utility/xmlstorage.h create mode 100644 reactos/base/applications/ibrowser/webchild.cpp create mode 100644 reactos/base/applications/ibrowser/webchild.h create mode 100644 reactos/base/applications/msconfig/De.rc create mode 100644 reactos/base/applications/msconfig/En.rc create mode 100644 reactos/base/applications/msconfig/Fr.rc create mode 100644 reactos/base/applications/msconfig/Hu.rc create mode 100644 reactos/base/applications/msconfig/freeldrpage.c create mode 100644 reactos/base/applications/msconfig/freeldrpage.h create mode 100644 reactos/base/applications/msconfig/generalpage.c create mode 100644 reactos/base/applications/msconfig/generalpage.h create mode 100644 reactos/base/applications/msconfig/msconfig.c create mode 100644 reactos/base/applications/msconfig/msconfig.h create mode 100644 reactos/base/applications/msconfig/msconfig.rc create mode 100644 reactos/base/applications/msconfig/msconfig.xml create mode 100644 reactos/base/applications/msconfig/precomp.h create mode 100644 reactos/base/applications/msconfig/resource.h create mode 100644 reactos/base/applications/msconfig/srvpage.c create mode 100644 reactos/base/applications/msconfig/srvpage.h create mode 100644 reactos/base/applications/msconfig/startuppage.c create mode 100644 reactos/base/applications/msconfig/startuppage.h create mode 100644 reactos/base/applications/msconfig/systempage.c create mode 100644 reactos/base/applications/msconfig/systempage.h create mode 100644 reactos/base/applications/msconfig/toolspage.c create mode 100644 reactos/base/applications/msconfig/toolspage.h create mode 100644 reactos/base/applications/sc/control.c create mode 100644 reactos/base/applications/sc/create.c create mode 100644 reactos/base/applications/sc/delete.c create mode 100644 reactos/base/applications/sc/query.c create mode 100644 reactos/base/applications/sc/sc.c create mode 100644 reactos/base/applications/sc/sc.h create mode 100644 reactos/base/applications/sc/sc.rc create mode 100644 reactos/base/applications/sc/sc.xml create mode 100644 reactos/base/applications/sc/start.c create mode 100644 reactos/base/applications/sc/usage.c create mode 100644 reactos/base/applications/servman/De.rc create mode 100644 reactos/base/applications/servman/En.rc create mode 100644 reactos/base/applications/servman/about.c create mode 100644 reactos/base/applications/servman/control.c create mode 100644 reactos/base/applications/servman/geterror.c create mode 100644 reactos/base/applications/servman/progress.c create mode 100644 reactos/base/applications/servman/propsheet.c create mode 100644 reactos/base/applications/servman/query.c create mode 100644 reactos/base/applications/servman/res/system.ico create mode 100644 reactos/base/applications/servman/res/toolbar.bmp create mode 100644 reactos/base/applications/servman/resource.h create mode 100644 reactos/base/applications/servman/servman.c create mode 100644 reactos/base/applications/servman/servman.h create mode 100644 reactos/base/applications/servman/servman.rc create mode 100644 reactos/base/applications/servman/servman.xml create mode 100644 reactos/base/applications/servman/start.c create mode 100644 reactos/base/applications/winefile/Doxyfile create mode 100644 reactos/base/applications/winefile/Makefile.MinGW create mode 100644 reactos/base/applications/winefile/Sv.rc create mode 100644 reactos/base/applications/winefile/cs.rc create mode 100644 reactos/base/applications/winefile/de.rc create mode 100644 reactos/base/applications/winefile/doxy-footer.html create mode 100644 reactos/base/applications/winefile/doxy-footer.htmt create mode 100644 reactos/base/applications/winefile/drivebar.bmp create mode 100644 reactos/base/applications/winefile/en.rc create mode 100644 reactos/base/applications/winefile/es.rc create mode 100644 reactos/base/applications/winefile/fr.rc create mode 100644 reactos/base/applications/winefile/hu.rc create mode 100644 reactos/base/applications/winefile/images.bmp create mode 100644 reactos/base/applications/winefile/it.rc create mode 100644 reactos/base/applications/winefile/license.c create mode 100755 reactos/base/applications/winefile/make-docu.sh create mode 100644 reactos/base/applications/winefile/make_winefile.dsp create mode 100755 reactos/base/applications/winefile/makel-docu.bat create mode 100644 reactos/base/applications/winefile/nl.rc create mode 100644 reactos/base/applications/winefile/pl.rc create mode 100644 reactos/base/applications/winefile/pt.rc create mode 100644 reactos/base/applications/winefile/resource.h create mode 100644 reactos/base/applications/winefile/resource.rc create mode 100644 reactos/base/applications/winefile/ru.rc create mode 100644 reactos/base/applications/winefile/si.rc create mode 100644 reactos/base/applications/winefile/splitpath.c create mode 100644 reactos/base/applications/winefile/toolbar.bmp create mode 100644 reactos/base/applications/winefile/winefile.c create mode 100644 reactos/base/applications/winefile/winefile.dsp create mode 100644 reactos/base/applications/winefile/winefile.dsw create mode 100644 reactos/base/applications/winefile/winefile.h create mode 100644 reactos/base/applications/winefile/winefile.ico create mode 100644 reactos/base/applications/winefile/winefile.rc create mode 100644 reactos/base/applications/winefile/winefile.xml create mode 100644 reactos/base/applications/winefile/zh.rc diff --git a/reactos/base/applications/devmgr/devmgr.c b/reactos/base/applications/devmgr/devmgr.c new file mode 100644 index 00000000000..0b2bf6e5f3f --- /dev/null +++ b/reactos/base/applications/devmgr/devmgr.c @@ -0,0 +1,723 @@ +/* Device manager + * (C) 2005 - Hervé Poussineau (hpoussin@reactos.org) + * GUI: Michael Fritscher (michael@fritscher.net) + * + */ + +#define INITGUID +#include +#include +#include +#include +#include +#include +#include +#if defined (__GNUC__) +#include +#endif + +/* FIXME: should be in cfgmgr32.h */ +typedef DWORD CONFIGRET; +typedef DWORD DEVINST, *PDEVINST; +#define CM_DRP_DEVICEDESC 0x00000001 +#define MAX_DEVICE_ID_LEN 200 +#define MAX_CLASS_NAME_LEN 32 +#define CR_SUCCESS 0x00000000 +#define CR_NO_SUCH_DEVINST 0x0000000D +#define CR_NO_SUCH_VALUE 0x00000025 +#ifdef _UNICODE +typedef WCHAR *DEVINSTID_W; +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW(DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG); +CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST, DEVINSTID_W, ULONG); +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyW +#define CM_Locate_DevNode CM_Locate_DevNodeW +#else +typedef CHAR *DEVINSTID_A; +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA(DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG); +CONFIGRET WINAPI CM_Locate_DevNodeA(PDEVINST, DEVINSTID_A, ULONG); +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyA +#define CM_Locate_DevNode CM_Locate_DevNodeA +#endif +CONFIGRET WINAPI CM_Enumerate_Classes(ULONG, LPGUID, ULONG); +CONFIGRET WINAPI CM_Get_Child(PDEVINST, DEVINST, ULONG); +CONFIGRET WINAPI CM_Get_Sibling(PDEVINST, DEVINST, ULONG); +/* end of cfgmgr32.h */ + +/************************************************************************** + Function Prototypes +**************************************************************************/ + +BOOL InitApplication(HINSTANCE); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM); +void CreateListView(HINSTANCE, HWND); +void ResizeListView(HWND); +BOOL InitListView(); +void InsertIntoListView(int, LPTSTR, LPTSTR); + + +LRESULT ListViewNotify(HWND, LPARAM); +void SwitchView(HWND, DWORD); +BOOL DoContextMenu(HWND, WPARAM, LPARAM); +void UpdateMenu(HWND, HMENU); +BOOL InsertListViewItems(); +void PositionHeader(); + +void CreateButtons(); +void ListByClass(); + +/************************************************************************** + Global Variables +**************************************************************************/ + +HINSTANCE g_hInst; +TCHAR g_szClassName[] = TEXT("VListVwClass"); +HWND hWnd; +HWND hwndListView; +HWND hwndButtonListByClass; +HWND hwndButtonListByConnection; +HWND hwndButtonListByInterface; +HWND hwndButtonExit; +TCHAR temp [255]; +HDC hDC; +TCHAR empty [255] = TEXT(" "); + +void ListByClass() +{ + GUID ClassGuid; + TCHAR ClassDescription[MAX_PATH]; + TCHAR ClassName[MAX_CLASS_NAME_LEN]; + TCHAR PropertyBuffer[256]; + HKEY KeyClass; + HDEVINFO hDevInfo; + SP_DEVINFO_DATA DeviceInfoData; + int i = 0, j; + long Size; + long rc; + + SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0); + + ListView_DeleteAllItems(hwndListView); + while (1) + { + CONFIGRET res; + res = CM_Enumerate_Classes(i, &ClassGuid, 0); + if (res == CR_NO_SUCH_VALUE) + break; + + i++; + ClassName[0] = '\0'; + if (!SetupDiClassNameFromGuid( + &ClassGuid, + ClassName, + sizeof(ClassName) / sizeof(ClassName[0]), + NULL)) + { + _tprintf(_T("SetupDiClassNameFromGuid() failed with status 0x%lx\n"), GetLastError()); + continue; + } + + /* Get class description */ + KeyClass = SetupDiOpenClassRegKey( + &ClassGuid, + KEY_READ); + if (KeyClass == INVALID_HANDLE_VALUE) + { + _tprintf(_T("SetupDiOpenClassRegKey() failed with status 0x%lx\n"), GetLastError()); + continue; + } + Size = sizeof(ClassDescription); + rc = RegQueryValue(KeyClass, NULL, ClassDescription, &Size); + if (rc == ERROR_SUCCESS) + { + InsertIntoListView(i,ClassDescription,ClassName); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, ClassDescription, strlen(ClassDescription)); + _tprintf(_T("%d %s (%s)\n"), i, ClassName, ClassDescription); + } + else + _tprintf(_T("RegQueryValue() failed with status 0x%lx\n"), rc); + RegCloseKey(KeyClass); + + /* Enumerate devices in the class */ + hDevInfo = SetupDiGetClassDevs( + &ClassGuid, + NULL, /* Enumerator */ + NULL, /* hWnd parent */ + DIGCF_PRESENT); + if (hDevInfo == INVALID_HANDLE_VALUE) + continue; + + j = 0; + while (1) + { + DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + if (!SetupDiEnumDeviceInfo( + hDevInfo, + j, + &DeviceInfoData)) + { + break; + } + j++; + if (SetupDiGetDeviceRegistryProperty( + hDevInfo, + &DeviceInfoData, + SPDRP_DEVICEDESC, + NULL, /* Property reg data type */ + (PBYTE)PropertyBuffer, + sizeof(PropertyBuffer), + NULL) /* Required size */) + { + _tprintf(_T("- %s\n"), PropertyBuffer); + InsertIntoListView(0,PropertyBuffer," "); + } + else if (SetupDiGetDeviceRegistryProperty( + hDevInfo, + &DeviceInfoData, + SPDRP_PHYSICAL_DEVICE_OBJECT_NAME, + NULL, /* Property reg data type */ + (PBYTE)PropertyBuffer, + sizeof(PropertyBuffer), + NULL) /* Required size */) + { + _tprintf(_T("- %s\n"), PropertyBuffer); + InsertIntoListView(0,PropertyBuffer," "); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, PropertyBuffer, strlen(PropertyBuffer)); + } + else + _tprintf(_T("SetupDiGetDeviceRegistryProperty() failed with status 0x%lx\n"), GetLastError()); + } + SetupDiDestroyDeviceInfoList(hDevInfo); + } + SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0); +} + +CONFIGRET GetDeviceName(DEVINST DevInst, LPTSTR Buffer, DWORD BufferLength) +{ + ULONG BufferSize = BufferLength * sizeof(TCHAR); + CONFIGRET cr; + cr = CM_Get_DevNode_Registry_Property(DevInst, CM_DRP_DEVICEDESC, NULL, Buffer, &BufferSize, 0); + if (cr != CR_SUCCESS) + { + _tprintf(_T("CM_Get_DevNode_Registry_Property() failed, cr= 0x%lx\n"), cr); + } + return cr; +} + +CONFIGRET ListSubNodes(DEVINST parent, DWORD Level) +{ + CONFIGRET cr; + DEVINST child; + + cr = CM_Get_Child(&child, parent, 0); + if (cr == CR_NO_SUCH_DEVINST) + return CR_SUCCESS; + else if (cr != CR_SUCCESS) + { + _tprintf(_T("CM_Get_Child() failed, cr= 0x%lx\n"), cr); + return cr; + } + + do + { +#define DISPLAY_LENGTH (MAX_PATH + MAX_DEVICE_ID_LEN) + DWORD DisplayLength = DISPLAY_LENGTH; + TCHAR DisplayName[DISPLAY_LENGTH]; + ULONG i = Level; + TCHAR LevelSpaces [ 255 ]; + cr = GetDeviceName(child, DisplayName, DisplayLength); + LevelSpaces[0] = '\0'; + while (i-- != 0) + { + _tprintf(_T(" ")); + sprintf(LevelSpaces,"%s%s",LevelSpaces," "); + } + if (cr == CR_SUCCESS) + { + _tprintf(_T("%s\n"), DisplayName); + sprintf(temp,"%s%s",LevelSpaces,DisplayName); + InsertIntoListView(0,temp," "); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, DisplayName, strlen(DisplayName)); + } + else + { + _tprintf(_T("(unknown device)\n")); + sprintf(temp,"%s%s",LevelSpaces,"(unknown device)"); + InsertIntoListView(0,temp," "); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, "(unknown device)", strlen("(unknown device)")); + } + cr = ListSubNodes(child, Level + 1); + if (cr != CR_SUCCESS) + return cr; + cr = CM_Get_Sibling(&child, child, 0); + if (cr != CR_SUCCESS && cr != CR_NO_SUCH_DEVINST) + { + _tprintf(_T("CM_Get_Sibling() failed, cr= 0x%lx\n"), cr); + return cr; + } + } while (cr == CR_SUCCESS); + return CR_SUCCESS; +} + +int ListByConnection() +{ + CONFIGRET cr; + DEVINST root; + ListView_DeleteAllItems(hwndListView); + + cr = CM_Locate_DevNode(&root, NULL, 0); + + if (cr != CR_SUCCESS) + { + _tprintf(_T("CM_Locate_DevNode() failed, cr= 0x%lx\n"), cr); + return 1; + } + SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0); + cr = ListSubNodes(root, 0); + SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0); + if (cr != CR_SUCCESS) + return 2; + return 0; +} + +int ListByInterface(const GUID* guid) +{ + HDEVINFO hDevInfo; + CHAR Buffer[sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + 0x100]; + PSP_DEVICE_INTERFACE_DETAIL_DATA DeviceInterfaceDetailData; + DWORD i; + SP_DEVICE_INTERFACE_DATA DeviceInterfaceData; + + ListView_DeleteAllItems(hwndListView); + + DeviceInterfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA)Buffer; + DeviceInterfaceDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); + + hDevInfo = SetupDiGetClassDevs( + guid, + NULL, /* Enumerator */ + NULL, /* hwndParent */ + DIGCF_DEVICEINTERFACE); + if (hDevInfo == INVALID_HANDLE_VALUE) + { + printf("SetupDiGetClassDevs() failed with status 0x%lx\n", GetLastError()); + return 1; + } + + i = 0; + DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0); + while (TRUE) + { + if (!SetupDiEnumDeviceInterfaces( + hDevInfo, + NULL, + guid, + i, + &DeviceInterfaceData)) + { + if (GetLastError() != ERROR_NO_MORE_ITEMS) + printf("SetupDiEnumDeviceInterfaces() failed with status 0x%lx\n", GetLastError()); + break; + } + i++; + if (SetupDiGetDeviceInterfaceDetail(hDevInfo, &DeviceInterfaceData, DeviceInterfaceDetailData, sizeof(Buffer), NULL, NULL)) + { + _tprintf(_T("- device %-2ld: %s\n"), i, DeviceInterfaceDetailData->DevicePath); + TextOut(hDC, 200, 40, empty, strlen(empty)); + TextOut(hDC, 200, 40, DeviceInterfaceDetailData->DevicePath, strlen(DeviceInterfaceDetailData->DevicePath)); + InsertIntoListView(i,DeviceInterfaceDetailData->DevicePath," "); + } + else + { + _tprintf(_T("- device %ld\n"), i); + InsertIntoListView(i," "," "); + } + + } + SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0); + SetupDiDestroyDeviceInfoList(hDevInfo); + return 0; +} + +/*int main(void) +{ + ListByClass(); + ListByInterface(&GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR); + ListByConnection(); + return 0; +}*/ + + + +//GUI +int WINAPI WinMain( HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ +MSG msg; + +g_hInst = hInstance; + +if(!hPrevInstance) + if(!InitApplication(hInstance)) + return FALSE; + +//required to use the common controls +InitCommonControls(); + +/* Perform initializations that apply to a specific instance */ + +if (!InitInstance(hInstance, nCmdShow)) + return FALSE; + +/* Acquire and dispatch messages until a WM_QUIT uMessage is received. */ + +while(GetMessage( &msg, NULL, 0x00, 0x00)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + +return (int)msg.wParam; +} + +BOOL InitApplication(HINSTANCE hInstance) +{ +WNDCLASSEX wcex; +ATOM aReturn; + +wcex.cbSize = sizeof(WNDCLASSEX); +wcex.style = 0; +wcex.lpfnWndProc = (WNDPROC)MainWndProc; +wcex.cbClsExtra = 0; +wcex.cbWndExtra = 0; +wcex.hInstance = hInstance; +wcex.hCursor = LoadCursor(NULL, IDC_ARROW); +wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW ); +wcex.lpszMenuName = 0; +wcex.lpszClassName = g_szClassName; +wcex.hIcon = 0; +wcex.hIconSm = 0; + +aReturn = RegisterClassEx(&wcex); + +if(0 == aReturn) + { + WNDCLASS wc; + + wc.style = 0; + wc.lpfnWndProc = (WNDPROC)MainWndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH)(COLOR_WINDOW); + wc.lpszMenuName = 0; + wc.lpszClassName = g_szClassName; + + aReturn = RegisterClass(&wc); + } + +return aReturn; +} + +BOOL InitInstance( HINSTANCE hInstance, + int nCmdShow) +{ +HWND hWnd; +TCHAR szTitle[MAX_PATH] = TEXT("Device viewer"); + +g_hInst = hInstance; + +/* Create a main window for this application instance. */ +hWnd = CreateWindowEx( 0, + g_szClassName, + szTitle, + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + NULL, + NULL, + hInstance, + NULL); + +/* If window could not be created, return "failure" */ + +if (!hWnd) + return FALSE; + +/* Make the window visible; update its client area; and return "success" */ + +ShowWindow(hWnd, nCmdShow); +UpdateWindow(hWnd); +hDC = GetDC(hWnd); +return TRUE; + +} + +LRESULT CALLBACK MainWndProc( HWND hWnd, + UINT uMessage, + WPARAM wParam, + LPARAM lParam) +{ + + +switch (uMessage) + { + case WM_CREATE: + // create the TreeView control + CreateListView(g_hInst, hWnd); + + //initialize the TreeView control + InitListView(); + + CreateButtons(g_hInst, hWnd); + TextOut(hDC, 200, 40, empty, strlen(empty)); + break; + + + case WM_SIZE: + ResizeListView(hWnd); + break; + case WM_DESTROY: + ReleaseDC(hWnd, hDC); + PostQuitMessage(0); + break; + case WM_COMMAND: + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonListByClass) + { + ListByClass(); + } + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonListByConnection) + { + ListByConnection(); + } + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonListByInterface) + { + ListByInterface(&GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR); + } + if (HIWORD(wParam) == BN_CLICKED && + (HWND) lParam == hwndButtonExit) + { + /* Close the window. */ + DestroyWindow (hWnd); + } return 0; + break; + default: + break; + } +return DefWindowProc(hWnd, uMessage, wParam, lParam); +} + +void CreateListView(HINSTANCE hInstance, HWND hwndParent) +{ +DWORD dwStyle; + +dwStyle = WS_TABSTOP | + WS_CHILD | + WS_BORDER | + WS_VISIBLE | + LVS_AUTOARRANGE | + LVS_REPORT ;//| + //LVS_OWNERDATA; + +hwndListView = CreateWindowEx( WS_EX_CLIENTEDGE, // ex style + WC_LISTVIEW, // class name - defined in commctrl.h + TEXT(""), // dummy text + dwStyle, // style + 0, // x position + 0, // y position + 0, // width + 0, // height + hwndParent, // parent + 0,//(HMENU)ID_LISTVIEW, // ID + g_hInst, // instance + NULL); // no extra data + + +ResizeListView(hwndParent); +} + +void ResizeListView(HWND hwndParent) +{ +RECT rc; + +GetClientRect(hwndParent, &rc); + +MoveWindow( hwndListView, + rc.left, + rc.top+60, + rc.right - rc.left, + rc.bottom - rc.top-60, + TRUE); +} + +void PositionHeader() +{ +HWND hwndHeader = GetWindow(hwndListView, GW_CHILD); +DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE); + +/*To ensure that the first item will be visible, create the control without +the LVS_NOSCROLL style and then add it here*/ +dwStyle |= LVS_NOSCROLL; +SetWindowLong(hwndListView, GWL_STYLE, dwStyle); + +//only do this if we are in report view and were able to get the header hWnd +if(((dwStyle & LVS_TYPEMASK) == LVS_REPORT) && hwndHeader) + { + RECT rc; + HD_LAYOUT hdLayout; + WINDOWPOS wpos; + + GetClientRect(hwndListView, &rc); + hdLayout.prc = &rc; + hdLayout.pwpos = &wpos; + + Header_Layout(hwndHeader, &hdLayout); + + SetWindowPos( hwndHeader, + wpos.hwndInsertAfter, + wpos.x, + wpos.y, + wpos.cx, + wpos.cy, + wpos.flags | SWP_SHOWWINDOW); + + ListView_EnsureVisible(hwndListView, 0, FALSE); + } +} + +BOOL InitListView() +{ +LV_COLUMN lvColumn; +int i; +TCHAR szString[3][20] = {TEXT("#"), TEXT("Name"), TEXT("Intern name")}; + +//empty the list +ListView_DeleteAllItems(hwndListView); + +//initialize the columns +lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; +lvColumn.fmt = LVCFMT_LEFT; +i=0; +lvColumn.cx = 20; +lvColumn.pszText = szString[i]; +ListView_InsertColumn(hwndListView, i, &lvColumn); +i=1; +lvColumn.cx = 400; +lvColumn.pszText = szString[i]; +ListView_InsertColumn(hwndListView, i, &lvColumn); +i=2; +lvColumn.cx = 150; +lvColumn.pszText = szString[i]; +ListView_InsertColumn(hwndListView, i, &lvColumn); + + +return TRUE; +} + +typedef struct tagLINE_INFO +{ + DWORD dwValType; + LPTSTR name; + void* val; + size_t val_len; +} LINE_INFO, *PLINE_INFO; + +void InsertIntoListView(int typ, LPTSTR name, LPTSTR intern_name) +{ + //MessageBox(hWnd, "You just pressed Ctrl+a", "Hotkey", MB_OK | MB_ICONINFORMATION); + TCHAR temp[ 255 ]; + //LINE_INFO* linfo; + LVITEM item; + int index; + //linfo->name = Name; + item.mask = LVIF_TEXT; + item.iItem = 9999; + item.iSubItem = 0; + item.state = 0; + //item.statemask = 0; + item.pszText=malloc(10); + if (typ>=1) + { + sprintf(temp,"%i",typ); + item.pszText = temp; + } + else + item.pszText = ""; + item.cchTextMax = _tcslen(item.pszText); + if (item.cchTextMax == 0) + item.pszText = LPSTR_TEXTCALLBACK; + item.iImage = 0; + //item.iIdent = 0; + //item.iGroupId = 0; + //item.cColumns = 0 ; + //item.puColumns = 0; + //item.lParam = (LPARAM)linfo; + index = ListView_InsertItem(hwndListView, &item); + ListView_SetItemText(hwndListView, index, 1, name); + ListView_SetItemText(hwndListView, index, 2, intern_name); +} + + + +void CreateButtons(HINSTANCE hInstance, HWND hwndParent) +{ + + hwndButtonListByClass = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "List by Class", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 0, 0, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); + hwndButtonListByConnection = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "List by Connection", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 200, 0, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); + hwndButtonListByInterface = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "List by Interface", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 400, 0, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); + hwndButtonExit = CreateWindowEx ( + 0, + "button", /* Builtin button class */ + "Exit", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 0, 30, 190, 30, + hwndParent, /* Parent is this window. */ + 0, /* Control ID: 1 */ + g_hInst, + NULL + ); +} diff --git a/reactos/base/applications/devmgr/devmgr.rc b/reactos/base/applications/devmgr/devmgr.rc new file mode 100644 index 00000000000..0ff0c3f9dd1 --- /dev/null +++ b/reactos/base/applications/devmgr/devmgr.rc @@ -0,0 +1,6 @@ +/* $Id$ */ + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS W32 Device Manager Utility\0" +#define REACTOS_STR_INTERNAL_NAME "devmgr\0" +#define REACTOS_STR_ORIGINAL_FILENAME "devmgr.exe\0" +#include diff --git a/reactos/base/applications/devmgr/devmgrapp.xml b/reactos/base/applications/devmgr/devmgrapp.xml new file mode 100644 index 00000000000..e9380871b1f --- /dev/null +++ b/reactos/base/applications/devmgr/devmgrapp.xml @@ -0,0 +1,12 @@ + + + + ntdll + setupapi + gdi32 + kernel32 + user32 + comctl32 + devmgr.c + devmgr.rc + diff --git a/reactos/base/applications/getfirefox/De.rc b/reactos/base/applications/getfirefox/De.rc new file mode 100644 index 00000000000..87864c59650 --- /dev/null +++ b/reactos/base/applications/getfirefox/De.rc @@ -0,0 +1,44 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/En.rc + * PURPOSE: English resources + * COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers + * Copyright 2005 Ge van Geldorp (gvg@reactos.org) + */ +/* + * Based on Wine dlls/shdocvw/En.rc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT + +IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 +STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Lade Firefox herunter" +FONT 8, "MS Shell Dlg" +{ + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12 + LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER + CHECKBOX "Entferne ""Get Firefox"" nach Fertigstellung aus dem Startmenü", IDC_REMOVE, + 10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE +BEGIN + IDS_START_MENU_NAME "Get Firefox" +END diff --git a/reactos/base/applications/getfirefox/En.rc b/reactos/base/applications/getfirefox/En.rc new file mode 100644 index 00000000000..3b8b3108fd2 --- /dev/null +++ b/reactos/base/applications/getfirefox/En.rc @@ -0,0 +1,44 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/En.rc + * PURPOSE: English resources + * COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers + * Copyright 2005 Ge van Geldorp (gvg@reactos.org) + */ +/* + * Based on Wine dlls/shdocvw/En.rc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 +STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Downloading Firefox" +FONT 8, "MS Shell Dlg" +{ + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12 + LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER + CHECKBOX "Remove ""Get Firefox"" from Start Menu when done", IDC_REMOVE, + 10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE +BEGIN + IDS_START_MENU_NAME "Get Firefox" +END diff --git a/reactos/base/applications/getfirefox/Fr.rc b/reactos/base/applications/getfirefox/Fr.rc new file mode 100644 index 00000000000..4d6e3b8ccf8 --- /dev/null +++ b/reactos/base/applications/getfirefox/Fr.rc @@ -0,0 +1,45 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/En.rc + * PURPOSE: French resources + * COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers + * Copyright 2005 Ge van Geldorp (gvg@reactos.org) + * Copyright 2005 G. Maton (mustang9@gmail.com) - French translation + */ +/* + * Based on Wine dlls/shdocvw/En.rc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT + +IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 +STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Téléchargement de Firefox" +FONT 8, "MS Shell Dlg" +{ + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12 + LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER + CHECKBOX "Supprimer ""Obtenir Firefox"" du Menu démarrer une fois terminé", IDC_REMOVE, + 10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Annuler", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE +BEGIN + IDS_START_MENU_NAME "Obtenir Firefox" +END diff --git a/reactos/base/applications/getfirefox/Hu.rc b/reactos/base/applications/getfirefox/Hu.rc new file mode 100644 index 00000000000..0324218b810 --- /dev/null +++ b/reactos/base/applications/getfirefox/Hu.rc @@ -0,0 +1,45 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/En.rc + * PURPOSE: English resources + * COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers + * Copyright 2005 Ge van Geldorp (gvg@reactos.org) + * Copyright 2005 Robert Horvath (talley@cubeclub.hu) - Hungarian translation + */ +/* + * Based on Wine dlls/shdocvw/En.rc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_HUNGARIAN, SUBLANG_NEUTRAL + +IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 +STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "A Firefox letöltése" +FONT 8, "MS Shell Dlg" +{ + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12 + LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER + CHECKBOX "A ""Szerezd meg a Firefoxot"" elvátolítása a Start Menübõl befejezés után", IDC_REMOVE, + 10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Mégse", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE +BEGIN + IDS_START_MENU_NAME "Szerezd meg Firefoxot" +END diff --git a/reactos/base/applications/getfirefox/firefox.ico b/reactos/base/applications/getfirefox/firefox.ico new file mode 100755 index 0000000000000000000000000000000000000000..0518438a040d8fa9b5523893e9edbcf9faf9a38c GIT binary patch literal 22486 zcmeHv2UwOz_V3{X1VM^)L@CmXXhg7J#e#rXKvY0Q!Ga(v2x39Oh7D|>*hLhiD1snX z1bfF`5@R%dlWY=`Y)PGSfAa#C#LaGY_kW*z?{mlJFz@%iQ_h?@GjqxuiPWeCb?QXO zwW(O2XbKV8+BW^xCek+`GBj-b9ji%HV@^%wZK>Fi$huu~dHhDXi+;`JZ7EiRXhtZJ z3)(~%Gyx#{QBupsO!=#ZzY>si0Y(5TfIYw+V5g@?UdVk_L~afa)Y;RMx&wLx@qXwd z5Z?x%*`QWL=#It$LebDzz)-^$6l$bK5oSb@mUwTfO`|MYQlym*4KOjGU}Iw%Wok;3 z(El`yF9CICVazec_-#rw5#vk3^BmNjhvz6;J(_Gs6o;`VxT2iB9>u$9Q;Gx8!uCXo z9gw>brM!jm-gxe=Mzg*2XpxUDO?EP*cn>2=_A#L$4)zq}?oOj!U1VY-wXqE0(OwCx~T zPG~FIJVp=Cy0pB1Yg#?fm@)^OQdXb|EgsN@mJhb1l|k)j!%$Po9$`sa#+Xt5X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whk5I_ z>GH9vc3We*l%HPR?H9yMGvcG+i-=~#QuE0r_CMxL?YjN$)l0Ze`upj@*;Dqn%2&kR xDNS1WuyRi3{Ud89KDvDFHQl_qh38PvpJ602W;FxUl<<#I^LJTR*7+WF{};EUKvMt! literal 0 HcmV?d00001 diff --git a/reactos/base/applications/getfirefox/getfirefox.c b/reactos/base/applications/getfirefox/getfirefox.c new file mode 100644 index 00000000000..40d758f43fa --- /dev/null +++ b/reactos/base/applications/getfirefox/getfirefox.c @@ -0,0 +1,383 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/getfirefox.c + * PURPOSE: Main program + * COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers) + * Copyright 2004 Mike McCormack (for CodeWeavers) + * Copyright 2005 Ge van Geldorp (gvg@reactos.org) + */ +/* + * Based on Wine dlls/shdocvw/shdocvw_main.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include + +#define NDEBUG +#include + +#define DOWNLOAD_URL L"http://links.reactos.org/getfirefox" + +typedef struct _IBindStatusCallbackImpl + { + const IBindStatusCallbackVtbl *vtbl; + LONG ref; + HWND hDialog; + BOOL *pbCancelled; + } IBindStatusCallbackImpl; + +static HRESULT WINAPI +dlQueryInterface(IBindStatusCallback* This, REFIID riid, void** ppvObject) +{ + if (NULL == ppvObject) + { + return E_POINTER; + } + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IBindStatusCallback)) + { + IBindStatusCallback_AddRef( This ); + *ppvObject = This; + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI +dlAddRef(IBindStatusCallback* iface) +{ + IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; + + return InterlockedIncrement(&This->ref); +} + +static ULONG WINAPI +dlRelease(IBindStatusCallback* iface) +{ + IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; + DWORD ref = InterlockedDecrement(&This->ref); + + if( !ref ) + { + DestroyWindow( This->hDialog ); + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI +dlOnStartBinding(IBindStatusCallback* iface, DWORD dwReserved, IBinding* pib) +{ + DPRINT1("OnStartBinding not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlGetPriority(IBindStatusCallback* iface, LONG* pnPriority) +{ + DPRINT1("GetPriority not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnLowResource( IBindStatusCallback* iface, DWORD reserved) +{ + DPRINT1("OnLowResource not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress, + ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) +{ + IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; + HWND Item; + LONG r; + WCHAR OldText[100]; + + Item = GetDlgItem(This->hDialog, IDC_PROGRESS); + if (NULL != Item && 0 != ulProgressMax) + { + SendMessageW(Item, PBM_SETPOS, (ulProgress * 100) / ulProgressMax, 0); + } + + Item = GetDlgItem(This->hDialog, IDC_STATUS); + if (NULL != Item) + { + SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]), + (LPARAM) OldText); + if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) || + 0 != wcscmp(OldText, szStatusText)) + { + SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) szStatusText); + } + } + + SetLastError(0); + r = GetWindowLongPtrW(This->hDialog, GWLP_USERDATA); + if (0 != r || 0 != GetLastError()) + { + *This->pbCancelled = TRUE; + DPRINT("Cancelled\n"); + return E_ABORT; + } + + return S_OK; +} + +static HRESULT WINAPI +dlOnStopBinding(IBindStatusCallback* iface, HRESULT hresult, LPCWSTR szError) +{ + DPRINT1("OnStopBinding not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlGetBindInfo(IBindStatusCallback* iface, DWORD* grfBINDF, BINDINFO* pbindinfo) +{ + DPRINT1("GetBindInfo not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnDataAvailable(IBindStatusCallback* iface, DWORD grfBSCF, + DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed) +{ + DPRINT1("OnDataAvailable implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnObjectAvailable(IBindStatusCallback* iface, REFIID riid, IUnknown* punk) +{ + DPRINT1("OnObjectAvailable implemented\n"); + + return S_OK; +} + +static const IBindStatusCallbackVtbl dlVtbl = +{ + dlQueryInterface, + dlAddRef, + dlRelease, + dlOnStartBinding, + dlGetPriority, + dlOnLowResource, + dlOnProgress, + dlOnStopBinding, + dlGetBindInfo, + dlOnDataAvailable, + dlOnObjectAvailable +}; + +static IBindStatusCallback* +CreateDl(HWND Dlg, BOOL *pbCancelled) +{ + IBindStatusCallbackImpl *This; + + This = HeapAlloc(GetProcessHeap(), 0, sizeof(IBindStatusCallbackImpl)); + This->vtbl = &dlVtbl; + This->ref = 1; + This->hDialog = Dlg; + This->pbCancelled = pbCancelled; + + return (IBindStatusCallback*) This; +} + +static BOOL +GetShortcutName(LPWSTR ShortcutName) +{ + if (! SHGetSpecialFolderPathW(0, ShortcutName, CSIDL_PROGRAMS, FALSE)) + { + return FALSE; + } + if (NULL == PathAddBackslashW(ShortcutName)) + { + return FALSE; + } + if (0 == LoadStringW(GetModuleHandle(NULL), IDS_START_MENU_NAME, + ShortcutName + wcslen(ShortcutName), + MAX_PATH - wcslen(ShortcutName))) + { + return FALSE; + } + if (MAX_PATH - 5 < wcslen(ShortcutName)) + { + return FALSE; + } + wcscat(ShortcutName, L".lnk"); + + return TRUE; +} + +static DWORD WINAPI +ThreadFunc(LPVOID Context) +{ + static const WCHAR szUrl[] = DOWNLOAD_URL; + IBindStatusCallback *dl; + WCHAR path[MAX_PATH], ShortcutName[MAX_PATH]; + LPWSTR p; + STARTUPINFOW si; + PROCESS_INFORMATION pi; + HWND Dlg = (HWND) Context; + DWORD r; + BOOL bCancelled = FALSE; + BOOL bTempfile = FALSE; + + /* built the path for the download */ + p = wcsrchr(szUrl, L'/'); + if (NULL == p) + { + goto end; + } + if (! GetTempPathW(MAX_PATH, path)) + { + goto end; + } + wcscat(path, p + 1); + + /* download it */ + bTempfile = TRUE; + dl = CreateDl(Context, &bCancelled); + r = URLDownloadToFileW(NULL, szUrl, path, 0, dl); + if (NULL != dl) + { + IBindStatusCallback_Release(dl); + } + if (S_OK != r || bCancelled ) + { + goto end; + } + ShowWindow(Dlg, SW_HIDE); + + /* run it */ + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi); + if (0 == r) + { + goto end; + } + CloseHandle(pi.hThread); + WaitForSingleObject(pi.hProcess, INFINITE); + CloseHandle(pi.hProcess); + + if (BST_CHECKED == SendMessageW(GetDlgItem(Dlg, IDC_REMOVE), BM_GETCHECK, + 0, 0) && + GetShortcutName(ShortcutName)) + { + DeleteFileW(ShortcutName); + } + +end: + if (bTempfile) + { + DeleteFileW(path); + } + EndDialog(Dlg, 0); + return 0; +} + +static INT_PTR CALLBACK +dlProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + HANDLE Thread; + DWORD ThreadId; + HWND Item; + HICON Icon; + WCHAR ShortcutName[MAX_PATH]; + + switch (Msg) + { + case WM_INITDIALOG: + Icon = LoadIconW((HINSTANCE) GetWindowLongPtr(Dlg, GWLP_HINSTANCE), + MAKEINTRESOURCEW(IDI_ICON_MAIN)); + if (NULL != Icon) + { + SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) Icon); + SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) Icon); + } + SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0); + Item = GetDlgItem(Dlg, IDC_PROGRESS); + if (NULL != Item) + { + SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100)); + SendMessageW(Item, PBM_SETPOS, 0, 0); + } + Item = GetDlgItem(Dlg, IDC_REMOVE); + if (NULL != Item) + { + if (GetShortcutName(ShortcutName) && + INVALID_FILE_ATTRIBUTES != GetFileAttributesW(ShortcutName)) + { + SendMessageW(Item, BM_SETCHECK, BST_CHECKED, 0); + } + else + { + SendMessageW(Item, BM_SETCHECK, BST_UNCHECKED, 0); + ShowWindow(Item, SW_HIDE); + } + } + Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId); + if (NULL == Thread) + { + return FALSE; + } + CloseHandle(Thread); + return TRUE; + + case WM_COMMAND: + if (wParam == IDCANCEL) + { + SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1); + PostMessage(Dlg, WM_CLOSE, 0, 0); + } + return FALSE; + + case WM_CLOSE: + EndDialog(Dlg, 0); + return TRUE; + + default: + return FALSE; + } +} + + +/*********************************************************************** + * Main program + */ +int +main(int argc, char *argv[]) +{ + InitCommonControls(); + + DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_GETFIREFOX), 0, + dlProc); + + return 0; +} diff --git a/reactos/base/applications/getfirefox/getfirefox.rc b/reactos/base/applications/getfirefox/getfirefox.rc new file mode 100644 index 00000000000..e9f4c7658f5 --- /dev/null +++ b/reactos/base/applications/getfirefox/getfirefox.rc @@ -0,0 +1,28 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/getfirefox.rc + * PURPOSE: Language-independent resources + * COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg@reactos.org) + */ + +#include +#include "resource.h" + +#define REACTOS_STR_FILE_DESCRIPTION "Firefox downloader\0" +#define REACTOS_STR_INTERNAL_NAME "getfirefox\0" +#define REACTOS_STR_ORIGINAL_FILENAME "getfirefox.exe\0" +#include + +/* + * Note: this icon is the "default logo" referenced here: + * http://www.mozilla.org/foundation/trademarks/faq.html (under "What are the + * Mozilla Trademarks and Logos?"). Don't use the official Firefox logo as it + * is trademarked. + */ +1 ICON "firefox.ico" + +#include "De.rc" +#include "En.rc" +#include "Fr.rc" +#include "Hu.rc" diff --git a/reactos/base/applications/getfirefox/getfirefox.xml b/reactos/base/applications/getfirefox/getfirefox.xml new file mode 100644 index 00000000000..fab9acc49f4 --- /dev/null +++ b/reactos/base/applications/getfirefox/getfirefox.xml @@ -0,0 +1,17 @@ + + . + + + + 0x0501 + +#include +#include +#include + +int main (int argc, char ** argv) +{ + if (1 == argc) + { + TCHAR ComputerName [MAX_COMPUTERNAME_LENGTH + 1]; + DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0]; + + ZeroMemory (ComputerName, sizeof ComputerName ); + if (GetComputerName(ComputerName, & ComputerNameSize)) + { + printf ("%s\n", ComputerName); + return EXIT_SUCCESS; + } + fprintf (stderr, "%s: Win32 error %ld.\n", + argv[0], GetLastError()); + return EXIT_FAILURE; + }else{ + if (0 == strcmp(argv[1],"-s")) + { + fprintf(stderr,"%s: -s not supported.\n",argv[0]); + return EXIT_FAILURE; + }else{ + printf("Print the current host's name.\n\nhostname\n"); + } + } + return EXIT_SUCCESS; +} +/* EOF */ diff --git a/reactos/base/applications/hostname/hostname.rc b/reactos/base/applications/hostname/hostname.rc new file mode 100644 index 00000000000..227ff6a10fe --- /dev/null +++ b/reactos/base/applications/hostname/hostname.rc @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Win32 Get local host name\0" +#define REACTOS_STR_INTERNAL_NAME "hostname\0" +#define REACTOS_STR_ORIGINAL_FILENAME "hostname.exe\0" +#include diff --git a/reactos/base/applications/hostname/hostname.xml b/reactos/base/applications/hostname/hostname.xml new file mode 100644 index 00000000000..03c29d5010a --- /dev/null +++ b/reactos/base/applications/hostname/hostname.xml @@ -0,0 +1,7 @@ + + + kernel32 + hostname.c + hostname.rc + + diff --git a/reactos/base/applications/ibrowser/De.rc b/reactos/base/applications/ibrowser/De.rc new file mode 100644 index 00000000000..f88edbdb9d2 --- /dev/null +++ b/reactos/base/applications/ibrowser/De.rc @@ -0,0 +1,148 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SDIFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&Datei" + BEGIN + MENUITEM "&Beenden", ID_FILE_EXIT + END + POPUP "&Ansicht" + BEGIN + MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR + MENUITEM "S&ide Bar", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "&Status Bar", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Aktualisieren\tF5", ID_REFRESH + MENUITEM "&Vollbild\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + END + POPUP "&Hilfe" + BEGIN + MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ + MENUITEM "&About IBrowser...", ID_ABOUT_IBROWSER + MENUITEM "About &OS...", ID_ABOUT_WINDOWS + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUT_IBROWSER DIALOG DISCARDABLE 0, 0, 199, 106 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About ReactOS Web Browser" +FONT 10, "MS Sans Serif" +BEGIN + LTEXT "ReactOS Web Browser",IDC_ROS_IBROWSER,91,13,104,11 + LTEXT "V 0.9",IDC_VERSION_TXT,91,27,104,8 + LTEXT "(c) 2005 Martin Fuchs",IDC_STATIC,91,42,104,8 + LTEXT "",IDC_WIN_VERSION,91,58,98,22 + LTEXT "http://www.sky.franken.de/explorer/",IDC_WWW,17,84,129, + 8 + CONTROL "&OK",IDOK,"Button",BS_OWNERDRAW | BS_FLAT | WS_GROUP, + 154,90,38,12 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLE "Reactos Internet Web Browser" + IDS_EMPTY "(Empty)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUT_IBROWSER "&Über..." +END + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s" +#else +IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/En.rc b/reactos/base/applications/ibrowser/En.rc new file mode 100644 index 00000000000..92212e278e6 --- /dev/null +++ b/reactos/base/applications/ibrowser/En.rc @@ -0,0 +1,161 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SDIFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Open", ID_FILE_OPEN + MENUITEM "E&xit", ID_FILE_EXIT + END + POPUP "&View" + BEGIN + MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR + MENUITEM "S&ide Bar", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "&Status Bar", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Refresh\tF5", ID_REFRESH + MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + END + POPUP "&Help" + BEGIN + MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ + MENUITEM "&About IBrowser...", ID_ABOUT_IBROWSER + MENUITEM "About &OS...", ID_ABOUT_WINDOWS + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUT_IBROWSER DIALOG DISCARDABLE 0, 0, 199, 106 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About ReactOS Web Browser" +FONT 10, "MS Sans Serif" +BEGIN + LTEXT "ReactOS Web Browser",IDC_ROS_IBROWSER,91,13,104,11 + LTEXT "V 0.9",IDC_VERSION_TXT,91,27,104,8 + LTEXT "(c) 2005 Martin Fuchs",IDC_STATIC,91,42,104,8 + LTEXT "",IDC_WIN_VERSION,91,58,98,22 + LTEXT "http://www.sky.franken.de/explorer/",IDC_WWW,17,84,129, + 8 + CONTROL "&OK",IDOK,"Button",BS_OWNERDRAW | BS_FLAT | WS_GROUP, + 154,90,38,12 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLE "Reactos Internet Web Browser" + IDS_EMPTY "(Empty)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUT_IBROWSER "&About..." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s" +#else +IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/Es.rc b/reactos/base/applications/ibrowser/Es.rc new file mode 100644 index 00000000000..244da05fcd1 --- /dev/null +++ b/reactos/base/applications/ibrowser/Es.rc @@ -0,0 +1,122 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_SPANISH, SUBLANG_SPANISH\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""Nevegador de Web ReactOS%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""Nevegador de Web ReactOS Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Spanish (Castilian) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESP) +#ifdef _WIN32 +LANGUAGE LANG_SPANISH, SUBLANG_SPANISH +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SDIFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&Archivo" + BEGIN + MENUITEM "S&alir", ID_FILE_EXIT + END + POPUP "&Ver" + BEGIN + MENUITEM "&Barra de Herramientas", ID_VIEW_TOOL_BAR + MENUITEM "Barra &Lateral", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "Barra de &Estado", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Actualizar\tF5", ID_REFRESH + MENUITEM "P&antalla Completa\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + END + POPUP "&Ayuda" + BEGIN + MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ + MENUITEM "&Acerca de IBrowser...", ID_ABOUT_IBROWSER + MENUITEM "Acerca de &OS...", ID_ABOUT_WINDOWS + END +END + +#endif // Spanish (Castilian) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_SPANISH, SUBLANG_SPANISH +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "Nevegador de Web ReactOS%0s" +#else +IDS_IBROWSER_VERSION_STR "Nevegador de Web ReactOS Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/Fr.rc b/reactos/base/applications/ibrowser/Fr.rc new file mode 100644 index 00000000000..d7205135d4a --- /dev/null +++ b/reactos/base/applications/ibrowser/Fr.rc @@ -0,0 +1,151 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// French (France) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) +#ifdef _WIN32 +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""Navigateur Internet de ReactOS%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""Navigateur Internet de ReactOS Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SDIFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&Fichier" + BEGIN + MENUITEM "&Ouvrir", ID_FILE_OPEN + MENUITEM "&Quitter", ID_FILE_EXIT + END + POPUP "&Affichage" + BEGIN + MENUITEM "Barre d'ou&tils", ID_VIEW_TOOL_BAR + MENUITEM "Pann&eau lat?al", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "&Barre d'?at", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "Actualise&r", ID_REFRESH + MENUITEM "&Plein ?ran", ID_VIEW_FULLSCREEN + END + POPUP "&Aide" + BEGIN + MENUITEM "&Rubriques d'aide de iBrowser", ID_IBROWSER_FAQ + MENUITEM "? propos de iBrowser...", ID_ABOUT_IBROWSER + MENUITEM "? propos de ReactOS...", ID_ABOUT_WINDOWS + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLE "Navigateur internet de Reactos" + IDS_EMPTY "(Vide)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUT_IBROWSER "? propos de iBrowser..." +END + +#endif // French (France) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "Navigateur Internet de ReactOS%0s" +#else +IDS_IBROWSER_VERSION_STR "Navigateur Internet de ReactOS Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/Hu.rc b/reactos/base/applications/ibrowser/Hu.rc new file mode 100644 index 00000000000..ee9b38e1707 --- /dev/null +++ b/reactos/base/applications/ibrowser/Hu.rc @@ -0,0 +1,81 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""A ReactOS %s webböngészõ%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""A ReactOS %s webböngészõ Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "A ReactOS %s webböngészõ%0s" +#else +IDS_IBROWSER_VERSION_STR "A ReactOS %s webböngészõ Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/Ja.rc b/reactos/base/applications/ibrowser/Ja.rc new file mode 100644 index 00000000000..f541cc209a1 --- /dev/null +++ b/reactos/base/applications/ibrowser/Ja.rc @@ -0,0 +1,140 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Japanese resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +#ifdef _WIN32 +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +#pragma code_page(932) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SDIFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "ƒtƒ@ƒCƒ‹(&F)" + BEGIN + MENUITEM "ŠJ‚­(&O)", ID_FILE_OPEN + MENUITEM "I—¹(&X)", ID_FILE_EXIT + END + POPUP "•\\Ž¦(&V)" + BEGIN + MENUITEM "ƒc[ƒ‹ ƒo[(&T)", ID_VIEW_TOOL_BAR + MENUITEM "ƒTƒCƒh ƒo[(&I)", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "ƒXƒe[ƒ^ƒX ƒo[(&S)", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "ÅV‚Ìî•ñ‚ÉXV(&R)\tF5", ID_REFRESH + MENUITEM "‘S‰æ–Ê•\\Ž¦(&I)\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + END + POPUP "ƒwƒ‹ƒv(&H)" + BEGIN + MENUITEM "IBrowser FAQ (&F)...", ID_IBROWSER_FAQ + MENUITEM "IBrowser ‚ɂ‚¢‚Ä(&A)...", ID_ABOUT_IBROWSER + MENUITEM "OS ‚ɂ‚¢‚Ä(&O)...", ID_ABOUT_WINDOWS + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLE "Reactos Internet Web Browser" + IDS_EMPTY "(Empty)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUT_IBROWSER "ƒo[ƒWƒ‡ƒ“î•ñ(&A)..." +END + +#endif // Japanese resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s" +#else +IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/Makefile.MinGW b/reactos/base/applications/ibrowser/Makefile.MinGW new file mode 100644 index 00000000000..cd1d90f5821 --- /dev/null +++ b/reactos/base/applications/ibrowser/Makefile.MinGW @@ -0,0 +1,67 @@ +# +# ROS Internet Web Browser +# +# Makefile.MinGW +# + +CC = gcc +CXX = g++ +LINK = g++ + +CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -Wno-unused-value -I. -I$(EXPAT_INC) +RCFLAGS = -DWIN32 -D__WINDRES__ +LFLAGS = -Wl,--subsystem,windows + +ifdef DEBUG +CFLAGS += -D_DEBUG -g +RCFLAGS += -D_DEBUG +LFLAGS += -g +else +CFLAGS += -DNDEBUG -Os +RCFLAGS += -DNDEBUG +LFLAGS += -s +endif + +ifndef UNICODE +UNICODE = 1 +endif + +ifeq ($(UNICODE),1) +CFLAGS += -DUNICODE +# LFLAGS+= -Wl,--entry,_wWinMain@16 +RCFLAGS += -DUNICODE +endif + +CXXFLAGS = $(CFLAGS) + +EXEC_SUFFIX = .exe +RES_SUFFIX = .coff + +VPATH = utility + +PROGRAM = ibrowser + +TARGET = $(PROGRAM)$(EXEC_SUFFIX) + +OBJECTS = \ + utility.o \ + window.o \ + ibrowser.o \ + webchild.o \ + mainframe.o \ + favorites.o \ + xmlstorage.o + +LIBS = gdi32 comctl32 shell32 ole32 uuid oleaut32 + +all: $(TARGET) + +$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) libexpat.dll + $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS)) + +ibrowser$(RES_SUFFIX): $(PROGRAM)_intres.rc res/*.bmp res/*.ico + windres $(RCFLAGS) -o $@ $(PROGRAM)_intres.rc + +clean: + rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) \ + desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o diff --git a/reactos/base/applications/ibrowser/Makefile.PCH b/reactos/base/applications/ibrowser/Makefile.PCH new file mode 100644 index 00000000000..769da64315b --- /dev/null +++ b/reactos/base/applications/ibrowser/Makefile.PCH @@ -0,0 +1,72 @@ +# +# ROS Internet Web Browser +# +# Makefile.PCH +# +# MinGW Makefile with precompiled header support +# + +CC = gcc +CXX = g++ +LINK = g++ + +CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -Wno-unused-value -I. -I$(EXPAT_INC) +RCFLAGS = -DWIN32 -D__WINDRES__ +LFLAGS = -Wl,--subsystem,windows + +ifdef DEBUG +CFLAGS += -D_DEBUG -g +RCFLAGS += -D_DEBUG +LFLAGS += -g +else +CFLAGS += -DNDEBUG -Os -march=pentium4 +RCFLAGS += -DNDEBUG +LFLAGS += -s +endif + +ifndef UNICODE +UNICODE = 1 +endif + +ifeq ($(UNICODE),1) +CFLAGS += -DUNICODE +# LFLAGS+= -Wl,--entry,_wWinMain@16 +RCFLAGS += -DUNICODE +endif + +CXXFLAGS = $(CFLAGS) + +EXEC_SUFFIX = .exe +RES_SUFFIX = .coff + +VPATH = utility + +PROGRAM = ibrowser + +TARGET = $(PROGRAM)$(EXEC_SUFFIX) + +OBJECTS = \ + utility.o \ + window.o \ + ibrowser.o \ + webchild.o \ + mainframe.o \ + favorites.o \ + xmlstorage.o + +LIBS = gdi32 comctl32 shell32 ole32 oleaut32 uuid + +all: precomp.h.gch $(TARGET) + +precomp.h.gch: *.h utility/*.h + $(CXX) $(CFLAGS) precomp.h + +$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) libexpat.dll + $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS)) + +ibrowser$(RES_SUFFIX): $(PROGRAM)_intres.rc res/*.bmp res/*.ico + windres $(RCFLAGS) -o $@ $(PROGRAM)_intres.rc + +clean: + rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) precomp.h.gch \ + utility/*.o diff --git a/reactos/base/applications/ibrowser/Ro.rc b/reactos/base/applications/ibrowser/Ro.rc new file mode 100644 index 00000000000..884a319dad2 --- /dev/null +++ b/reactos/base/applications/ibrowser/Ro.rc @@ -0,0 +1,122 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral (Default) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SDIFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&Fisier" + BEGIN + MENUITEM "&Iesire", ID_FILE_EXIT + END + POPUP "&Prezentare" + BEGIN + MENUITEM "&Bara cu instrumente", ID_VIEW_TOOL_BAR + MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "&Bara de stare", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Resetare\tF5", ID_REFRESH + MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + END + POPUP "&Ajutor" + BEGIN + MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ + MENUITEM "&Despre IBrowser...", ID_ABOUT_IBROWSER + MENUITEM "Despre &OS...", ID_ABOUT_WINDOWS + END +END + +#endif // Neutral (Default) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s" +#else +IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/Sv.rc b/reactos/base/applications/ibrowser/Sv.rc new file mode 100644 index 00000000000..d52763d0e62 --- /dev/null +++ b/reactos/base/applications/ibrowser/Sv.rc @@ -0,0 +1,140 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#ifndef _ROS_\r\n" + "LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT\r\n" + "STRINGTABLE DISCARDABLE \r\n" + "BEGIN\r\n" + "#ifdef UNICODE\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n" + "#else\r\n" + "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n" + "#endif\r\n" + "END\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Swedish resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE) +#ifdef _WIN32 +LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SDIFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&Arkiv" + BEGIN + MENUITEM "&Öppna", ID_FILE_OPEN + MENUITEM "&Avsluta", ID_FILE_EXIT + END + POPUP "&Visa" + BEGIN + MENUITEM "&Verktygsfält", ID_VIEW_TOOL_BAR + MENUITEM "S&idfält", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "&Statusfält", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Uppdatera\tF5", ID_REFRESH + MENUITEM "&Fullskärm\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + END + POPUP "&Hjälp" + BEGIN + MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ + MENUITEM "Om &IBrowser...", ID_ABOUT_IBROWSER + MENUITEM "Om &operativsystemet...", ID_ABOUT_WINDOWS + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLE "ReactOS webbläsare" + IDS_EMPTY "(Tom)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUT_IBROWSER "&Om..." +END + +#endif // Swedish resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#ifndef _ROS_ +LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE +BEGIN +#ifdef UNICODE +IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s" +#else +IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s" +#endif +END +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/expat.license b/reactos/base/applications/ibrowser/expat.license new file mode 100644 index 00000000000..5c5d524a1f8 --- /dev/null +++ b/reactos/base/applications/ibrowser/expat.license @@ -0,0 +1,22 @@ +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper +Copyright (c) 2001, 2002, 2003 Expat maintainers. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/reactos/base/applications/ibrowser/favorites.cpp b/reactos/base/applications/ibrowser/favorites.cpp new file mode 100644 index 00000000000..47f7948b688 --- /dev/null +++ b/reactos/base/applications/ibrowser/favorites.cpp @@ -0,0 +1,496 @@ +/* + * Copyright 2004 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // Explorer and Desktop clone + // + // favorites.cpp + // + // Martin Fuchs, 04.04.2004 + // + + +#include + + +String DecodeURLString(const char* s) +{ + TCHAR buffer[BUFFER_LEN]; + LPTSTR o = buffer; + + for(const char* p=s; *p; ++p) + if (*p == '%') { + if (!strncmp(p+1, "20", 2)) { + *o++ = ' '; + p += 2; + } else + *o++ = *p; + } else + *o++ = *p; + + return String(buffer, o-buffer); +} + + + /// read .URL file +bool Bookmark::read_url(LPCTSTR path) +{ + char line[BUFFER_LEN]; + + tifstream in(path); + + while(in.good()) { + in.getline(line, BUFFER_LEN); + + const char* p = line; + while(isspace(*p)) + ++p; + + const char* keyword = p; + const char* eq = strchr(p, '='); + + if (eq) { + const char* cont = eq + 1; + while(isspace(*cont)) + ++cont; + + if (!strnicmp(keyword, "URL", 3)) + _url = DecodeURLString(cont); + else if (!strnicmp(keyword, "IconFile", 8)) + _icon_path = DecodeURLString(cont); + } + } + + return true; +} + + /// convert XBEL bookmark node +bool Bookmark::read(const_XMLPos& pos) +{ + _url = pos.get("href").c_str(); + + if (pos.go_down("title")) { + _name = pos->get_content(); + pos.back(); + } + + if (pos.go_down("desc")) { + _description = pos->get_content(); + pos.back(); + } + + if (pos.go_down("info")) { + const_XMLChildrenFilter metadata(pos, "metadata"); + + for(const_XMLChildrenFilter::const_iterator it=metadata.begin(); it!=metadata.end(); ++it) { + const XMLNode& node = **it; + const_XMLPos sub_pos(&node); + + if (node.get("owner") == "ros-explorer") { + if (sub_pos.go_down("icon")) { + _icon_path = sub_pos.get("path").c_str(); + _icon_idx = XS_toi(sub_pos.get("index")); + + sub_pos.back(); // + } + } + } + + pos.back(); // + pos.back(); // + } + + return !_url.empty(); // _url is mandatory. +} + + /// write XBEL bookmark node +void Bookmark::write(XMLPos& pos) const +{ + pos.create("bookmark"); + + pos["href"] = _url.c_str(); + + if (!_name.empty()) { + pos.create("title"); + pos->set_content(_name); + pos.back(); + } + + if (!_description.empty()) { + pos.create("desc"); + pos->set_content(_description); + pos.back(); + } + + if (!_icon_path.empty()) { + pos.create("info"); + pos.create("metadata"); + pos["owner"] = "ros-explorer"; + pos.create("icon"); + pos["path"] = _icon_path.c_str(); + pos["index"].printf(XS_TEXT("%d"), _icon_idx); + pos.back(); // + pos.back(); // + pos.back(); // + } + + pos.back(); +} + + + /// read bookmark folder from XBEL formated XML tree +void BookmarkFolder::read(const_XMLPos& pos) +{ + if (pos.go_down("title")) { + _name = pos->get_content(); + pos.back(); + } + + if (pos.go_down("desc")) { + _description = pos->get_content(); + pos.back(); + } + + _bookmarks.read(pos); +} + + /// write bookmark folder content from XBEL formated XML tree +void BookmarkFolder::write(XMLPos& pos) const +{ + pos.create("folder"); + + if (!_name.empty()) { + pos.create("title"); + pos->set_content(_name); + pos.back(); + } + + if (!_description.empty()) { + pos.create("desc"); + pos->set_content(_description); + pos.back(); + } + + _bookmarks.write(pos); +} + + +BookmarkNode::BookmarkNode() + : _type(BMNT_NONE) +{ + _pbookmark = NULL; +} + +BookmarkNode::BookmarkNode(const Bookmark& bm) + : _type(BMNT_BOOKMARK) +{ + _pbookmark = new Bookmark(bm); +} + +BookmarkNode::BookmarkNode(const BookmarkFolder& bmf) + : _type(BMNT_FOLDER) +{ + _pfolder = new BookmarkFolder(bmf); +} + +BookmarkNode::BookmarkNode(const BookmarkNode& other) + : _type(other._type) +{ + if (other._type == BMNT_BOOKMARK) + _pbookmark = new Bookmark(*other._pbookmark); + else if (other._type == BMNT_FOLDER) + _pfolder = new BookmarkFolder(*other._pfolder); + else + _pbookmark = NULL; +} + +BookmarkNode::~BookmarkNode() +{ + if (_type == BMNT_BOOKMARK) + delete _pbookmark; + else if (_type == BMNT_FOLDER) + delete _pfolder; +} + +BookmarkNode& BookmarkNode::operator=(const Bookmark& bm) +{ + clear(); + + _pbookmark = new Bookmark(bm); + + return *this; +} + +BookmarkNode& BookmarkNode::operator=(const BookmarkFolder& bmf) +{ + clear(); + + _pfolder = new BookmarkFolder(bmf); + + return *this; +} + +BookmarkNode& BookmarkNode::operator=(const BookmarkNode& other) +{ + clear(); + + _type = other._type; + + if (other._type == BMNT_BOOKMARK) + _pbookmark = new Bookmark(*other._pbookmark); + else if (other._type == BMNT_FOLDER) + _pfolder = new BookmarkFolder(*other._pfolder); + + return *this; +} + +void BookmarkNode::clear() +{ + if (_type == BMNT_BOOKMARK) { + delete _pbookmark; + _pbookmark = NULL; + } + else if (_type == BMNT_FOLDER) { + delete _pfolder; + _pfolder = NULL; + } + + _type = BMNT_NONE; +} + + + /// read bookmark list from XBEL formated XML tree +void BookmarkList::read(const_XMLPos& pos) +{ + const XMLNode::Children& children = pos->get_children(); + + for(XMLNode::Children::const_iterator it=children.begin(); it!=children.end(); ++it) { + const XMLNode& node = **it; + const_XMLPos sub_pos(&node); + + if (node == "folder") { + BookmarkFolder folder; + + folder.read(sub_pos); + + push_back(folder); + } else if (node == "bookmark") { + Bookmark bookmark; + + if (bookmark.read(sub_pos)) + push_back(bookmark); + } + } +} + + /// write bookmark list into XBEL formated XML tree +void BookmarkList::write(XMLPos& pos) const +{ + for(const_iterator it=begin(); it!=end(); ++it) { + const BookmarkNode& node = *it; + + if (node._type == BookmarkNode::BMNT_FOLDER) { + const BookmarkFolder& folder = *node._pfolder; + + folder.write(pos); + + pos.back(); + } else if (node._type == BookmarkNode::BMNT_BOOKMARK) { + const Bookmark& bookmark = *node._pbookmark; + + if (!bookmark._url.empty()) + bookmark.write(pos); + } + } +} + + + /// fill treeview control with bookmark tree content +void BookmarkList::fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST himagelist, HDC hdc_wnd) const +{ + TV_INSERTSTRUCT tvi; + + tvi.hParent = parent; + tvi.hInsertAfter = TVI_LAST; + + TV_ITEM& tv = tvi.item; + tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM; + + for(const_iterator it=begin(); it!=end(); ++it) { + const BookmarkNode& node = *it; + + tv.lParam = (LPARAM)&node; + + if (node._type == BookmarkNode::BMNT_FOLDER) { + const BookmarkFolder& folder = *node._pfolder; + + tv.pszText = (LPTSTR)folder._name.c_str(); + tv.iImage = 3; // folder + tv.iSelectedImage = 4; // open folder + HTREEITEM hitem = TreeView_InsertItem(hwnd, &tvi); + + folder._bookmarks.fill_tree(hwnd, hitem, himagelist, hdc_wnd); + } else if (node._type == BookmarkNode::BMNT_BOOKMARK) { + const Bookmark& bookmark = *node._pbookmark; + + tv.pszText = (LPTSTR)bookmark._name.c_str(); + tv.iImage = 1; // bookmark + tv.iSelectedImage = 2; // selected bookmark + + if (!bookmark._icon_path.empty()) { + const Icon& icon = g_icon_cache.extract(bookmark._icon_path, bookmark._icon_idx); + + if ((ICON_ID)icon != ICID_NONE) + tv.iImage = tv.iSelectedImage = icon.add_to_imagelist(himagelist, hdc_wnd); + } + + (void)TreeView_InsertItem(hwnd, &tvi); + } + } +} + + +/*@@ + + /// import Internet Explorer bookmarks from Favorites folder into bookmark list +void BookmarkList::import_IE_favorites(ShellDirectory& dir, HWND hwnd) +{ + TCHAR path[MAX_PATH], ext[_MAX_EXT]; + + dir.smart_scan(SORT_NAME, SCAN_FILESYSTEM); + + for(Entry*entry=dir._down; entry; entry=entry->_next) { + if (entry->_shell_attribs & SFGAO_HIDDEN) // ignore files like "desktop.ini" + continue; + + String name; + + if (entry->_etype == ET_SHELL) + name = dir._folder.get_name(static_cast(entry)->_pidl); + else + name = entry->_display_name; + + if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + BookmarkFolder new_folder; + + new_folder._name = DecodeXMLString(name); + + if (entry->_etype == ET_SHELL) { + ShellDirectory new_dir(dir._folder, static_cast(entry)->_pidl, hwnd); + new_folder._bookmarks.import_IE_favorites(new_dir, hwnd); + } else { + entry->get_path(path); + ShellDirectory new_dir(GetDesktopFolder(), path, hwnd); + new_folder._bookmarks.import_IE_favorites(new_dir, hwnd); + } + + push_back(new_folder); + } else { + Bookmark bookmark; + + bookmark._name = DecodeXMLString(name); + + entry->get_path(path); + _tsplitpath(path, NULL, NULL, NULL, ext); + + if (!_tcsicmp(ext, TEXT(".url"))) { + bookmark.read_url(path); + push_back(bookmark); + } else { + ///@todo read shell links + //assert(0); + } + } + } +} + +*/ + + + /// read XBEL bookmark file +bool Favorites::read(LPCTSTR path) +{ + XMLDoc xbel; + + if (!xbel.read(path)) + if (xbel._last_error == XML_ERROR_NO_ELEMENTS) + return false; + else + MessageBox(0/*@@g_Globals._hwndDesktop*/, String(xbel._last_error_msg.c_str()), + TEXT("ROS Explorer - reading bookmark file"), MB_OK); + + const_XMLPos pos(&xbel); + + if (!pos.go_down("xbel")) + return false; + + super::read(pos); + + pos.back(); + + return true; +} + + /// write XBEL bookmark file +void Favorites::write(LPCTSTR path) const +{ + XMLDoc xbel; + + XMLPos pos(&xbel); + pos.create("xbel"); + super::write(pos); + pos.back(); + + xbel._header._doctype = ""; + + xbel.write(path); +} + + +/*@@ + + /// import Internet Explorer bookmarks from Favorites folder +bool Favorites::import_IE_favorites(HWND hwnd) +{ + WaitCursor wait; + + StartMenuShellDirs dirs; + + try { + dirs.push_back(ShellDirectory(GetDesktopFolder(), SpecialFolderPath(CSIDL_COMMON_FAVORITES, hwnd), hwnd)); + dirs.push_back(ShellDirectory(GetDesktopFolder(), SpecialFolderPath(CSIDL_FAVORITES, hwnd), hwnd)); + } catch(COMException&) { + } + + for(StartMenuShellDirs::iterator it=dirs.begin(); it!=dirs.end(); ++it) { + StartMenuDirectory& smd = *it; + ShellDirectory& dir = smd._dir; + + try { + super::import_IE_favorites(dir, hwnd); + } catch(COMException&) { + } + } + + return true; +} + +*/ diff --git a/reactos/base/applications/ibrowser/favorites.h b/reactos/base/applications/ibrowser/favorites.h new file mode 100644 index 00000000000..4d139ee0d1d --- /dev/null +++ b/reactos/base/applications/ibrowser/favorites.h @@ -0,0 +1,104 @@ +/* + * Copyright 2004 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // Explorer and Desktop clone + // + // favorites.h + // + // Martin Fuchs, 04.04.2004 + // + + +extern String DecodeURLString(const char* s); + + +struct Bookmark +{ + Bookmark() : _icon_idx(0) {} + + String _name; + String _description; + String _url; + String _icon_path; + int _icon_idx; + + bool read_url(LPCTSTR path); + bool read(const_XMLPos& pos); + void write(XMLPos& pos) const; +}; + +struct BookmarkFolder; + +struct BookmarkNode +{ + BookmarkNode(); + BookmarkNode(const Bookmark& bm); + BookmarkNode(const BookmarkFolder& bmf); + BookmarkNode(const BookmarkNode& other); + + ~BookmarkNode(); + + BookmarkNode& operator=(const Bookmark& bm); + BookmarkNode& operator=(const BookmarkFolder& bmf); + BookmarkNode& operator=(const BookmarkNode& other); + + void clear(); + + enum BOOKMARKNODE_TYPE { + BMNT_NONE, BMNT_BOOKMARK, BMNT_FOLDER + }; + + BOOKMARKNODE_TYPE _type; + + union { + Bookmark* _pbookmark; + BookmarkFolder* _pfolder; + }; +}; + +struct BookmarkList : public list +{ + void import_IE_favorites(struct ShellDirectory& dir, HWND hwnd); + + void read(const_XMLPos& pos); + void write(XMLPos& pos) const; + + void fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const; +}; + +struct BookmarkFolder +{ + String _name; + String _description; + BookmarkList _bookmarks; + + void read(const_XMLPos& pos); + void write(XMLPos& pos) const; +}; + +struct Favorites : public BookmarkList +{ + typedef BookmarkList super; + + bool read(LPCTSTR path); + void write(LPCTSTR path) const; + + bool import_IE_favorites(HWND hwnd); +}; diff --git a/reactos/base/applications/ibrowser/ibrowser.cpp b/reactos/base/applications/ibrowser/ibrowser.cpp new file mode 100644 index 00000000000..04b44e86c41 --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser.cpp @@ -0,0 +1,550 @@ +/* + * Copyright 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // ibrowser.cpp + // + // Martin Fuchs, 24.01.2005 + // + + +#include + +#include "ibrowser_intres.h" + +#include // for setlocale() + +#ifndef __WINE__ +#include // for dup2() +#include // for _O_RDONLY +#endif + + + // globals + +HINSTANCE g_hInstance; +IconCache g_icon_cache; +ATOM g_hframeClass; + + +/*@@ +void ExplorerGlobals::read_persistent() +{ + // read configuration file + _cfg_dir.printf(TEXT("%s\\ReactOS"), (LPCTSTR)SpecialFolderFSPath(CSIDL_APPDATA,0)); + _cfg_path.printf(TEXT("%s\\ros-ibrowser-cfg.xml"), _cfg_dir.c_str()); + + if (!_cfg.read(_cfg_path)) { + if (_cfg._last_error != XML_ERROR_NO_ELEMENTS) + MessageBox(g_Globals._hwndDesktop, String(_cfg._last_error_msg.c_str()), + TEXT("ROS Explorer - reading user settings"), MB_OK); + + _cfg.read(TEXT("ibrowser-cfg-template.xml")); + } + + // read bookmarks + _favorites_path.printf(TEXT("%s\\ros-ibrowser-bookmarks.xml"), _cfg_dir.c_str()); + + if (!_favorites.read(_favorites_path)) { + _favorites.import_IE_favorites(0); + _favorites.write(_favorites_path); + } +} + +void ExplorerGlobals::write_persistent() +{ + // write configuration file + RecursiveCreateDirectory(_cfg_dir); + + _cfg.write(_cfg_path); + _favorites.write(_favorites_path); +} + + +XMLPos ExplorerGlobals::get_cfg() +{ + XMLPos cfg_pos(&_cfg); + + cfg_pos.smart_create("ibrowser-cfg"); + + return cfg_pos; +} + +XMLPos ExplorerGlobals::get_cfg(const char* path) +{ + XMLPos cfg_pos(&_cfg); + + cfg_pos.smart_create("ibrowser-cfg"); + cfg_pos.create_relative(path); + + return cfg_pos; +} +*/ + + +Icon::Icon() + : _id(ICID_UNKNOWN), + _itype(IT_STATIC), + _hicon(0) +{ +} + +Icon::Icon(ICON_ID id, UINT nid) + : _id(id), + _itype(IT_STATIC), + _hicon(SmallIcon(nid)) +{ +} + +Icon::Icon(ICON_TYPE itype, int id, HICON hIcon) + : _id((ICON_ID)id), + _itype(itype), + _hicon(hIcon) +{ +} + +Icon::Icon(ICON_TYPE itype, int id, int sys_idx) + : _id((ICON_ID)id), + _itype(itype), + _sys_idx(sys_idx) +{ +} + +void Icon::draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const +{ + if (_itype == IT_SYSCACHE) + ImageList_DrawEx(g_icon_cache.get_sys_imagelist(), _sys_idx, hdc, x, y, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL); + else + DrawIconEx(hdc, x, y, _hicon, cx, cy, 0, bk_brush, DI_NORMAL); +} + +HBITMAP Icon::create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const +{ + if (_itype == IT_SYSCACHE) { + HIMAGELIST himl = g_icon_cache.get_sys_imagelist(); + + int cx, cy; + ImageList_GetIconSize(himl, &cx, &cy); + + HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy); + HDC hdc = CreateCompatibleDC(hdc_wnd); + HBITMAP hbmp_old = SelectBitmap(hdc, hbmp); + ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL); + SelectBitmap(hdc, hbmp_old); + DeleteDC(hdc); + + return hbmp; + } else + return create_bitmap_from_icon(_hicon, hbrBkgnd, hdc_wnd); +} + + +int Icon::add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color, HBRUSH bk_brush) const +{ + int ret; + + if (_itype == IT_SYSCACHE) { + HIMAGELIST himl = g_icon_cache.get_sys_imagelist(); + + int cx, cy; + ImageList_GetIconSize(himl, &cx, &cy); + + HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy); + HDC hdc = CreateCompatibleDC(hdc_wnd); + HBITMAP hbmp_old = SelectBitmap(hdc, hbmp); + ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL); + SelectBitmap(hdc, hbmp_old); + DeleteDC(hdc); + + ret = ImageList_Add(himl, hbmp, 0); + + DeleteObject(hbmp); + } else + ret = ImageList_AddAlphaIcon(himl, _hicon, bk_brush, hdc_wnd); + + return ret; +} + +HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd) +{ + int cx = GetSystemMetrics(SM_CXSMICON); + int cy = GetSystemMetrics(SM_CYSMICON); + HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy); + + MemCanvas canvas; + BitmapSelection sel(canvas, hbmp); + + RECT rect = {0, 0, cx, cy}; + FillRect(canvas, &rect, hbrush_bkgnd); + + DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL); + + return hbmp; +} + +int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd) +{ + HBITMAP hbmp = create_bitmap_from_icon(hIcon, hbrush_bkgnd, hdc_wnd); + + int ret = ImageList_Add(himl, hbmp, 0); + + DeleteObject(hbmp); + + return ret; +} + + +int IconCache::s_next_id = ICID_DYNAMIC; + + +void IconCache::init() +{ + _icons[ICID_NONE] = Icon(IT_STATIC, ICID_NONE, (HICON)0); + + _icons[ICID_IBROWSER] = Icon(ICID_IBROWSER, IDI_IBROWSER); + _icons[ICID_BOOKMARK] = Icon(ICID_BOOKMARK, IDI_DOT_TRANS); +} + + +const Icon& IconCache::extract(const String& path) +{ + PathMap::iterator found = _pathMap.find(path); + + if (found != _pathMap.end()) + return _icons[found->second]; + + SHFILEINFO sfi; + +#if 1 // use system image list + HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX|SHGFI_SMALLICON); + + if (himlSys) { + _himlSys = himlSys; + + const Icon& icon = add(sfi.iIcon/*, IT_SYSCACHE*/); +#else + if (SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_SMALLICON)) { + const Icon& icon = add(sfi.hIcon, IT_CACHED); +#endif + + ///@todo limit cache size + _pathMap[path] = icon; + + return icon; + } else + return _icons[ICID_NONE]; +} + +const Icon& IconCache::extract(LPCTSTR path, int idx) +{ + CachePair key(path, idx); + +#ifndef __WINE__ ///@todo _tcslwr() for Wine + _tcslwr((LPTSTR)key.first.c_str()); +#endif + + PathIdxMap::iterator found = _pathIdxMap.find(key); + + if (found != _pathIdxMap.end()) + return _icons[found->second]; + + HICON hIcon; + + if ((int)ExtractIconEx(path, idx, NULL, &hIcon, 1) > 0) { + const Icon& icon = add(hIcon, IT_CACHED); + + _pathIdxMap[key] = icon; + + return icon; + } else { + + ///@todo retreive "http://.../favicon.ico" format icons + + return _icons[ICID_NONE]; + } +} + + +const Icon& IconCache::add(HICON hIcon, ICON_TYPE type) +{ + int id = ++s_next_id; + + return _icons[id] = Icon(type, id, hIcon); +} + +const Icon& IconCache::add(int sys_idx/*, ICON_TYPE type=IT_SYSCACHE*/) +{ + int id = ++s_next_id; + + return _icons[id] = SysCacheIcon(id, sys_idx); +} + +const Icon& IconCache::get_icon(int id) +{ + return _icons[id]; +} + +void IconCache::free_icon(int icon_id) +{ + IconMap::iterator found = _icons.find(icon_id); + + if (found != _icons.end()) { + Icon& icon = found->second; + + if (icon.destroy()) + _icons.erase(found); + } +} + + +ResString::ResString(UINT nid) +{ + TCHAR buffer[BUFFER_LEN]; + + int len = LoadString(g_hInstance, nid, buffer, sizeof(buffer)/sizeof(TCHAR)); + + super::assign(buffer, len); +} + + +ResIcon::ResIcon(UINT nid) +{ + _hicon = LoadIcon(g_hInstance, MAKEINTRESOURCE(nid)); +} + +SmallIcon::SmallIcon(UINT nid) +{ + _hicon = (HICON)LoadImage(g_hInstance, MAKEINTRESOURCE(nid), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); +} + +ResIconEx::ResIconEx(UINT nid, int w, int h) +{ + _hicon = (HICON)LoadImage(g_hInstance, MAKEINTRESOURCE(nid), IMAGE_ICON, w, h, LR_SHARED); +} + + +void SetWindowIcon(HWND hwnd, UINT nid) +{ + HICON hIcon = ResIcon(nid); + (void)Window_SetIcon(hwnd, ICON_BIG, hIcon); + + HICON hIconSmall = SmallIcon(nid); + (void)Window_SetIcon(hwnd, ICON_SMALL, hIconSmall); +} + + +ResBitmap::ResBitmap(UINT nid) +{ + _hBmp = LoadBitmap(g_hInstance, MAKEINTRESOURCE(nid)); +} + + +void ibrowser_show_frame(int cmdshow, LPTSTR lpCmdLine) +{ + MainFrameBase::Create(lpCmdLine, cmdshow); +} + + +PopupMenu::PopupMenu(UINT nid) +{ + HMENU hMenu = LoadMenu(g_hInstance, MAKEINTRESOURCE(nid)); + _hmenu = GetSubMenu(hMenu, 0); +} + + + /// "About" Dialog +struct ExplorerAboutDlg : public + CtlColorParent< + OwnerDrawParent + > +{ + typedef CtlColorParent< + OwnerDrawParent + > super; + + ExplorerAboutDlg(HWND hwnd) + : super(hwnd) + { + SetWindowIcon(hwnd, IDI_REACTOS); + + new FlatButton(hwnd, IDOK); + + _hfont = CreateFont(20, 0, 0, 0, FW_BOLD, TRUE, 0, 0, 0, 0, 0, 0, 0, TEXT("Sans Serif")); + new ColorStatic(hwnd, IDC_ROS_IBROWSER, RGB(32,32,128), 0, _hfont); + + new HyperlinkCtrl(hwnd, IDC_WWW); + + FmtString ver_txt(ResString(IDS_IBROWSER_VERSION_STR), (LPCTSTR)ResString(IDS_VERSION_STR)); + SetWindowText(GetDlgItem(hwnd, IDC_VERSION_TXT), ver_txt); + + /*@@ + HWND hwnd_winver = GetDlgItem(hwnd, IDC_WIN_VERSION); + SetWindowText(hwnd_winver, get_windows_version_str()); + SetWindowFont(hwnd_winver, GetStockFont(DEFAULT_GUI_FONT), FALSE); + */ + + CenterWindow(hwnd); + } + + ~ExplorerAboutDlg() + { + DeleteObject(_hfont); + } + +protected: + HFONT _hfont; +}; + +void ibrowser_about(HWND hwndParent) +{ + Dialog::DoModal(IDD_ABOUT_IBROWSER, WINDOW_CREATOR(ExplorerAboutDlg), hwndParent); +} +void ibrowser_open(HWND hwndParent) +{ + HMODULE hShell32; + RUNFILEDLG RunFileDlg; + OSVERSIONINFO versionInfo; + WCHAR wTitle[40]; + WCHAR wText[256]; + char szTitle[40] = "Open"; + char szText[256] = "Type the Internet Address of a document or folder and IBrowser will open it for you."; + + hShell32 = LoadLibrary(_T("SHELL32.DLL")); + RunFileDlg = (RUNFILEDLG)(FARPROC)GetProcAddress(hShell32, (char*)((long)0x3D)); + + /* Show "Run..." dialog */ + if (RunFileDlg) + { + versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&versionInfo); + + if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szTitle, -1, wTitle, 40); + MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szText, -1, wText, 256); + RunFileDlg(hwndParent, 0, NULL, (LPCSTR)wTitle, (LPCSTR)wText, RFF_CALCDIRECTORY); + } + else + RunFileDlg(hwndParent, 0, NULL, szTitle, szText, RFF_CALCDIRECTORY); + } + + FreeLibrary(hShell32); +} + +static void InitInstance(HINSTANCE hInstance) +{ + CONTEXT("InitInstance"); + + // register frame window class + g_hframeClass = IconWindowClass(CLASSNAME_FRAME,IDI_IBROWSER); + + // register child window class + WindowClass(CLASSNAME_CHILDWND, CS_CLASSDC|CS_VREDRAW).Register(); +} + + +int ibrowser_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdshow) +{ + CONTEXT("ibrowser_main"); + + // initialize Common Controls library + CommonControlInit usingCmnCtrl; + + try { + InitInstance(hInstance); + } catch(COMException& e) { + HandleException(e, GetDesktopWindow()); + return -1; + } + + if (cmdshow != SW_HIDE) { +/* // don't maximize if being called from the ROS desktop + if (cmdshow == SW_SHOWNORMAL) + ///@todo read window placement from registry + cmdshow = SW_MAXIMIZE; +*/ + + ibrowser_show_frame(cmdshow, lpCmdLine); + } + + return Window::MessageLoop(); +} + + + // MinGW does not provide a Unicode startup routine, so we have to implement an own. +#if defined(__MINGW32__) && defined(UNICODE) + +#define _tWinMain wWinMain +int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int); + +int main(int argc, char* argv[]) +{ + CONTEXT("main"); + + STARTUPINFO startupinfo; + int nShowCmd = SW_SHOWNORMAL; + + GetStartupInfo(&startupinfo); + + if (startupinfo.dwFlags & STARTF_USESHOWWINDOW) + nShowCmd = startupinfo.wShowWindow; + + LPWSTR cmdline = GetCommandLineW(); + + while(*cmdline && !_istspace(*cmdline)) + ++cmdline; + + while(_istspace(*cmdline)) + ++cmdline; + + return wWinMain(GetModuleHandle(NULL), 0, cmdline, nShowCmd); +} + +#endif // __MINGW && UNICODE + + +int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd) +{ + CONTEXT("WinMain()"); + + g_hInstance = hInstance; + + // initialize COM and OLE before creating the desktop window + OleInit usingCOM; + + // init common controls library + CommonControlInit usingCmnCtrl; + +//@@ g_Globals.read_persistent(); + + /**TODO fix command line handling */ + if (*lpCmdLine=='"' && lpCmdLine[_tcslen(lpCmdLine)-1]=='"') { + ++lpCmdLine; + lpCmdLine[_tcslen(lpCmdLine)-1] = '\0'; + } + + int ret = ibrowser_main(hInstance, lpCmdLine, nShowCmd); + + // write configuration file +//@@ g_Globals.write_persistent(); + + return ret; +} diff --git a/reactos/base/applications/ibrowser/ibrowser.dsp b/reactos/base/applications/ibrowser/ibrowser.dsp new file mode 100644 index 00000000000..902a9901ded --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser.dsp @@ -0,0 +1,346 @@ +# Microsoft Developer Studio Project File - Name="ibrowser" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=IBROWSER - WIN32 DEBUG +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ibrowser.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ibrowser.mak" CFG="IBROWSER - WIN32 DEBUG" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ibrowser - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ibrowser - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "ibrowser - Win32 Debug Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ibrowser - Win32 Unicode Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ibrowser - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ibrowser - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GR /GX /O1 /D "NDEBUG" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /Yu"precomp.h" /FD /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /machine:I386 /libpath:"Release" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "ibrowser - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /Yu"precomp.h" /FD /GZ /c +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"Debug" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "ibrowser - Win32 Debug Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "DRelease" +# PROP BASE Intermediate_Dir "DRelease" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "DRelease" +# PROP Intermediate_Dir "DRelease" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_ROS_" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GR /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /Yu"precomp.h" /FD /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "ibrowser - Win32 Unicode Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "URelease" +# PROP BASE Intermediate_Dir "URelease" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "URelease" +# PROP Intermediate_Dir "URelease" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /Yu"precomp.h" /FD /c +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /machine:I386 /libpath:"Release" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "ibrowser - Win32 Unicode Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "UDebug" +# PROP BASE Intermediate_Dir "UDebug" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "UDebug" +# PROP Intermediate_Dir "UDebug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /FR /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /Yu"precomp.h" /FD /GZ /c +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"Debug" +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "ibrowser - Win32 Release" +# Name "ibrowser - Win32 Debug" +# Name "ibrowser - Win32 Debug Release" +# Name "ibrowser - Win32 Unicode Release" +# Name "ibrowser - Win32 Unicode Debug" +# Begin Group "utility" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\utility\comutil.h +# End Source File +# Begin Source File + +SOURCE=.\utility\utility.cpp +# End Source File +# Begin Source File + +SOURCE=.\utility\utility.h +# End Source File +# Begin Source File + +SOURCE=.\utility\window.cpp +# End Source File +# Begin Source File + +SOURCE=.\utility\window.h +# End Source File +# Begin Source File + +SOURCE=.\utility\xmlstorage.cpp +# End Source File +# Begin Source File + +SOURCE=.\utility\xmlstorage.h +# End Source File +# End Group +# Begin Group "resources" + +# PROP Default_Filter "bmp,ico" +# Begin Source File + +SOURCE=.\De.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\res\dot.ico +# End Source File +# Begin Source File + +SOURCE=.\res\dot_red.ico +# End Source File +# Begin Source File + +SOURCE=.\res\dot_trans.ico +# End Source File +# Begin Source File + +SOURCE=.\En.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\Es.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\res\favorites.ico +# End Source File +# Begin Source File + +SOURCE=.\Fr.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\Hu.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\res\ibrowser.ico +# End Source File +# Begin Source File + +SOURCE=.\ibrowser.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\ibrowser_intres.h +# End Source File +# Begin Source File + +SOURCE=.\ibrowser_intres.rc +# End Source File +# Begin Source File + +SOURCE=.\res\iexplore.ico +# End Source File +# Begin Source File + +SOURCE=.\Ja.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\res\network.ico +# End Source File +# Begin Source File + +SOURCE=.\res\reactos.ico +# End Source File +# Begin Source File + +SOURCE=.\Ro.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\Sv.rc +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\res\toolbar.bmp +# End Source File +# End Group +# Begin Group "main" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\favorites.cpp +# End Source File +# Begin Source File + +SOURCE=.\favorites.h +# End Source File +# Begin Source File + +SOURCE=.\ibrowser.cpp +# End Source File +# Begin Source File + +SOURCE=.\ibrowser.h +# End Source File +# Begin Source File + +SOURCE=.\mainframe.cpp +# End Source File +# Begin Source File + +SOURCE=.\mainframe.h +# End Source File +# Begin Source File + +SOURCE=.\precomp.cpp +# ADD CPP /Yc"precomp.h" +# End Source File +# Begin Source File + +SOURCE=.\precomp.h +# End Source File +# Begin Source File + +SOURCE=.\webchild.cpp +# End Source File +# Begin Source File + +SOURCE=.\webchild.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\readme.txt +# End Source File +# End Target +# End Project diff --git a/reactos/base/applications/ibrowser/ibrowser.dsw b/reactos/base/applications/ibrowser/ibrowser.dsw new file mode 100644 index 00000000000..eb8d2593f88 --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser.dsw @@ -0,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "ibrowser"=.\ibrowser.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "make_ibrowser"=.\make_ibrowser.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/reactos/base/applications/ibrowser/ibrowser.h b/reactos/base/applications/ibrowser/ibrowser.h new file mode 100644 index 00000000000..f1e3b260552 --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser.h @@ -0,0 +1,231 @@ +/* + * Copyright 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // ibrowser.h + // + // Martin Fuchs, 25.01.2005 + // + + +#include "utility/window.h" + + +#define IDW_STATUSBAR 0x100 +#define IDW_TOOLBAR 0x101 +#define IDW_EXTRABAR 0x102 +#define IDW_ADDRESSBAR 0x104 +#define IDW_SIDEBAR 0x106 +#define IDW_FIRST_CHILD 0xC000 /*0x200*/ + + +#define PM_GET_FILEWND_PTR (WM_APP+0x05) +#define PM_GET_SHELLBROWSER_PTR (WM_APP+0x06) + +#define PM_GET_CONTROLWINDOW (WM_APP+0x16) + +#define PM_RESIZE_CHILDREN (WM_APP+0x17) +#define PM_GET_WIDTH (WM_APP+0x18) + +#define PM_REFRESH (WM_APP+0x1B) +#define PM_REFRESH_CONFIG (WM_APP+0x1C) + + +#define CLASSNAME_FRAME TEXT("IBrowserFrameWClass") + +#define CLASSNAME_CHILDWND TEXT("IBrowserChildWClass") + + +#include "mainframe.h" + + + /// convenient loading of string resources +struct ResString : public String +{ + ResString(UINT nid); +}; + + /// convenient loading of standard (32x32) icon resources +struct ResIcon +{ + ResIcon(UINT nid); + + operator HICON() const {return _hicon;} + +protected: + HICON _hicon; +}; + + /// convenient loading of small (16x16) icon resources +struct SmallIcon +{ + SmallIcon(UINT nid); + + operator HICON() const {return _hicon;} + +protected: + HICON _hicon; +}; + + /// convenient loading of icon resources with specified sizes +struct ResIconEx +{ + ResIconEx(UINT nid, int w, int h); + + operator HICON() const {return _hicon;} + +protected: + HICON _hicon; +}; + + /// set big and small icons out of the resources for a window +extern void SetWindowIcon(HWND hwnd, UINT nid); + + /// convenient loading of bitmap resources +struct ResBitmap +{ + ResBitmap(UINT nid); + ~ResBitmap() {DeleteObject(_hBmp);} + + operator HBITMAP() const {return _hBmp;} + +protected: + HBITMAP _hBmp; +}; + + +enum ICON_TYPE { + IT_STATIC, + IT_CACHED, + IT_DYNAMIC, + IT_SYSCACHE +}; + +enum ICON_ID { + ICID_UNKNOWN, + ICID_NONE, + + ICID_IBROWSER, + ICID_BOOKMARK, + + ICID_DYNAMIC +}; + +struct Icon { + Icon(); + Icon(ICON_ID id, UINT nid); + Icon(ICON_TYPE itype, int id, HICON hIcon); + Icon(ICON_TYPE itype, int id, int sys_idx); + + operator ICON_ID() const {return _id;} + + void draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const; + HBITMAP create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const; + int add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const; + + int get_sysiml_idx() const {return _itype==IT_SYSCACHE? _sys_idx: -1;} + + bool destroy() {if (_itype == IT_DYNAMIC) {DestroyIcon(_hicon); return true;} else return false;} + +protected: + ICON_ID _id; + ICON_TYPE _itype; + HICON _hicon; + int _sys_idx; +}; + +struct SysCacheIcon : public Icon { + SysCacheIcon(int id, int sys_idx) + : Icon(IT_SYSCACHE, id, sys_idx) {} +}; + +struct IconCache { + IconCache() : _himlSys(0) {} + + void init(); + + const Icon& extract(const String& path); + const Icon& extract(LPCTSTR path, int idx); + const Icon& extract(IExtractIcon* pExtract, LPCTSTR path, int idx); + + const Icon& add(HICON hIcon, ICON_TYPE type=IT_DYNAMIC); + const Icon& add(int sys_idx/*, ICON_TYPE type=IT_SYSCACHE*/); + + const Icon& get_icon(int icon_id); + HIMAGELIST get_sys_imagelist() const {return _himlSys;} + + void free_icon(int icon_id); + +protected: + static int s_next_id; + + typedef map IconMap; + IconMap _icons; + + typedef map PathMap; + PathMap _pathMap; + + typedef pair CachePair; + typedef map PathIdxMap; + PathIdxMap _pathIdxMap; + + HIMAGELIST _himlSys; +}; + + + /// create a bitmap from an icon +extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd); + + /// add icon with alpha channel to imagelist using the specified background color +extern int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd); + + +#include "utility/xmlstorage.h" + +using namespace XMLStorage; + +#include "favorites.h" + + + // globals +extern HINSTANCE g_hInstance; +extern IconCache g_icon_cache; +extern ATOM g_hframeClass; + + + // display explorer "About" dialog +extern void ibrowser_about(HWND hwndParent); + + // display explorer "open" dialog +extern void ibrowser_open(HWND hwndParent); + + // declare shell32's "Run..." dialog export function +typedef void (WINAPI* RUNFILEDLG)(HWND hwndOwner, HICON hIcon, LPCSTR lpstrDirectory, LPCSTR lpstrTitle, LPCSTR lpstrDescription, UINT uFlags); + + // + // Flags for RunFileDlg + // + +#define RFF_NOBROWSE 0x01 // Removes the browse button. +#define RFF_NODEFAULT 0x02 // No default item selected. +#define RFF_CALCDIRECTORY 0x04 // Calculates the working directory from the file name. +#define RFF_NOLABEL 0x08 // Removes the edit box label. +#define RFF_NOSEPARATEMEM 0x20 // Removes the Separate Memory Space check box (Windows NT only). diff --git a/reactos/base/applications/ibrowser/ibrowser.rc b/reactos/base/applications/ibrowser/ibrowser.rc new file mode 100644 index 00000000000..2dbd1d6ceff --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser.rc @@ -0,0 +1,13 @@ +#include + +#include "ibrowser_intres.rc" + +#define REACTOS_STR_FILE_DESCRIPTION "ROS Internet Web Browser\0" +#define REACTOS_STR_INTERNAL_NAME "ibrowser\0" +#define REACTOS_STR_ORIGINAL_FILENAME "ibrowser.exe\0" +#include + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#define IDS_VERSION_STR 5000 +#define IDS_IBROWSER_VERSION_STR 5001 diff --git a/reactos/base/applications/ibrowser/ibrowser.xml b/reactos/base/applications/ibrowser/ibrowser.xml new file mode 100644 index 00000000000..e4fd3fd2499 --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser.xml @@ -0,0 +1,31 @@ + + -fexceptions + . + include/expat + + + + + 0x0600 + 0x0501 + 0x0500 + uuid + kernel32 + gdi32 + comctl32 + ole32 + oleaut32 + shell32 + expat + precomp.h + + utility.cpp + window.cpp + xmlstorage.cpp + + ibrowser.cpp + favorites.cpp + mainframe.cpp + webchild.cpp + ibrowser.rc + diff --git a/reactos/base/applications/ibrowser/ibrowser_intres.h b/reactos/base/applications/ibrowser/ibrowser_intres.h new file mode 100644 index 00000000000..c80ddc7f548 --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser_intres.h @@ -0,0 +1,52 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by ibrowser_intres.rc +// +#define IDS_TITLE 1 +#define IDS_EMPTY 13 +#define IDS_ABOUT_IBROWSER 27 +#define IDI_REACTOS 100 +#define IDB_TOOLBAR 103 +#define IDA_IBROWSER 104 +#define IDM_SDIFRAME 113 +#define IDD_ABOUT_IBROWSER 135 +#define IDI_FAVORITES 140 +#define IDI_DOT 163 +#define IDI_DOT_TRANS 164 +#define IDI_DOT_RED 165 +#define IDI_IBROWSER 169 +#define ID_VIEW_STATUSBAR 503 +#define ID_VIEW_TOOL_BAR 508 +#define ID_VIEW_SIDE_BAR 510 +#define IDC_ROS_IBROWSER 1000 +#define IDC_WWW 1012 +#define IDC_VERSION_TXT 1029 +#define IDC_WIN_VERSION 1030 +#define ID_REFRESH 1704 +#define IDS_VERSION_STR 5000 +#define IDS_IBROWSER_VERSION_STR 5001 +#define ID_IBROWSER_FAQ 10002 +#define ID_VIEW_FULLSCREEN 0x8004 +#define ID_ABOUT_WINDOWS 40002 +#define ID_ABOUT_IBROWSER 40003 +#define ID_GO_BACK 40005 +#define ID_GO_FORWARD 40006 +#define ID_GO_HOME 40007 +#define ID_GO_SEARCH 40008 +#define ID_GO_UP 40009 +#define ID_STOP 40010 +#define ID_FILE_OPEN 0xE140 +#define ID_FILE_EXIT 0xE141 +#define ID_HELP 0xE146 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 170 +#define _APS_NEXT_COMMAND_VALUE 40024 +#define _APS_NEXT_CONTROL_VALUE 1033 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/reactos/base/applications/ibrowser/ibrowser_intres.rc b/reactos/base/applications/ibrowser/ibrowser_intres.rc new file mode 100644 index 00000000000..0afbb767787 --- /dev/null +++ b/reactos/base/applications/ibrowser/ibrowser_intres.rc @@ -0,0 +1,107 @@ +//Microsoft Developer Studio generated resource script. +// +#include "ibrowser_intres.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDA_IBROWSER ACCELERATORS DISCARDABLE +BEGIN + "X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT + "S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, + NOINVERT +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ibrowser_intres.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""En.rc""\r\n" + "#include ""Es.rc""\r\n" + "#include ""Fr.rc""\r\n" + "#include ""Sv.rc""\r\n" + "#include ""Hu.rc""\r\n" + "#include ""Ro.rc""\r\n" + "#include ""Ja.rc""\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_REACTOS ICON DISCARDABLE "res/reactos.ico" +IDI_FAVORITES ICON DISCARDABLE "res/favorites.ico" +IDI_DOT ICON DISCARDABLE "res/dot.ico" +IDI_DOT_TRANS ICON DISCARDABLE "res/dot_trans.ico" +IDI_DOT_RED ICON DISCARDABLE "res/dot_red.ico" +IDI_IBROWSER ICON DISCARDABLE "res/ibrowser.ico" +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "En.rc" +#include "Es.rc" +#include "Fr.rc" +#include "Sv.rc" +#include "Hu.rc" +#include "Ro.rc" +#include "Ja.rc" +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/reactos/base/applications/ibrowser/mainframe.cpp b/reactos/base/applications/ibrowser/mainframe.cpp new file mode 100644 index 00000000000..b92ea804b16 --- /dev/null +++ b/reactos/base/applications/ibrowser/mainframe.cpp @@ -0,0 +1,791 @@ +/* + * Copyright 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // mainframe.cpp + // + // Martin Fuchs, 25.01.2005 + // + + +#include + +/* We can't include webchild.h here - otherwise MinGW produces errors like: "multiple definition of `QACONTAINERFLAGS'" +#include "webchild.h" +*/ +extern HWND create_webchildwindow(const WebChildWndInfo& info); + +#include "ibrowser_intres.h" + + +HWND MainFrameBase::Create(LPCTSTR url, UINT cmdshow) +{ + HWND hMainFrame; + + hMainFrame = MainFrame::Create(); + //@@hMainFrame = MainFrame::Create(url); + + if (hMainFrame) { + if (url) { + static String sPath = url; // copy url to avoid accessing freed memory + url = sPath; + } + + ShowWindow(hMainFrame, cmdshow); + UpdateWindow(hMainFrame); + + // Open the first child window after initializing the application + PostMessage(hMainFrame, PM_OPEN_WINDOW, 0, (LPARAM)url); + } + + return hMainFrame; +} + + +MainFrameBase::MainFrameBase(HWND hwnd) + : super(hwnd), + _himl(ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0)) +{ + _hMenuFrame = GetMenu(hwnd); + _hMenuWindow = GetSubMenu(_hMenuFrame, GetMenuItemCount(_hMenuFrame)-3); + + _menu_info._hMenuView = GetSubMenu(_hMenuFrame, 1); + + _hAccel = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDA_IBROWSER)); + + + TBBUTTON toolbarBtns[] = { +#ifdef _NO_REBAR + {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0}, +#endif + {7, ID_GO_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {8, ID_GO_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {9, ID_GO_UP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {10, ID_GO_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {11, ID_GO_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {12, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {13, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0} + }; + + _htoolbar = CreateToolbarEx(hwnd, +#ifndef _NO_REBAR + CCS_NOPARENTALIGN|CCS_NORESIZE| +#endif + WS_CHILD|WS_VISIBLE, IDW_TOOLBAR, 2, g_hInstance, IDB_TOOLBAR, + toolbarBtns, sizeof(toolbarBtns)/sizeof(TBBUTTON), + 16, 15, 16, 15, sizeof(TBBUTTON)); + + CheckMenuItem(_menu_info._hMenuView, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED); + + + // address bar + WindowCanvas canvas(hwnd); + RECT rect = {0, 0, 0, 0}; + DrawText(canvas, TEXT("My"), -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT); + HFONT hfont = GetStockFont(DEFAULT_GUI_FONT); + + _haddressedit = CreateWindow(TEXT("EDIT"), NULL, WS_CHILD|WS_VISIBLE|WS_BORDER, 0, 0, 0, rect.bottom, + hwnd, (HMENU)IDW_ADDRESSBAR, g_hInstance, 0); + SetWindowFont(_haddressedit, hfont, FALSE); + new EditController(_haddressedit); + + /* CreateStatusWindow does not accept WS_BORDER + _hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0, + WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0, + hwnd, (HMENU)IDW_STATUSBAR, g_hInstance, 0);*/ + + _hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, hwnd, IDW_STATUSBAR); + CheckMenuItem(_menu_info._hMenuView, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED); + + _hsidebar = CreateWindowEx(WS_EX_STATICEDGE, WC_TREEVIEW, TEXT("Sidebar"), + WS_CHILD|WS_TABSTOP|WS_BORDER|/*WS_VISIBLE|*/WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_SHOWSELALWAYS|TVS_INFOTIP, + -1, -1, 200, 0, _hwnd, (HMENU)IDW_SIDEBAR, g_hInstance, 0); + + (void)TreeView_SetImageList(_hsidebar, _himl, TVSIL_NORMAL); + + CheckMenuItem(_menu_info._hMenuView, ID_VIEW_SIDE_BAR, MF_BYCOMMAND|MF_UNCHECKED/*MF_CHECKED*/); + + + // create rebar window to manage toolbar and address bar +#ifndef _NO_REBAR + _hwndrebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL, + WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN| + RBS_VARHEIGHT|RBS_AUTOSIZE|RBS_DBLCLKTOGGLE| + CCS_NODIVIDER|CCS_NOPARENTALIGN, + 0, 0, 0, 0, _hwnd, 0, g_hInstance, 0); + + int btn_hgt = HIWORD(SendMessage(_htoolbar, TB_GETBUTTONSIZE, 0, 0)); + + REBARBANDINFO rbBand; + + rbBand.cbSize = sizeof(REBARBANDINFO); + rbBand.fMask = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE; +#ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004 +#define RBBS_HIDETITLE 0x400 +#endif + rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE; + + rbBand.cxMinChild = 0; + rbBand.cyMinChild = 0; + rbBand.cyChild = 0; + rbBand.cyMaxChild = 0; + rbBand.cyIntegral = btn_hgt; + + rbBand.lpText = TEXT("Toolbar"); + rbBand.hwndChild = _htoolbar; + rbBand.cxMinChild = 0; + rbBand.cyMinChild = btn_hgt + 4; + rbBand.cx = 182; + SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand); + + rbBand.lpText = TEXT("Address"); + rbBand.hwndChild = _haddressedit; + rbBand.cxMinChild = 0; + rbBand.cyMinChild = btn_hgt - 2; + rbBand.cx = 284; + SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand); +#endif +} + + +MainFrameBase::~MainFrameBase() +{ + ImageList_Destroy(_himl); + +//@@if (g_Globals._hMainWnd == _hwnd) + PostQuitMessage(0); +} + + +LRESULT MainFrameBase::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + LRESULT res; + + if (ProcessMessage(nmsg, wparam, lparam, &res)) + return res; + else + return super::WndProc(nmsg, wparam, lparam); +} + +bool MainFrameBase::ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT* pres) +{ + switch(nmsg) { + case PM_TRANSLATE_MSG: + *pres = TranslateMsg((MSG*)lparam); + return true; + + case WM_SHOWWINDOW: + if (wparam) // trigger child resizing after window creation - now we can succesfully call IsWindowVisible() + resize_frame_client(); + return false; // goto def; + + case WM_CLOSE: + DestroyWindow(_hwnd); +//@@ g_Globals._hMainWnd = 0; + break; + + case WM_DESTROY: + break; + + case WM_SIZE: + resize_frame(LOWORD(lparam), HIWORD(lparam)); + break; // do not pass message to DefFrameProc + + case WM_GETMINMAXINFO: { + LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam; + + lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */ + lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */ + break;} + + case PM_FRM_CALC_CLIENT: + frame_get_clientspace((PRECT)lparam); + *pres = TRUE; + return true; + + case PM_FRM_GET_MENUINFO: + *pres = (LPARAM)&_menu_info; + return true; + + case PM_GET_CONTROLWINDOW: + if (wparam == FCW_STATUS) { + *pres = (LRESULT)(HWND)_hstatusbar; + return true; + } + break; + + case PM_SETSTATUSTEXT: + SendMessage(_hstatusbar, SB_SETTEXT, wparam, lparam); + break; + + case PM_URL_CHANGED: + SetWindowText(_haddressedit, (LPCTSTR)lparam); + break; + + default: + return false; + } + + *pres = 0; + return true; +} + +BOOL MainFrameBase::TranslateMsg(MSG* pmsg) +{ + if (TranslateAccelerator(_hwnd, _hAccel, pmsg)) + return TRUE; + + return FALSE; +} + + +int MainFrameBase::Command(int id, int code) +{ + CONTEXT("MainFrameBase::Command()"); + + switch(id) { + case ID_FILE_OPEN: + ibrowser_open(_hwnd); + break; + + case ID_FILE_EXIT: + SendMessage(_hwnd, WM_CLOSE, 0, 0); + break; + + case ID_VIEW_TOOL_BAR: + toggle_child(_hwnd, id, _htoolbar, 0); + break; + + case ID_VIEW_STATUSBAR: + toggle_child(_hwnd, id, _hstatusbar); + break; + + case ID_VIEW_SIDE_BAR: + // lazy initialization + if (!TreeView_GetCount(_hsidebar)) + FillBookmarks(); + + toggle_child(_hwnd, id, _hsidebar); + break; + + case ID_HELP: + WinHelp(_hwnd, TEXT("ibrowser")/*file ibrowser.hlp*/, HELP_INDEX, 0); + break; + + case ID_VIEW_FULLSCREEN: + CheckMenuItem(_menu_info._hMenuView, id, toggle_fullscreen()?MF_CHECKED:0); + break; + + case ID_ABOUT_WINDOWS: + ShellAbout(_hwnd, ResString(IDS_TITLE), NULL, 0); + break; + + case ID_ABOUT_IBROWSER: + ibrowser_about(_hwnd); + break; + + case ID_IBROWSER_FAQ: + launch_file(_hwnd, TEXT("http://www.sky.franken.de/explorer/"), SW_SHOW); + break; + + case IDW_ADDRESSBAR: + if (code == 1) { + TCHAR url[BUFFER_LEN]; + + if (GetWindowText(_haddressedit, url, BUFFER_LEN)) + go_to(url, false); + } + break; + + default: + return 1; // no command handlers in Window::Command() + } + + return 0; +} + + +int MainFrameBase::Notify(int id, NMHDR* pnmh) +{ + switch(pnmh->code) { + // resize children windows when the rebar size changes + case RBN_AUTOSIZE: + resize_frame_client(); + break; + + case TVN_GETINFOTIP: { + NMTVGETINFOTIP* pnmgit = (NMTVGETINFOTIP*)pnmh; + + if (pnmgit->lParam) { + const BookmarkNode& node = *(BookmarkNode*)pnmgit->lParam; + + if (node._type == BookmarkNode::BMNT_FOLDER) { + // display tooltips for bookmark folders + if (!node._pfolder->_description.empty()) + lstrcpyn(pnmgit->pszText, node._pfolder->_description.c_str(), pnmgit->cchTextMax); + } else if (node._type == BookmarkNode::BMNT_BOOKMARK) { + // display tooltips for bookmark folders + String txt = node._pbookmark->_description; + + if (!node._pbookmark->_url.empty()) { + if (!txt.empty()) + txt += TEXT(" - "); + + txt += node._pbookmark->_url; + } + + lstrcpyn(pnmgit->pszText, txt.c_str(), pnmgit->cchTextMax); + } + } + break;} + + case NM_DBLCLK: { + HTREEITEM hitem = TreeView_GetSelection(_hsidebar); + LPARAM lparam = TreeView_GetItemData(_hsidebar, hitem); + + if (lparam) { + const BookmarkNode& node = *(BookmarkNode*)lparam; + + if (node._type == BookmarkNode::BMNT_BOOKMARK) { + bool new_window = GetAsyncKeyState(VK_SHIFT)<0; + + go_to(node._pbookmark->_url, new_window); + } + } + break;} + } + + return 0; +} + + +void MainFrameBase::resize_frame(int cx, int cy) +{ + if (cy <= 0) + return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized + + RECT rect = {0, 0, cx, cy}; + + if (_hwndrebar) { + int height = ClientRect(_hwndrebar).bottom; + MoveWindow(_hwndrebar, rect.left, rect.top, rect.right-rect.left, height, TRUE); + rect.top += height; + } else { + if (IsWindowVisible(_htoolbar)) { + SendMessage(_htoolbar, WM_SIZE, 0, 0); + WindowRect rt(_htoolbar); + rect.top = rt.bottom; + // rect.bottom -= rt.bottom; + } + } + + if (IsWindowVisible(_hstatusbar)) { + int parts[] = {300, 500}; + + SendMessage(_hstatusbar, WM_SIZE, 0, 0); + SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts); + ClientRect rt(_hstatusbar); + rect.bottom -= rt.bottom; + } + + if (IsWindowVisible(_hsidebar)) { + WindowRect rt(_hsidebar); + rect.left += rt.right-rt.left; + + SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER); + } +} + +void MainFrameBase::resize_frame_client() +{ + ClientRect rect(_hwnd); + + resize_frame(rect.right, rect.bottom); +} + +void MainFrameBase::frame_get_clientspace(PRECT prect) +{ + if (!IsIconic(_hwnd)) + GetClientRect(_hwnd, prect); + else { + WINDOWPLACEMENT wp; + + GetWindowPlacement(_hwnd, &wp); + + prect->left = prect->top = 0; + prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left- + 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE)); + prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top- + 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))- + GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE); + } + + if (IsWindowVisible(_htoolbar)) { + ClientRect rt(_htoolbar); + prect->top += rt.bottom+2; + } + + if (IsWindowVisible(_hstatusbar)) { + ClientRect rt(_hstatusbar); + prect->bottom -= rt.bottom; + } +} + +BOOL MainFrameBase::toggle_fullscreen() +{ + RECT rt; + + if ((_fullscreen._mode=!_fullscreen._mode)) { + GetWindowRect(_hwnd, &_fullscreen._orgPos); + _fullscreen._wasZoomed = IsZoomed(_hwnd); + + Frame_CalcFrameClient(_hwnd, &rt); + ClientToScreen(_hwnd, (LPPOINT)&rt.left); + ClientToScreen(_hwnd, (LPPOINT)&rt.right); + + rt.left = _fullscreen._orgPos.left-rt.left; + rt.top = _fullscreen._orgPos.top-rt.top; + rt.right = GetSystemMetrics(SM_CXSCREEN)+_fullscreen._orgPos.right-rt.right; + rt.bottom = GetSystemMetrics(SM_CYSCREEN)+_fullscreen._orgPos.bottom-rt.bottom; + + MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE); + } else { + MoveWindow(_hwnd, _fullscreen._orgPos.left, _fullscreen._orgPos.top, + _fullscreen._orgPos.right-_fullscreen._orgPos.left, + _fullscreen._orgPos.bottom-_fullscreen._orgPos.top, TRUE); + + if (_fullscreen._wasZoomed) + ShowWindow(_hwnd, WS_MAXIMIZE); + } + + return _fullscreen._mode; +} + +void MainFrameBase::fullscreen_move() +{ + RECT rt, pos; + GetWindowRect(_hwnd, &pos); + + Frame_CalcFrameClient(_hwnd, &rt); + ClientToScreen(_hwnd, (LPPOINT)&rt.left); + ClientToScreen(_hwnd, (LPPOINT)&rt.right); + + rt.left = pos.left-rt.left; + rt.top = pos.top-rt.top; + rt.right = GetSystemMetrics(SM_CXSCREEN)+pos.right-rt.right; + rt.bottom = GetSystemMetrics(SM_CYSCREEN)+pos.bottom-rt.bottom; + + MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE); +} + + +void MainFrameBase::toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx) +{ + BOOL vis = IsWindowVisible(hchild); + + CheckMenuItem(_menu_info._hMenuView, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED); + + if (band_idx != -1) + SendMessage(_hwndrebar, RB_SHOWBAND, band_idx, !vis); + else + ShowWindow(hchild, vis? SW_HIDE: SW_SHOW); + + if (_fullscreen._mode) + fullscreen_move(); + + resize_frame_client(); +} + +void MainFrameBase::FillBookmarks() +{ +/*@@ + HiddenWindow hide(_hsidebar); + WindowCanvas canvas(_hwnd); + + TreeView_DeleteAllItems(_hsidebar); + + g_icon_cache.get_icon(ICID_FAVORITES).add_to_imagelist(_himl, canvas); + g_icon_cache.get_icon(ICID_BOOKMARK).add_to_imagelist(_himl, canvas); + ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT), GetStockBrush(WHITE_BRUSH), canvas); + g_icon_cache.get_icon(ICID_FOLDER).add_to_imagelist(_himl, canvas); + g_icon_cache.get_icon(ICID_FOLDER).add_to_imagelist(_himl, canvas); + + TV_INSERTSTRUCT tvi; + + tvi.hParent = TVI_ROOT; + tvi.hInsertAfter = TVI_LAST; + tvi.item.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; + ResString sFavorites(IDS_FAVORITES); + tvi.item.pszText = (LPTSTR)sFavorites.c_str(); + tvi.item.iSelectedImage = tvi.item.iImage = 0; + + HTREEITEM hitem_bookmarks = TreeView_InsertItem(_hsidebar, &tvi); + + g_Globals._favorites.fill_tree(_hsidebar, hitem_bookmarks, _himl, canvas); + + TreeView_Expand(_hsidebar, hitem_bookmarks, TVE_EXPAND); +*/ +} + + +MainFrame::MainFrame(HWND hwnd) + : super(hwnd) +{ + _split_pos = DEFAULT_SPLIT_POS; + _last_split = DEFAULT_SPLIT_POS; +} + +HWND MainFrame::Create() +{ + HMENU hMenuFrame = LoadMenu(g_hInstance, MAKEINTRESOURCE(IDM_SDIFRAME)); + + return Window::Create(WINDOW_CREATOR(MainFrame), 0, + (LPCTSTR)(int)g_hframeClass, ResString(IDS_TITLE), WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + 0/*hwndDesktop*/, hMenuFrame); +} + +/*@@ +HWND MainFrame::Create(LPCTSTR url) +{ + HWND hFrame = Create(); + if (!hFrame) + return 0; + + ShowWindow(hFrame, SW_SHOW); + + MainFrame* pFrame = GET_WINDOW(MainFrame, hFrame); + + if (pFrame) + pFrame->set_url(url); + + return hFrame; +} +*/ + +LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + switch(nmsg) { + case WM_SIZE: + resize_frame(LOWORD(lparam), HIWORD(lparam)); + break; + + case WM_PAINT: { + PaintCanvas canvas(_hwnd); + + if (_left_hwnd && _right_hwnd) { + ClientRect rt(_hwnd); + rt.left = _split_pos-SPLIT_WIDTH/2; + rt.right = _split_pos+SPLIT_WIDTH/2+1; + + if (_right_hwnd) { + WindowRect right_rect(_right_hwnd); + ScreenToClient(_hwnd, &right_rect); + rt.top = right_rect.top; + rt.bottom = right_rect.bottom; + } + + HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR)); + Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1); + SelectObject(canvas, lastBrush); + } + break;} + + case WM_SETCURSOR: + if (LOWORD(lparam) == HTCLIENT) { + POINT pt; + GetCursorPos(&pt); + ScreenToClient(_hwnd, &pt); + + if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) { + SetCursor(LoadCursor(0, IDC_SIZEWE)); + return TRUE; + } + } + goto def; + + case WM_LBUTTONDOWN: { + int x = GET_X_LPARAM(lparam); + + ClientRect rt(_hwnd); + + if (x>=_split_pos-SPLIT_WIDTH/2 && x<_split_pos+SPLIT_WIDTH/2+1) { + _last_split = _split_pos; + SetCapture(_hwnd); + } + + break;} + + case WM_LBUTTONUP: + if (GetCapture() == _hwnd) + ReleaseCapture(); + break; + + case WM_KEYDOWN: + if (wparam == VK_ESCAPE) + if (GetCapture() == _hwnd) { + _split_pos = _last_split; + resize_children(); + _last_split = -1; + ReleaseCapture(); + SetCursor(LoadCursor(0, IDC_ARROW)); + } + break; + + case WM_MOUSEMOVE: + if (GetCapture() == _hwnd) { + int x = LOWORD(lparam); + + ClientRect rt(_hwnd); + + if (x>=0 && x +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=make_ibrowser - Win32 bjam +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "make_ibrowser.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "make_ibrowser.mak" CFG="make_ibrowser - Win32 bjam" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "make_ibrowser - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "make_ibrowser - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE "make_ibrowser - Win32 Unicode Debug" (based on "Win32 (x86) External Target") +!MESSAGE "make_ibrowser - Win32 Unicode Release" (based on "Win32 (x86) External Target") +!MESSAGE "make_ibrowser - Win32 bjam" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "make_ibrowser - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f make_ibrowser.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "make_ibrowser.exe" +# PROP BASE Bsc_Name "make_ibrowser.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.PCH UNICODE=0" +# PROP Rebuild_Opt "clean all" +# PROP Target_File "ibrowser.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f make_ibrowser.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "make_ibrowser.exe" +# PROP BASE Bsc_Name "make_ibrowser.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.PCH UNICODE=0 DEBUG=1" +# PROP Rebuild_Opt "clean all" +# PROP Target_File "ibrowser.exe" +# PROP Bsc_Name "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=0 DEBUG=1" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "UDebug" +# PROP BASE Intermediate_Dir "UDebug" +# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1 DEBUG=1" +# PROP BASE Rebuild_Opt "clean all" +# PROP BASE Target_File "ibrowser.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "UDebug" +# PROP Intermediate_Dir "UDebug" +# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1 DEBUG=1" +# PROP Rebuild_Opt "clean all" +# PROP Target_File "ibrowser.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "URelease" +# PROP BASE Intermediate_Dir "URelease" +# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1" +# PROP BASE Rebuild_Opt "clean all" +# PROP BASE Target_File "ibrowser.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "URelease" +# PROP Intermediate_Dir "URelease" +# PROP Cmd_Line "msdevfilt -gcc make -f Makefile.PCH UNICODE=1" +# PROP Rebuild_Opt "clean all" +# PROP Target_File "ibrowser.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 bjam" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW DEBUG=1" +# PROP BASE Rebuild_Opt "clean all" +# PROP BASE Target_File "ibrowser.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" bjam" +# PROP Rebuild_Opt "clean&bjam release" +# PROP Target_File "ibrowser.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "make_ibrowser - Win32 Release" +# Name "make_ibrowser - Win32 Debug" +# Name "make_ibrowser - Win32 Unicode Debug" +# Name "make_ibrowser - Win32 Unicode Release" +# Name "make_ibrowser - Win32 bjam" + +!IF "$(CFG)" == "make_ibrowser - Win32 Release" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Debug" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Debug" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Release" + +!ELSEIF "$(CFG)" == "make_ibrowser - Win32 bjam" + +!ENDIF + +# Begin Source File + +SOURCE=.\Makefile +# End Source File +# Begin Source File + +SOURCE=.\Makefile.MinGW +# End Source File +# Begin Source File + +SOURCE=.\Makefile.PCH +# End Source File +# End Target +# End Project diff --git a/reactos/base/applications/ibrowser/precomp.cpp b/reactos/base/applications/ibrowser/precomp.cpp new file mode 100644 index 00000000000..c786813cbda --- /dev/null +++ b/reactos/base/applications/ibrowser/precomp.cpp @@ -0,0 +1,28 @@ +/* + * Copyright 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser - precompiled header support + // + // precomp.h + // + // Martin Fuchs, 25.01.2005 + // + +#include "precomp.h" diff --git a/reactos/base/applications/ibrowser/precomp.h b/reactos/base/applications/ibrowser/precomp.h new file mode 100644 index 00000000000..c0d382d9681 --- /dev/null +++ b/reactos/base/applications/ibrowser/precomp.h @@ -0,0 +1,32 @@ +/* + * Copyright 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser - precompiled header support + // + // precomp.h + // + // Martin Fuchs, 25.01.2005 + // + +#include "utility/utility.h" +#include "utility/comutil.h" + +#include "ibrowser.h" + diff --git a/reactos/base/applications/ibrowser/readme.txt b/reactos/base/applications/ibrowser/readme.txt new file mode 100644 index 00000000000..234c112c97e --- /dev/null +++ b/reactos/base/applications/ibrowser/readme.txt @@ -0,0 +1,9 @@ + +IBrowser is a Web Browser User Interface similar derived from ROS Explorer. +It encapsulates the Mozilla or MS Web Browser Control. + + +For more information about ReactOS Explorer please look at the FAQ web page: + +http://www.sky.franken.de/explorer/ + diff --git a/reactos/base/applications/ibrowser/res/dot.ico b/reactos/base/applications/ibrowser/res/dot.ico new file mode 100644 index 0000000000000000000000000000000000000000..9ddbb8a41c7472dca30197bd6541898b0df64bc8 GIT binary patch literal 3750 zcmds(e@xV69LL`$5GQhirG^T4nHi86V#TSbrzmB{4_oBs2-sYW^#_r(eUEA5=nuHm zKit$!UF~w&7HdPD>DbJ;N)l_%xj`d!4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(wMdN0&{p-&+68-%`w&@U1CKr#1E_vMGdem{K( zp|4=tp>HAdM})qS_KkUd;e9>dbEf?4sZTrUw+MY5+5FKL(|6`i DK928Q literal 0 HcmV?d00001 diff --git a/reactos/base/applications/ibrowser/res/dot_red.ico b/reactos/base/applications/ibrowser/res/dot_red.ico new file mode 100644 index 0000000000000000000000000000000000000000..4d176eef1d552bb3ca84b8562a8cce458b818a76 GIT binary patch literal 3750 zcmds3eN0nV6hDQQ7FunmPSK%O-4wqDn@);G-lKi}!hwY`qC@{A2ei9Ah*Z^m@Hcr%PrTW0Gb7O6GjG#p+7WDYj%6y_{|}8jV`5 z*2pA=q||OcRIp$}PVu&!l3J^KYnEeOdTxoyJWr?7hHPxfqSLmOdkSCw#If#3VMSBH z@&>D`IwRL(GMQ4?ga@Zs%?>avmSt>jentT?XLJ zSbz>CK)bZBQjErEP9UF-ecv;gZ(;aOh7yL+0?Sw+naKl&MVm_n){p_LX#udh0$|Nn zNKVN`%>$dw1}3csv=%pLGfF}G$}-e)&}A-1T?x9ZHL%dO3@R%t!NfFy&Pq_%1D8_; zTz(C31+}2JZHGm+YS7zvfWB}i7#t1YcI<`~rF$SXc^}N@TEN160fwTzU|9SC7+fEL z(bWV-_W>}JdJT-6Njjm@yS?j)?)eiAmk za|##+H|H@DXP5?@B?=LXJ<+R=`WBBuMD=0Xv?Dj$HE?cMbiGjOEA9_oRi+SK+}6!s zlWHKLuA8TUXvDIezB)A49PNwkA5{-_tS!VazC( zUF+s)KNidfkU-andcb1}lu2=a4fJ}8CYU3`O^_jTRZKVU_0kzMpuzqrK5b+@bX5Pz zR|_$(m-fH@mRZQ5)#y6tsKTCT&w*Ih+_SvB^*n!BE{VG=2e4zEAAUANdt;i=bKa&j zP+gxV@VPMtVGOK&&}f5DkHeapEvd9T{B=$TG~TuMFr4W=j9)^Z&~F*t110VSouB&U ztIL<;`S-^AbJRFed^)a&aw$H4&UgG>tTh8iy0LW65f+5zQU#nZevv}d_g(gVGld^R z$nJT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tl5 z^_x<(#b0ybW2e&Wr>BSmPDLDF!nWSw&Lh5W0^PpCso5mst3LRrKI6`si22B8S_Umc zpViQz@VOvu%}zz;^E&zyji9c{*#t~Uk0N$iM}N`x^wA=*7Ln#@PQ~St5%i?T{KYj4$%Ralg!!cduRDs#aPv#OdL7l&cu;KM&xN}UrVi@ zuT$q7pSq3$uDzkgubRF_)!wy_4O*k-TZNqZeQ!#7`r}*-iNDKsjB1_7@F#SO{L5qy z#$zvJd}*7KOgq4lYk{Ya4qEKtSdYYtJ$6}>@({TeL(9g>p2Mt)^p!#w&+(qW=J9uV z;D2Vp(sgRQ_tBHbYv`lZG5Xks)|@mSYd%Jv$_Vk$yK^nu7;L#irq-CiOb%pOnh3Zx>n#obimvKZy1c!%* z^Q;gZFPP>pd2~<8^FjPu93LOgn>KCYjT<*|Y-}t?Mn-a2SQsyyK8^>Aw;kAHFm3;k zlai8n=gysMHk*0t)~%e7kiao9F+6|X+(Fk;dgL=sOH1Q}2M;pt2b`6a#kfnb0BAHC z*W{Cxi&KX~wfolYlrbae2UGiSK4u#i(zQ#mer z(ST!1tjL{?R^3nc?((BYkJLQ3Z{KFzyLof0VMyoa&O-FvxzmOVwUt~^oX;P<|F*$v Wf7*24?~L4UrL_9E_lmvmz4uRwx7!&2 literal 0 HcmV?d00001 diff --git a/reactos/base/applications/ibrowser/res/favorites.ico b/reactos/base/applications/ibrowser/res/favorites.ico new file mode 100644 index 0000000000000000000000000000000000000000..558748e9ed09ff9d3cd195744f3e56625f8b72e6 GIT binary patch literal 9374 zcmeHMdr*|u6+g?uvJiwtQ4xh*d5H*!Cd5P&LGg|6AS$2{1!PqOdHQD2q>)5S+Qvj{ z-zH7$OwvR%O*@k|+i0fkjMGlqw9_;CD63bwD|Inzux2SNER=ck=E=f^3uW=* z#j<3{5?QuvnG_cnOKEATR8&;R=FOX>t*s6EM)Ga9~ zf0NYIcVPQH$;#?R=|fxbjD2YPW!f~A+izEyIaB5CyH)b@RhBRJVyv&qwryVc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35$9haLz&&{@(9KvH_fCpCBgnr7n{OI=xJxqlfmoYy?iPTDO@ejs zOkK*-m#O=jVT(2cy6|E68X5=iJxm3D2q5(q3i%NLW63BW1dyu$_Gn21h7x(~gA8S< zLtWaSE!s3})5mc8KiCGbZ!EA7a07KfC4hZGVu6n$%21X%)TIsDqRpH6Mfd0QS-$}z zGuz`t9vHdcu5jdmtxP>Af}}QlVELFd&dbOHci~{=HS@q$&&T*3spGYJt(Rly=mQ#@ z4|a(`{G$F#dgiIGf2_In-6u|2V;!U3aX3c(wx)99&2FR?j96(1OfO^5`BnSuNh$7j;sBA%21X%3+5Gk^~Wzh6XtSGdLH*9*bCpn zx#XXSUEV+(RMzKmChaFeLP`xD`zS+Mmoxp>)a7q@;Ya5z?y7s&q$a1FNf?*mO`MSU zH0I)5_K_+p%8D{3O*-##X8k@ZGxMiAw{5AUj@kRa{nfSsxzKPV6|6VUg$BJbC&~qF z@H%5IFrJ{$kka7ek0(&^h}rOZz2JES=3vyc%L@O|305`s3?;kA%7vZw%vRxnmE0ksy9@ N7(wt)&1a$RzX4e@g8Tpg literal 0 HcmV?d00001 diff --git a/reactos/base/applications/ibrowser/res/ibrowser.ico b/reactos/base/applications/ibrowser/res/ibrowser.ico new file mode 100644 index 0000000000000000000000000000000000000000..cb99641284ecc07310f9518eab044b4cbc9b183c GIT binary patch literal 50534 zcmeFa2S8Q1@;^S7)wP$k>sqj*V($fe$F;kbwTrzWAczWf#DZ8rMO46o3Km2VEFdb_ z5Gyvi4HXePD%|;hCih-Mci(%i?|sYf`!_n|oO@1kGLvL7nam_a*(g7?ZCe;|PMVOH zD2#~e)zjVQA~MQHRI#G=J}Enqa}lD#g|+uJvJuTMMo3Rc|1;GnLA0y5q}Sei6(qV` zOVaD^e|B4qrD)gGGvyZ5Zl{3vb`hH z>H^ZIBq!F^l|Y``bDA!#ydvo@8yM(NP|xjtuB%UtSiWyyP&-MLpb(<~RM5jC^94mj z0|TSbEYDL64Ktss?;98xB+pPUsPrjc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Ui?;Phb^V@=jCd1XOSd}>u$8^on%DX9=cXvehKGdv+G{WdWJFJ;xrRDOer{wB8 z;nZ<`abZE8p8a|(`?e@D8Wz*5ei8GdSxE z`wl+$rVMS-&Shxh(7yh5hEX5d9v}9R{l$QB4(AqxH~;zMI@e_t*&q1eKuja{C7e&I zb=~dwvm>Ju!-dhB@vrjx&poF9|L~u^0(=&p-Hb6zGgwRdMKTaEJTV!&%bbK+2rXjy zy(M8}TwyS0V#j=mgf+v8(LmA}lFE>f|A_eyS>tB?Y-2QJ;NRs%aADNsDf++gTgjbX z(kAoX6YILVljPCZ@76r@i95;AP*hnqHAMc`p2604+B~A z$lKI8@9Hw=zut3dt?#i0HzqA5et6Zf=-1^d^vzuEww8u}j`O$g~I9_DD_W zuB*Acyl>9*MvL4Q?Kz*kd63Tza@IK>H?y>oV{xgE<9Lw#d5~YPeAki_dY0mh#uMQF zR*bkjhYK^8p7phv{^ktqK`X~OC-xPPPd8~hS~ z%^VA|?zK6Os_Ez4i`OtUZ!XBO2bu7yW{r${BqjCss5uAuIc;A1aY_2FDB+yFY>y{Q z`~2}R!w0vvzJ)EzJF>5y0sWP2Ad4RHg&Qq{0y=bldjDo)nzgX|#JOzBWCvuptrzQDF$W?@xsEOLtv6w_a62={+xtYaI{^79T;TrhEkI}&C)A)G!im`W5hCy68w0D!S5uM!>!rx EPmXshk^lez literal 0 HcmV?d00001 diff --git a/reactos/base/applications/ibrowser/res/network.ico b/reactos/base/applications/ibrowser/res/network.ico new file mode 100644 index 0000000000000000000000000000000000000000..5bcf5ec7cbf6580cc14ae9386a3474f9f0c77f1f GIT binary patch literal 9062 zcmeHMcUV+c^PZ(GiXe!X7?h@njU?DL*opZpNe~sWAOY;XL`_ps(Igth5=#`Z8kz&@e#EBMI7GCvq)KlIv(w zOKlk$=%BYa*VUmGEn1MizCIbX&?J+V8f4T`n@n42k&%HO85``t<2Tg9Z(v30-u_sha^!?bd?E+Zxk2yAHH=P%E0<%aGg$n$o;M?P=veLv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l?HznP_Y7O^aN<;M86ErSzhaL^2Xo54}Dp`JVn<39qQjy5@i|3)moNs0-< zDKq$M2A};R23$Xw!H+Zea|W-@dUCDX7;paZyKmHj3uo}v4E|Y)slaI?mhx-{5np*S zxOWC`&v*xWF(Rvv@yr`sBbiYlV|YQ49=RtS2K8Q23O9g5wK}%ooo!T1Db#T zVkU8KsDX~gt@k?{)SyPfsCO`GCk>s9v>zdk@kYDgS^iGMJf?sH-~@>O?Q3HLi3>&V X5Wowa1pZ9C(BReBHyi&P!KMBmL^5l| literal 0 HcmV?d00001 diff --git a/reactos/base/applications/ibrowser/res/reactos.ico b/reactos/base/applications/ibrowser/res/reactos.ico new file mode 100644 index 0000000000000000000000000000000000000000..492e388a939f05b77da8a5a5681b2843e38b3a55 GIT binary patch literal 25214 zcmeHP30zgx)?Xk3Do$aB4T?5sW+stIkb(**3W6dEIDjaqD2Sq76qSppTn1-RoU6TA9s0QcLrh&jzzzy|=#qf8Tov%wF||?|a|-x%n;jIs5Fh_u6Z(wf5Tk ztaU|Pq=7VRCdfTyTz!$1BI4_7zu)dD@;8)q>EgI=BC-`=ukR)uTto)k;H>W^r(H#+ zw|3TdlX31MBilOb`^q>sk(b&#>-)-f^xL_Uvp()`7CCyaNC)76M*=j2c$tL0E|+Ex zzE$SL-zj-{d6J)Shs+ysr<9KAB+JHklA_W6lAjWcJV4e>50H7Oy`(rJQkG?fO6ior zvMgtqys@>j9Nc=RytC^rc_2SbHd!O(ne~0-$?{0qvS6reFC8L}mB-1d{8U+6m?00Z z$(GH_XG`VA9C>o<6nSq?j2wGadfvFfA2~8^YQ)i)v4#@o6ir(g)^_qg|lzT#Xr9<7tenv-<|(R z{_^b^`Qf{Bk~idLxf(>yX&8Y20TPlPAm!JT8M0TmDwFfJzgV&YE?5+4d+7I;tl1YV zfyEarH+l7YvMSCv6oc>+R#M zjsM!+rz{nyjV5F>>hVn<08=y2sh9myzH!jPaVuW9;5#lZpaJlk?s!lS`5d{{m3T5S zhuF!}kD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hqA!-lRoZi-BwMS#*O!s zlAv#Hr*H3@&2+Na-=Ce$-sqS8z5tmFB4jQn`-3F%b7%)WVFd>IIzhwHvRqyKI)R)l z<#HVD8%fepIsPVAm*q95%=KfEBuj=oJUo5Y0pNYx-jE*Y$C`PFS0woGhP~e_Jj;jK?3A ziRep~b15%NzVn4H=Z{MA?9J}D!yZbE*>hk{;zrZvWIc25d4o7r@7OMW8m zC2YVVKHmn>`&IhFYKUrJMZSFbqPal$iarhknKvetWK<%M8DJrPp+t*hV=%VlV$q$j z2>d(eC8m+5Z<6PrFX4>gh>`fEAv@WGY0x*DBJcL9VH3{KN7!0@>MqtnwW*#mg@G*(!CeaE78a^R58UxB@{{Rtz^7Q|=$m1cgt(#^qkA!V_ zn^|#cZgs*#FvRa-@^N;huOvsWX18bWS==^1B?3WTm~gCczk^yz(m%9*{Bit-`m`$A zt;fyU()A*Qj)vAoNwOF`;6>oO?r9+@`o7qGALZ#HVFQZ1&+&YzpKEqtP*n! zJvg1sZYR8=6)$`Tk`B{n^4OtH>1+C44+yb4#7`Hm!Y4Of%q2AsHcB{I23GP0aHt~i zFW1oqsY@QB9WQLEjZL8e>|)siIuux?S@Sl=x}=e)2I` zkS7hI?KdF|Qu{v{^2C%(ga27tfuT(<$siqxXP=DyfTP0Z^z{DFuq%qYPMx&!a`yBb Pj?rxx^nURFgHrzmrx|d` literal 0 HcmV?d00001 diff --git a/reactos/base/applications/ibrowser/utility/comutil.h b/reactos/base/applications/ibrowser/utility/comutil.h new file mode 100644 index 00000000000..fc2655e00c2 --- /dev/null +++ b/reactos/base/applications/ibrowser/utility/comutil.h @@ -0,0 +1,321 @@ +/* + * Copyright 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // comutil.h + // + // C++ wrapper classes for COM interfaces + // + // Martin Fuchs, 25.01.2005 + // + + + // windows shell headers +#include +#include + +/*@@ +#if _MSC_VER>=1300 // VS.Net +#include +using namespace _com_util; +#endif +*/ + +#ifndef _INC_COMUTIL // is comutil.h of MS headers not available? +#ifndef _NO_COMUTIL +#define _NO_COMUTIL +#endif +#endif + + + // Exception Handling + +#ifndef _NO_COMUTIL + +#define COMExceptionBase _com_error + +#else + + /// COM ExceptionBase class as replacement for _com_error +struct COMExceptionBase +{ + COMExceptionBase(HRESULT hr) + : _hr(hr) + { + } + + HRESULT Error() const + { + return _hr; + } + + LPCTSTR ErrorMessage() const + { + if (_msg.empty()) { + LPTSTR pBuf; + + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + 0, _hr, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPTSTR)&pBuf, 0, NULL)) { + _msg = pBuf; + LocalFree(pBuf); + } else { + TCHAR buffer[128]; + _stprintf(buffer, TEXT("unknown Exception: 0x%08lX"), _hr); + _msg = buffer; + } + } + + return _msg; + } + +protected: + HRESULT _hr; + mutable String _msg; +}; + +#endif + + + /// Exception with context information + +struct COMException : public COMExceptionBase +{ + typedef COMExceptionBase super; + + COMException(HRESULT hr) + : super(hr), + _context(CURRENT_CONTEXT), + _file(NULL), _line(0) + { + LOG(toString()); + LOG(CURRENT_CONTEXT.getStackTrace()); + } + + COMException(HRESULT hr, const char* file, int line) + : super(hr), + _context(CURRENT_CONTEXT), + _file(file), _line(line) + { + LOG(toString()); + LOG(CURRENT_CONTEXT.getStackTrace()); + } + + COMException(HRESULT hr, const String& obj) + : super(hr), + _context(CURRENT_CONTEXT), + _file(NULL), _line(0) + { + LOG(toString()); + LOG(CURRENT_CONTEXT.getStackTrace()); + } + + COMException(HRESULT hr, const String& obj, const char* file, int line) + : super(hr), + _context(CURRENT_CONTEXT), + _file(file), _line(line) + { + LOG(toString()); + LOG(CURRENT_CONTEXT.getStackTrace()); + } + + String toString() const; + + Context _context; + + const char* _file; + int _line; +}; + +#define THROW_EXCEPTION(hr) throw COMException(hr, __FILE__, __LINE__) +#define CHECKERROR(hr) ((void)(FAILED(hr)? THROW_EXCEPTION(hr): 0)) + + +#ifdef _NO_COMUTIL + +inline void CheckError(HRESULT hr) +{ + if (FAILED(hr)) + throw COMException(hr); +} + +#endif + + + /// COM Initialisation + +struct ComInit +{ + ComInit() + { + CHECKERROR(CoInitialize(0)); + } + +#if (_WIN32_WINNT>=0x0400) || defined(_WIN32_DCOM) + ComInit(DWORD flag) + { + CHECKERROR(CoInitializeEx(0, flag)); + } +#endif + + ~ComInit() + { + CoUninitialize(); + } +}; + + + /// OLE initialisation for drag drop support + +struct OleInit +{ + OleInit() + { + CHECKERROR(OleInitialize(0)); + } + + ~OleInit() + { + OleUninitialize(); + } +}; + + + /// Exception Handler for COM exceptions + +extern void HandleException(COMException& e, HWND hwnd); + + + /// wrapper class for COM interface pointers + +template struct SIfacePtr +{ + SIfacePtr() + : _p(0) + { + } + + SIfacePtr(T* p) + : _p(p) + { + if (p) + p->AddRef(); + } + + SIfacePtr(IUnknown* unknown, REFIID riid) + { + CHECKERROR(unknown->QueryInterface(riid, (LPVOID*)&_p)); + } + + ~SIfacePtr() + { + Free(); + } + + T* operator->() + { + return _p; + } + + const T* operator->() const + { + return _p; + } + +/* not GCC compatible + operator const T*() const + { + return _p; + } */ + + operator T*() + { + return _p; + } + + T** operator&() + { + return &_p; + } + + bool empty() const //NOTE: GCC seems not to work correctly when defining operator bool() AND operator T*() at one time + { + return !_p; + } + + SIfacePtr& operator=(T* p) + { + Free(); + + if (p) { + p->AddRef(); + _p = p; + } + + return *this; + } + + void operator=(SIfacePtr const& o) + { + T* h = _p; + + if (o._p) + o._p->AddRef(); + + _p = o._p; + + if (h) + h->Release(); + } + + HRESULT CreateInstance(REFIID clsid, REFIID riid) + { + return CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, riid, (LPVOID*)&_p); + } + + template HRESULT QueryInterface(REFIID riid, I* p) + { + return _p->QueryInterface(riid, (LPVOID*)p); + } + + T* get() + { + return _p; + } + + void Free() + { + T* h = _p; + _p = NULL; + + if (h) + h->Release(); + } + +protected: + SIfacePtr(const SIfacePtr& o) + : _p(o._p) + { + if (_p) + _p->AddRef(); + } + + T* _p; +}; diff --git a/reactos/base/applications/ibrowser/utility/utility.cpp b/reactos/base/applications/ibrowser/utility/utility.cpp new file mode 100644 index 00000000000..5ab4981ee4b --- /dev/null +++ b/reactos/base/applications/ibrowser/utility/utility.cpp @@ -0,0 +1,419 @@ +/* + * Copyright 2003, 2004, 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // Explorer clone + // + // utility.cpp + // + // Martin Fuchs, 23.07.2003 + // + + +#include + +//#include + +#include +#include + + +DWORD WINAPI Thread::ThreadProc(void* para) +{ + Thread* pThis = (Thread*) para; + + int ret = pThis->Run(); + + pThis->_alive = false; + + return ret; +} + + +void CenterWindow(HWND hwnd) +{ + RECT rt, prt; + GetWindowRect(hwnd, &rt); + + DWORD style; + HWND owner = 0; + + for(HWND wh=hwnd; (wh=GetWindow(wh,GW_OWNER))!=0; ) + if (((style=GetWindowStyle(wh))&WS_VISIBLE) && !(style&WS_MINIMIZE)) + {owner=wh; break;} + + if (owner) + GetWindowRect(owner, &prt); + else + SystemParametersInfo(SPI_GETWORKAREA, 0, &prt, 0); //@@ GetDesktopWindow() wäre auch hilfreich. + + SetWindowPos(hwnd, 0, (prt.left+prt.right+rt.left-rt.right)/2, + (prt.top+prt.bottom+rt.top-rt.bottom)/2, 0,0, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER); + + MoveVisible(hwnd); +} + +void MoveVisible(HWND hwnd) +{ + RECT rc; + GetWindowRect(hwnd, &rc); + int left=rc.left, top=rc.top; + + int xmax = GetSystemMetrics(SM_CXSCREEN); + int ymax = GetSystemMetrics(SM_CYSCREEN); + + if (rc.left < 0) + rc.left = 0; + else if (rc.right > xmax) + if ((rc.left-=rc.right-xmax) < 0) + rc.left = 0; + + if (rc.top < 0) + rc.top = 0; + else if (rc.bottom > ymax) + if ((rc.top-=rc.bottom-ymax) < 0) + rc.top = 0; + + if (rc.left!=left || rc.top!=top) + SetWindowPos(hwnd, 0, rc.left,rc.top, 0,0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE); +} + + +void display_error(HWND hwnd, DWORD error) //@@ CONTEXT mit ausgeben -> display_error(HWND hwnd, const Exception& e) +{ + PTSTR msg; + + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL)) { + LOG(FmtString(TEXT("display_error(%#x): %s"), error, msg)); + + SetLastError(0); + MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK); + + if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE) + MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK); + } else { + LOG(FmtString(TEXT("Unknown Error %#x"), error)); + + FmtString msg(TEXT("Unknown Error %#x"), error); + + SetLastError(0); + MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK); + + if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE) + MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK); + } + + LocalFree(msg); +} + + +Context Context::s_main("-NO-CONTEXT-"); +Context* Context::s_current = &Context::s_main; + +String Context::toString() const +{ + String str = _ctx; + + if (!_obj.empty()) + str.appendf(TEXT("\nObject: %s"), (LPCTSTR)_obj); + + return str; +} + +String Context::getStackTrace() const +{ + ostringstream str; + + str << "Context Trace:\n"; + + for(const Context*p=this; p && p!=&s_main; p=p->_last) { + str << "- " << p->_ctx; + + if (!p->_obj.empty()) + str << " obj=" << ANS(p->_obj); + + str << '\n'; + } + + return str.str(); +} + + +BOOL time_to_filetime(const time_t* t, FILETIME* ftime) +{ + struct tm* tm = gmtime(t); + SYSTEMTIME stime; + + if (!tm) + return FALSE; + + stime.wYear = tm->tm_year+1900; + stime.wMonth = tm->tm_mon+1; + stime.wDayOfWeek = (WORD)-1; + stime.wDay = tm->tm_mday; + stime.wHour = tm->tm_hour; + stime.wMinute = tm->tm_min; + stime.wSecond = tm->tm_sec; + stime.wMilliseconds = 0; + + return SystemTimeToFileTime(&stime, ftime); +} + + +BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters) +{ + CONTEXT("launch_file()"); + + HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow); + + if ((int)hinst <= 32) { + display_error(hwnd, GetLastError()); + return FALSE; + } + + return TRUE; +} + +#ifdef UNICODE +BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow, LPCSTR parameters) +{ + HINSTANCE hinst = ShellExecuteA(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow); + + if ((int)hinst <= 32) { + display_error(hwnd, GetLastError()); + return FALSE; + } + + return TRUE; +} +#endif + + +/* search for already running instance */ + +static int g_foundPrevInstance = 0; + +static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam) +{ + TCHAR cls[128]; + + GetClassName(hwnd, cls, 128); + + if (!lstrcmp(cls, (LPCTSTR)lparam)) { + g_foundPrevInstance++; + return FALSE; + } + + return TRUE; +} + +/* search for window of given class name to allow only one running instance */ +int find_window_class(LPCTSTR classname) +{ + EnumWindows(EnumWndProc, (LPARAM)classname); + + if (g_foundPrevInstance) + return 1; + + return 0; +} + + +typedef void (WINAPI*RUNDLLPROC)(HWND hwnd, HINSTANCE hinst, LPCTSTR cmdline, DWORD nCmdShow); + +BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow) +{ + HMODULE hmod = LoadLibrary(dllname); + if (!hmod) + return FALSE; + +/*TODO + + It is possible to create a Unicode version of the function. + Rundll32 first tries to find a function named EntryPointW. + If it cannot find this function, it tries EntryPointA, then EntryPoint. + To create a DLL that supports ANSI on Windows 95/98/Me and Unicode otherwise, + export two functions: EntryPointW and EntryPoint. +*/ + RUNDLLPROC proc = (RUNDLLPROC)GetProcAddress(hmod, procname); + if (!proc) { + FreeLibrary(hmod); + return FALSE; + } + + proc(hwnd, hmod, cmdline, nCmdShow); + + FreeLibrary(hmod); + + return TRUE; +} + + +BOOL launch_cpanel(HWND hwnd, LPCTSTR applet) +{ + //launch_file(_hwnd, applet, SW_SHOWNORMAL); // This would be enough, but we want the fastest solution. + //launch_file(_hwnd, TEXT("rundll32.exe /d shell32.dll,Control_RunDLL ")+applet, SW_SHOWNORMAL); + + return RunDLL(hwnd, TEXT("shell32"), "Control_RunDLL", applet, SW_SHOWNORMAL); +} + + +BOOL RecursiveCreateDirectory(LPCTSTR path_in) +{ + TCHAR path[MAX_PATH], hole_path[MAX_PATH]; + + _tcscpy(hole_path, path_in); + + int drv_len = 0; + LPCTSTR d; + + for(d=hole_path; *d && *d!='/' && *d!='\\'; ++d) { + ++drv_len; + + if (*d == ':') + break; + } + + LPTSTR dir = hole_path + drv_len; + + int l; + LPTSTR p = hole_path + (l=_tcslen(hole_path)); + + while(--p>=hole_path && (*p=='/' || *p=='\\')) + *p = '\0'; + + WIN32_FIND_DATA w32fd; + + HANDLE hFind = FindFirstFile(hole_path, &w32fd); + + if (hFind == INVALID_HANDLE_VALUE) { + _tcsncpy(path, hole_path, drv_len); + int i = drv_len; + + for(p=dir; *p=='/'||*p=='\\'; p++) + path[i++] = *p++; + + for(; i + + // Unicode support +#ifdef UNICODE +#define _UNICODE +#endif +#include + +#include // for SelectBrush(), ListBox_SetSel(), SubclassWindow(), ... +#include + +#ifndef _MSC_VER +#include +#endif +#include // for VARIANT + +#include // for alloca() +#include +#include // for _MAX_DIR, ... +#include // for sprintf() +#include + +#ifndef _MAX_PATH +#define _MAX_DRIVE 3 +#define _MAX_FNAME 256 +#define _MAX_DIR _MAX_FNAME +#define _MAX_EXT _MAX_FNAME +#define _MAX_PATH 260 +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define for if (0) {} else for + +#define COUNTOF(x) (sizeof(x)/sizeof(x[0])) + + +#define BUFFER_LEN 2048 + + +#define LOG(txt) + + +#ifndef _tcsrchr +#ifdef UNICODE +#define _tcsrchr wcsrchr +#else +#define _tcsrchr strrchr +#endif +#endif + +#ifndef _stprintf +#ifdef UNICODE +#define _stprintf wcsprintf +#else +#define _stprintf sprintf +#endif +#endif + +#define U2A(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, -1, d, l, NULL, NULL) +#define U2nA(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, l, d, l, NULL, NULL) +#define A2U(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, -1, d, l) +#define A2nU(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, l, d, l) + + +#ifdef __WINE__ +#ifdef UNICODE +extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); +#else +extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext); +#endif +#define _tcsnicmp strncasecmp +#define _tcsicoll strcasecmp +#endif + +#ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED +#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040 +#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#endif + + +#define SetDlgCtrlID(hwnd, id) SetWindowLong(hwnd, GWL_ID, id) +#define SetWindowStyle(hwnd, val) (DWORD)SetWindowLong(hwnd, GWL_STYLE, val) +#define SetWindowExStyle(h, val) (DWORD)SetWindowLong(hwnd, GWL_EXSTYLE, val) +#define Window_SetIcon(hwnd, type, hicon) (HICON)SendMessage(hwnd, WM_SETICON, type, (LPARAM)(hicon)) + + + // center window in respect to its parent window +extern void CenterWindow(HWND hwnd); + + // move window into visibility +extern void MoveVisible(HWND hwnd); + + // display error message +extern void display_error(HWND hwnd, DWORD error); + + // convert time_t to WIN32 FILETIME +extern BOOL time_to_filetime(const time_t* t, FILETIME* ftime); + + // search for windows of a specific classname +extern int find_window_class(LPCTSTR classname); + + // create a directory with all missing parent directories +BOOL RecursiveCreateDirectory(LPCTSTR path_in); + + // test for existing directory +BOOL exists_path(LPCTSTR path); + + +#ifdef __cplusplus +} // extern "C" +#endif + + +#ifdef __cplusplus + +#ifdef _MSC_VER +#pragma warning(disable: 4786) // disable warnings about too long debug information symbols +#endif + + // STL headers for strings and streams +#include +#include +using namespace std; + + // containers +#include +#include +#include +#include +#include + + +#if _MSC_VER>=1300 // VS.Net +#define _NO_COMUTIL //@@ +#endif + +#if defined(_MSC_VER) && !defined(_NO_COMUTIL) + + // COM utility headers +#include +using namespace _com_util; + +#endif // _MSC_VER && !_NO_COMUTIL + + + // launch a program or document file +extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow=SW_SHOWNORMAL, LPCTSTR parameters=NULL); +#ifdef UNICODE +extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow=SW_SHOWNORMAL, LPCSTR parameters=NULL); +#else +#define launch_fileA launch_file +#endif + + // call an DLL export like rundll32 +extern BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow); + + // launch control panel applet +extern BOOL launch_cpanel(HWND hwnd, LPCTSTR applet); + + + /// initialization of windows common controls +struct CommonControlInit +{ + CommonControlInit(DWORD flags=ICC_LISTVIEW_CLASSES|ICC_TREEVIEW_CLASSES|ICC_BAR_CLASSES|ICC_PROGRESS_CLASS|ICC_COOL_CLASSES) + { + INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), flags}; + + InitCommonControlsEx(&icc); + } +}; + + + /// wait cursor + +struct WaitCursor ///@todo integrate with WM_SETCURSOR to enable multithreaded background tasks as program launching +{ + WaitCursor() + { + _old_cursor = SetCursor(LoadCursor(0, IDC_WAIT)); + } + + ~WaitCursor() + { + SetCursor(_old_cursor); + } + +protected: + HCURSOR _old_cursor; +}; + + + /// base of all structures storing a window handle +struct WindowHandle +{ + WindowHandle(HWND hwnd=0) + : _hwnd(hwnd) {} + + operator HWND() const {return _hwnd;} + HWND* operator&() {return &_hwnd;} + +protected: + HWND _hwnd; +}; + + + /// locally hide a window +struct HiddenWindow : public WindowHandle +{ + HiddenWindow(HWND hwnd) + : WindowHandle(IsWindowVisible(hwnd)? hwnd: 0) + { + if (_hwnd) + SetWindowPos(_hwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW|SWP_NOREDRAW|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER); + } + + ~HiddenWindow() + { + if (_hwnd) + SetWindowPos(_hwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER); + } +}; + + + /// critical section wrapper + +struct CritSect : public CRITICAL_SECTION +{ + CritSect() + { + InitializeCriticalSection(this); + } + + ~CritSect() + { + DeleteCriticalSection(this); + } +}; + + + /// Lock protects a code section utilizing a critical section + +struct Lock +{ + Lock(CritSect& crit_sect) + : _crit_sect(crit_sect) + { + EnterCriticalSection(&crit_sect); + } + + ~Lock() + { + LeaveCriticalSection(&_crit_sect); + } + +protected: + CritSect& _crit_sect; +}; + + + /// Thread base class + +struct Thread +{ + Thread() + : _alive(false), + _destroy(false) + { + _hThread = INVALID_HANDLE_VALUE; + _evtFinish = CreateEvent(NULL, TRUE, FALSE, NULL); + } + + virtual ~Thread() + { + Stop(); + + CloseHandle(_evtFinish); + CloseHandle(_hThread); + + if (_destroy) + delete this; + } + + void Start() + { + if (!_alive) { + _alive = true; + _hThread = CreateThread(NULL, 0, ThreadProc, this, 0, NULL); + } + } + + void Stop() + { + SetEvent(_evtFinish); + + if (_alive) { + { + Lock lock(_crit_sect); + _alive = false; + } + + // wait for finishing + WaitForSingleObject(_hThread, INFINITE); + } + } + + virtual int Run() = 0; + + bool is_alive() const {return _alive;} + + CritSect _crit_sect; + +protected: + static DWORD WINAPI ThreadProc(void* para); + + HANDLE _hThread; + HANDLE _evtFinish; + bool _alive; + bool _destroy; +}; + + + // window utilities + + /// ClientRect retreives the client area rectangle of a window. +struct ClientRect : public RECT +{ + ClientRect(HWND hwnd) + { + GetClientRect(hwnd, this); + } + + operator LPRECT() {return this;} + + POINT& pos() {return *(LPPOINT)this;} +}; + + /// ClientRect retreives the window rectangle of a window. +struct WindowRect : public RECT +{ + WindowRect(HWND hwnd) + { + GetWindowRect(hwnd, this); + } + + operator LPRECT() {return this;} + + POINT& pos() {return *(LPPOINT)this;} +}; + + /// PointL encapsulates the POINT structure into a C++ object. +struct Point : public POINT +{ + Point(LONG x_, LONG y_) + { + x = x_; + y = y_; + } + + // constructor for being used in processing WM_MOUSEMOVE, WM_LBUTTONDOWN, ... messages + Point(LPARAM lparam) + { + x = GET_X_LPARAM(lparam); + y = GET_Y_LPARAM(lparam); + } + + operator LPPOINT() {return this;} +}; + + + /// transform coordinates in a RECT from client to screen coordiantes +inline void ClientToScreen(HWND hwnd, RECT* prect) + {::ClientToScreen(hwnd,(LPPOINT)&prect->left); ::ClientToScreen(hwnd,(LPPOINT)&prect->right);} + + /// transform coordinates in a RECT from screen to client coordiantes +inline void ScreenToClient(HWND hwnd, RECT* prect) + {::ScreenToClient(hwnd,(LPPOINT)&prect->left); ::ScreenToClient(hwnd,(LPPOINT)&prect->right);} + + + /// structure containing information about full screen display of the frame window +struct FullScreenParameters +{ + FullScreenParameters() + : _mode(FALSE) + { + } + + BOOL _mode; + RECT _orgPos; + BOOL _wasZoomed; +}; + + + // drawing utilities + + /// PaintCanvas is a encapsulation of device contexts managed by BeginPaint()/EndPaint(). +struct PaintCanvas : public PAINTSTRUCT +{ + PaintCanvas(HWND hwnd) + : _hwnd(hwnd) + { + BeginPaint(hwnd, this); + } + + ~PaintCanvas() + { + EndPaint(_hwnd, this); + } + + operator HDC() const {return hdc;} + +protected: + HWND _hwnd; +}; + + /// Canvas is a encapsulation of device contexts. +struct Canvas +{ + Canvas(HDC hdc) : _hdc(hdc) {} + + operator HDC() {return _hdc;} + +protected: + HDC _hdc; +}; + + /// WindowCanvas is a encapsulation of client area device contexts. +struct WindowCanvas : public Canvas +{ + WindowCanvas(HWND hwnd) + : Canvas(GetDC(hwnd)), _hwnd(hwnd) {} + + ~WindowCanvas() {ReleaseDC(_hwnd, _hdc);} + +protected: + HWND _hwnd; +}; + + + // double buffering classes + + /// Memory Canvas creates and destroys memory devoce contexts. +struct MemCanvas : public Canvas +{ + MemCanvas(HDC hdc=0) + : Canvas(CreateCompatibleDC(hdc)) {assert(_hdc);} + + ~MemCanvas() {DeleteDC(_hdc);} +}; + + /// SelectedBitmap is used to localy select bitmaps into device contexts. +struct SelectedBitmap +{ + SelectedBitmap(HDC hdc, HBITMAP hbmp) + : _hdc(hdc), _old_hbmp(SelectBitmap(hdc, hbmp)) {} + + ~SelectedBitmap() {DeleteObject(SelectBitmap(_hdc, _old_hbmp));} + +protected: + HDC _hdc; + HBITMAP _old_hbmp; +}; + + /// BufferCanvas manages offscreen bitmaps selected into memory device contexts. +struct BufferCanvas : public MemCanvas +{ + BufferCanvas(HDC hdc, int x, int y, int w, int h) + : MemCanvas(hdc), _hdctarg(hdc), + _x(x), _y(y), _w(w), _h(h), + _bmp(_hdc, CreateCompatibleBitmap(hdc, w, h)) {} + + BufferCanvas(HDC hdc, const RECT& rect) + : MemCanvas(hdc), _hdctarg(hdc), + _x(rect.left), _y(rect.top), _w(rect.right-rect.left), _h(rect.bottom-rect.top), + _bmp(_hdc, CreateCompatibleBitmap(hdc, _w, _h)) {} + +protected: + HDC _hdctarg; + int _x, _y, _w, _h; + SelectedBitmap _bmp; +}; + + /// BufferedCanvas enables double buffering for a device context. +struct BufferedCanvas : public BufferCanvas +{ + BufferedCanvas(HDC hdc, int x, int y, int w, int h, DWORD mode=SRCCOPY) + : BufferCanvas(hdc, x, y, w, h), _mode(mode) {} + + BufferedCanvas(HDC hdc, const RECT& rect, DWORD mode=SRCCOPY) + : BufferCanvas(hdc, rect), _mode(mode) {} + + ~BufferedCanvas() {BitBlt(_hdctarg, _x, _y, _w, _h, _hdc, 0, 0, _mode);} + + DWORD _mode; +}; + + /// BufferedPaintCanvas extends PaintCanvas for double buffering. +struct BufferedPaintCanvas : public PaintCanvas, public BufferedCanvas +{ + BufferedPaintCanvas(HWND hwnd) + : PaintCanvas(hwnd), + BufferedCanvas(PAINTSTRUCT::hdc, 0, 0, rcPaint.right, rcPaint.bottom) + { + } + + operator HDC() {return BufferedCanvas::_hdc;} +}; + + + /// TextColor locally selects a text color for drawing. +struct TextColor +{ + TextColor(HDC hdc, COLORREF color) + : _hdc(hdc), _old_color(SetTextColor(hdc, color)) {} + + ~TextColor() {SetTextColor(_hdc, _old_color);} + +protected: + HDC _hdc; + COLORREF _old_color; +}; + + /// BkMode locally sets the background mode for drawing. +struct BkMode +{ + BkMode(HDC hdc, int bkmode) + : _hdc(hdc), _old_bkmode(SetBkMode(hdc, bkmode)) {} + + ~BkMode() {SetBkMode(_hdc, _old_bkmode);} + +protected: + HDC _hdc; + COLORREF _old_bkmode; +}; + + /// FontSelection locally selects a font for drawing. +struct FontSelection +{ + FontSelection(HDC hdc, HFONT hFont) + : _hdc(hdc), _old_hFont(SelectFont(hdc, hFont)) {} + + ~FontSelection() {SelectFont(_hdc, _old_hFont);} + +protected: + HDC _hdc; + HFONT _old_hFont; +}; + + /// BitmapSelection locally selects a bitmap into a device context. +struct BitmapSelection +{ + BitmapSelection(HDC hdc, HBITMAP hBmp) + : _hdc(hdc), _old_hBmp(SelectBitmap(hdc, hBmp)) {} + + ~BitmapSelection() {SelectBitmap(_hdc, _old_hBmp);} + +protected: + HDC _hdc; + HBITMAP _old_hBmp; +}; + + /// BrushSelection locally selects a brush into a device context. +struct BrushSelection +{ + BrushSelection(HDC hdc, HBRUSH hBrush) + : _hdc(hdc), _old_hBrush(SelectBrush(hdc, hBrush)) {} + + ~BrushSelection() {SelectBrush(_hdc, _old_hBrush);} + +protected: + HDC _hdc; + HBRUSH _old_hBrush; +}; + + + /// Popup Menus +struct PopupMenu +{ + PopupMenu() + : _hmenu(CreatePopupMenu()) + { + } + + PopupMenu(UINT nid); + + operator HMENU() {return _hmenu;} + + void Append(UINT id, LPCTSTR str, UINT flags=MF_STRING) + { + AppendMenu(_hmenu, flags, id, str); + } + + int TrackPopupMenu(HWND hwnd, const POINT& pt, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON, LPTPMPARAMS tpm=NULL) { + return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, tpm); + } + + int PopupContextMenu(HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON) { + POINT pt; POINTSTOPOINT(pt, pos); + return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL); + } + + int TrackPopupMenu(HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON) { + POINT pt; POINTSTOPOINT(pt, pos); + ClientToScreen(hwnd, &pt); + return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL); + } + + int TrackPopupMenuAtCursor(HWND hwnd, UINT flags=TPM_LEFTBUTTON) { + POINT pt; GetCursorPos(&pt); + return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL); + } + + int TrackPopupMenuAtPos(HWND hwnd, DWORD pos, UINT flags=TPM_LEFTBUTTON) { + return TrackPopupMenuEx(_hmenu, flags, GET_X_LPARAM(pos), GET_Y_LPARAM(pos), hwnd, NULL); + } + +protected: + HMENU _hmenu; +}; + + +struct Variant : public VARIANT +{ + Variant() {VariantInit(this);} + Variant(const VARIANT& var); + Variant(const VARIANT* var); + ~Variant(); + + operator long() const; + operator bool() const; + operator VARIANT_BOOL() const; + operator IDispatch*() const; +}; + + +struct BStr +{ + BStr() + { + _p = NULL; + } + + BStr(const BSTR s) + { + _p = SysAllocString(s); + } + + BStr(LPCSTR s) + { + WCHAR b[BUFFER_LEN]; + + if (s) + _p = SysAllocStringLen(b, MultiByteToWideChar(CP_ACP, 0, s, -1, b, BUFFER_LEN)-1); + else + _p = NULL; + } + + BStr(LPCWSTR s) + { + _p = SysAllocString(s); + } + + BStr(const VARIANT& var) + : _p(NULL) + { + assign(var); + } + + ~BStr() + { + SysFreeString(_p); + } + + void assign(BSTR s); + void assign(const VARIANT& var); + + operator BSTR() const + { + return _p? _p: (BSTR)L""; + } + + int length() const + { + return _p? wcslen(_p): 0; + } + +protected: + BSTR _p; +}; + + + /// string class for TCHAR strings +struct String +#ifdef UNICODE + : public wstring +#else + : public string +#endif +{ +#ifdef UNICODE + typedef wstring super; +#else + typedef string super; +#endif + + String() {} + + String(LPCTSTR s) {if (s) super::assign(s);} + String(LPCTSTR s, int l) : super(s, l) {} + + String(const super& other) : super(other) {} + String(const String& other) : super(other) {} + +#ifdef UNICODE + String(LPCSTR s) {assign(s);} + String(LPCSTR s, int l) {assign(s, l);} + String(const string& other) {assign(other.c_str());} + String& operator=(LPCSTR s) {assign(s); return *this;} + void assign(LPCSTR s) {if (s) {TCHAR b[BUFFER_LEN]; super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, -1, b, BUFFER_LEN)-1);} else erase();} + void assign(LPCSTR s, int l) {if (s) {TCHAR b[BUFFER_LEN]; super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, l, b, BUFFER_LEN));} else erase();} + void assign(const BStr& s) {int l = s.length(); super::assign(s, l);} +#else + String(LPCWSTR s) {assign(s);} + String(LPCWSTR s, int l) {assign(s, l);} + String(const wstring& other) {assign(other.c_str());} + String& operator=(LPCWSTR s) {assign(s); return *this;} + void assign(LPCWSTR s) {if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, -1, b, BUFFER_LEN, 0, 0)-1);} else erase();} + void assign(LPCWSTR s, int l) {if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();} + void assign(const BStr& s) {int l = s.length(); if (l) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();} +#endif + String(const BStr& s) {assign(s);} + String& operator=(const BStr& s) {assign(s); return *this;} + + String& operator=(LPCTSTR s) {if (s) super::assign(s); else erase(); return *this;} + String& operator=(const super& s) {super::assign(s); return *this;} + void assign(LPCTSTR s) {super::assign(s);} + void assign(LPCTSTR s, int l) {super::assign(s, l);} + + operator LPCTSTR() const {return c_str();} + +#ifdef UNICODE + operator string() const {char b[BUFFER_LEN]; return string(b, WideCharToMultiByte(CP_ACP, 0, c_str(), -1, b, BUFFER_LEN, 0, 0)-1);} +#else + operator wstring() const {WCHAR b[BUFFER_LEN]; return wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), -1, b, BUFFER_LEN)-1);} +#endif + + String& printf(LPCTSTR fmt, ...) + { + va_list l; + TCHAR b[BUFFER_LEN]; + + va_start(l, fmt); + super::assign(b, _vstprintf(b, fmt, l)); + va_end(l); + + return *this; + } + + String& vprintf(LPCTSTR fmt, va_list l) + { + TCHAR b[BUFFER_LEN]; + + super::assign(b, _vstprintf(b, fmt, l)); + + return *this; + } + + String& appendf(LPCTSTR fmt, ...) + { + va_list l; + TCHAR b[BUFFER_LEN]; + + va_start(l, fmt); + super::append(b, _vstprintf(b, fmt, l)); + va_end(l); + + return *this; + } + + String& vappendf(LPCTSTR fmt, va_list l) + { + TCHAR b[BUFFER_LEN]; + + super::append(b, _vstprintf(b, fmt, l)); + + return *this; + } +}; + +#define _STRING_DEFINED + + +struct FmtString : public String +{ + FmtString(LPCTSTR fmt, ...) + { + va_list l; + + va_start(l, fmt); + vprintf(fmt, l); + va_end(l); + } +}; + + +#ifdef UNICODE + +struct ANS +{ + ANS(LPCWSTR s) + { + int l = wcslen(s) + 1; + _str = (LPSTR) malloc(2*l); + + if (WideCharToMultiByte(CP_ACP, 0, s, -1, _str, 2*l, 0, 0) <= 0) + *_str = '\0'; + } + + ~ANS() + { + free(_str); + } + + operator LPCSTR() {return _str;} + +protected: + LPSTR _str; +}; + +#define UNC(x) ((LPCWSTR)(x)) + +#else + +#define ANS(x) ((LPCSTR)(x)) + +struct UNC +{ + UNC(LPCSTR s) + { + int l = strlen(s) + 1; + _str = (LPWSTR) malloc(2*l); + + if (MultiByteToWideChar(CP_ACP, 0, s, -1, _str, l) <= 0) + *_str = '\0'; + } + + ~UNC() + { + free(_str); + } + + operator LPCWSTR() {return _str;} + +protected: + LPWSTR _str; +}; + +#endif + + + // determine windows version string +//@@String get_windows_version_str(); + + + /// link dynamicly to functions by using GetModuleHandle() and GetProcAddress() +template struct DynamicFct +{ + DynamicFct(LPCTSTR moduleName, UINT ordinal) + { + HMODULE hModule = GetModuleHandle(moduleName); + + _fct = (FCT) GetProcAddress(hModule, (LPCSTR)ordinal); + } + + DynamicFct(LPCTSTR moduleName, LPCSTR name) + { + HMODULE hModule = GetModuleHandle(moduleName); + + _fct = (FCT) GetProcAddress(hModule, name); + } + + FCT operator*() const {return _fct;} + operator bool() const {return _fct? true: false;} + +protected: + FCT _fct; +}; + + + /// link dynamicly to functions by using LoadLibrary() and GetProcAddress() +template struct DynamicLoadLibFct +{ + DynamicLoadLibFct(LPCTSTR moduleName, UINT ordinal) + { + _hModule = LoadLibrary(moduleName); + + _fct = (FCT) GetProcAddress(_hModule, (LPCSTR)ordinal); + } + + DynamicLoadLibFct(LPCTSTR moduleName, LPCSTR name) + { + _hModule = LoadLibrary(moduleName); + + _fct = (FCT) GetProcAddress(_hModule, name); + } + + ~DynamicLoadLibFct() + { + FreeLibrary(_hModule); + } + + FCT operator*() const {return _fct;} + operator bool() const {return _fct? true: false;} + +protected: + HMODULE _hModule; + FCT _fct; +}; + + +struct Context +{ + Context(const char* ctx) + : _ctx(ctx) + { + _last = s_current; + s_current = this; + } + + Context(const char* ctx, LPCSTR obj) + : _ctx(ctx), + _obj(obj) + { + _last = s_current; + s_current = this; + } + + Context(const char* ctx, LPCWSTR obj) + : _ctx(ctx), + _obj(obj) + { + _last = s_current; + s_current = this; + } + + Context(const Context& other) + : _ctx(other._ctx), + _obj(other._obj) + { + _last = NULL; + } + + ~Context() + { + if (_last) { + s_current = _last; + _last = NULL; + } + } + + String toString() const; + String getStackTrace() const; + + const char* _ctx; + String _obj; + + static Context& current() {return *s_current;} + +protected: + Context* _last; + + static Context* s_current; ///@todo use TLS + static Context s_main; +}; + +#define CONTEXT_OBJ __ctx__._obj +#define CONTEXT(c) Context __ctx__(c) +#define CURRENT_CONTEXT Context::current() +#define OBJ_CONTEXT(c, o) Context __ctx__(c, o) + + +extern bool SplitFileSysURL(LPCTSTR url, String& dir_out, String& fname_out); + + +#endif // __cplusplus diff --git a/reactos/base/applications/ibrowser/utility/window.cpp b/reactos/base/applications/ibrowser/utility/window.cpp new file mode 100644 index 00000000000..3d23a324448 --- /dev/null +++ b/reactos/base/applications/ibrowser/utility/window.cpp @@ -0,0 +1,1206 @@ +/* + * Copyright 2003, 2004, 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // window.cpp + // + // Martin Fuchs, 23.07.2003 + // + + +#include + +#include "../ibrowser_intres.h" // for ID_GO_BACK, ... + + +WindowClass::WindowClass(LPCTSTR classname, UINT style_, WNDPROC wndproc) +{ + memset(this, 0, sizeof(WNDCLASSEX)); + + cbSize = sizeof(WNDCLASSEX); + style = style_; + hInstance = g_hInstance; + hCursor = LoadCursor(0, IDC_ARROW); + + lpszClassName = classname; + lpfnWndProc = wndproc; + + _atomClass = 0; +} + + +IconWindowClass::IconWindowClass(LPCTSTR classname, UINT nid, UINT style, WNDPROC wndproc) + : WindowClass(classname, style, wndproc) +{ + hIcon = ResIcon(nid); + hIconSm = SmallIcon(nid); +} + + +Window::WindowMap Window::s_wnd_map; + +Window::CREATORFUNC Window::s_window_creator = NULL; +const void* Window::s_new_info = NULL; + + +Window::StaticWindowData& Window::GetStaticWindowData() +{ + static StaticWindowData s_initialized_data; + + return s_initialized_data; +} + + +Window::Window(HWND hwnd) + : WindowHandle(hwnd) +{ + Lock lock(GetStaticWindowData()._map_crit_sect); // protect access to s_wnd_map + + s_wnd_map[_hwnd] = this; +} + +Window::~Window() +{ + Lock lock(GetStaticWindowData()._map_crit_sect); // protect access to s_wnd_map + + s_wnd_map.erase(_hwnd); +} + + +HWND Window::Create(CREATORFUNC creator, DWORD dwExStyle, + LPCTSTR lpClassName, LPCTSTR lpWindowName, + DWORD dwStyle, int x, int y, int w, int h, + HWND hwndParent, HMENU hMenu/*, LPVOID lpParam*/) +{ + Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info + + s_window_creator = creator; + s_new_info = NULL; + + return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, + x, y, w, h, + hwndParent, hMenu, g_hInstance, 0/*lpParam*/); +} + +HWND Window::Create(CREATORFUNC_INFO creator, const void* info, DWORD dwExStyle, + LPCTSTR lpClassName, LPCTSTR lpWindowName, + DWORD dwStyle, int x, int y, int w, int h, + HWND hwndParent, HMENU hMenu/*, LPVOID lpParam*/) +{ + Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info + + s_window_creator = (CREATORFUNC) creator; + s_new_info = info; + + return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, + x, y, w, h, + hwndParent, hMenu, g_hInstance, 0/*lpParam*/); +} + + + /// get window controller from window handle + +Window* Window::get_window(HWND hwnd) +{ + { + Lock lock(GetStaticWindowData()._map_crit_sect); // protect access to s_wnd_map + + WindowMap::const_iterator found = s_wnd_map.find(hwnd); + + if (found!=s_wnd_map.end()) + return found->second; + } + + return NULL; +} + + + /// create controller for a new window + +Window* Window::create_controller(HWND hwnd) +{ + if (s_window_creator) { // protect for recursion and create the window object only for the first window + Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info + + const void* info = s_new_info; + s_new_info = NULL; + + CREATORFUNC window_creator = s_window_creator; + s_window_creator = NULL; + + if (info) + return CREATORFUNC_INFO(window_creator)(hwnd, info); + else + return CREATORFUNC(window_creator)(hwnd); + } + + return NULL; +} + + +LRESULT Window::Init(LPCREATESTRUCT pcs) +{ + return 0; +} + + +LRESULT CALLBACK Window::WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + Window* pThis = get_window(hwnd); + + if (!pThis) + pThis = create_controller(hwnd); + + if (pThis) { + switch(nmsg) { + case WM_COMMAND: + return pThis->Command(LOWORD(wparam), HIWORD(wparam)); + + case WM_NOTIFY: + return pThis->Notify(wparam, (NMHDR*)lparam); + + case WM_NOTIFYFORMAT: + return NFR_CURRENT; + + case WM_CREATE: + return pThis->Init((LPCREATESTRUCT)lparam); + + case WM_NCDESTROY: + delete pThis; + return 0; + + default: + return pThis->WndProc(nmsg, wparam, lparam); + } + } + else + return DefWindowProc(hwnd, nmsg, wparam, lparam); +} + +LRESULT Window::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + return DefWindowProc(_hwnd, nmsg, wparam, lparam); +} + +int Window::Command(int id, int code) +{ + return 1; // no command handler found +} + +int Window::Notify(int id, NMHDR* pnmh) +{ + return 0; +} + +void Window::CancelModes(HWND hwnd) +{ + if (hwnd) + PostMessage(hwnd, WM_CANCELMODE, 0, 0); + else + PostMessage(HWND_BROADCAST, WM_CANCELMODE, 0, 0); +} + + +SubclassedWindow::SubclassedWindow(HWND hwnd) + : super(hwnd) +{ + _orgWndProc = SubclassWindow(_hwnd, SubclassedWndProc); + + if (!_orgWndProc) + delete this; +} + +LRESULT CALLBACK SubclassedWindow::SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + SubclassedWindow* pThis = GET_WINDOW(SubclassedWindow, hwnd); + assert(pThis); + + if (pThis) { + switch(nmsg) { + case WM_COMMAND: + if (!pThis->Command(LOWORD(wparam), HIWORD(wparam))) + return 0; + break; + + case WM_NOTIFY: + return pThis->Notify(wparam, (NMHDR*)lparam); + + case WM_NOTIFYFORMAT: + return NFR_CURRENT; + + case WM_CREATE: + return pThis->Init((LPCREATESTRUCT)lparam); + + case WM_NCDESTROY: + delete pThis; + return 0; + + default: + return pThis->WndProc(nmsg, wparam, lparam); + } + } + + return CallWindowProc(pThis->_orgWndProc, hwnd, nmsg, wparam, lparam); +} + +LRESULT SubclassedWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + return CallWindowProc(_orgWndProc, _hwnd, nmsg, wparam, lparam); +} + +int SubclassedWindow::Command(int id, int code) +{ + return 1; // no command handler found +} + +int SubclassedWindow::Notify(int id, NMHDR* pnmh) +{ + return CallWindowProc(_orgWndProc, _hwnd, WM_NOTIFY, id, (LPARAM)pnmh); +} + + +ChildWindow::ChildWindow(HWND hwnd, HWND hwndFrame) + : super(hwnd), + _hwndFrame(hwndFrame) +{ +} + + +ChildWindow* ChildWindow::create(const ChildWndInfo& info, CREATORFUNC_INFO creator, + LPCTSTR classname, LPCTSTR title, DWORD style) +{ + HWND hwnd = Window::Create(creator, &info, 0, classname, title, style, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, info._hwndFrame); + + return GET_WINDOW(ChildWindow, hwnd); +} + + +LRESULT ChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + switch(nmsg) { + case PM_JUMP_TO_URL: + return go_to((LPCTSTR)lparam)? TRUE: FALSE; + + default: + return super::WndProc(nmsg, wparam, lparam); + } + + return 0; +} + + +bool ChildWindow::go_to(LPCTSTR url) +{ + const String& url_str = jump_to_int(url); + + if (!url_str.empty()) { + set_url(url_str); + + _url_history.push(url_str); + + return true; + } else + return false; +} + +void ChildWindow::set_url(LPCTSTR url) +{ + if (_url != url) { + _url = url; + + SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)url); + } +} + + +WindowSet Window::s_pretranslate_windows; + +void Window::register_pretranslate(HWND hwnd) +{ + s_pretranslate_windows.insert(hwnd); +} + +void Window::unregister_pretranslate(HWND hwnd) +{ + s_pretranslate_windows.erase(hwnd); +} + +BOOL Window::pretranslate_msg(LPMSG pmsg) +{ + for(WindowSet::const_iterator it=Window::s_pretranslate_windows.begin(); it!=s_pretranslate_windows.end(); ++it) + if (SendMessage(*it, PM_TRANSLATE_MSG, 0, (LPARAM)pmsg)) + return TRUE; + + return FALSE; +} + + +WindowSet Window::s_dialogs; + +void Window::register_dialog(HWND hwnd) +{ + s_dialogs.insert(hwnd); +} + +void Window::unregister_dialog(HWND hwnd) +{ + s_dialogs.erase(hwnd); +} + +BOOL Window::dispatch_dialog_msg(MSG* pmsg) +{ + for(WindowSet::const_iterator it=Window::s_dialogs.begin(); it!=s_dialogs.end(); ++it) + if (IsDialogMessage(*it, pmsg)) + return TRUE; + + return FALSE; +} + + +int Window::MessageLoop() +{ + MSG msg; + + while(GetMessage(&msg, 0, 0, 0)) { + try { + if (pretranslate_msg(&msg)) + continue; + + if (dispatch_dialog_msg(&msg)) + continue; + + TranslateMessage(&msg); + + try { + DispatchMessage(&msg); + } catch(COMException& e) { + HandleException(e, 0); + } + } catch(COMException& e) { + HandleException(e, 0); + } + } + + return msg.wParam; +} + + +LRESULT Window::SendParent(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + HWND parent = GetParent(_hwnd); + + if (!parent) + return 0; + + return SendMessage(parent, nmsg, wparam, lparam); +} + +LRESULT Window::PostParent(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + HWND parent = GetParent(_hwnd); + + if (!parent) + return 0; + + return PostMessage(parent, nmsg, wparam, lparam); +} + + +PreTranslateWindow::PreTranslateWindow(HWND hwnd) + : super(hwnd) +{ + register_pretranslate(hwnd); +} + +PreTranslateWindow::~PreTranslateWindow() +{ + unregister_pretranslate(_hwnd); +} + + +Dialog::Dialog(HWND hwnd) + : super(hwnd) +{ + register_dialog(hwnd); +} + +Dialog::~Dialog() +{ + unregister_dialog(_hwnd); +} + +int Dialog::DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent) +{ + Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info + + s_window_creator = creator; + s_new_info = NULL; + + ///@todo call Window::pretranslate_msg() + + return DialogBoxParam(g_hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/); +} + +int Dialog::DoModal(UINT nid, CREATORFUNC_INFO creator, const void* info, HWND hwndParent) +{ + Lock lock(GetStaticWindowData()._create_crit_sect); // protect access to s_window_creator and s_new_info + + s_window_creator = (CREATORFUNC) creator; + s_new_info = NULL; + + ///@todo call Window::pretranslate_msg() + + return DialogBoxParam(g_hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/); +} + +INT_PTR CALLBACK Window::DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + Window* pThis = get_window(hwnd); + + if (pThis) { + switch(nmsg) { + case WM_COMMAND: + pThis->Command(LOWORD(wparam), HIWORD(wparam)); + return TRUE; // message has been processed + + case WM_NOTIFY: + pThis->Notify(wparam, (NMHDR*)lparam); + return TRUE; // message has been processed + + case WM_NOTIFYFORMAT: + SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT + return TRUE; // message has been processed + + case WM_NCDESTROY: + delete pThis; + return TRUE; // message has been processed + + default: + return pThis->WndProc(nmsg, wparam, lparam); + } + } else if (nmsg == WM_INITDIALOG) { + pThis = create_controller(hwnd); + + if (pThis) + return pThis->Init(NULL); + } + + return FALSE; // message has not been processed +} + +LRESULT Dialog::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + return FALSE; // message has not been processed +} + +int Dialog::Command(int id, int code) +{ + if (code == BN_CLICKED) { + EndDialog(_hwnd, id); + return 0; // message has been processed + } + + return 1; +} + + +ResizeManager::ResizeManager(HWND hwnd) + : _hwnd(hwnd) +{ + ClientRect clnt(hwnd); + _last_size.cx = clnt.right; + _last_size.cy = clnt.bottom; + + WindowRect rect(hwnd); + _min_wnd_size.cx = rect.right - rect.left; + _min_wnd_size.cy = rect.bottom - rect.top; +} + +void ResizeManager::HandleSize(int cx, int cy) +{ + ClientRect clnt_rect(_hwnd); + SIZE new_size = {cx, cy}; + + int dx = new_size.cx - _last_size.cx; + int dy = new_size.cy - _last_size.cy; + + if (!dx && !dy) + return; + + _last_size = new_size; + + HDWP hDWP = BeginDeferWindowPos(size()); + + for(ResizeManager::const_iterator it=begin(); it!=end(); ++it) { + const ResizeEntry& e = *it; + RECT move = {0}; + + if (e._flags & MOVE_LEFT) + move.left += dx; + + if (e._flags & MOVE_RIGHT) + move.right += dx; + + if (e._flags & MOVE_TOP) + move.top += dy; + + if (e._flags & MOVE_BOTTOM) + move.bottom += dy; + + UINT flags = 0; + + if (!move.left && !move.top) + flags = SWP_NOMOVE; + + if (move.right==move.left && move.bottom==move.top) + flags |= SWP_NOSIZE; + + if (flags != (SWP_NOMOVE|SWP_NOSIZE)) { + HWND hwnd = GetDlgItem(_hwnd, e._id); + + if (hwnd) { + WindowRect rect(hwnd); + ScreenToClient(_hwnd, rect); + + rect.left += move.left; + rect.right += move.right; + rect.top += move.top; + rect.bottom += move.bottom; + + hDWP = DeferWindowPos(hDWP, hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, flags|SWP_NOACTIVATE|SWP_NOZORDER); + } + } + } + + EndDeferWindowPos(hDWP); +} + +void ResizeManager::Resize(int dx, int dy) +{ + ::SetWindowPos(_hwnd, 0, 0, 0, _min_wnd_size.cx+dx, _min_wnd_size.cy+dy, SWP_NOMOVE|SWP_NOACTIVATE); + MoveVisible(_hwnd); + + ClientRect clnt_rect(_hwnd); + HandleSize(clnt_rect.right, clnt_rect.bottom); +} + + +Button::Button(HWND parent, LPCTSTR title, int left, int top, int width, int height, + int id, DWORD flags, DWORD exStyle) + : WindowHandle(CreateWindowEx(exStyle, TEXT("BUTTON"), title, flags, left, top, width, height, + parent, (HMENU)id, g_hInstance, 0)) +{ +} + + +LRESULT OwnerdrawnButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + if (nmsg == PM_DISPATCH_DRAWITEM) { + DrawItem((LPDRAWITEMSTRUCT)lparam); + return TRUE; + } else + return super::WndProc(nmsg, wparam, lparam); +} + + +Static::Static(HWND parent, LPCTSTR title, int left, int top, int width, int height, + int id, DWORD flags, DWORD exStyle) + : WindowHandle(CreateWindowEx(exStyle, TEXT("STATIC"), title, flags, left, top, width, height, + parent, (HMENU)id, g_hInstance, 0)) +{ +} + + +static RECT s_MyDrawText_Rect = {0, 0, 0, 0}; + +static BOOL CALLBACK MyDrawText(HDC hdc, LPARAM data, int cnt) +{ + ::DrawText(hdc, (LPCTSTR)data, cnt, &s_MyDrawText_Rect, DT_SINGLELINE); + return TRUE; +} + +void DrawGrayText(HDC hdc, LPRECT pRect, LPCTSTR title, int dt_flags) +{ + COLORREF gray = GetSysColor(COLOR_GRAYTEXT); + + if (gray) { + TextColor lcColor(hdc, GetSysColor(COLOR_BTNHIGHLIGHT)); + RECT shadowRect = {pRect->left+1, pRect->top+1, pRect->right+1, pRect->bottom+1}; + DrawText(hdc, title, -1, &shadowRect, dt_flags); + + SetTextColor(hdc, gray); + DrawText(hdc, title, -1, pRect, dt_flags); + } else { + int old_r = pRect->right; + int old_b = pRect->bottom; + + DrawText(hdc, title, -1, pRect, dt_flags|DT_CALCRECT); + + int x = pRect->left + (old_r-pRect->right)/2; + int y = pRect->top + (old_b-pRect->bottom)/2; + int w = pRect->right-pRect->left; + int h = pRect->bottom-pRect->top; + s_MyDrawText_Rect.right = w; + s_MyDrawText_Rect.bottom = h; + + GrayString(hdc, GetSysColorBrush(COLOR_GRAYTEXT), MyDrawText, (LPARAM)title, -1, x, y, w, h); + } +} + + +/* not yet used +void ColorButton::DrawItem(LPDRAWITEMSTRUCT dis) +{ + UINT state = DFCS_BUTTONPUSH; + + if (dis->itemState & ODS_DISABLED) + state |= DFCS_INACTIVE; + + RECT textRect = {dis->rcItem.left+2, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4}; + + if (dis->itemState & ODS_SELECTED) { + state |= DFCS_PUSHED; + ++textRect.left; ++textRect.top; + ++textRect.right; ++textRect.bottom; + } + + DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, state); + + TCHAR title[BUFFER_LEN]; + GetWindowText(_hwnd, title, BUFFER_LEN); + + BkMode bk_mode(dis->hDC, TRANSPARENT); + + if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) + DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER|DT_CENTER); + else { + TextColor lcColor(dis->hDC, _textColor); + DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER); + } + + if (dis->itemState & ODS_FOCUS) { + RECT rect = { + dis->rcItem.left+3, dis->rcItem.top+3, + dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4 + }; + if (dis->itemState & ODS_SELECTED) { + ++rect.left; ++rect.top; + ++rect.right; ++rect.bottom; + } + DrawFocusRect(dis->hDC, &rect); + } +} +*/ + + +void PictureButton::DrawItem(LPDRAWITEMSTRUCT dis) +{ + UINT state = DFCS_BUTTONPUSH; + int style = GetWindowStyle(_hwnd); + + if (dis->itemState & ODS_DISABLED) + state |= DFCS_INACTIVE; + + POINT imagePos; + RECT textRect; + int dt_flags; + + if (style & BS_BOTTOM) { + // align horizontal centered, vertical floating + imagePos.x = (dis->rcItem.left + dis->rcItem.right - _cx) / 2; + imagePos.y = dis->rcItem.top + 3; + + textRect.left = dis->rcItem.left + 2; + textRect.top = dis->rcItem.top + _cy + 4; + textRect.right = dis->rcItem.right - 4; + textRect.bottom = dis->rcItem.bottom - 4; + + dt_flags = DT_SINGLELINE|DT_CENTER|DT_VCENTER; + } else { + // horizontal floating, vertical centered + imagePos.x = dis->rcItem.left + 3; + imagePos.y = (dis->rcItem.top + dis->rcItem.bottom - _cy)/2; + + textRect.left = dis->rcItem.left + _cx + 4; + textRect.top = dis->rcItem.top + 2; + textRect.right = dis->rcItem.right - 4; + textRect.bottom = dis->rcItem.bottom - 4; + + dt_flags = DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/; + } + + if (dis->itemState & ODS_SELECTED) { + state |= DFCS_PUSHED; + ++imagePos.x; ++imagePos.y; + ++textRect.left; ++textRect.top; + ++textRect.right; ++textRect.bottom; + } + + if (_flat) { + FillRect(dis->hDC, &dis->rcItem, _hBrush); + + if (style & BS_FLAT) // Only with BS_FLAT set, there will be drawn a frame without highlight. + DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT); + } else + DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, state); + + if (_hIcon) + DrawIconEx(dis->hDC, imagePos.x, imagePos.y, _hIcon, _cx, _cy, 0, _hBrush, DI_NORMAL); + else { + MemCanvas mem_dc; + BitmapSelection sel(mem_dc, _hBmp); + BitBlt(dis->hDC, imagePos.x, imagePos.y, _cx, _cy, mem_dc, 0, 0, SRCCOPY); + } + + TCHAR title[BUFFER_LEN]; + GetWindowText(_hwnd, title, BUFFER_LEN); + + BkMode bk_mode(dis->hDC, TRANSPARENT); + + if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) + DrawGrayText(dis->hDC, &textRect, title, dt_flags); + else { + TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNTEXT)); + DrawText(dis->hDC, title, -1, &textRect, dt_flags); + } + + if (dis->itemState & ODS_FOCUS) { + RECT rect = { + dis->rcItem.left+3, dis->rcItem.top+3, + dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4 + }; + if (dis->itemState & ODS_SELECTED) { + ++rect.left; ++rect.top; + ++rect.right; ++rect.bottom; + } + DrawFocusRect(dis->hDC, &rect); + } +} + + +void FlatButton::DrawItem(LPDRAWITEMSTRUCT dis) +{ + UINT style = DFCS_BUTTONPUSH; + + if (dis->itemState & ODS_DISABLED) + style |= DFCS_INACTIVE; + + RECT textRect = {dis->rcItem.left+2, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4}; + + if (dis->itemState & ODS_SELECTED) { + style |= DFCS_PUSHED; + ++textRect.left; ++textRect.top; + ++textRect.right; ++textRect.bottom; + } + + FillRect(dis->hDC, &dis->rcItem, GetSysColorBrush(COLOR_BTNFACE)); + + // highlight the button? + if (_active) + DrawEdge(dis->hDC, &dis->rcItem, EDGE_ETCHED, BF_RECT); + else if (GetWindowStyle(_hwnd) & BS_FLAT) // Only with BS_FLAT there will be drawn a frame to show highlighting. + DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT); + + TCHAR txt[BUFFER_LEN]; + int txt_len = GetWindowText(_hwnd, txt, BUFFER_LEN); + + if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) { + COLORREF gray = GetSysColor(COLOR_GRAYTEXT); + + if (gray) { + { + TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNHIGHLIGHT)); + RECT shadowRect = {textRect.left+1, textRect.top+1, textRect.right+1, textRect.bottom+1}; + DrawText(dis->hDC, txt, txt_len, &shadowRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER); + } + + BkMode mode(dis->hDC, TRANSPARENT); + TextColor lcColor(dis->hDC, gray); + DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER); + } else { + int old_r = textRect.right; + int old_b = textRect.bottom; + DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER|DT_CALCRECT); + int x = textRect.left + (old_r-textRect.right)/2; + int y = textRect.top + (old_b-textRect.bottom)/2; + int w = textRect.right-textRect.left; + int h = textRect.bottom-textRect.top; + s_MyDrawText_Rect.right = w; + s_MyDrawText_Rect.bottom = h; + GrayString(dis->hDC, GetSysColorBrush(COLOR_GRAYTEXT), MyDrawText, (LPARAM)txt, txt_len, x, y, w, h); + } + } else { + TextColor lcColor(dis->hDC, _active? _activeColor: _textColor); + DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER); + } + + if (dis->itemState & ODS_FOCUS) { + RECT rect = { + dis->rcItem.left+3, dis->rcItem.top+3, + dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4 + }; + if (dis->itemState & ODS_SELECTED) { + ++rect.left; ++rect.top; + ++rect.right; ++rect.bottom; + } + DrawFocusRect(dis->hDC, &rect); + } +} + +LRESULT FlatButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + switch(nmsg) { + case WM_MOUSEMOVE: { + bool active = false; + + if (IsWindowEnabled(_hwnd)) { + DWORD pid_foreground; + HWND hwnd_foreground = GetForegroundWindow(); //@@ may be better look for WM_ACTIVATEAPP ? + GetWindowThreadProcessId(hwnd_foreground, &pid_foreground); + + if (GetCurrentProcessId() == pid_foreground) { + POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)}; + ClientRect clntRect(_hwnd); + + // highlight the button? + if (pt.x>=clntRect.left && pt.x=clntRect.top && pt.y=clntRect.right || pt.y=clntRect.bottom) + goto cancel_press; + + goto def;} + + case WM_CANCELMODE: + cancel_press: { + TRACKMOUSEEVENT tme = {sizeof(tme), /*TME_HOVER|*/TME_LEAVE|TME_CANCEL, _hwnd/*, HOVER_DEFAULT*/}; + _TrackMouseEvent(&tme); + _active = false; + ReleaseCapture();} + // fall through + + case WM_MOUSELEAVE: + if (_active) { + _active = false; + + InvalidateRect(_hwnd, NULL, TRUE); + } + + return 0; + + default: def: + return super::WndProc(nmsg, wparam, lparam); + } +} + + +HyperlinkCtrl::HyperlinkCtrl(HWND hwnd, COLORREF colorLink, COLORREF colorVisited) + : super(hwnd), + _cmd(ResString(GetDlgCtrlID(hwnd))), + _textColor(colorLink), + _colorVisited(colorVisited), + _hfont(0), + _crsr_link(0) +{ + init(); +} + +HyperlinkCtrl::HyperlinkCtrl(HWND owner, int id, COLORREF colorLink, COLORREF colorVisited) + : super(GetDlgItem(owner, id)), + _cmd(ResString(id)), + _textColor(colorLink), + _colorVisited(colorVisited), + _hfont(0), + _crsr_link(0) +{ + init(); +} + +void HyperlinkCtrl::init() +{ + if (_cmd.empty()) { + TCHAR txt[BUFFER_LEN]; + _cmd.assign(txt, GetWindowText(_hwnd, txt, BUFFER_LEN)); + } +} + +HyperlinkCtrl::~HyperlinkCtrl() +{ + if (_hfont) + DeleteObject(_hfont); +} + +LRESULT HyperlinkCtrl::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + switch(nmsg) { + case PM_DISPATCH_CTLCOLOR: { + if (!_hfont) { + HFONT hfont = (HFONT) SendMessage(_hwnd, WM_GETFONT, 0, 0); + LOGFONT lf; GetObject(hfont, sizeof(lf), &lf); + lf.lfUnderline = TRUE; + _hfont = CreateFontIndirect(&lf); + } + + HDC hdc = (HDC) wparam; + SetTextColor(hdc, _textColor); //@@ + SelectFont(hdc, _hfont); + SetBkMode(hdc, TRANSPARENT); + return (LRESULT)GetStockObject(HOLLOW_BRUSH); + } + + case WM_SETCURSOR: + if (!_crsr_link) + _crsr_link = LoadCursor(0, IDC_HAND); + + if (_crsr_link) + SetCursor(_crsr_link); + return 0; + + case WM_NCHITTEST: + return HTCLIENT; // Aktivierung von Maus-Botschaften + + case WM_LBUTTONDOWN: + if (LaunchLink()) { + _textColor = _colorVisited; + InvalidateRect(_hwnd, NULL, FALSE); + } else + MessageBeep(0); + return 0; + + default: + return super::WndProc(nmsg, wparam, lparam); + } +} + + +ToolTip::ToolTip(HWND owner) + : super(CreateWindowEx(WS_EX_TOPMOST|WS_EX_NOPARENTNOTIFY, TOOLTIPS_CLASS, 0, + WS_POPUP|TTS_NOPREFIX|TTS_ALWAYSTIP, CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT, + owner, 0, g_hInstance, 0)) +{ + activate(); +} + + +ListSort::ListSort(HWND hwndListview, PFNLVCOMPARE compare_fct) + : WindowHandle(hwndListview), + _compare_fct(compare_fct) +{ + _sort_crit = 0; + _direction = false; +} + +void ListSort::toggle_sort(int idx) +{ + if (_sort_crit == idx) + _direction = !_direction; + else { + _sort_crit = idx; + _direction = false; + } +} + +void ListSort::sort() +{ + int idx = ListView_GetSelectionMark(_hwnd); + LPARAM param = ListView_GetItemData(_hwnd, idx); + + ListView_SortItems(_hwnd, _compare_fct, (LPARAM)this); + + if (idx >= 0) { + idx = ListView_FindItemPara(_hwnd, param); + ListView_EnsureVisible(_hwnd, idx, FALSE); + } +} + + +PropSheetPage::PropSheetPage(UINT nid, Window::CREATORFUNC dlg_creator) + : _dlg_creator(dlg_creator) +{ + PROPSHEETPAGE::dwSize = sizeof(PROPSHEETPAGE); + PROPSHEETPAGE::dwFlags = 0; + PROPSHEETPAGE::hInstance = g_hInstance; + PROPSHEETPAGE::pszTemplate = MAKEINTRESOURCE(nid); + PROPSHEETPAGE::pfnDlgProc = PropSheetPageDlg::DialogProc; + PROPSHEETPAGE::lParam = (LPARAM) this; +} + + +#ifndef PSM_GETRESULT // currently (as of 18.01.2004) missing in MinGW headers +#define PSM_GETRESULT (WM_USER + 135) +#define PropSheet_GetResult(hDlg) SNDMSG(hDlg, PSM_GETRESULT, 0, 0) +#endif + + +PropertySheetDialog::PropertySheetDialog(HWND owner) + : _hwnd(0) +{ + PROPSHEETHEADER::dwSize = sizeof(PROPSHEETHEADER); + PROPSHEETHEADER::dwFlags = PSH_PROPSHEETPAGE | PSH_MODELESS; + PROPSHEETHEADER::hwndParent = owner; + PROPSHEETHEADER::hInstance = g_hInstance; +} + +void PropertySheetDialog::add(PropSheetPage& psp) +{ + _pages.push_back(psp); +} + +int PropertySheetDialog::DoModal(int start_page) +{ + PROPSHEETHEADER::ppsp = (LPCPROPSHEETPAGE) &_pages[0]; + PROPSHEETHEADER::nPages = _pages.size(); + PROPSHEETHEADER::nStartPage = start_page; +/* + Window* pwnd = Window::create_property_sheet(this, WINDOW_CREATOR(PropertySheetDlg), NULL); + if (!pwnd) + return -1; + + HWND hwndPropSheet = *pwnd; +*/ + int ret = PropertySheet(this); + if (ret == -1) + return -1; + + HWND hwndPropSheet = (HWND) ret; + HWND hwndparent = GetParent(hwndPropSheet); + + if (hwndparent) + EnableWindow(hwndparent, FALSE); + + ret = 0; + MSG msg; + + while(GetMessage(&msg, 0, 0, 0)) { + try { + if (Window::pretranslate_msg(&msg)) + continue; + + if (PropSheet_IsDialogMessage(hwndPropSheet, &msg)) + continue; + + if (Window::dispatch_dialog_msg(&msg)) + continue; + + TranslateMessage(&msg); + + try { + DispatchMessage(&msg); + } catch(COMException& e) { + HandleException(e, 0); + } + + if (!PropSheet_GetCurrentPageHwnd(hwndPropSheet)) { + ret = PropSheet_GetResult(hwndPropSheet); + break; + } + } catch(COMException& e) { + HandleException(e, 0); + } + } + + if (hwndparent) + EnableWindow(hwndparent, TRUE); + + DestroyWindow(hwndPropSheet); + + return ret; +} + +HWND PropertySheetDialog::GetCurrentPage() +{ + HWND hdlg = PropSheet_GetCurrentPageHwnd(_hwnd); + return hdlg; +} + + +PropSheetPageDlg::PropSheetPageDlg(HWND hwnd) + : super(hwnd) +{ +} + +INT_PTR CALLBACK PropSheetPageDlg::DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + PropSheetPageDlg* pThis = GET_WINDOW(PropSheetPageDlg, hwnd); + + if (pThis) { + switch(nmsg) { + case WM_COMMAND: + pThis->Command(LOWORD(wparam), HIWORD(wparam)); + return TRUE; // message has been processed + + case WM_NOTIFY: + pThis->Notify(wparam, (NMHDR*)lparam); + return TRUE; // message has been processed + + case WM_NOTIFYFORMAT: + SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT + return TRUE; // message has been processed + + case WM_NCDESTROY: + delete pThis; + return TRUE; // message has been processed + + default: + return pThis->WndProc(nmsg, wparam, lparam); + } + } else if (nmsg == WM_INITDIALOG) { + PROPSHEETPAGE* psp = (PROPSHEETPAGE*) lparam; + PropSheetPage* ppsp = (PropSheetPage*) psp->lParam; + + if (ppsp->_dlg_creator) { + pThis = static_cast(ppsp->_dlg_creator(hwnd)); + + if (pThis) + return pThis->Init(NULL); + } + } + + return FALSE; // message has not been processed +} + +int PropSheetPageDlg::Command(int id, int code) +{ + // override call to EndDialog in Dialog::Command(); + + return FALSE; +} diff --git a/reactos/base/applications/ibrowser/utility/window.h b/reactos/base/applications/ibrowser/utility/window.h new file mode 100644 index 00000000000..73b9ea6acf4 --- /dev/null +++ b/reactos/base/applications/ibrowser/utility/window.h @@ -0,0 +1,1100 @@ +/* + * Copyright 2003, 2004, 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // window.h + // + // Martin Fuchs, 23.07.2003 + // + + +typedef set WindowSet; + + + /* + Classes are declared using "struct", not "class" because the default + access mode is "public". This way we can list the member functions in a + natural order without explicitly specifying any access mode at the begin + of the definition. + First are public constructors and destructor, then public member functions. + After that we list protected member varibables and functions. If needed, + private implemenation varibales and functions are positioned at the end. + */ + + + /// information structure for creation of a child window +struct ChildWndInfo +{ + ChildWndInfo(HWND hwndFrame) + : _hwndFrame(hwndFrame) {} + + HWND _hwndFrame; +}; + + + /** + Class Window is the base class for several C++ window wrapper classes. + Window objects are allocated from the heap. They are automatically freed + when the window gets destroyed. + */ +struct Window : public WindowHandle +{ + Window(HWND hwnd); + virtual ~Window(); + + + typedef map WindowMap; + + typedef Window* (*CREATORFUNC)(HWND); + typedef Window* (*CREATORFUNC_INFO)(HWND, const void*); + + static HWND Create(CREATORFUNC creator, DWORD dwExStyle, + LPCTSTR lpClassName, LPCTSTR lpWindowName, + DWORD dwStyle, int x, int y, int w, int h, + HWND hwndParent=0, HMENU hMenu=0/*, LPVOID lpParam=0*/); + + static HWND Create(CREATORFUNC_INFO creator, const void* info, + DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, + DWORD dwStyle, int x, int y, int w, int h, + HWND hwndParent=0, HMENU hMenu=0/*, LPVOID lpParam=0*/); + + static LRESULT CALLBACK WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam); + static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam); + + static Window* get_window(HWND hwnd); +#ifndef _MSC_VER + template static CLASS* get_window(HWND hwnd) {return static_cast(get_window(hwnd));} +#define GET_WINDOW(CLASS, hwnd) Window::get_window(hwnd) +#endif + + static void register_pretranslate(HWND hwnd); + static void unregister_pretranslate(HWND hwnd); + static BOOL pretranslate_msg(LPMSG pmsg); + + static void register_dialog(HWND hwnd); + static void unregister_dialog(HWND hwnd); + static BOOL dispatch_dialog_msg(LPMSG pmsg); + + static int MessageLoop(); + + + LRESULT SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0); + LRESULT PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0); + + static void CancelModes(HWND hwnd=0); + + +protected: + virtual LRESULT Init(LPCREATESTRUCT pcs); // WM_CREATE processing + virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + virtual int Command(int id, int code); // WM_COMMAND processing + virtual int Notify(int id, NMHDR* pnmh); // WM_NOTIFY processing + + static Window* create_controller(HWND hwnd); + + + static WindowMap s_wnd_map; + + static const void* s_new_info; + static CREATORFUNC s_window_creator; + + + /// structure for managing critical sections as static class information in struct Window + struct StaticWindowData { + CritSect _map_crit_sect; + CritSect _create_crit_sect; + }; + + static StaticWindowData& GetStaticWindowData(); + + + static WindowSet s_pretranslate_windows; + static WindowSet s_dialogs; +}; + +#ifdef UNICODE +#define NFR_CURRENT NFR_UNICODE +#else +#define NFR_CURRENT NFR_ANSI +#endif + + +#ifdef _MSC_VER +template struct GetWindowHelper +{ + static CLASS* get_window(HWND hwnd) { + return static_cast(Window::get_window(hwnd)); + } +}; +#define GET_WINDOW(CLASS, hwnd) GetWindowHelper::get_window(hwnd) +#endif + + + /// dynamic casting of Window pointers +template struct TypeCheck +{ + static CLASS* dyn_cast(Window* wnd) + {return dynamic_cast(wnd);} +}; + +#define WINDOW_DYNAMIC_CAST(CLASS, hwnd) \ + TypeCheck::dyn_cast(Window::get_window(hwnd)) + + + /** + SubclassedWindow is used to wrap already existing window handles + into C++ Window objects. To construct a object, use the "new" operator + to put it in the heap. It is automatically freed, when the window + gets destroyed. + */ +struct SubclassedWindow : public Window +{ + typedef Window super; + + SubclassedWindow(HWND); + +protected: + WNDPROC _orgWndProc; + + static LRESULT CALLBACK SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam); + + virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + virtual int Command(int id, int code); + virtual int Notify(int id, NMHDR* pnmh); +}; + + + /// template class used in macro WINDOW_CREATOR to define the creater functions for Window objects +template struct WindowCreator +{ + static WND_CLASS* window_creator(HWND hwnd) + { + return new WND_CLASS(hwnd); + } +}; + +#define WINDOW_CREATOR(WND_CLASS) \ + ((Window::CREATORFUNC) WindowCreator::window_creator) + + + /// template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects with additional creation information +template struct WindowCreatorInfo +{ + static WND_CLASS* window_creator(HWND hwnd, const void* info) + { + return new WND_CLASS(hwnd, *static_cast(info)); + } +}; + +#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS) \ + ((Window::CREATORFUNC_INFO) WindowCreatorInfo::window_creator) + + + /** + WindowClass is a neat wrapper for RegisterClassEx(). + Just construct a WindowClass object, override the attributes you want + to change, then call Register() or simply request the ATOM value to + register the window class. You don't have to worry calling Register() + more than once. It checks if, the class has already been registered. + */ +struct WindowClass : public WNDCLASSEX +{ + WindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc); + + ATOM Register() + { + if (!_atomClass) + _atomClass = RegisterClassEx(this); + + return _atomClass; + } + + operator ATOM() {return Register();} + + // return LPCTSTR for the CreateWindowEx() parameter + operator LPCTSTR() {return (LPCTSTR)(int)Register();} + +protected: + ATOM _atomClass; +}; + + /// window class with gray background color +struct BtnWindowClass : public WindowClass +{ + BtnWindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc) + : WindowClass(classname, style, wndproc) + { + hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); + } +}; + + /// window class with specified icon from resources +struct IconWindowClass : public WindowClass +{ + IconWindowClass(LPCTSTR classname, UINT nid, UINT style=0, WNDPROC wndproc=Window::WindowWndProc); +}; + + + // private message constants +#define PM_DISPATCH_COMMAND (WM_APP+0x00) +#define PM_TRANSLATE_MSG (WM_APP+0x01) + + +#define SPLIT_WIDTH 5 +#define DEFAULT_SPLIT_POS 300 +#define COLOR_SPLITBAR LTGRAY_BRUSH + + + /// menu info structure +struct MenuInfo +{ + HMENU _hMenuView; +}; + +#define PM_FRM_GET_MENUINFO (WM_APP+0x02) + +#define Frame_GetMenuInfo(hwnd) ((MenuInfo*)SNDMSG(hwnd, PM_FRM_GET_MENUINFO, 0, 0)) + + + /** + Class ChildWindow is used with class MainFrame. + */ +struct ChildWindow : public Window +{ + typedef Window super; + + ChildWindow(HWND hwnd, HWND hwndFrame); + + static ChildWindow* create(const ChildWndInfo& info, CREATORFUNC_INFO creator, + LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0); + + bool go_to(LPCTSTR url); + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + + virtual String jump_to_int(LPCTSTR url) = 0; + +protected: + MenuInfo*_menu_info; + + HWND _hwndFrame; + String _statusText; + String _url; + + stack _url_history; + + void set_url(LPCTSTR url); +}; + +#define PM_SETSTATUSTEXT (WM_APP+0x1E) + + + /** + PreTranslateWindow is used to register windows to be called by Window::pretranslate_msg(). + This way you get PM_TRANSLATE_MSG messages before the message loop dispatches messages. + You can then for example use TranslateAccelerator() to implement key shortcuts. + */ +struct PreTranslateWindow : public Window +{ + typedef Window super; + + PreTranslateWindow(HWND); + ~PreTranslateWindow(); +}; + + + /** + The class DialogWindow implements modeless dialogs, which are managed by + Window::dispatch_dialog_msg() in Window::MessageLoop(). + A DialogWindow object should be constructed by calling Window::Create() + and specifying the class using the WINDOW_CREATOR() macro. + */ +struct DialogWindow : public Window +{ + typedef Window super; + + DialogWindow(HWND hwnd) + : super(hwnd) + { + register_dialog(hwnd); + } + + ~DialogWindow() + { + unregister_dialog(_hwnd); + } +}; + + + /** + The class Dialog implements modal dialogs. + A Dialog object should be constructed by calling Dialog::DoModal() + and specifying the class using the WINDOW_CREATOR() macro. + */ +struct Dialog : public Window +{ + typedef Window super; + + Dialog(HWND); + ~Dialog(); + + static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0); + static int DoModal(UINT nid, CREATORFUNC_INFO creator, const void* info, HWND hwndParent=0); + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + int Command(int id, int code); +}; + + +#define PM_FRM_CALC_CLIENT (WM_APP+0x03) +#define Frame_CalcFrameClient(hwnd, prt) ((BOOL)SNDMSG(hwnd, PM_FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt)) + +#define PM_JUMP_TO_URL (WM_APP+0x25) +#define PM_URL_CHANGED (WM_APP+0x26) + + +struct PropSheetPage : public PROPSHEETPAGE +{ + PropSheetPage(UINT nid, Window::CREATORFUNC dlg_creator); + + void init(struct PropertySheetDialog*); + +protected: + friend struct PropSheetPageDlg; + + Window::CREATORFUNC _dlg_creator; +}; + + + /// Property Sheet dialog +struct PropertySheetDialog : public PROPSHEETHEADER +{ + PropertySheetDialog(HWND owner); + + void add(PropSheetPage& psp); + int DoModal(int start_page=0); + + HWND GetCurrentPage(); + +protected: + typedef vector Vector; + Vector _pages; + HWND _hwnd; +}; + + + /// Property Sheet Page (inner dialog) +struct PropSheetPageDlg : public Dialog +{ + typedef Dialog super; + + PropSheetPageDlg(HWND); + +protected: + friend struct PropertySheetDialog; + friend struct PropSheetPage; + + static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam); + + int Command(int id, int code); +}; + + +/* + /// Property Sheet Dialog (outer dialog) +struct PropertySheetDlg : public SubclassedWindow +{ + typedef SubclassedWindow super; + + PropertySheetDlg(HWND hwnd) : super(hwnd) {} +}; +*/ + + + // Layouting of resizable windows + + /// Flags to specify how to move and resize controls when resizing their parent window +enum RESIZE_FLAGS { + MOVE_LEFT = 0x1, + MOVE_RIGHT = 0x2, + MOVE_TOP = 0x4, + MOVE_BOTTOM = 0x8, + + MOVE_X = MOVE_LEFT | MOVE_RIGHT, + MOVE_Y = MOVE_TOP | MOVE_BOTTOM, + RESIZE_X= MOVE_RIGHT, + RESIZE_Y= MOVE_BOTTOM, + + MOVE = MOVE_X | MOVE_Y, + RESIZE = RESIZE_X | RESIZE_Y +}; + + /// structure to assign RESIZE_FLAGS to dialogs control +struct ResizeEntry +{ + ResizeEntry(UINT id, int flags) + : _id(id), _flags(flags) {} + + ResizeEntry(HWND hwnd, int flags) + : _id(GetDlgCtrlID(hwnd)), _flags(flags) {} + + UINT _id; + int _flags; +}; + + + /// Management of controls in resizable dialogs +struct ResizeManager : public std::list +{ + typedef std::list super; + + ResizeManager(HWND hwnd); + + void Add(UINT id, int flags) + {push_back(ResizeEntry(id, flags));} + + void Add(HWND hwnd, int flags) + {push_back(ResizeEntry(hwnd, flags));} + + void HandleSize(int cx, int cy); + void Resize(int dx, int dy); + + void SetMinMaxInfo(LPMINMAXINFO lpmmi) + { + lpmmi->ptMinTrackSize.x = _min_wnd_size.cx; + lpmmi->ptMinTrackSize.y = _min_wnd_size.cy; + } + + SIZE _min_wnd_size; + +protected: + HWND _hwnd; + SIZE _last_size; +}; + + + /// Controller base template class for resizable dialogs +template struct ResizeController : public BASE +{ + typedef BASE super; + + ResizeController(HWND hwnd) + : super(hwnd), + _resize_mgr(hwnd) + { + } + + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) + { + switch(nmsg) { + case PM_FRM_CALC_CLIENT: + GetClientSpace((PRECT)lparam); + return TRUE; + + case WM_SIZE: + if (wparam != SIZE_MINIMIZED) + _resize_mgr.HandleSize(LOWORD(lparam), HIWORD(lparam)); + goto def; + + case WM_GETMINMAXINFO: + _resize_mgr.SetMinMaxInfo((LPMINMAXINFO)lparam); + goto def; + + default: def: + return super::WndProc(nmsg, wparam, lparam); + } + } + + virtual void GetClientSpace(PRECT prect) + { + if (!IsIconic(this->_hwnd)) { + GetClientRect(this->_hwnd, prect); + } else { + WINDOWPLACEMENT wp; + GetWindowPlacement(this->_hwnd, &wp); + prect->left = prect->top = 0; + prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left- + 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE)); + prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top- + 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))- + GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE); + } + } + +protected: + ResizeManager _resize_mgr; +}; + + + /** + This class constructs button controls. + The button will remain existent when the C++ Button object is destroyed. + There is no conjunction between C++ object and windows control life time. + */ +struct Button : public WindowHandle +{ + Button(HWND parent, LPCTSTR text, int left, int top, int width, int height, + int id, DWORD flags=WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, DWORD exStyle=0); +}; + + + /** + This class constructs static controls. + The control will remain existent when the C++ object is destroyed. + There is no conjunction between C++ object and windows control life time. + */ +struct Static : public WindowHandle +{ + Static(HWND parent, LPCTSTR text, int left, int top, int width, int height, + int id, DWORD flags=WS_VISIBLE|WS_CHILD|SS_SIMPLE, DWORD ex_flags=0); +}; + + + // control color message routing for ColorStatic and HyperlinkCtrl + +#define PM_DISPATCH_CTLCOLOR (WM_APP+0x08) + +template struct CtlColorParent : public BASE +{ + typedef BASE super; + + CtlColorParent(HWND hwnd) + : super(hwnd) {} + + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) + { + switch(nmsg) { + case WM_CTLCOLOR: + case WM_CTLCOLORBTN: + case WM_CTLCOLORDLG: + case WM_CTLCOLORSCROLLBAR: + case WM_CTLCOLORSTATIC: { + HWND hctl = (HWND) lparam; + return SendMessage(hctl, PM_DISPATCH_CTLCOLOR, wparam, nmsg); + } + + default: + return super::WndProc(nmsg, wparam, lparam); + } + } +}; + + +#define PM_DISPATCH_DRAWITEM (WM_APP+0x09) + + /// draw message routing for ColorButton and PictureButton +template struct OwnerDrawParent : public BASE +{ + typedef BASE super; + + OwnerDrawParent(HWND hwnd) + : super(hwnd) {} + + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) + { + switch(nmsg) { + case WM_DRAWITEM: + if (wparam) { // should there be drawn a control? + HWND hctl = GetDlgItem(this->_hwnd, wparam); + + if (hctl) + return SendMessage(hctl, PM_DISPATCH_DRAWITEM, wparam, lparam); + } /*else // or is it a menu entry? + ; */ + + return 0; + + default: + return super::WndProc(nmsg, wparam, lparam); + } + } +}; + + + /** + Subclass button controls to draw them by using PM_DISPATCH_DRAWITEM + The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons. + */ +struct OwnerdrawnButton : public SubclassedWindow +{ + typedef SubclassedWindow super; + + OwnerdrawnButton(HWND hwnd) + : super(hwnd) {} + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + + virtual void DrawItem(LPDRAWITEMSTRUCT dis) = 0; +}; + +extern void DrawGrayText(HDC hdc, LPRECT pRect, LPCTSTR text, int dt_flags); + + + /** + Subclass button controls to paint colored text labels. + The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons. + */ +/* not yet used +struct ColorButton : public OwnerdrawnButton +{ + typedef OwnerdrawnButton super; + + ColorButton(HWND hwnd, COLORREF textColor) + : super(hwnd), _textColor(textColor) {} + +protected: + virtual void DrawItem(LPDRAWITEMSTRUCT dis); + + COLORREF _textColor; +}; +*/ + + +struct FlatButton : public OwnerdrawnButton +{ + typedef OwnerdrawnButton super; + + FlatButton(HWND hwnd) + : super(hwnd), _active(false) {} + + FlatButton(HWND owner, int id) + : super(GetDlgItem(owner, IDOK)), _active(false) {} + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + virtual void DrawItem(LPDRAWITEMSTRUCT dis); + + COLORREF _textColor; + COLORREF _activeColor; + bool _active; +}; + + + /** + Subclass button controls to paint pictures left to the labels. + The buttons should have set the style bit BS_OWNERDRAW. + The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons. + */ +struct PictureButton : public OwnerdrawnButton +{ + typedef OwnerdrawnButton super; + + PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) + : super(hwnd), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat) + { + _cx = 16; + _cy = 16; + } + + PictureButton(HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) + : super(GetDlgItem(hparent, id)), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat) + { + _cx = 16; + _cy = 16; + } + + PictureButton(HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) + : super(hwnd), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat) + { + BITMAP bmp; + GetObject(hBmp, sizeof(bmp), &bmp); + _cx = bmp.bmWidth; + _cy = bmp.bmHeight; + } + + PictureButton(HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) + : super(GetDlgItem(hparent, id)), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat) + { + BITMAP bmp; + GetObject(hBmp, sizeof(bmp), &bmp); + _cx = bmp.bmWidth; + _cy = bmp.bmHeight; + } + +protected: + virtual void DrawItem(LPDRAWITEMSTRUCT dis); + + HICON _hIcon; + HBITMAP _hBmp; + HBRUSH _hBrush; + + int _cx; + int _cy; + + bool _flat; +}; + + +struct ColorStatic : public SubclassedWindow +{ + typedef SubclassedWindow super; + + ColorStatic(HWND hwnd, COLORREF textColor=RGB(255,0,0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0) + : super(hwnd), + _textColor(textColor), + _hbrush_bkgnd(hbrush_bkgnd), + _hfont(hfont) + { + } + + ColorStatic(HWND owner, int id, COLORREF textColor=RGB(255,0,0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0) + : super(GetDlgItem(owner, id)), + _textColor(textColor), + _hbrush_bkgnd(hbrush_bkgnd), + _hfont(hfont) + { + } + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) + { + if (nmsg == PM_DISPATCH_CTLCOLOR) { + HDC hdc = (HDC) wparam; + + SetTextColor(hdc, _textColor); + + if (_hfont) + SelectFont(hdc, _hfont); + + if (_hbrush_bkgnd) + return (LRESULT)_hbrush_bkgnd; + else { + SetBkMode(hdc, TRANSPARENT); + return (LRESULT)GetStockBrush(HOLLOW_BRUSH); + } + } else + return super::WndProc(nmsg, wparam, lparam); + } + + COLORREF _textColor; + HBRUSH _hbrush_bkgnd; + HFONT _hfont; +}; + + + /// Hyperlink Controls + +struct HyperlinkCtrl : public SubclassedWindow +{ + typedef SubclassedWindow super; + + HyperlinkCtrl(HWND hwnd, COLORREF colorLink=RGB(0,0,255), COLORREF colorVisited=RGB(128,0,128)); + HyperlinkCtrl(HWND owner, int id, COLORREF colorLink=RGB(0,0,255), COLORREF colorVisited=RGB(128,0,128)); + + ~HyperlinkCtrl(); + + String _cmd; + +protected: + COLORREF _textColor; + COLORREF _colorVisited; + HFONT _hfont; + HCURSOR _crsr_link; + + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + + void init(); + + bool LaunchLink() + { + if (!_cmd.empty()) { + HINSTANCE hinst = ShellExecute(GetParent(_hwnd), _T("open"), _cmd, 0, 0, SW_SHOWNORMAL); + return (int)hinst > HINSTANCE_ERROR; + } + + return true; + } +}; + + + /// encapsulation of tool tip controls +struct ToolTip : public WindowHandle +{ + typedef WindowHandle super; + + ToolTip(HWND owner); + + void activate(BOOL active=TRUE) + { + SendMessage(_hwnd, TTM_ACTIVATE, active, 0); + } + + void add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0) + { + TOOLINFO ti = { + sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND|TTF_TRANSPARENT, hparent, (UINT)htool, + {0,0,0,0}, 0, (LPTSTR)txt, lparam + }; + +#ifdef UNICODE ///@todo Why is it neccesary to try both TTM_ADDTOOLW and TTM_ADDTOOLW ?! + if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti)) + SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); +#else + if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti)) + SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti); +#endif + } + + void add(HWND hparent, UINT id, const RECT& rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0) + { + TOOLINFO ti = { + sizeof(TOOLINFO), TTF_SUBCLASS|TTF_TRANSPARENT, hparent, id, + {rect.left,rect.top,rect.right,rect.bottom}, 0, (LPTSTR)txt, lparam + }; + +#ifdef UNICODE + if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti)) + SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); +#else + if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti)) + SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti); +#endif + } + + void remove(HWND hparent, HWND htool) + { + TOOLINFO ti = { + sizeof(TOOLINFO), TTF_IDISHWND, hparent, (UINT)htool, + {0,0,0,0}, 0, 0, 0 + }; + + SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti); + } + + void remove(HWND hparent, UINT id) + { + TOOLINFO ti = { + sizeof(TOOLINFO), 0, hparent, id, + {0,0,0,0}, 0, 0, 0 + }; + + SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti); + } +}; + + +inline int ListView_GetItemData(HWND list_ctrl, int idx) +{ + LV_ITEM item; + + item.mask = LVIF_PARAM; + item.iItem = idx; + + if (!ListView_GetItem(list_ctrl, &item)) + return 0; + + return item.lParam; +} + +inline int ListView_FindItemPara(HWND list_ctrl, LPARAM param) +{ + LVFINDINFO fi; + + fi.flags = LVFI_PARAM; + fi.lParam = param; + + return ListView_FindItem(list_ctrl, (unsigned)-1, &fi); +} + +inline int ListView_GetFocusedItem(HWND list_ctrl) +{ + int idx = ListView_GetItemCount(list_ctrl); + + while(--idx >= 0) + if (ListView_GetItemState(list_ctrl, idx, LVIS_FOCUSED)) + break; + + return idx; +} + + + /// sorting of list controls +struct ListSort : public WindowHandle +{ + ListSort(HWND hwndListview, PFNLVCOMPARE compare_fct); + + void toggle_sort(int idx); + void sort(); + + int _sort_crit; + bool _direction; + +protected: + PFNLVCOMPARE _compare_fct; + + static int CALLBACK CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort); +}; + + +inline LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem) +{ + TVITEM tvItem; + + tvItem.mask = TVIF_PARAM; + tvItem.hItem = hItem; + + if (!TreeView_GetItem(hwndTreeView, &tvItem)) + return 0; + + return tvItem.lParam; +} + + +enum {TRAYBUTTON_LEFT=0, TRAYBUTTON_RIGHT, TRAYBUTTON_MIDDLE}; + +#define PM_TRAYICON (WM_APP+0x20) + +#define WINMSG_TASKBARCREATED TEXT("TaskbarCreated") + + +struct TrayIcon +{ + TrayIcon(HWND hparent, UINT id) + : _hparent(hparent), _id(id) {} + + ~TrayIcon() + {Remove();} + + void Add(HICON hIcon, LPCTSTR tooltip=NULL) + {Set(NIM_ADD, _id, hIcon, tooltip);} + + void Modify(HICON hIcon, LPCTSTR tooltip=NULL) + {Set(NIM_MODIFY, _id, hIcon, tooltip);} + + void Remove() + { + NOTIFYICONDATA nid = { + sizeof(NOTIFYICONDATA), // cbSize + _hparent, // hWnd + _id, // uID + }; + + Shell_NotifyIcon(NIM_DELETE, &nid); + } + +protected: + HWND _hparent; + UINT _id; + + void Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL) + { + NOTIFYICONDATA nid = { + sizeof(NOTIFYICONDATA), // cbSize + _hparent, // hWnd + id, // uID + NIF_MESSAGE|NIF_ICON, // uFlags + PM_TRAYICON, // uCallbackMessage + hIcon // hIcon + }; + + if (tooltip) + lstrcpyn(nid.szTip, tooltip, COUNTOF(nid.szTip)); + + if (nid.szTip[0]) + nid.uFlags |= NIF_TIP; + + Shell_NotifyIcon(dwMessage, &nid); + } +}; + + +template struct TrayIconControllerTemplate : public BASE +{ + typedef BASE super; + + TrayIconControllerTemplate(HWND hwnd) : BASE(hwnd), + WM_TASKBARCREATED(RegisterWindowMessage(WINMSG_TASKBARCREATED)) + { + } + + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) + { + if (nmsg == PM_TRAYICON) { + switch(lparam) { + case WM_MOUSEMOVE: + TrayMouseOver(wparam); + break; + + case WM_LBUTTONDOWN: + TrayClick(wparam, TRAYBUTTON_LEFT); + break; + + case WM_LBUTTONDBLCLK: + TrayDblClick(wparam, TRAYBUTTON_LEFT); + break; + + case WM_RBUTTONDOWN: + TrayClick(wparam, TRAYBUTTON_RIGHT); + break; + + case WM_RBUTTONDBLCLK: + TrayDblClick(wparam, TRAYBUTTON_RIGHT); + break; + + case WM_MBUTTONDOWN: + TrayClick(wparam, TRAYBUTTON_MIDDLE); + break; + + case WM_MBUTTONDBLCLK: + TrayDblClick(wparam, TRAYBUTTON_MIDDLE); + break; + } + + return 0; + } else if (nmsg == WM_TASKBARCREATED) { + AddTrayIcons(); + return 0; + } else + return super::WndProc(nmsg, wparam, lparam); + } + + virtual void AddTrayIcons() = 0; + virtual void TrayMouseOver(UINT id) {} + virtual void TrayClick(UINT id, int btn) {} + virtual void TrayDblClick(UINT id, int btn) {} + +protected: + const UINT WM_TASKBARCREATED; +}; + + +struct EditController : public SubclassedWindow +{ + typedef SubclassedWindow super; + + EditController(HWND hwnd) + : super(hwnd) + { + } + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) + { + if (nmsg==WM_KEYDOWN && wparam==VK_RETURN) { + SendParent(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(_hwnd),1), (LPARAM)_hwnd); + return 0; + } else + return super::WndProc(nmsg, wparam, lparam); + } +}; diff --git a/reactos/base/applications/ibrowser/utility/xmlstorage.cpp b/reactos/base/applications/ibrowser/utility/xmlstorage.cpp new file mode 100644 index 00000000000..0a2dc79d8a7 --- /dev/null +++ b/reactos/base/applications/ibrowser/utility/xmlstorage.cpp @@ -0,0 +1,623 @@ + + // + // XML storage classes + // + // xmlstorage.cpp + // + // Copyright (c) 2004, 2005 Martin Fuchs + // + + +/* + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +//#include "xmlstorage.h" +#include + + + // work around GCC's wide string constant bug +#ifdef __GNUC__ +const LPCXSSTR XMLStorage::XS_TRUE = XS_TEXT("true"); +const LPCXSSTR XMLStorage::XS_FALSE = XS_TEXT("false"); +const LPCXSSTR XMLStorage::XS_NUMBERFMT = XS_TEXT("%d"); +#endif + + +namespace XMLStorage { + + +static std::string unescape(const char* s, char b='"', char e='"') +{ + const char* end = s + strlen(s); + +// if (*s == b) +// ++s; +// +// if (end>s && end[-1]==e) +// --end; + + if (*s == b) + if (end>s && end[-1]==e) + ++s, --end; + + return std::string(s, end-s); +} + +static std::string unescape(const char* s, int l, char b='"', char e='"') +{ + const char* end = s + l; + +// if (*s == b) +// ++s; +// +// if (end>s && end[-1]==e) +// --end; + + if (*s == b) + if (end>s && end[-1]==e) + ++s, --end; + + return std::string(s, end-s); +} + + + /// move XPath like to position in XML tree +bool XMLPos::go(const char* path) +{ + XMLNode* node = _cur; + + // Is this an absolute path? + if (*path == '/') { + node = _root; + ++path; + } + + node = node->find_relative(path); + + if (node) { + go_to(node); + return true; + } else + return false; +} + + /// move XPath like to position in XML tree +bool const_XMLPos::go(const char* path) +{ + const XMLNode* node = _cur; + + // Is this an absolute path? + if (*path == '/') { + node = _root; + ++path; + } + + node = node->find_relative(path); + + if (node) { + go_to(node); + return true; + } else + return false; +} + + +const XMLNode* XMLNode::find_relative(const char* path) const +{ + const XMLNode* node = this; + + // parse relative path + while(*path) { + const char* slash = strchr(path, '/'); + if (slash == path) + return NULL; + + int l = slash? slash-path: strlen(path); + std::string comp(path, l); + path += l; + + // look for [n] and [@attr_name="attr_value"] expressions in path components + const char* bracket = strchr(comp.c_str(), '['); + l = bracket? bracket-comp.c_str(): comp.length(); + std::string child_name(comp.c_str(), l); + std::string attr_name, attr_value; + + int n = 0; + if (bracket) { + std::string expr = unescape(bracket, '[', ']'); + const char* p = expr.c_str(); + + n = atoi(p); // read index number + + if (n) + n = n - 1; // convert into zero based index + + const char* at = strchr(p, '@'); + + if (at) { + p = at + 1; + const char* equal = strchr(p, '='); + + // read attribute name and value + if (equal) { + attr_name = unescape(p, equal-p); + attr_value = unescape(equal+1); + } + } + } + + if (attr_name.empty()) + // search n.th child node with specified name + node = node->find(child_name, n); + else + // search n.th child node with specified name and matching attribute value + node = node->find(child_name, attr_name, attr_value, n); + + if (!node) + return NULL; + + if (*path == '/') + ++path; + } + + return node; +} + +XMLNode* XMLNode::create_relative(const char* path) +{ + XMLNode* node = this; + + // parse relative path + while(*path) { + const char* slash = strchr(path, '/'); + if (slash == path) + return NULL; + + int l = slash? slash-path: strlen(path); + std::string comp(path, l); + path += l; + + // look for [n] and [@attr_name="attr_value"] expressions in path components + const char* bracket = strchr(comp.c_str(), '['); + l = bracket? bracket-comp.c_str(): comp.length(); + std::string child_name(comp.c_str(), l); + std::string attr_name, attr_value; + + int n = 0; + if (bracket) { + std::string expr = unescape(bracket, '[', ']'); + const char* p = expr.c_str(); + + n = atoi(p); // read index number + + if (n) + n = n - 1; // convert into zero based index + + const char* at = strchr(p, '@'); + + if (at) { + p = at + 1; + const char* equal = strchr(p, '='); + + // read attribute name and value + if (equal) { + attr_name = unescape(p, equal-p); + attr_value = unescape(equal+1); + } + } + } + + XMLNode* child; + + if (attr_name.empty()) + // search n.th child node with specified name + child = node->find(child_name, n); + else + // search n.th child node with specified name and matching attribute value + child = node->find(child_name, attr_name, attr_value, n); + + if (!child) { + child = new XMLNode(child_name); + node->add_child(child); + + if (!attr_name.empty()) + (*node)[attr_name] = attr_value; + } + + node = child; + + if (*path == '/') + ++path; + } + + return node; +} + + + /// read XML stream into XML tree below _pos +XML_Status XMLReaderBase::read() +{ + XML_Status status = XML_STATUS_OK; + + while(status == XML_STATUS_OK) { + char* buffer = (char*) XML_GetBuffer(_parser, BUFFER_LEN); + + int l = read_buffer(buffer, BUFFER_LEN); + if (l < 0) + break; + + status = XML_ParseBuffer(_parser, l, false); + } + + if (status != XML_STATUS_ERROR) + status = XML_ParseBuffer(_parser, 0, true); + + if (_pos->_children.empty()) + _pos->_trailing.append(_content); + else + _pos->_children.back()->_trailing.append(_content); + + _content.erase(); + + return status; +} + + + /// store XML version and encoding into XML reader +void XMLCALL XMLReaderBase::XML_XmlDeclHandler(void* userData, const XML_Char* version, const XML_Char* encoding, int standalone) +{ + XMLReaderBase* pReader = (XMLReaderBase*) userData; + + if (version) + pReader->_xml_version = version; + + if (encoding) + pReader->_encoding = encoding; +} + + /// notifications about XML start tag +void XMLCALL XMLReaderBase::XML_StartElementHandler(void* userData, const XML_Char* name, const XML_Char** atts) +{ + XMLReaderBase* pReader = (XMLReaderBase*) userData; + XMLPos& pos = pReader->_pos; + + // search for end of first line + const char* s = pReader->_content.c_str(); + const char* p = s; + const char* e = p + pReader->_content.length(); + + for(; p_children.empty()) { // no children in last node? + if (pReader->_last_tag == TAG_START) + pos->_content.append(s, p-s); + else if (pReader->_last_tag == TAG_END) + pos->_trailing.append(s, p-s); + // else TAG_NONE -> don't store white space in root node + } else + pos->_children.back()->_trailing.append(s, p-s); + + std::string leading; + + if (p != e) + leading.assign(p, e-p); + + XMLNode* node = new XMLNode(String_from_XML_Char(name), leading); + + pos.add_down(node); + + while(*atts) { + const XML_Char* attr_name = *atts++; + const XML_Char* attr_value = *atts++; + + (*node)[String_from_XML_Char(attr_name)] = String_from_XML_Char(attr_value); + } + + pReader->_last_tag = TAG_START; + pReader->_content.erase(); +} + + /// notifications about XML end tag +void XMLCALL XMLReaderBase::XML_EndElementHandler(void* userData, const XML_Char* name) +{ + XMLReaderBase* pReader = (XMLReaderBase*) userData; + XMLPos& pos = pReader->_pos; + + // search for end of first line + const char* s = pReader->_content.c_str(); + const char* p = s; + const char* e = p + pReader->_content.length(); + + for(; p_children.empty()) // no children in current node? + pos->_content.append(s, p-s); + else + if (pReader->_last_tag == TAG_START) + pos->_content.append(s, p-s); + else + pos->_children.back()->_trailing.append(s, p-s); + + if (p != e) + pos->_end_leading.assign(p, e-p); + + pos.back(); + + pReader->_last_tag = TAG_END; + pReader->_content.erase(); +} + + /// store content, white space and comments +void XMLCALL XMLReaderBase::XML_DefaultHandler(void* userData, const XML_Char* s, int len) +{ + XMLReaderBase* pReader = (XMLReaderBase*) userData; + + pReader->_content.append(s, len); +} + + +std::string XMLReaderBase::get_error_string() const +{ + XML_Error error = XML_GetErrorCode(_parser); + + switch(error) { + case XML_ERROR_NONE: return "XML_ERROR_NONE"; + case XML_ERROR_NO_MEMORY: return "XML_ERROR_NO_MEMORY"; + case XML_ERROR_SYNTAX: return "XML_ERROR_SYNTAX"; + case XML_ERROR_NO_ELEMENTS: return "XML_ERROR_NO_ELEMENTS"; + case XML_ERROR_INVALID_TOKEN: return "XML_ERROR_INVALID_TOKEN"; + case XML_ERROR_UNCLOSED_TOKEN: return "XML_ERROR_UNCLOSED_TOKEN"; + case XML_ERROR_PARTIAL_CHAR: return "XML_ERROR_PARTIAL_CHAR"; + case XML_ERROR_TAG_MISMATCH: return "XML_ERROR_TAG_MISMATCH"; + case XML_ERROR_DUPLICATE_ATTRIBUTE: return "XML_ERROR_DUPLICATE_ATTRIBUTE"; + case XML_ERROR_JUNK_AFTER_DOC_ELEMENT: return "XML_ERROR_JUNK_AFTER_DOC_ELEMENT"; + case XML_ERROR_PARAM_ENTITY_REF: return "XML_ERROR_PARAM_ENTITY_REF"; + case XML_ERROR_UNDEFINED_ENTITY: return "XML_ERROR_UNDEFINED_ENTITY"; + case XML_ERROR_RECURSIVE_ENTITY_REF: return "XML_ERROR_RECURSIVE_ENTITY_REF"; + case XML_ERROR_ASYNC_ENTITY: return "XML_ERROR_ASYNC_ENTITY"; + case XML_ERROR_BAD_CHAR_REF: return "XML_ERROR_BAD_CHAR_REF"; + case XML_ERROR_BINARY_ENTITY_REF: return "XML_ERROR_BINARY_ENTITY_REF"; + case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: return "XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF"; + case XML_ERROR_MISPLACED_XML_PI: return "XML_ERROR_MISPLACED_XML_PI"; + case XML_ERROR_UNKNOWN_ENCODING: return "XML_ERROR_UNKNOWN_ENCODING"; + case XML_ERROR_INCORRECT_ENCODING: return "XML_ERROR_INCORRECT_ENCODING"; + case XML_ERROR_UNCLOSED_CDATA_SECTION: return "XML_ERROR_UNCLOSED_CDATA_SECTION"; + case XML_ERROR_EXTERNAL_ENTITY_HANDLING: return "XML_ERROR_EXTERNAL_ENTITY_HANDLING"; + case XML_ERROR_NOT_STANDALONE: return "XML_ERROR_NOT_STANDALONE"; + case XML_ERROR_UNEXPECTED_STATE: return "XML_ERROR_UNEXPECTED_STATE"; + case XML_ERROR_ENTITY_DECLARED_IN_PE: return "XML_ERROR_ENTITY_DECLARED_IN_PE"; + case XML_ERROR_FEATURE_REQUIRES_XML_DTD: return "XML_ERROR_FEATURE_REQUIRES_XML_DTD"; + case XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING: return "XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING"; + case XML_ERROR_UNBOUND_PREFIX: return "XML_ERROR_UNBOUND_PREFIX"; + // EXPAT version >= 1.95.8 +#if XML_MAJOR_VERSION>1 || (XML_MAJOR_VERSION==1 && XML_MINOR_VERSION>95) || (XML_MAJOR_VERSION==1 && XML_MINOR_VERSION==95 && XML_MICRO_VERSION>7) + case XML_ERROR_UNDECLARING_PREFIX: return "XML_ERROR_UNDECLARING_PREFIX"; + case XML_ERROR_INCOMPLETE_PE: return "XML_ERROR_INCOMPLETE_PE"; + case XML_ERROR_XML_DECL: return "XML_ERROR_XML_DECL"; + case XML_ERROR_TEXT_DECL: return "XML_ERROR_TEXT_DECL"; + case XML_ERROR_PUBLICID: return "XML_ERROR_PUBLICID"; + case XML_ERROR_SUSPENDED: return "XML_ERROR_SUSPENDED"; + case XML_ERROR_NOT_SUSPENDED: return "XML_ERROR_NOT_SUSPENDED"; + case XML_ERROR_ABORTED: return "XML_ERROR_ABORTED"; + case XML_ERROR_FINISHED: return "XML_ERROR_FINISHED"; + case XML_ERROR_SUSPEND_PE: return "XML_ERROR_SUSPEND_PE"; +//#endif +//#if XML_MAJOR_VERSION>=2 + /* Added in 2.0. */ + case XML_ERROR_RESERVED_PREFIX_XML: return "XML_ERROR_RESERVED_PREFIX_XML"; + case XML_ERROR_RESERVED_PREFIX_XMLNS: return "XML_ERROR_RESERVED_PREFIX_XMLNS"; + case XML_ERROR_RESERVED_NAMESPACE_URI: return "XML_ERROR_RESERVED_NAMESPACE_URI"; +#endif + } + + std::ostringstream out; + + out << "XML parser error #" << error; + + return out.str(); +} + + +std::string EncodeXMLString(const XS_String& str) +{ + LPCXSSTR s = str.c_str(); + LPXSSTR buffer = (LPXSSTR)alloca(5*sizeof(XS_CHAR)*XS_len(s)); // worst case. "&" + LPXSSTR o = buffer; + + for(LPCXSSTR p=s; *p; ++p) + switch(*p) { + case '&': + *o++ = '&'; *o++ = 'a'; *o++ = 'm'; *o++ = 'p'; *o++ = ';'; + break; + + case '<': + *o++ = '&'; *o++ = 'l'; *o++ = 't'; *o++ = ';'; + break; + + case '>': + *o++ = '&'; *o++ = 'g'; *o++ = 't'; *o++ = ';'; + break; + + case '"': + *o++ = '&'; *o++ = 'q'; *o++ = 'u'; *o++ = 'o'; *o++ = 't'; *o++ = ';'; + break; + + case '\'': + *o++ = '&'; *o++ = 'a'; *o++ = 'p'; *o++ = 'o'; *o++ = 's'; *o++ = ';'; + break; + + default: + *o++ = *p; + } + +#ifdef XS_STRING_UTF8 + return XS_String(buffer, o-buffer); +#else + return get_utf8(buffer, o-buffer); +#endif +} + +XS_String DecodeXMLString(const XS_String& str) +{ + LPCXSSTR s = str.c_str(); + LPXSSTR buffer = (LPXSSTR)alloca(sizeof(XS_CHAR)*XS_len(s)); + LPXSSTR o = buffer; + + for(LPCXSSTR p=s; *p; ++p) + if (*p == '&') { + if (!XS_nicmp(p+1, XS_TEXT("lt;"), 3)) { + *o++ = '<'; + p += 3; + } else if (!XS_nicmp(p+1, XS_TEXT("gt;"), 3)) { + *o++ = '>'; + p += 3; + } else if (!XS_nicmp(p+1, XS_TEXT("amp;"), 4)) { + *o++ = '&'; + p += 4; + } else if (!XS_nicmp(p+1, XS_TEXT("quot;"), 5)) { + *o++ = '"'; + p += 5; + } else if (!XS_nicmp(p+1, XS_TEXT("apos;"), 5)) { + *o++ = '\''; + p += 5; + } else + *o++ = *p; + } else + *o++ = *p; + + return XS_String(buffer, o-buffer); +} + + + /// write node with children tree to output stream using original white space +void XMLNode::write_worker(std::ostream& out, int indent) const +{ + out << _leading << '<' << EncodeXMLString(*this); + + for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it) + out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\""; + + if (!_children.empty() || !_content.empty()) { + out << '>' << _content; + + for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) + (*it)->write_worker(out, indent+1); + + out << _end_leading << "'; + } else + out << "/>"; + + out << _trailing; +} + + + /// pretty print node with children tree to output stream +void XMLNode::pretty_write_worker(std::ostream& out, int indent) const +{ + for(int i=indent; i--; ) + out << XML_INDENT_SPACE; + + out << '<' << EncodeXMLString(*this); + + for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it) + out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\""; + + if (!_children.empty() || !_content.empty()) { + out << ">\n"; + + for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) + (*it)->pretty_write_worker(out, indent+1); + + for(int i=indent; i--; ) + out << XML_INDENT_SPACE; + + out << "\n"; + } else + out << "/>\n"; +} + + + /// write node with children tree to output stream using smart formating +void XMLNode::smart_write_worker(std::ostream& out, int indent) const +{ + if (_leading.empty()) + for(int i=indent; i--; ) + out << XML_INDENT_SPACE; + else + out << _leading; + + out << '<' << EncodeXMLString(*this); + + for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it) + out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\""; + + if (_children.empty() && _content.empty()) + out << "/>"; + else { + out << '>'; + + if (_content.empty()) + out << '\n'; + else + out << _content; + + Children::const_iterator it = _children.begin(); + + if (it != _children.end()) { + for(; it!=_children.end(); ++it) + (*it)->smart_write_worker(out, indent+1); + + if (_end_leading.empty()) + for(int i=indent; i--; ) + out << XML_INDENT_SPACE; + else + out << _end_leading; + } else + out << _end_leading; + + out << "'; + } + + if (_trailing.empty()) + out << '\n'; + else + out << _trailing; +} + + +} // namespace XMLStorage diff --git a/reactos/base/applications/ibrowser/utility/xmlstorage.h b/reactos/base/applications/ibrowser/utility/xmlstorage.h new file mode 100644 index 00000000000..f3ef5cf781d --- /dev/null +++ b/reactos/base/applications/ibrowser/utility/xmlstorage.h @@ -0,0 +1,1733 @@ + + // + // XML storage classes + // + // xmlstorage.h + // + // Copyright (c) 2004, 2005 Martin Fuchs + // + + +/* + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _XMLSTORAGE_H + +#include + +#ifdef _MSC_VER +#pragma comment(lib, "libexpat.lib") +#pragma warning(disable: 4786) +#endif + + +#include // for LPCTSTR + +#ifdef UNICODE +#define _UNICODE +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include + + +#ifndef BUFFER_LEN +#define BUFFER_LEN 2048 +#endif + + +namespace XMLStorage { + + +#ifndef XS_String + +#ifdef XS_STRING_UTF8 +#define XS_CHAR char +#define XS_TEXT(x) x +#define LPXSSTR LPSTR +#define LPCXSSTR LPCSTR +#define XS_icmp stricmp +#define XS_nicmp strnicmp +#define XS_toi atoi +#define XS_len strlen +#define XS_sprintf sprintf +#define XS_vsprintf vsprintf +#else +#define XS_CHAR TCHAR +#define XS_TEXT(x) TEXT(x) +#define LPXSSTR LPTSTR +#define LPCXSSTR LPCTSTR +#define XS_icmp _tcsicmp +#define XS_nicmp _tcsnicmp +#define XS_toi _ttoi +#define XS_len _tcslen +#define XS_sprintf _stprintf +#define XS_vsprintf _vstprintf +#endif + +#if defined(_STRING_DEFINED) && !defined(XS_STRING_UTF8) + +#define XS_String String + +#else // _STRING_DEFINED, !XS_STRING_UTF8 + + /// string class for TCHAR strings + +struct XS_String +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + : public std::wstring +#else + : public std::string +#endif +{ +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + typedef std::wstring super; +#else + typedef std::string super; +#endif + + XS_String() {} + + XS_String(LPCXSSTR s) {if (s) super::assign(s);} + XS_String(LPCXSSTR s, int l) : super(s, l) {} + + XS_String(const super& other) : super(other) {} + XS_String(const XS_String& other) : super(other) {} + +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + XS_String(LPCSTR s) {assign(s);} + XS_String(LPCSTR s, int l) {assign(s, l);} + XS_String(const std::string& other) {assign(other.c_str());} + XS_String& operator=(LPCSTR s) {assign(s); return *this;} + void assign(LPCSTR s) {if (s) {int bl=strlen(s); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, bl, b, bl));} else erase();} + void assign(LPCSTR s, int l) {if (s) {int bl=l; LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, l, b, bl));} else erase();} +#else + XS_String(LPCWSTR s) {assign(s);} + XS_String(LPCWSTR s, int l) {assign(s, l);} + XS_String(const std::wstring& other) {assign(other.c_str());} + XS_String& operator=(LPCWSTR s) {assign(s); return *this;} +#ifdef XS_STRING_UTF8 + void assign(const XS_String& s) {assign(s.c_str());} + void assign(LPCWSTR s) {if (s) {int bl=wcslen(s); LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_UTF8, 0, s, bl, b, bl, 0, 0));} else erase();} + void assign(LPCWSTR s, int l) {int bl=l; if (s) {LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_UTF8, 0, s, l, b, bl, 0, 0));} else erase();} +#else // if !UNICODE && !XS_STRING_UTF8 + void assign(LPCWSTR s) {if (s) {int bl=wcslen(s); LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, bl, b, bl, 0, 0));} else erase();} + void assign(LPCWSTR s, int l) {int bl=l; if (s) {LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, bl, 0, 0));} else erase();} +#endif +#endif + + XS_String& operator=(LPCXSSTR s) {if (s) super::assign(s); else erase(); return *this;} + XS_String& operator=(const super& s) {super::assign(s); return *this;} + void assign(LPCXSSTR s) {super::assign(s);} + void assign(LPCXSSTR s, int l) {super::assign(s, l);} + + operator LPCXSSTR() const {return c_str();} + +#ifdef XS_STRING_UTF8 + operator std::wstring() const {int bl=length(); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); return std::wstring(b, MultiByteToWideChar(CP_UTF8, 0, c_str(), bl, b, bl));} +#elif defined(UNICODE) + operator std::string() const {int bl=length(); LPSTR b=(LPSTR)alloca(bl); return std::string(b, WideCharToMultiByte(CP_ACP, 0, c_str(), bl, b, bl, 0, 0));} +#else + operator std::wstring() const {int bl=length(); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); return std::wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), bl, b, bl));} +#endif + + XS_String& printf(LPCXSSTR fmt, ...) + { + va_list l; + XS_CHAR b[BUFFER_LEN]; + + va_start(l, fmt); + super::assign(b, XS_vsprintf(b, fmt, l)); + va_end(l); + + return *this; + } + + XS_String& vprintf(LPCXSSTR fmt, va_list l) + { + XS_CHAR b[BUFFER_LEN]; + + super::assign(b, XS_vsprintf(b, fmt, l)); + + return *this; + } + + XS_String& appendf(LPCXSSTR fmt, ...) + { + va_list l; + XS_CHAR b[BUFFER_LEN]; + + va_start(l, fmt); + super::append(b, XS_vsprintf(b, fmt, l)); + va_end(l); + + return *this; + } + + XS_String& vappendf(LPCXSSTR fmt, va_list l) + { + XS_CHAR b[BUFFER_LEN]; + + super::append(b, XS_vsprintf(b, fmt, l)); + + return *this; + } +}; + +#endif // _STRING_DEFINED, !XS_STRING_UTF8 + +#endif // XS_String + + +#ifndef XS_STRING_UTF8 + +inline void assign_utf8(XS_String& s, const char* str) +{ + int lutf8 = strlen(str); + +#ifdef UNICODE + LPTSTR buffer = (LPTSTR)alloca(sizeof(TCHAR)*lutf8); + int l = MultiByteToWideChar(CP_UTF8, 0, str, lutf8, buffer, lutf8); +#else + LPWSTR wbuffer = (LPWSTR)alloca(sizeof(WCHAR)*lutf8); + int l = MultiByteToWideChar(CP_UTF8, 0, str, lutf8, wbuffer, lutf8); + + int bl=2*l; LPSTR buffer = (LPSTR)alloca(bl); + l = WideCharToMultiByte(CP_ACP, 0, wbuffer, l, buffer, bl, 0, 0); +#endif + + s.assign(buffer, l); +} + +inline std::string get_utf8(LPCTSTR s, int l) +{ +#ifdef UNICODE + int bl=2*l; LPSTR buffer = (LPSTR)alloca(bl); + l = WideCharToMultiByte(CP_UTF8, 0, s, l, buffer, bl, 0, 0); +#else + LPWSTR wbuffer = (LPWSTR)alloca(sizeof(WCHAR)*l); + l = MultiByteToWideChar(CP_ACP, 0, s, l, wbuffer, l); + + int bl=2*l; LPSTR buffer = (LPSTR)alloca(bl); + l = WideCharToMultiByte(CP_UTF8, 0, wbuffer, l, buffer, bl, 0, 0); +#endif + + return std::string(buffer, l); +} + +inline std::string get_utf8(const XS_String& s) +{ + return get_utf8(s.c_str(), s.length()); +} + +#endif // XS_STRING_UTF8 + +extern std::string EncodeXMLString(const XS_String& str); +extern XS_String DecodeXMLString(const XS_String& str); + + +#ifdef __GNUC__ +#include +typedef __gnu_cxx::stdio_filebuf STDIO_FILEBUF; +#else +typedef std::filebuf STDIO_FILEBUF; +#endif + + /// input file stream with ANSI/UNICODE file names +struct tifstream : public std::istream +{ + typedef std::istream super; + + tifstream(LPCTSTR path) + : super(&_buf), + _pfile(_tfopen(path, TEXT("r"))), +#ifdef __GNUC__ + _buf(_pfile, ios::in) +#else + _buf(_pfile) +#endif + { + } + + ~tifstream() + { + if (_pfile) + fclose(_pfile); + } + +protected: + FILE* _pfile; + STDIO_FILEBUF _buf; +}; + + /// output file stream with ANSI/UNICODE file names +struct tofstream : public std::ostream +{ + typedef std::ostream super; + + tofstream(LPCTSTR path) + : super(&_buf), + _pfile(_tfopen(path, TEXT("w"))), +#ifdef __GNUC__ + _buf(_pfile, ios::out) +#else + _buf(_pfile) +#endif + { + } + + ~tofstream() + { + flush(); + + if (_pfile) + fclose(_pfile); + } + +protected: + FILE* _pfile; + STDIO_FILEBUF _buf; +}; + + + // write XML files with 2 spaces indenting +#define XML_INDENT_SPACE " " + + +#ifdef XML_UNICODE // Are XML_Char strings UTF-16 encoded? + +typedef XS_String String_from_XML_Char; + +#elif defined(XS_STRING_UTF8) + +typedef XS_String String_from_XML_Char; + +#else + +struct String_from_XML_Char : public XS_String +{ + String_from_XML_Char(const XML_Char* str) + { + assign_utf8(*this, str); + } +}; + +#endif + + +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + + // optimization for faster UNICODE/ASCII string comparison without temporary A/U conversion +inline bool operator==(const XS_String& s1, const char* s2) +{ + LPCWSTR p = s1; + const unsigned char* q = (const unsigned char*)s2; + + while(*p && *q) + if (*p++ != *q++) + return false; + + return *p == *q; +}; + +#endif + + + /// in memory representation of an XML node +struct XMLNode : public XS_String +{ +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + // optimized read access without temporary A/U conversion when using ASCII attribute names + struct AttributeMap : public std::map + { + typedef std::map super; + + const_iterator find(const char* x) const + { + for(const_iterator it=begin(); it!=end(); ++it) + if (it->first == x) + return it; + + return end(); + } + + const_iterator find(const key_type& x) const + { + return super::find(x); + } + + iterator find(const key_type& x) + { + return super::find(x); + } + }; +#else + typedef std::map AttributeMap; +#endif + + struct Children : public std::list + { + void assign(const Children& other) + { + clear(); + + for(Children::const_iterator it=other.begin(); it!=other.end(); ++it) + push_back(new XMLNode(**it)); + } + + void clear() + { + while(!empty()) { + XMLNode* node = back(); + pop_back(); + + node->clear(); + delete node; + } + } + }; + + // access to protected class members for XMLPos and XMLReader + friend struct XMLPos; + friend struct const_XMLPos; + friend struct XMLReaderBase; + + XMLNode(const XS_String& name) + : XS_String(name) + { + } + + XMLNode(const XS_String& name, const std::string& leading) + : XS_String(name), + _leading(leading) + { + } + + XMLNode(const XMLNode& other) + : _attributes(other._attributes), + _leading(other._leading), + _content(other._content), + _end_leading(other._end_leading), + _trailing(other._trailing) + { + for(Children::const_iterator it=other._children.begin(); it!=other._children.end(); ++it) + _children.push_back(new XMLNode(**it)); + } + + ~XMLNode() + { + while(!_children.empty()) { + delete _children.back(); + _children.pop_back(); + } + } + + void clear() + { + _leading.erase(); + _content.erase(); + _end_leading.erase(); + _trailing.erase(); + + _attributes.clear(); + _children.clear(); + + XS_String::erase(); + } + + XMLNode& operator=(const XMLNode& other) + { + _children.assign(other._children); + + _attributes = other._attributes; + + _leading = other._leading; + _content = other._content; + _end_leading = other._end_leading; + _trailing = other._trailing; + + return *this; + } + + /// add a new child node + void add_child(XMLNode* child) + { + _children.push_back(child); + } + + /// write access to an attribute + void put(const XS_String& attr_name, const XS_String& value) + { + _attributes[attr_name] = value; + } + + /// C++ write access to an attribute + XS_String& operator[](const XS_String& attr_name) + { + return _attributes[attr_name]; + } + + /// read only access to an attribute + template XS_String get(const T& attr_name) const + { + AttributeMap::const_iterator found = _attributes.find(attr_name); + + if (found != _attributes.end()) + return found->second; + else + return XS_String(); + } + + /// convenient value access in children node + XS_String subvalue(const XS_String& name, const XS_String& attr_name, int n=0) const + { + const XMLNode* node = find(name, n); + + if (node) + return node->get(attr_name); + else + return XS_String(); + } + + /// convenient storage of distinct values in children node + XS_String& subvalue(const XS_String& name, const XS_String& attr_name, int n=0) + { + XMLNode* node = find(name, n); + + if (!node) { + node = new XMLNode(name); + add_child(node); + } + + return (*node)[attr_name]; + } + +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + /// convenient value access in children node + XS_String subvalue(const char* name, const char* attr_name, int n=0) const + { + const XMLNode* node = find(name, n); + + if (node) + return node->get(attr_name); + else + return XS_String(); + } + + /// convenient storage of distinct values in children node + XS_String& subvalue(const char* name, const XS_String& attr_name, int n=0) + { + XMLNode* node = find(name, n); + + if (!node) { + node = new XMLNode(name); + add_child(node); + } + + return (*node)[attr_name]; + } +#endif + + const Children& get_children() const + { + return _children; + } + + Children& get_children() + { + return _children; + } + + XS_String get_content() const + { +#ifdef XS_STRING_UTF8 + const XS_String& ret = _content; +#else + XS_String ret; + assign_utf8(ret, _content.c_str()); +#endif + + return DecodeXMLString(ret.c_str()); + } + + void set_content(const XS_String& s) + { + _content.assign(EncodeXMLString(s.c_str())); + } + + enum WRITE_MODE { + FORMAT_SMART = 0, /// preserve original white space and comments if present; pretty print otherwise + FORMAT_ORIGINAL = 1, /// write XML stream preserving original white space and comments + FORMAT_PRETTY = 2 /// pretty print node to stream without preserving original white space + }; + + /// write node with children tree to output stream + std::ostream& write(std::ostream& out, WRITE_MODE mode=FORMAT_SMART, int indent=0) const + { + switch(mode) { + case FORMAT_PRETTY: + pretty_write_worker(out, indent); + break; + + case FORMAT_ORIGINAL: + write_worker(out, indent); + break; + + default: // FORMAT_SMART + smart_write_worker(out, indent); + } + + return out; + } + +protected: + Children _children; + AttributeMap _attributes; + + std::string _leading; + std::string _content; + std::string _end_leading; + std::string _trailing; + + XMLNode* get_first_child() const + { + if (!_children.empty()) + return _children.front(); + else + return NULL; + } + + XMLNode* find(const XS_String& name, int n=0) const + { + for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) + if (**it == name) + if (!n--) + return *it; + + return NULL; + } + + XMLNode* find(const XS_String& name, const XS_String& attr_name, const XS_String& attr_value, int n=0) const + { + for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) { + const XMLNode& node = **it; + + if (node==name && node.get(attr_name)==attr_value) + if (!n--) + return *it; + } + + return NULL; + } + +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + XMLNode* find(const char* name, int n=0) const + { + for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) + if (**it == name) + if (!n--) + return *it; + + return NULL; + } + + template + XMLNode* find(const char* name, const T& attr_name, const U& attr_value, int n=0) const + { + for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) { + const XMLNode& node = **it; + + if (node==name && node.get(attr_name)==attr_value) + if (!n--) + return *it; + } + + return NULL; + } +#endif + + /// XPath find functions + const XMLNode* find_relative(const char* path) const; + + XMLNode* find_relative(const char* path) + {return const_cast(const_cast(this)->find_relative(path));} + + /// relative XPath create function + XMLNode* create_relative(const char* path); + + void write_worker(std::ostream& out, int indent) const; + void pretty_write_worker(std::ostream& out, int indent) const; + void smart_write_worker(std::ostream& out, int indent) const; +}; + + + /// iterator access to children nodes with name filtering +struct XMLChildrenFilter +{ + XMLChildrenFilter(XMLNode::Children& children, const XS_String& name) + : _begin(children.begin(), children.end(), name), + _end(children.end(), children.end(), name) + { + } + + XMLChildrenFilter(XMLNode* node, const XS_String& name) + : _begin(node->get_children().begin(), node->get_children().end(), name), + _end(node->get_children().end(), node->get_children().end(), name) + { + } + + struct iterator + { + typedef XMLNode::Children::iterator BaseIterator; + + iterator(BaseIterator begin, BaseIterator end, const XS_String& filter_name) + : _cur(begin), + _end(end), + _filter_name(filter_name) + { + search_next(); + } + + operator BaseIterator() + { + return _cur; + } + + const XMLNode* operator*() const + { + return *_cur; + } + + XMLNode* operator*() + { + return *_cur; + } + + iterator& operator++() + { + ++_cur; + search_next(); + + return *this; + } + + iterator operator++(int) + { + iterator ret = *this; + + ++_cur; + search_next(); + + return ret; + } + + bool operator==(const BaseIterator& other) const + { + return _cur == other; + } + + bool operator!=(const BaseIterator& other) const + { + return _cur != other; + } + + protected: + BaseIterator _cur; + BaseIterator _end; + XS_String _filter_name; + + void search_next() + { + while(_cur!=_end && **_cur!=_filter_name) + ++_cur; + } + }; + + iterator begin() + { + return _begin; + } + + iterator end() + { + return _end; + } + +protected: + iterator _begin; + iterator _end; +}; + + + /// read only iterator access to children nodes with name filtering +struct const_XMLChildrenFilter +{ + const_XMLChildrenFilter(const XMLNode::Children& children, const XS_String& name) + : _begin(children.begin(), children.end(), name), + _end(children.end(), children.end(), name) + { + } + + const_XMLChildrenFilter(const XMLNode* node, const XS_String& name) + : _begin(node->get_children().begin(), node->get_children().end(), name), + _end(node->get_children().end(), node->get_children().end(), name) + { + } + + struct const_iterator + { + typedef XMLNode::Children::const_iterator BaseIterator; + + const_iterator(BaseIterator begin, BaseIterator end, const XS_String& filter_name) + : _cur(begin), + _end(end), + _filter_name(filter_name) + { + search_next(); + } + + operator BaseIterator() + { + return _cur; + } + + const XMLNode* operator*() const + { + return *_cur; + } + + const_iterator& operator++() + { + ++_cur; + search_next(); + + return *this; + } + + const_iterator operator++(int) + { + const_iterator ret = *this; + + ++_cur; + search_next(); + + return ret; + } + + bool operator==(const BaseIterator& other) const + { + return _cur == other; + } + + bool operator!=(const BaseIterator& other) const + { + return _cur != other; + } + + protected: + BaseIterator _cur; + BaseIterator _end; + XS_String _filter_name; + + void search_next() + { + while(_cur!=_end && **_cur!=_filter_name) + ++_cur; + } + }; + + const_iterator begin() + { + return _begin; + } + + const_iterator end() + { + return _end; + } + +protected: + const_iterator _begin; + const_iterator _end; +}; + + + /// iterator for XML trees +struct XMLPos +{ + XMLPos(XMLNode* root) + : _root(root), + _cur(root) + { + } + + XMLPos(const XMLPos& other) + : _root(other._root), + _cur(other._cur) + { // don't copy _stack + } + + XMLPos(XMLNode* node, const XS_String& name) + : _root(node), + _cur(node) + { + smart_create(name); + } + + XMLPos(XMLNode* node, const XS_String& name, const XS_String& attr_name, const XS_String& attr_value) + : _root(node), + _cur(node) + { + smart_create(name, attr_name, attr_value); + } + + XMLPos(const XMLPos& other, const XS_String& name) + : _root(other._root), + _cur(other._cur) + { + smart_create(name); + } + + XMLPos(const XMLPos& other, const XS_String& name, const XS_String& attr_name, const XS_String& attr_value) + : _root(other._root), + _cur(other._cur) + { + smart_create(name, attr_name, attr_value); + } + + /// access to current node + XMLNode& cur() + { + return *_cur; + } + + const XMLNode& cur() const + { + return *_cur; + } + + /// C++ access to current node + operator const XMLNode*() const {return _cur;} + operator XMLNode*() {return _cur;} + + const XMLNode* operator->() const {return _cur;} + XMLNode* operator->() {return _cur;} + + const XMLNode& operator*() const {return *_cur;} + XMLNode& operator*() {return *_cur;} + + /// attribute access + XS_String get(const XS_String& attr_name) const + { + return _cur->get(attr_name); + } + + void put(const XS_String& attr_name, const XS_String& value) + { + _cur->put(attr_name, value); + } + + /// C++ attribute access + template XS_String get(const T& attr_name) const {return (*_cur)[attr_name];} + XS_String& operator[](const XS_String& attr_name) {return (*_cur)[attr_name];} + + /// insert children when building tree + void add_down(XMLNode* child) + { + _cur->add_child(child); + go_to(child); + } + + /// go back to previous position + bool back() + { + if (!_stack.empty()) { + _cur = _stack.top(); + _stack.pop(); + return true; + } else + return false; + } + + /// go down to first child + bool go_down() + { + XMLNode* node = _cur->get_first_child(); + + if (node) { + go_to(node); + return true; + } else + return false; + } + + /// search for child and go down + bool go_down(const XS_String& name, int n=0) + { + XMLNode* node = _cur->find(name, n); + + if (node) { + go_to(node); + return true; + } else + return false; + } + + /// move XPath like to position in XML tree + bool go(const char* path); + + /// create child nodes using XPath notation and move to the deepest child + bool create_relative(const char* path) + { + XMLNode* node = _cur->create_relative(path); + if (!node) + return false; // invalid path specified + + go_to(node); + return true; + } + + /// create node and move to it + void create(const XS_String& name) + { + add_down(new XMLNode(name)); + } + + /// create node if not already existing and move to it + void smart_create(const XS_String& name) + { + XMLNode* node = _cur->find(name); + + if (node) + go_to(node); + else + add_down(new XMLNode(name)); + } + + /// search matching child node identified by key name and an attribute value + void smart_create(const XS_String& name, const XS_String& attr_name, const XS_String& attr_value) + { + XMLNode* node = _cur->find(name, attr_name, attr_value); + + if (node) + go_to(node); + else { + node = new XMLNode(name); + add_down(node); + (*node)[attr_name] = attr_value; + } + } + +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + /// search for child and go down + bool go_down(const char* name, int n=0) + { + XMLNode* node = _cur->find(name, n); + + if (node) { + go_to(node); + return true; + } else + return false; + } + + /// create node and move to it + void create(const char* name) + { + add_down(new XMLNode(name)); + } + + /// create node if not already existing and move to it + void smart_create(const char* name) + { + XMLNode* node = _cur->find(name); + + if (node) + go_to(node); + else + add_down(new XMLNode(name)); + } + + /// search matching child node identified by key name and an attribute value + template + void smart_create(const char* name, const T& attr_name, const U& attr_value) + { + XMLNode* node = _cur->find(name, attr_name, attr_value); + + if (node) + go_to(node); + else { + XMLNode* node = new XMLNode(name); + add_down(node); + (*node)[attr_name] = attr_value; + } + } +#endif + + XS_String& str() {return *_cur;} + const XS_String& str() const {return *_cur;} + +protected: + XMLNode* _root; + XMLNode* _cur; + std::stack _stack; + + /// go to specified node + void go_to(XMLNode* child) + { + _stack.push(_cur); + _cur = child; + } +}; + + + /// iterator for XML trees +struct const_XMLPos +{ + const_XMLPos(const XMLNode* root) + : _root(root), + _cur(root) + { + } + + const_XMLPos(const const_XMLPos& other) + : _root(other._root), + _cur(other._cur) + { // don't copy _stack + } + + /// access to current node + const XMLNode& cur() const + { + return *_cur; + } + + /// C++ access to current node + operator const XMLNode*() const {return _cur;} + + const XMLNode* operator->() const {return _cur;} + + const XMLNode& operator*() const {return *_cur;} + + /// attribute access + XS_String get(const XS_String& attr_name) const + { + return _cur->get(attr_name); + } + + /// C++ attribute access + template XS_String get(const T& attr_name) const {return _cur->get(attr_name);} + + /// go back to previous position + bool back() + { + if (!_stack.empty()) { + _cur = _stack.top(); + _stack.pop(); + return true; + } else + return false; + } + + /// go down to first child + bool go_down() + { + const XMLNode* node = _cur->get_first_child(); + + if (node) { + go_to(node); + return true; + } else + return false; + } + + /// search for child and go down + bool go_down(const XS_String& name, int n=0) + { + XMLNode* node = _cur->find(name, n); + + if (node) { + go_to(node); + return true; + } else + return false; + } + + /// move XPath like to position in XML tree + bool go(const char* path); + +#if defined(UNICODE) && !defined(XS_STRING_UTF8) + /// search for child and go down + bool go_down(const char* name, int n=0) + { + XMLNode* node = _cur->find(name, n); + + if (node) { + go_to(node); + return true; + } else + return false; + } +#endif + + const XS_String& str() const {return *_cur;} + +protected: + const XMLNode* _root; + const XMLNode* _cur; + std::stack _stack; + + /// go to specified node + void go_to(const XMLNode* child) + { + _stack.push(_cur); + _cur = child; + } +}; + + + // work around GCC's wide string constant bug +#ifdef __GNUC__ +extern const LPCXSSTR XS_TRUE; +extern const LPCXSSTR XS_FALSE; +extern const LPCXSSTR XS_NUMBERFMT; +#else +#define XS_TRUE XS_TEXT("true") +#define XS_FALSE XS_TEXT("false") +#define XS_NUMBERFMT XS_TEXT("%d") +#endif + + +struct XMLBool +{ + XMLBool(bool value=false) + : _value(value) + { + } + + XMLBool(LPCXSSTR value, bool def=false) + { + if (value && *value) + _value = !XS_icmp(value, XS_TRUE); + else + _value = def; + } + + XMLBool(const XMLNode* node, const XS_String& attr_name, bool def=false) + { + const XS_String& value = node->get(attr_name); + + if (!value.empty()) + _value = !XS_icmp(value.c_str(), XS_TRUE); + else + _value = def; + } + + operator bool() const + { + return _value; + } + + bool operator!() const + { + return !_value; + } + + operator LPCXSSTR() const + { + return _value? XS_TRUE: XS_FALSE; + } + +protected: + bool _value; + +private: + void operator=(const XMLBool&); // disallow assignment operations +}; + +struct XMLBoolRef +{ + XMLBoolRef(XMLNode* node, const XS_String& attr_name, bool def=false) + : _ref((*node)[attr_name]) + { + if (_ref.empty()) + assign(def); + } + + operator bool() const + { + return !XS_icmp(_ref.c_str(), XS_TRUE); + } + + bool operator!() const + { + return XS_icmp(_ref.c_str(), XS_TRUE)? true: false; + } + + XMLBoolRef& operator=(bool value) + { + assign(value); + + return *this; + } + + void assign(bool value) + { + _ref.assign(value? XS_TRUE: XS_FALSE); + } + + void toggle() + { + assign(!operator bool()); + } + +protected: + XS_String& _ref; +}; + + +struct XMLInt +{ + XMLInt(int value) + : _value(value) + { + } + + XMLInt(LPCXSSTR value, int def=0) + { + if (value && *value) + _value = XS_toi(value); + else + _value = def; + } + + XMLInt(const XMLNode* node, const XS_String& attr_name, int def=0) + { + const XS_String& value = node->get(attr_name); + + if (!value.empty()) + _value = XS_toi(value.c_str()); + else + _value = def; + } + + operator int() const + { + return _value; + } + + operator XS_String() const + { + XS_CHAR buffer[32]; + XS_sprintf(buffer, XS_NUMBERFMT, _value); + return buffer; + } + +protected: + int _value; + +private: + void operator=(const XMLInt&); // disallow assignment operations +}; + +struct XMLIntRef +{ + XMLIntRef(XMLNode* node, const XS_String& attr_name, int def=0) + : _ref((*node)[attr_name]) + { + if (_ref.empty()) + assign(def); + } + + XMLIntRef& operator=(int value) + { + assign(value); + + return *this; + } + + operator int() const + { + return XS_toi(_ref.c_str()); + } + + void assign(int value) + { + XS_CHAR buffer[32]; + XS_sprintf(buffer, XS_NUMBERFMT, value); + _ref.assign(buffer); + } + +protected: + XS_String& _ref; +}; + + +struct XMLString +{ + XMLString(const XS_String& value) + : _value(value) + { + } + + XMLString(LPCXSSTR value, LPCXSSTR def=XS_TEXT("")) + { + if (value && *value) + _value = value; + else + _value = def; + } + + XMLString(const XMLNode* node, const XS_String& attr_name, LPCXSSTR def=XS_TEXT("")) + { + const XS_String& value = node->get(attr_name); + + if (!value.empty()) + _value = value; + else + _value = def; + } + + operator const XS_String&() const + { + return _value; + } + + const XS_String& c_str() const + { + return _value; + } + +protected: + XS_String _value; + +private: + void operator=(const XMLString&); // disallow assignment operations +}; + +struct XMStringRef +{ + XMStringRef(XMLNode* node, const XS_String& attr_name, LPCXSSTR def=XS_TEXT("")) + : _ref((*node)[attr_name]) + { + if (_ref.empty()) + assign(def); + } + + XMStringRef(XMLNode* node, const XS_String& node_name, const XS_String& attr_name, LPCXSSTR def=XS_TEXT("")) + : _ref(node->subvalue(node_name, attr_name)) + { + if (_ref.empty()) + assign(def); + } + + XMStringRef& operator=(const XS_String& value) + { + assign(value); + + return *this; + } + + operator const XS_String&() const + { + return _ref; + } + + void assign(const XS_String& value) + { + _ref.assign(value); + } + +protected: + XS_String& _ref; +}; + + +template + inline void read_option(T& var, const_XMLPos& cfg, LPCXSSTR key) + { + const XS_String& val = cfg.get(key); + + if (!val.empty()) + var = val; + } + +template<> + inline void read_option(int& var, const_XMLPos& cfg, LPCXSSTR key) + { + const XS_String& val = cfg.get(key); + + if (!val.empty()) + var = XS_toi(val.c_str()); + } + + +#ifdef _MSC_VER +#pragma warning(disable: 4355) +#endif + + /// XML reader base class +struct XMLReaderBase +{ + XMLReaderBase(XMLNode* node) + : _pos(node), + _parser(XML_ParserCreate(NULL)) + { + XML_SetUserData(_parser, this); + XML_SetXmlDeclHandler(_parser, XML_XmlDeclHandler); + XML_SetElementHandler(_parser, XML_StartElementHandler, XML_EndElementHandler); + XML_SetDefaultHandler(_parser, XML_DefaultHandler); + + _last_tag = TAG_NONE; + } + + virtual ~XMLReaderBase() + { + XML_ParserFree(_parser); + } + + XML_Status read(); + + virtual int read_buffer(char* buffer, int len) = 0; + + std::string get_position() const + { + int line = XML_GetCurrentLineNumber(_parser); + int column = XML_GetCurrentColumnNumber(_parser); + + std::ostringstream out; + out << "(" << line << ") : [column " << column << "]"; + + return out.str(); + } + + std::string get_instructions() const {return _instructions;} + + XML_Error get_error_code() {return XML_GetErrorCode(_parser);} + std::string get_error_string() const; + +protected: + XMLPos _pos; + XML_Parser _parser; + std::string _xml_version; + std::string _encoding; + std::string _instructions; + + std::string _content; + enum {TAG_NONE, TAG_START, TAG_END} _last_tag; + + static void XMLCALL XML_XmlDeclHandler(void* userData, const XML_Char* version, const XML_Char* encoding, int standalone); + static void XMLCALL XML_StartElementHandler(void* userData, const XML_Char* name, const XML_Char** atts); + static void XMLCALL XML_EndElementHandler(void* userData, const XML_Char* name); + static void XMLCALL XML_DefaultHandler(void* userData, const XML_Char* s, int len); +}; + + + /// XML file reader +struct XMLReader : public XMLReaderBase +{ + XMLReader(XMLNode* node, std::istream& in) + : XMLReaderBase(node), + _in(in) + { + } + + /// read XML stream into XML tree below _pos + int read_buffer(char* buffer, int len) + { + if (!_in.good()) + return -1; + + _in.read(buffer, len); + + return _in.gcount(); + } + +protected: + std::istream& _in; +}; + + +struct XMLHeader +{ + XMLHeader(const std::string& xml_version="1.0", const std::string& encoding="UTF-8", const std::string& doctype="") + : _version(xml_version), + _encoding(encoding), + _doctype(doctype) + { + } + + void print(std::ostream& out) const + { + out << "\n"; + + if (!_doctype.empty()) + out << _doctype << '\n'; + if (!_additional.empty()) + out << _additional << '\n'; + } + + std::string _version; + std::string _encoding; + std::string _doctype; + std::string _additional; +}; + + +struct XMLDoc : public XMLNode +{ + XMLDoc() + : XMLNode(""), + _last_error(XML_ERROR_NONE) + { + } + + XMLDoc(LPCTSTR path) + : XMLNode(""), + _last_error(XML_ERROR_NONE) + { + read(path); + } + + std::istream& read(std::istream& in) + { + XMLReader reader(this, in); + + read(reader); + + return in; + } + + bool read(LPCTSTR path) + { + tifstream in(path); + XMLReader reader(this, in); + +//#if defined(_STRING_DEFINED) && !defined(XS_STRING_UTF8) +// return read(reader, std::string(ANS(path))); +//#else + return read(reader, XS_String(path)); +//#endif + } + + bool read(XMLReaderBase& reader) + { + XML_Status status = reader.read(); + + _header._additional = reader.get_instructions(); + + if (status == XML_STATUS_ERROR) { + std::ostringstream out; + + out << "input stream" << reader.get_position() << " " << reader.get_error_string(); + + _last_error = reader.get_error_code(); + _last_error_msg = out.str(); + } + + return status != XML_STATUS_ERROR; + } + + bool read(XMLReaderBase& reader, const std::string& display_path) + { + XML_Status status = reader.read(); + + _header._additional = reader.get_instructions(); + + if (status == XML_STATUS_ERROR) { + std::ostringstream out; + + out << display_path << reader.get_position() << " " << reader.get_error_string(); + + _last_error = reader.get_error_code(); + _last_error_msg = out.str(); + } + + return status != XML_STATUS_ERROR; + } + + /// write XML stream preserving previous white space and comments + std::ostream& write(std::ostream& out, WRITE_MODE mode=FORMAT_SMART) const + { + _header.print(out); + + if (!_children.empty()) + _children.front()->write(out); + + return out; + } + + /// write XML stream with formating + std::ostream& write_formating(std::ostream& out) const + { + return write(out, FORMAT_PRETTY); + } + + void write(LPCTSTR path, WRITE_MODE mode=FORMAT_SMART) const + { + tofstream out(path); + + write(out, mode); + } + + void write_formating(LPCTSTR path) const + { + tofstream out(path); + + write_formating(out); + } + + XMLHeader _header; + XML_Error _last_error; + std::string _last_error_msg; +}; + + +struct XMLMessage : public XMLDoc +{ + XMLMessage(const char* name) + : _pos(this) + { + _pos.create(name); + } + + XMLPos _pos; +}; + + +} // namespace XMLStorage + +#define _XMLSTORAGE_H +#endif // _XMLSTORAGE_H diff --git a/reactos/base/applications/ibrowser/webchild.cpp b/reactos/base/applications/ibrowser/webchild.cpp new file mode 100644 index 00000000000..76bb8951036 --- /dev/null +++ b/reactos/base/applications/ibrowser/webchild.cpp @@ -0,0 +1,309 @@ +/* + * Copyright 2004, 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // webchild.cpp + // + // Martin Fuchs, 25.01.2005 + // + + +#include + +#include "ibrowser_intres.h" + +#include "webchild.h" + + +#ifdef _MSC_VER + +#if _MSC_VER>=1300 // vtMissing for VS.Net +#include +#pragma comment(lib, "comsupp") +#endif + +#else + +#ifdef __MINGW32__ // MinGW is lacking vtMissing (as of 07.02.2004) +static Variant vtMissing; +#endif + +#endif + +//#include + + +Variant::Variant(const VARIANT& var) +{ + VariantInit(this); + CheckError(VariantCopy(this, const_cast(&var))); +} + +Variant::Variant(const VARIANT* var) +{ + VariantInit(this); + CheckError(VariantCopy(this, const_cast(var))); +} + +Variant::~Variant() +{ + VariantClear(this); +} + + +Variant::operator long() const +{ + Variant v; + CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_I4)); + return V_I4(&v); +} + +Variant::operator bool() const +{ + Variant v; + CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_BOOL)); + return V_BOOL(&v)? true: false; +} + +Variant::operator IDispatch*() const +{ + Variant v; + CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_DISPATCH)); + return V_DISPATCH(&v); +} + +Variant::operator VARIANT_BOOL() const +{ + Variant v; + CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_BOOL)); + return V_BOOL(&v); +} + + +void BStr::assign(BSTR s) +{ + if (!SysReAllocString(&_p, s)) + THROW_EXCEPTION(E_OUTOFMEMORY); +} + +void BStr::assign(const VARIANT& var) +{ + if (V_VT(&var) == VT_BSTR) + assign(V_BSTR(&var)); + else { + Variant v; + CheckError(VariantChangeType(&v, const_cast(&var), 0, VT_BSTR)); + assign(V_BSTR(&v)); + } +} + + +BrowserNavigator::BrowserNavigator() + : _browser_initialized(false) +{ +} + +void BrowserNavigator::attach(IWebBrowser* browser) +{ + _browser = browser; +} + +void BrowserNavigator::goto_url(LPCTSTR url) +{ + if (_browser_initialized) + _browser->Navigate(BStr(url), NULL, NULL, NULL, NULL); + else { + _new_url = url; + + _browser->Navigate(L"about:blank", NULL, NULL, NULL, NULL); + } +} + +void BrowserNavigator::set_html_page(const String& html_txt) +{ + _new_html_txt = html_txt; + + goto_url(TEXT("about:blank")); +} + +void T2nA_binary(LPCTSTR s, LPSTR d, int len) +{ + while(len-- > 0) + *d++ = (unsigned char)*s++; +} + +void BrowserNavigator::navigated(LPCTSTR url) +{ + _browser_initialized = true; + + bool nav = false; + + if (!_new_url.empty()) { + if (!_tcscmp(url,TEXT("about:blank")) && _new_url!=TEXT("about:blank")) { + _browser->Navigate(BStr(_new_url), NULL, NULL, NULL, NULL); + ++nav; + } + + _new_url.erase(); + } + + if (!nav && !_new_html_txt.empty()) { ///@todo move this into DocumentComplete() ? + int len = _new_html_txt.length(); + HGLOBAL hHtmlText = GlobalAlloc(GPTR, len); + + if (!hHtmlText) { + T2nA_binary(_new_html_txt, (char*)hHtmlText, len); + _new_html_txt.erase(); + + SIfacePtr pStream; + HRESULT hr = CreateStreamOnHGlobal(hHtmlText, TRUE, &pStream); + + if (SUCCEEDED(hr)) { + SIfacePtr pHtmlDoc; + CheckError(_browser->get_Document(&pHtmlDoc)); + + SIfacePtr pPersistStreamInit; + pHtmlDoc.QueryInterface(IID_IPersistStreamInit, &pPersistStreamInit); + + CheckError(pPersistStreamInit->InitNew()); + CheckError(pPersistStreamInit->Load(pStream)); + } else + GlobalFree(hHtmlText); + } + } +} + + +HWND create_webchildwindow(const WebChildWndInfo& info) +{ + WebChildWindow* pWnd = WebChildWindow::create(info); + + if (!pWnd) + return 0; + + return *pWnd; +} + +static const CLSID CLSID_MozillaBrowser = + {0x1339B54C, 0x3453, 0x11D2, {0x93, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; + + +WebChildWindow::WebChildWindow(HWND hwnd, const WebChildWndInfo& info) + : super(hwnd, info._hwndFrame), + web_super(_navigator) +{ + // first try to create a web control with MS IE's CLASSID + HRESULT hr = create_control(hwnd, CLSID_WebBrowser, IID_IWebBrowser2); + + // If this failed, try to use Mozilla's web control + if (FAILED(hr)) + hr = create_control(hwnd, CLSID_MozillaBrowser, IID_IWebBrowser2); + + if (SUCCEEDED(hr)) { + _navigator.attach(_control); + + _connector = auto_ptr(new EventConnector(_control, DIID_DWebBrowserEvents2, this)); + + // We need to call Navigate() here to initialize the browser control (see _browser_initialized) + _control->Navigate(BStr(info._url), &vtMissing, &vtMissing, &vtMissing, &vtMissing); + } +} + +LRESULT WebChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + try { + switch(nmsg) { + case WM_ERASEBKGND: + if (!_control) { + HDC hdc = (HDC)wparam; + ClientRect rect(_hwnd); + + HBRUSH hbrush = CreateSolidBrush(RGB(200,200,235)); + BkMode mode(hdc, TRANSPARENT); + TextColor color(hdc, RGB(200,40,40)); + FillRect(hdc, &rect, hbrush); + DrawText(hdc, TEXT("Sorry - no web browser control could be loaded."), -1, &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE); + DeleteObject(hbrush); + } + + return TRUE; + + + case PM_DISPATCH_COMMAND: { + if (_control) { + HRESULT hr = E_FAIL; + + switch(LOWORD(wparam)) { + case ID_GO_BACK: + hr = _control->GoBack(); + break; + + case ID_GO_FORWARD: + hr = _control->GoForward(); + break; + + case ID_GO_UP: + ///@todo + break; + + case ID_GO_HOME: + hr = _control->GoHome(); + break; + + case ID_GO_SEARCH: + hr = _control->GoSearch(); + break; + + case ID_REFRESH: + hr = _control->Refresh(); + break; + + case ID_STOP: + hr = _control->Stop(); + break; + + default: + return super::WndProc(nmsg, wparam, lparam); + } + + if (FAILED(hr) && hr!=E_FAIL) + THROW_EXCEPTION(hr); + } + + return TRUE;} + + default: + return super::WndProc(nmsg, wparam, lparam); + } + } catch(COMException& e) { + HandleException(e, _hwnd); + } + + return 0; +} + + +String WebChildWindow::jump_to_int(LPCTSTR url) +{ + _navigator.goto_url(url); + + return url; +} diff --git a/reactos/base/applications/ibrowser/webchild.h b/reactos/base/applications/ibrowser/webchild.h new file mode 100644 index 00000000000..5258db5025b --- /dev/null +++ b/reactos/base/applications/ibrowser/webchild.h @@ -0,0 +1,1103 @@ +/* + * Copyright 2004, 2005 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // ROS Internet Web Browser + // + // webchild.h + // + // Martin Fuchs, 25.01.2005 + // + + +#ifndef _MSC_VER +#include // for IConnectionPointContainer +#include // for DWebBrowserEvents2 IDs +#endif + +#ifndef DISPID_BEFORENAVIGATE // missing in MinGW (as of 07.02.2004) +#define DISPID_BEFORENAVIGATE 100 +#define DISPID_NAVIGATECOMPLETE 101 +#define DISPID_STATUSTEXTCHANGE 102 +#define DISPID_QUIT 103 +#define DISPID_DOWNLOADCOMPLETE 104 +#define DISPID_COMMANDSTATECHANGE 105 +#define DISPID_DOWNLOADBEGIN 106 +#define DISPID_NEWWINDOW 107 +#define DISPID_PROGRESSCHANGE 108 +#define DISPID_WINDOWMOVE 109 +#define DISPID_WINDOWRESIZE 110 +#define DISPID_WINDOWACTIVATE 111 +#define DISPID_PROPERTYCHANGE 112 +#define DISPID_TITLECHANGE 113 +#define DISPID_TITLEICONCHANGE 114 +#define DISPID_FRAMEBEFORENAVIGATE 200 +#define DISPID_FRAMENAVIGATECOMPLETE 201 +#define DISPID_FRAMENEWWINDOW 204 + +#define DISPID_NAVIGATECOMPLETE2 252 +#define DISPID_ONQUIT 253 +#define DISPID_ONVISIBLE 254 +#define DISPID_ONTOOLBAR 255 +#define DISPID_ONMENUBAR 256 +#define DISPID_ONSTATUSBAR 257 +#define DISPID_ONFULLSCREEN 258 +#define DISPID_DOCUMENTCOMPLETE 259 +#define DISPID_ONTHEATERMODE 260 +#define DISPID_ONADDRESSBAR 261 +#define DISPID_WINDOWSETRESIZABLE 262 +#define DISPID_WINDOWCLOSING 263 +#define DISPID_WINDOWSETLEFT 264 +#define DISPID_WINDOWSETTOP 265 +#define DISPID_WINDOWSETWIDTH 266 +#define DISPID_WINDOWSETHEIGHT 267 +#define DISPID_CLIENTTOHOSTWINDOW 268 +#define DISPID_SETSECURELOCKICON 269 +#define DISPID_FILEDOWNLOAD 270 +#define DISPID_NAVIGATEERROR 271 +#define DISPID_PRIVACYIMPACTEDSTATECHANGE 272 +#endif + +#ifndef V_INT // missing in MinGW (as of 07.02.2004) +#define V_INT(x) V_UNION(x, intVal) +#endif + +#ifdef _MSC_VER +#define NOVTABLE __declspec(novtable) +#else +#define NOVTABLE +#endif +#define ANSUNC + +#ifdef _MSC_VER +#pragma warning(disable: 4355) // use of 'this' for initialization of _connector +#endif + + +struct NOVTABLE ComSrvObject // NOVTABLE erlaubt, da protected Destruktor +{ +protected: + ComSrvObject() : _ref(1) {} + virtual ~ComSrvObject() {} + + ULONG _ref; +}; + +struct SimpleComObject : public ComSrvObject +{ + ULONG IncRef() {return ++_ref;} + ULONG DecRef() {ULONG ref=--_ref; if (!ref) {_ref++; delete this;} return ref;} +}; + + + // server object interfaces + +template struct IComSrvQI : public BASE +{ + IComSrvQI(REFIID uuid_base) + : _uuid_base(uuid_base) + { + } + + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) + { + *ppv = NULL; + + if (IsEqualIID(riid, _uuid_base) || IsEqualIID(riid, IID_IUnknown)) + {*ppv=static_cast(this); this->AddRef(); return S_OK;} + + return E_NOINTERFACE; + } + +protected: + IComSrvQI() {} + virtual ~IComSrvQI() {} + + REFIID _uuid_base; +}; + +template<> struct IComSrvQI : public IUnknown +{ + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) + { + *ppv = NULL; + + if (IsEqualIID(riid, IID_IUnknown)) + {*ppv=this; AddRef(); return S_OK;} + + return E_NOINTERFACE; + } + +protected: + IComSrvQI() {} + virtual ~IComSrvQI() {} +}; + + +template + class IComSrvBase : public IComSrvQI +{ + typedef IComSrvQI super; + +protected: + IComSrvBase(REFIID uuid_base) + : super(uuid_base) + { + } + +public: + STDMETHODIMP_(ULONG) AddRef() {return static_cast(this)->IncRef();} + STDMETHODIMP_(ULONG) Release() {return static_cast(this)->DecRef();} +}; + + +template struct ConnectionPoint : public SIfacePtr +{ + ConnectionPoint(IConnectionPointContainer* pCPC, REFIID riid) + { + CheckError(pCPC->FindConnectionPoint(riid, &this->_p)); + } +}; + +struct EventConnection +{ + EventConnection(IConnectionPoint* connectionpoint, IUnknown* sink) + { + CheckError(connectionpoint->Advise(sink, &_cookie)); + _connectionpoint = connectionpoint; + } + + template EventConnection(T& connectionpoint, IUnknown* sink) + { + CheckError(connectionpoint->Advise(sink, &_cookie)); + _connectionpoint = connectionpoint; + } + +/* template EventConnection(SIfacePtr& connectionpoint, IUnknown* sink) + { + CheckError(connectionpoint->Advise(sink, &_cookie)); + _connectionpoint = connectionpoint.GetPtr(); + } */ + +/* template EventConnection(T& connectionpoint, IUnknown* sink) + { + CheckError(connectionpoint->Advise(sink, &_cookie)); + _connectionpoint = connectionpoint; + } */ + + ~EventConnection() + { + if (_connectionpoint) + _connectionpoint->Unadvise(_cookie); + } + +protected: + SIfacePtr _connectionpoint; + DWORD _cookie; +}; + +struct EventConnector : public EventConnection +{ + EventConnector(IUnknown* unknown, REFIID riid, IUnknown* sink) + : EventConnection(ConnectionPoint( + SIfacePtr(unknown, IID_IConnectionPointContainer), riid), sink) + { + } +}; + + +struct OleInPlaceClient : public SimpleComObject, + public IOleClientSite, + public IOleInPlaceSite +{ +protected: + HWND _hwnd; + +public: + OleInPlaceClient(HWND hwnd=0) + : _hwnd(hwnd) + { + } + + void attach(HWND hwnd) + { + _hwnd = hwnd; + } + + HRESULT attach_control(IOleObject* ole_obj, LONG iVerb=OLEIVERB_INPLACEACTIVATE, HWND hwndParent=0, LPCRECT pRect=NULL) + { + HRESULT hr = ole_obj->SetClientSite(this); + if (FAILED(hr)) + return hr; + +// hr = ole_obj->SetHostNames(app, doc)); + + hr = ole_obj->DoVerb(iVerb, NULL, this, 0, 0/*hwnd*/, NULL/*&rcPos*/); + + return hr; + } + + HRESULT detach(IOleObject* ole_obj, DWORD dwSaveOption=OLECLOSE_SAVEIFDIRTY) + { + HRESULT hr = ole_obj->Close(dwSaveOption); + + _hwnd = 0; + + return hr; + } + + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) + { + if (IsEqualIID(riid, IID_IOleClientSite)) + {*ppv=static_cast(this); IncRef(); return S_OK;} + + if (IsEqualIID(riid, IID_IOleInPlaceSite)) + {*ppv=static_cast(this); IncRef(); return S_OK;} + + if (IsEqualIID(riid, IID_IUnknown)) + {*ppv=static_cast(this); IncRef(); return S_OK;} + + return E_NOINTERFACE; + } + + STDMETHODIMP_(ULONG) AddRef() {return IncRef();} + STDMETHODIMP_(ULONG) Release() {return DecRef();} + + + // IOleWindow: + + virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetWindow(/* [out] */ HWND __RPC_FAR *phwnd) + { + *phwnd = _hwnd; + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(/* [in] */ BOOL fEnterMode) + { + return E_NOTIMPL; + } + + + // IOleClientSite: + + virtual HRESULT STDMETHODCALLTYPE SaveObject() + { + return E_NOTIMPL; + } + + virtual HRESULT STDMETHODCALLTYPE GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker __RPC_FAR *__RPC_FAR *ppmk) + { + return E_NOTIMPL; + } + + virtual HRESULT STDMETHODCALLTYPE GetContainer(IOleContainer __RPC_FAR *__RPC_FAR *ppContainer) + { + ppContainer = 0; + return E_NOINTERFACE; + } + + virtual HRESULT STDMETHODCALLTYPE ShowObject() + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE OnShowWindow(BOOL fShow) + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE RequestNewObjectLayout() + { + return S_OK; + } + + + // IOleInPlaceSite: + + virtual HRESULT STDMETHODCALLTYPE CanInPlaceActivate() + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivate() + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE OnUIActivate() + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE GetWindowContext( + /* [out] */ IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, + /* [out] */ IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, + /* [out] */ LPRECT lprcPosRect, + /* [out] */ LPRECT lprcClipRect, + /* [out][in] */ LPOLEINPLACEFRAMEINFO lpFrameInfo) + { + ClientRect rect(_hwnd); + + ppFrame = 0; + ppDoc = 0; + *lprcPosRect = rect; + *lprcClipRect = rect; + + assert(lpFrameInfo->cb>=sizeof(OLEINPLACEFRAMEINFO)); + lpFrameInfo->fMDIApp = FALSE; + lpFrameInfo->hwndFrame = 0; + lpFrameInfo->haccel = 0; + lpFrameInfo->cAccelEntries = 0; + + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE Scroll(/* [in] */ SIZE scrollExtant) + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE OnUIDeactivate(/* [in] */ BOOL fUndoable) + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivate() + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE DiscardUndoState() + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE DeactivateAndUndo() + { + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE OnPosRectChange(/* [in] */ LPCRECT lprcPosRect) + { + return S_OK; + } +}; + + + // window with in place activates Active-X Control + +template struct IPCtrlWindow : public BASE +{ + typedef BASE super; + + IPCtrlWindow(HWND hwnd) + : super(hwnd) + { + } + + template IPCtrlWindow(HWND hwnd, T& info) + : super(hwnd, info) + { + } + + HRESULT create_control(HWND hwnd, REFIID clsid, REFIID riid) + { + // Erzeugen einer Instanz des Controls + HRESULT hr = _control.CreateInstance(clsid, riid); + if (FAILED(hr)) + return hr; + + _client_side.attach(hwnd); + + hr = _client_side.attach_control(SIfacePtr(_control, IID_IOleObject)/*, OLEIVERB_INPLACEACTIVATE, + hwnd, &Rect(10, 10, 500, 500)*/); + if (FAILED(hr)) + return hr; + + // try to get a IOleInPlaceObject interface for window resizing + return _control.QueryInterface(IID_IOleInPlaceObject, &_in_place_object); // _in_place_object = _control + } + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) + { + if (nmsg == WM_SIZE) { + if (_in_place_object) { + RECT rect = {0, 0, LOWORD(lparam), HIWORD(lparam)}; + + _in_place_object->SetObjectRects(&rect, &rect); + } + } else if (nmsg == WM_CLOSE) { + _in_place_object = NULL; + + if (_control) { + _client_side.detach(SIfacePtr(_control, IID_IOleObject), OLECLOSE_NOSAVE); + _control = NULL; + } + } + + return super::WndProc(nmsg, wparam, lparam); + } + + ComInit _usingCOM; + SMARTPTR _control; + OleInPlaceClient _client_side; + SIfacePtr _in_place_object; +}; + + + +#include "exdispid.h" + + +struct DWebBrowserEvents2IF +{ + virtual ~DWebBrowserEvents2IF() {} + + virtual void StatusTextChange(const BStr& text) + {} + + virtual void ProgressChange(long progress, long progressMax) + {} + + virtual void WindowMove() + {} + + virtual void WindowResize() + {} + + virtual void WindowActivate() + {} + + virtual void PropertyChange(const BStr& property) + {} + + virtual void DownloadComplete() + {} + + virtual void CommandStateChange(long command, bool enable) + {} + + virtual void DownloadBegin() + {} + + virtual void NewWindow2(IDispatch** ppDisp, VARIANT_BOOL& cancel) + {} + + virtual void TitleChange(const BStr& text) + {} + + virtual void TitleIconChange(const BStr& text) + {} + + virtual void FrameBeforeNavigate(const BStr& url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& cancel) + {} + + virtual void FrameNavigateComplete(const BStr& url) + {} + + virtual void FrameNewWindow(const BStr&url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& processed) + {} + + virtual void BeforeNavigate2(IDispatch* pDisp, const Variant& url, const Variant& flags, + const Variant& targetFrameName, const Variant& postData, + const Variant& headers, VARIANT_BOOL& cancel) + {} + + virtual void NavigateComplete2(IDispatch* pDisp, const Variant& url) + {} + + virtual void OnQuit() + {} + + virtual void OnVisible(bool Visible) + {} + + virtual void OnToolbar(bool Visible) + {} + + virtual void OnMenubar(bool Visible) + {} + + virtual void OnStatusbar(bool Visible) + {} + + virtual void OnFullscreen(bool Visible) + {} + + virtual void DocumentComplete() + {} + + virtual void OnTheatermode(bool Visible) + {} + + virtual void OnAddressbar(bool Visible) + {} + + virtual void WindowSetResizable(bool Visible) + {} + + virtual void WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL& cancel) + {} + + virtual void WindowSetLeft(long Left) + {} + + virtual void WindowSetTop(long Top) + {} + + virtual void WindowSetWidth(long Width) + {} + + virtual void WindowSetHeight(long Height) + {} + + virtual void ClientToHostWindow(long& CX, long& CY) + {} + + virtual void SetSecureLockIcon(long SecureLockIcon) + {} + + virtual void FileDownload(Variant& cancel) + {} + + virtual void NavigateError(IDispatch* pDisp, const Variant& url, const Variant& Frame, const Variant& StatusCode, VARIANT_BOOL& cancel) + {} + + virtual void PrivacyImpactedStateChange(bool bImpacted) + {} +}; + + + // The web browser control has to be initialized completely before being able, + // to display a page, that does not access internet. +struct ANSUNC BrowserNavigator +{ + BrowserNavigator(); + + void attach(IWebBrowser* browser); + void goto_url(LPCTSTR url); + void set_html_page(const String& html_txt); + void navigated(LPCTSTR url); + + IWebBrowser* get_browser() {return _browser.get();} + +protected: + SIfacePtr _browser; + String _new_url; + String _new_html_txt; + bool _browser_initialized; +}; + + + // MinGW defines a wrong FixedDWebBrowserEvents2 interface with virtual functions for DISPID calls, so we use our own, corrected version: +interface FixedDWebBrowserEvents2 : public IDispatch +{ +#ifdef __GNUC__ + virtual ~FixedDWebBrowserEvents2() {} +#endif +}; + +struct ANSUNC DWebBrowserEvents2Impl : public SimpleComObject, + public IComSrvBase, + public DWebBrowserEvents2IF +{ + typedef IComSrvBase super; + + + DWebBrowserEvents2IF* _callback; + + + DWebBrowserEvents2Impl(BrowserNavigator& navigator) + : super(DIID_DWebBrowserEvents2), + _navigator(navigator) + { + _callback = this; + } + + +/* // IUnknown + STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppv) + { + *ppv = NULL; + + if (SUCCEEDED(super::QueryInterface(riid, ppv))) + return S_OK; + + return E_NOINTERFACE; + } */ + + + // IDispatch + STDMETHOD(GetTypeInfoCount)(UINT* pctinfo) + {return E_NOTIMPL;} + + STDMETHOD(GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) + {return E_NOTIMPL;} + + STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) + {return E_NOTIMPL;} + + STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, + DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr) + { + switch(dispIdMember) { + case DISPID_STATUSTEXTCHANGE: + _callback->StatusTextChange((BStr)Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_COMMANDSTATECHANGE: + _callback->CommandStateChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_DOWNLOADBEGIN: + _callback->DownloadBegin(); + break; + + case DISPID_PROGRESSCHANGE: // sent when download progress is updated + _callback->ProgressChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_WINDOWMOVE: // sent when main window has been moved + _callback->WindowMove(); + break; + + case DISPID_WINDOWRESIZE: // sent when main window has been sized + _callback->WindowResize(); + break; + + case DISPID_WINDOWACTIVATE: // sent when main window has been activated + _callback->WindowActivate(); + break; + + case DISPID_PROPERTYCHANGE: // sent when the PutProperty method is called + _callback->PropertyChange((BStr)Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_TITLECHANGE: // sent when the document title changes + _callback->TitleChange((BStr)Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_TITLEICONCHANGE: // sent when the top level window icon may have changed. + _callback->TitleIconChange((BStr)Variant(pDispParams->rgvarg[0])); + break; + + + // anything below here is not present in DWebBrowserEvents, only in DWebBrowserEvents2: -> + + case DISPID_FRAMEBEFORENAVIGATE: + if (pDispParams->cArgs != 6) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF)) + return E_INVALIDARG; + _callback->FrameBeforeNavigate( + (BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]), + (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2], + (BStr)Variant(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0])); + break; + + case DISPID_FRAMENAVIGATECOMPLETE: + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->FrameNavigateComplete((BStr)Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_FRAMENEWWINDOW: + if (pDispParams->cArgs != 6) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF)) + return E_INVALIDARG; + _callback->FrameNewWindow((BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]), + (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2], + (BStr)Variant(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0])); + break; + + case DISPID_BEFORENAVIGATE2: // hyperlink clicked on + if (pDispParams->cArgs != 7) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF)) + return E_INVALIDARG; + _callback->BeforeNavigate2(Variant(pDispParams->rgvarg[6]), + pDispParams->rgvarg[5], &pDispParams->rgvarg[4], + pDispParams->rgvarg[3], &pDispParams->rgvarg[2], + pDispParams->rgvarg[1], *V_BOOLREF(&pDispParams->rgvarg[0])); + break; + + case DISPID_NEWWINDOW2: // sent when a new window should be created + if (pDispParams->cArgs != 2) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF)) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[1]) != (VT_DISPATCH|VT_BYREF)) + return E_INVALIDARG; + _callback->NewWindow2(V_DISPATCHREF(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0])); + break; + + case DISPID_NAVIGATECOMPLETE2:// UIActivate new document + if (pDispParams->cArgs != 2) + return E_INVALIDARG; + + // notify the navigator + NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0])); + + _callback->NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_ONQUIT: + _callback->OnQuit(); + break; + + case DISPID_ONVISIBLE: // sent when the window goes visible/hidden + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->OnVisible(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_ONTOOLBAR: // sent when the toolbar should be shown/hidden + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->OnToolbar(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_ONMENUBAR: // sent when the menubar should be shown/hidden + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->OnMenubar(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_ONSTATUSBAR: // sent when the statusbar should be shown/hidden + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->OnStatusbar(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_ONFULLSCREEN: // sent when kiosk mode should be on/off + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->OnFullscreen(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_DOCUMENTCOMPLETE:// new document goes ReadyState_Complete + _callback->DocumentComplete(); + break; + + case DISPID_DOWNLOADCOMPLETE: + _callback->DownloadComplete(); + break; + + case DISPID_ONTHEATERMODE: // sent when theater mode should be on/off + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->OnTheatermode(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_ONADDRESSBAR: // sent when the address bar should be shown/hidden + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->OnAddressbar(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_WINDOWSETRESIZABLE:// sent to set the style of the host window frame + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->WindowSetResizable(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_WINDOWCLOSING: // sent before script window.close closes the window + if (pDispParams->cArgs != 2) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF)) + return E_INVALIDARG; + _callback->WindowClosing(Variant(pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0])); + break; + + case DISPID_WINDOWSETLEFT: // sent when the put_left method is called on the WebOC + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->WindowSetLeft(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_WINDOWSETTOP: // sent when the put_top method is called on the WebOC + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->WindowSetTop(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_WINDOWSETWIDTH: // sent when the put_width method is called on the WebOC + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->WindowSetWidth(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_WINDOWSETHEIGHT: // sent when the put_height method is called on the WebOC + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->WindowSetHeight(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_CLIENTTOHOSTWINDOW:// sent during window.open to request conversion of dimensions + if (pDispParams->cArgs != 2) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[0]) != (VT_I4|VT_BYREF)) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[1]) != (VT_I4|VT_BYREF)) + return E_INVALIDARG; + _callback->ClientToHostWindow(*V_I4REF(&pDispParams->rgvarg[1]), *V_I4REF(&pDispParams->rgvarg[0])); + break; + + case DISPID_SETSECURELOCKICON:// sent to suggest the appropriate security icon to show + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->SetSecureLockIcon(Variant(pDispParams->rgvarg[0])); + break; + + case DISPID_FILEDOWNLOAD: { // Fired to indicate the File Download dialog is opening + if (pDispParams->cArgs != 1) //@@ every time 2 ?! + return E_INVALIDARG; + Variant var(pDispParams->rgvarg[0]); + _callback->FileDownload(var);} + break; + + case DISPID_NAVIGATEERROR: // Fired to indicate the a binding error has occured + if (pDispParams->cArgs != 5) + return E_INVALIDARG; + if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF)) + return E_INVALIDARG; + _callback->NavigateError(Variant(pDispParams->rgvarg[4]), Variant(pDispParams->rgvarg[3]), + Variant(pDispParams->rgvarg[2]), Variant(pDispParams->rgvarg[1]), + *V_BOOLREF(&pDispParams->rgvarg[0])); + break; + + case DISPID_PRIVACYIMPACTEDSTATECHANGE:// Fired when the user's browsing experience is impacted + if (pDispParams->cArgs != 1) + return E_INVALIDARG; + _callback->PrivacyImpactedStateChange(Variant(pDispParams->rgvarg[0])); + break; + + default: + return NOERROR; + } + + return S_OK; + } + +protected: + BrowserNavigator& _navigator; + + void NavigateComplete2(IDispatch* pDisp, const Variant& url) + { + String adr = (BStr)url; + + _navigator.navigated(adr); + } +}; + + + /// encapsulation of the Web control +struct WebChildWindow : public IPCtrlWindow >, + public DWebBrowserEvents2Impl +{ + typedef IPCtrlWindow > super; + typedef DWebBrowserEvents2Impl web_super; + + WebChildWindow(HWND hwnd, const WebChildWndInfo& info); + + static WebChildWindow* create(const WebChildWndInfo& info) + { + ChildWindow* child = ChildWindow::create(info, + WINDOW_CREATOR_INFO(WebChildWindow,WebChildWndInfo), CLASSNAME_CHILDWND, NULL, WS_CHILD|WS_VISIBLE); + + return static_cast(child); + } + + + // DWebBrowserEvents2Impl overides -> + + void BeforeNavigate2(IDispatch* pDisp, const Variant& url, const Variant& flags, + const Variant& targetFrameName, const Variant& postData, + const Variant& headers, VARIANT_BOOL& cancel) + { + //String adr = (BStr)url; + } + + void NavigateComplete2(IDispatch* pDisp, const Variant& url) + { + web_super::NavigateComplete2(pDisp, url); + + set_url(String(BStr(url))); + } + + void StatusTextChange(const BStr& text) + { + _statusText = text; + SendMessage(_hwndFrame, PM_SETSTATUSTEXT, 0, (LPARAM)_statusText.c_str()); + } + + void ProgressChange(long Progress, long ProgressMax) + { + String txt; + + if (Progress>=0 && ProgressGetProperty(Property, &value); + } + + void CommandStateChange(long command/*CSC_NAVIGATEFORWARD, CSC_NAVIGATEBACK*/, bool enable) + { + } + + void DownloadBegin() + { + } + + void NewWindow2(IDispatch** ppDisp, VARIANT_BOOL& cancel) + { + //*ppDisp = ; + //cancel = TRUE; + } + + void TitleChange(const BStr& text) + { + SetWindowText(_hwnd, String(text)); + } + + void TitleIconChange(const BStr& text) + { + } + + void FrameBeforeNavigate(const BStr& url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& cancel) + { + } + + void FrameNavigateComplete(const BStr& url) + { + } + + void FrameNewWindow(const BStr& url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& processed) + { + } + + void OnQuit() + { + } + + void OnVisible(bool Visible) + { + } + + void OnToolbar(bool Visible) + { + } + + void OnMenubar(bool Visible) + { + } + + void OnStatusbar(bool Visible) + { + } + + void OnFullscreen(bool Visible) + { + } + + void DocumentComplete() + { + } + + void OnTheatermode(bool Visible) + { + } + + void OnAddressbar(bool Visible) + { + } + + void WindowSetResizable(bool Visible) + { + } + + void WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL& cancel) + { + } + + void WindowSetLeft(long Left) + { + } + + void WindowSetTop(long Top) + { + } + + void WindowSetWidth(long Width) + { + } + + void WindowSetHeight(long Height) + { + } + + void ClientToHostWindow(long& CX, long& CY) + { + } + + void SetSecureLockIcon(long SecureLockIcon) + { + } + + void FileDownload(Variant& cancel) + { + } + + void NavigateError(IDispatch* pDisp, const Variant& url, const Variant& Frame, const Variant& StatusCode, VARIANT_BOOL& cancel) + { + } + + void PrivacyImpactedStateChange(bool bImpacted) + { + } + + +protected: + BrowserNavigator _navigator; + auto_ptr _connector; + + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + + virtual String jump_to_int(LPCTSTR url); +}; diff --git a/reactos/base/applications/msconfig/De.rc b/reactos/base/applications/msconfig/De.rc new file mode 100644 index 00000000000..f057363bd3f --- /dev/null +++ b/reactos/base/applications/msconfig/De.rc @@ -0,0 +1,155 @@ +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +IDD_MSCONFIG_DIALOG DIALOG DISCARDABLE 0, 0, 378, 220 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME +CAPTION "Systemkonfigurationsprogramm" +FONT 8, "Tahoma" +BEGIN + CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,2,2,374,195 + DEFPUSHBUTTON "OK", IDOK, 211, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Hilfe", IDC_BTN_HELP, 2, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Abbrechen", IDCANCEL, 267, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Ü&bernehmen", IDC_BTN_APPLY, 323, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_STARTUP_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 + PUSHBUTTON "Alle &aktivieren",IDC_BTN_STARTUP_ACTIVATE,223,155,66,14 + PUSHBUTTON "Alle &deaktivieren",IDC_BTN_STARTUP_DEACTIVATE,295,155,66,14 +END + +IDD_TOOLS_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List2",IDC_TOOLS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 134 + EDITTEXT IDC_TOOLS_CMDLINE, 1, 139, 360, 12, ES_READONLY + PUSHBUTTON "&Ausführen", IDC_BTN_RUN, 311, 155, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_SERVICES_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List1",IDC_SERVICES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,2,1,360,148 + PUSHBUTTON "Alle &aktivieren",IDC_BTN_SERVICES_ACTIVATE,223,155,66,14 + PUSHBUTTON "Alle &deaktivieren",IDC_BTN_SERVICES_DEACTIVATE,295,155,66,14 +END + +IDD_GENERAL_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + GROUPBOX "Systemstartauswahl", -1, 10, 10, 340, 150 + CONTROL "&Normaler Systemstart - Alle Gerätetreiber und Dienste laden", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 210, 10 + CONTROL "&Diagnosesystemstart - Nur grundlegende Geräte und Dienste laden", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 230, 10 + CONTROL "B&enutzerdefinierter Systemstart", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 120, 10 + CHECKBOX "D&atei SYSTEM.INI verarbeiten", IDC_CBX_SYSTEM_INI, 30, 80, 110, 10 + CHECKBOX "&Systemdienste laden", IDC_CBX_SYSTEM_SERVICE, 30, 95, 90, 10 + CHECKBOX "S&ystemstartelemente laden", IDC_CBX_STARTUP_ITEM, 30, 110, 110, 10 +END + +IDD_FREELDR_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + PUSHBUTTON "&Alle Bootpfade überprüfen", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 90, 12 + PUSHBUTTON "A&ls Standard", IDC_BTN_SET_DEFAULT_BOOT, 120, 65, 63, 12 + PUSHBUTTON "Nach &oben", IDC_BTN_MOVE_UP_BOOT_OPTION, 203, 65, 63, 12 + PUSHBUTTON "Nach &unten", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 286, 65, 63, 12 + GROUPBOX "Boot Optionen", -1, 10, 80, 250, 90 + CHECKBOX "/SA&FEBOOT", IDC_CBX_SAFE_BOOT, 15, 90, 50, 10 + CHECKBOX "/&NOGUIBOOT", IDC_CBX_NO_GUI_BOOT, 15, 105, 55, 10 + CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 + CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 + CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 + PUSHBUTTON "E&rweiterte Optionen...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 90, 12 + LTEXT "&Zeitlimit:", -1, 280, 91, 30, 10 + EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT + LTEXT "Sek.", -1, 340, 91, 15, 10 +END + +IDD_FREELDR_ADVANCED_PAGE DIALOG DISCARDABLE 0, 0, 175, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CHECKBOX "/&MAXMEM=", IDC_CBX_MAX_MEM, 10, 10, 50, 10 + EDITTEXT IDC_TXT_MAX_MEM, 80, 10, 60, 12 + CONTROL "",IDC_SCR_MAX_MEM, "msctls_updown32", 0x50000000, 140, 10, 11, 11 + CHECKBOX "/&NUMPROC=", IDC_CBX_NUM_PROC, 10, 25, 50, 10 + COMBOBOX IDC_DRP_NUM_PROC, 80, 25, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&PCILOCK", IDC_CBX_PCI_LOCK, 10, 40, 50, 10 + CHECKBOX "/P&ROFILE", IDC_CBX_PROFILE, 10, 55, 50, 10 + CHECKBOX "/&IRQ", IDC_CBX_IRQ, 10, 70, 40, 12 + EDITTEXT IDC_TXT_IRQ, 80, 70, 60, 12, ES_LEFT + CHECKBOX "/&DEBUG", IDC_CBX_DEBUG, 10, 85, 40, 10 + CHECKBOX "/D&EBUGPORT", IDC_CBX_DEBUG_PORT, 20, 100, 60, 10 + COMBOBOX IDC_DRP_DEBUG_PORT, 80, 100, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&BAUDRATE", IDC_CBX_BAUD_RATE, 20, 115, 50, 10 + COMBOBOX IDC_DRP_DRP_BAUD_RATE, 80, 115, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&CHANNEL", IDC_CBX_CHANNEL, 20, 130, 50, 10 + EDITTEXT IDC_TXT_CHANNEL, 80, 130, 60, 12, ES_LEFT + CONTROL "",IDC_SCR_CHANNEL, "msctls_updown32", 0x50000000, 140, 130, 11, 11 + PUSHBUTTON "OK", IDC_OK, 20, 160, 50, 12 + PUSHBUTTON "Abbrechen", IDC_CANCEL, 100, 160, 50, 12 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MSCONFIG "Systemkonfigurationsprogramm" + IDS_TAB_GENERAL "Allgemein" + IDS_TAB_SYSTEM "SYSTEM.INI" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Dienste" + IDS_TAB_STARTUP "Systemstart" + IDS_TAB_TOOLS "Tools" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_COLUMN_SERVICE "Dienst" + IDS_SERVICES_COLUMN_REQ "Erforderlich" + IDS_SERVICES_COLUMN_VENDOR "Hersteller" + IDS_SERVICES_COLUMN_STATUS "Status" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLS_COLUMN_NAME "Name" + IDS_TOOLS_COLUMN_DESCR "Beschreibung" + + IDS_TOOLS_CMD_NAME "Konsole" + IDS_TOOLS_CMD_DESCR "" + IDS_TOOLS_CMD_CMD "cmd.exe" + + IDS_TOOLS_INFO_NAME "Version" + IDS_TOOLS_INFO_DESCR "Zeigt die installierte ReactOS Version an." + IDS_TOOLS_INFO_CMD "winver.exe" + + IDS_TOOLS_REGEDIT_NAME "Registrierungs-Editor" + IDS_TOOLS_REGEDIT_DESCR "Öffnet den Registrierungs-Editor." + IDS_TOOLS_REGEDIT_CMD "regedit.exe" + + IDS_TOOLS_SYSDM_NAME "Systemeigenschaften" + IDS_TOOLS_SYSDM_DESCR "Zeigt Informationen über diesen Rechner an." + IDS_TOOLS_SYSDM_CMD "control" + IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" + + IDS_STARTUP_COLUMN_ELEMENT "Element" + IDS_STARTUP_COLUMN_CMD "Befehl" + IDS_STARTUP_COLUMN_PATH "Pfad" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "Gestartet" + IDS_SERVICES_STATUS_STOPPED "Beendet" + IDS_SERVICES_YES "Ja" + IDS_SERVICES_UNKNOWN "Unbekannt" +END diff --git a/reactos/base/applications/msconfig/En.rc b/reactos/base/applications/msconfig/En.rc new file mode 100644 index 00000000000..01c170e810f --- /dev/null +++ b/reactos/base/applications/msconfig/En.rc @@ -0,0 +1,155 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +IDD_MSCONFIG_DIALOG DIALOG DISCARDABLE 0, 0, 378, 220 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME +CAPTION "System configuration program" +FONT 8, "Tahoma" +BEGIN + CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,2,2,374,195 + DEFPUSHBUTTON "OK", IDOK, 211, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Help", IDC_BTN_HELP, 2, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 267, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Apply", IDC_BTN_APPLY, 323, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_STARTUP_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 + PUSHBUTTON "&Activate all",IDC_BTN_STARTUP_ACTIVATE,223,155,66,14 + PUSHBUTTON "&Deactivate all",IDC_BTN_STARTUP_DEACTIVATE,295,155,66,14 +END + +IDD_TOOLS_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List2",IDC_TOOLS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 134 + EDITTEXT IDC_TOOLS_CMDLINE, 1, 139, 360, 12, ES_READONLY + PUSHBUTTON "&Run", IDC_BTN_RUN, 311, 155, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_SERVICES_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List1",IDC_SERVICES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,2,1,360,148 + PUSHBUTTON "&Activate all",IDC_BTN_SERVICES_ACTIVATE,223,155,66,14 + PUSHBUTTON "&Deactivate all",IDC_BTN_SERVICES_DEACTIVATE,295,155,66,14 +END + +IDD_GENERAL_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + GROUPBOX "Startup Selection", -1, 10, 10, 340, 150 + CONTROL "&Normal Startup - load all device drivers and services", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 180, 10 + CONTROL "&Diagnostic Startup - load basic devices and services only", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 195, 10 + CONTROL "S&elective Startup", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 70, 10 + CHECKBOX "P&rocess SYSTEM.INI File", IDC_CBX_SYSTEM_INI, 30, 80, 95, 10 + CHECKBOX "&Load System Services", IDC_CBX_SYSTEM_SERVICE, 30, 95, 90, 10 + CHECKBOX "&L&oad Startup Items", IDC_CBX_STARTUP_ITEM, 30, 110, 75, 10 +END + +IDD_FREELDR_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + PUSHBUTTON "&Check All Boot Paths", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 + PUSHBUTTON "&Set as Default", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 + PUSHBUTTON "Move &Up", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 + PUSHBUTTON "Move &Down", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 + GROUPBOX "Boot Options", -1, 10, 80, 250, 90 + CHECKBOX "/SA&FEBOOT", IDC_CBX_SAFE_BOOT, 15, 90, 50, 10 + CHECKBOX "/&NOGUIBOOT", IDC_CBX_NO_GUI_BOOT, 15, 105, 55, 10 + CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 + CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 + CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 + PUSHBUTTON "Ad&vanced Options...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + LTEXT "&Timeout:", -1, 280, 91, 30, 10 + EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT + LTEXT "sec.", -1, 340, 91, 15, 10 +END + +IDD_FREELDR_ADVANCED_PAGE DIALOG DISCARDABLE 0, 0, 175, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CHECKBOX "/&MAXMEM=", IDC_CBX_MAX_MEM, 10, 10, 50, 10 + EDITTEXT IDC_TXT_MAX_MEM, 80, 10, 60, 12 + CONTROL "",IDC_SCR_MAX_MEM, "msctls_updown32", 0x50000000, 140, 10, 11, 11 + CHECKBOX "/&NUMPROC=", IDC_CBX_NUM_PROC, 10, 25, 50, 10 + COMBOBOX IDC_DRP_NUM_PROC, 80, 25, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&PCILOCK", IDC_CBX_PCI_LOCK, 10, 40, 50, 10 + CHECKBOX "/P&ROFILE", IDC_CBX_PROFILE, 10, 55, 50, 10 + CHECKBOX "/&IRQ", IDC_CBX_IRQ, 10, 70, 40, 12 + EDITTEXT IDC_TXT_IRQ, 80, 70, 60, 12, ES_LEFT + CHECKBOX "/&DEBUG", IDC_CBX_DEBUG, 10, 85, 40, 10 + CHECKBOX "/D&EBUGPORT", IDC_CBX_DEBUG_PORT, 20, 100, 60, 10 + COMBOBOX IDC_DRP_DEBUG_PORT, 80, 100, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&BAUDRATE", IDC_CBX_BAUD_RATE, 20, 115, 50, 10 + COMBOBOX IDC_DRP_DRP_BAUD_RATE, 80, 115, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&CHANNEL", IDC_CBX_CHANNEL, 20, 130, 50, 10 + EDITTEXT IDC_TXT_CHANNEL, 80, 130, 60, 12, ES_LEFT + CONTROL "",IDC_SCR_CHANNEL, "msctls_updown32", 0x50000000, 140, 130, 11, 11 + PUSHBUTTON "Ok", IDC_OK, 20, 160, 50, 12 + PUSHBUTTON "Cancel", IDC_CANCEL, 100, 160, 50, 12 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MSCONFIG "System configuration program" + IDS_TAB_GENERAL "General" + IDS_TAB_SYSTEM "SYSTEM.INI" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Services" + IDS_TAB_STARTUP "Startup" + IDS_TAB_TOOLS "Tools" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_COLUMN_SERVICE "Service" + IDS_SERVICES_COLUMN_REQ "Required" + IDS_SERVICES_COLUMN_VENDOR "Vendor" + IDS_SERVICES_COLUMN_STATUS "Status" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLS_COLUMN_NAME "Name" + IDS_TOOLS_COLUMN_DESCR "Description" + + IDS_TOOLS_CMD_NAME "Console" + IDS_TOOLS_CMD_DESCR "" + IDS_TOOLS_CMD_CMD "cmd.exe" + + IDS_TOOLS_INFO_NAME "Version" + IDS_TOOLS_INFO_DESCR "Displays version information." + IDS_TOOLS_INFO_CMD "winver.exe" + + IDS_TOOLS_REGEDIT_NAME "Registry-Editor" + IDS_TOOLS_REGEDIT_DESCR "Opens the Registry-Editor." + IDS_TOOLS_REGEDIT_CMD "regedit.exe" + + IDS_TOOLS_SYSDM_NAME "System properties" + IDS_TOOLS_SYSDM_DESCR "Shows information about this computer." + IDS_TOOLS_SYSDM_CMD "control" + IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" + + IDS_STARTUP_COLUMN_ELEMENT "Element" + IDS_STARTUP_COLUMN_CMD "Command" + IDS_STARTUP_COLUMN_PATH "Path" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "Running" + IDS_SERVICES_STATUS_STOPPED "Stopped" + IDS_SERVICES_YES "Yes" + IDS_SERVICES_UNKNOWN "Unknown" +END diff --git a/reactos/base/applications/msconfig/Fr.rc b/reactos/base/applications/msconfig/Fr.rc new file mode 100644 index 00000000000..8c7407fe6b8 --- /dev/null +++ b/reactos/base/applications/msconfig/Fr.rc @@ -0,0 +1,96 @@ +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +IDD_MSCONFIG_DIALOG DIALOG DISCARDABLE 0, 0, 378, 220 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME +CAPTION "Utilitaire de configuration système" +FONT 8, "Tahoma" +BEGIN + CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,2,2,374,195 + DEFPUSHBUTTON "OK", IDOK, 211, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Aide", IDC_BTN_HELP, 2, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Annuler", IDCANCEL, 267, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "A&ppliquer", IDC_BTN_APPLY, 323, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_STARTUP_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 + PUSHBUTTON "&Activer tout",IDC_BTN_STARTUP_ACTIVATE,223,155,66,14 + PUSHBUTTON "&Désactiver tout",IDC_BTN_STARTUP_DEACTIVATE,295,155,66,14 +END + +IDD_TOOLS_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List2",IDC_TOOLS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 134 + EDITTEXT IDC_TOOLS_CMDLINE, 1, 139, 360, 12, ES_READONLY + PUSHBUTTON "&Lancer", IDC_BTN_RUN, 311, 155, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_SERVICES_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List1",IDC_SERVICES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,2,1,360,148 + PUSHBUTTON "&Activer tout",IDC_BTN_SERVICES_ACTIVATE,223,155,66,14 + PUSHBUTTON "&Désactiver tout",IDC_BTN_SERVICES_DEACTIVATE,295,155,66,14 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MSCONFIG "Utilitaire de configuration système" + IDS_TAB_GENERAL "Général" + IDS_TAB_SYSTEM "SYSTEM.INI" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Services" + IDS_TAB_STARTUP "Démarrage" + IDS_TAB_TOOLS "Outils" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_COLUMN_SERVICE "Service" + IDS_SERVICES_COLUMN_REQ "Requis" + IDS_SERVICES_COLUMN_VENDOR "Fabricant" + IDS_SERVICES_COLUMN_STATUS "Etat" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLS_COLUMN_NAME "Nom" + IDS_TOOLS_COLUMN_DESCR "Description" + + IDS_TOOLS_CMD_NAME "Console" + IDS_TOOLS_CMD_DESCR "" + IDS_TOOLS_CMD_CMD "cmd.exe" + + IDS_TOOLS_INFO_NAME "Version" + IDS_TOOLS_INFO_DESCR "Affiche les informations de version." + IDS_TOOLS_INFO_CMD "winver.exe" + + IDS_TOOLS_REGEDIT_NAME "Editeur de Registre" + IDS_TOOLS_REGEDIT_DESCR "Ouvre l'éditeur de Registre" + IDS_TOOLS_REGEDIT_CMD "regedit.exe" + + IDS_TOOLS_SYSDM_NAME "Propriétés système" + IDS_TOOLS_SYSDM_DESCR "Affiche/modifie des information a propos de l'ordinateur." + IDS_TOOLS_SYSDM_CMD "control" + IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" + + IDS_STARTUP_COLUMN_ELEMENT "Elément" + IDS_STARTUP_COLUMN_CMD "Commande" + IDS_STARTUP_COLUMN_PATH "Chemin" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "En cours" + IDS_SERVICES_STATUS_STOPPED "Arrêté" + IDS_SERVICES_YES "Oui" + IDS_SERVICES_UNKNOWN "Inconnu" +END diff --git a/reactos/base/applications/msconfig/Hu.rc b/reactos/base/applications/msconfig/Hu.rc new file mode 100644 index 00000000000..bdbf73f67c9 --- /dev/null +++ b/reactos/base/applications/msconfig/Hu.rc @@ -0,0 +1,98 @@ +// Hungarian resources, by Robert Horvath (Talley at cubeclub.hu) + +LANGUAGE LANG_HUNGARIAN, SUBLANG_NEUTRAL + +IDD_MSCONFIG_DIALOG DIALOG DISCARDABLE 0, 0, 378, 220 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME +CAPTION "Rendszerbeállítások" +FONT 8, "Tahoma" +BEGIN + CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,2,2,374,195 + DEFPUSHBUTTON "OK", IDOK, 211, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Súgó", IDC_BTN_HELP, 2, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Mégse", IDCANCEL, 267, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Alkalmaz", IDC_BTN_APPLY, 323, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_STARTUP_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 + PUSHBUTTON "Mindet &bekapcsol",IDC_BTN_STARTUP_ACTIVATE,223,155,66,14 + PUSHBUTTON "Mindet &kikapcsol",IDC_BTN_STARTUP_DEACTIVATE,295,155,66,14 +END + +IDD_TOOLS_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List2",IDC_TOOLS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 134 + EDITTEXT IDC_TOOLS_CMDLINE, 1, 139, 360, 12, ES_READONLY + PUSHBUTTON "&Futtat", IDC_BTN_RUN, 311, 155, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_SERVICES_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List1",IDC_SERVICES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,2,1,360,148 + PUSHBUTTON "Mindet &bekapcsol",IDC_BTN_SERVICES_ACTIVATE,223,155,66,14 + PUSHBUTTON "Mindet &kikapcsol",IDC_BTN_SERVICES_DEACTIVATE,295,155,66,14 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MSCONFIG "Rendszerkonfiguráciüs segédprogram" + IDS_TAB_GENERAL "Általános" + IDS_TAB_SYSTEM "SYSTEM.INI" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Szolgáltatások" + IDS_TAB_STARTUP "Automatikus indítás" + IDS_TAB_TOOLS "Segédprogramok" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_COLUMN_SERVICE "Szolgálgatás" + IDS_SERVICES_COLUMN_REQ "Lényeges" + IDS_SERVICES_COLUMN_VENDOR "Gyártó" + IDS_SERVICES_COLUMN_STATUS "Állapot" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLS_COLUMN_NAME "Név" + IDS_TOOLS_COLUMN_DESCR "Description" + + IDS_TOOLS_CMD_NAME "Konzol" + IDS_TOOLS_CMD_DESCR "" + IDS_TOOLS_CMD_CMD "cmd.exe" + + IDS_TOOLS_INFO_NAME "Verzió" + IDS_TOOLS_INFO_DESCR "Megjeleníti a verzió-információkat." + IDS_TOOLS_INFO_CMD "winver.exe" + + IDS_TOOLS_REGEDIT_NAME "Rendszerleíróadatbázis-szerkesztõ" + IDS_TOOLS_REGEDIT_DESCR "Megnyitja a szerkesztõ programot." + IDS_TOOLS_REGEDIT_CMD "regedit.exe" + + IDS_TOOLS_SYSDM_NAME "Rendszertulajdonságok" + IDS_TOOLS_SYSDM_DESCR "Megjeleníti a számítógép információkat." + IDS_TOOLS_SYSDM_CMD "control" + IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" + + IDS_STARTUP_COLUMN_ELEMENT "Element" + IDS_STARTUP_COLUMN_CMD "Parancs" + IDS_STARTUP_COLUMN_PATH "Elérési út" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "Fut" + IDS_SERVICES_STATUS_STOPPED "Leállítva" + IDS_SERVICES_YES "Igen" + IDS_SERVICES_UNKNOWN "Ismeretlen" +END diff --git a/reactos/base/applications/msconfig/freeldrpage.c b/reactos/base/applications/msconfig/freeldrpage.c new file mode 100644 index 00000000000..a6d84d5fc00 --- /dev/null +++ b/reactos/base/applications/msconfig/freeldrpage.c @@ -0,0 +1,17 @@ +#include + +HWND hFreeLdrPage; +HWND hFreeLdrDialog; + +INT_PTR CALLBACK +FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_INITDIALOG: + hFreeLdrDialog = hDlg; + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + return TRUE; + } + + return 0; +} diff --git a/reactos/base/applications/msconfig/freeldrpage.h b/reactos/base/applications/msconfig/freeldrpage.h new file mode 100644 index 00000000000..6e0331b2a4f --- /dev/null +++ b/reactos/base/applications/msconfig/freeldrpage.h @@ -0,0 +1,3 @@ +extern HWND hFreeLdrPage; + +INT_PTR CALLBACK FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/reactos/base/applications/msconfig/generalpage.c b/reactos/base/applications/msconfig/generalpage.c new file mode 100644 index 00000000000..ed5454c0b87 --- /dev/null +++ b/reactos/base/applications/msconfig/generalpage.c @@ -0,0 +1,17 @@ +#include + +HWND hGeneralPage; +HWND hGeneralDialog; + +INT_PTR CALLBACK +GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_INITDIALOG: + hGeneralDialog = hDlg; + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + return TRUE; + } + + return 0; +} diff --git a/reactos/base/applications/msconfig/generalpage.h b/reactos/base/applications/msconfig/generalpage.h new file mode 100644 index 00000000000..408c4049dc1 --- /dev/null +++ b/reactos/base/applications/msconfig/generalpage.h @@ -0,0 +1,3 @@ +extern HWND hGeneralPage; + +INT_PTR CALLBACK GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/reactos/base/applications/msconfig/msconfig.c b/reactos/base/applications/msconfig/msconfig.c new file mode 100644 index 00000000000..839c6fa6d53 --- /dev/null +++ b/reactos/base/applications/msconfig/msconfig.c @@ -0,0 +1,198 @@ +#include + +HINSTANCE hInst = 0; + +HWND hMainWnd; /* Main Window */ +HWND hTabWnd; /* Tab Control Window */ + +void MsConfig_OnTabWndSelChange(void); + +BOOL OnCreate(HWND hWnd) +{ + TCHAR szTemp[256]; + TCITEM item; + + hTabWnd = GetDlgItem(hWnd, IDC_TAB); + hGeneralPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_GENERAL_PAGE), hWnd, GeneralPageWndProc); + hSystemPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SYSTEM_PAGE), hWnd, SystemPageWndProc); + hFreeLdrPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FREELDR_PAGE), hWnd, FreeLdrPageWndProc); + hServicesPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SERVICES_PAGE), hWnd, ServicesPageWndProc); + hStartupPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_STARTUP_PAGE), hWnd, StartupPageWndProc); + hToolsPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TOOLS_PAGE), hWnd, ToolsPageWndProc); + + LoadString(hInst, IDS_MSCONFIG, szTemp, 256); + SetWindowText(hWnd, szTemp); + + // Insert Tab Pages + LoadString(hInst, IDS_TAB_GENERAL, szTemp, 256); + memset(&item, 0, sizeof(TCITEM)); + item.mask = TCIF_TEXT; + item.pszText = szTemp; + TabCtrl_InsertItem(hTabWnd, 0, &item); + + LoadString(hInst, IDS_TAB_SYSTEM, szTemp, 256); + memset(&item, 0, sizeof(TCITEM)); + item.mask = TCIF_TEXT; + item.pszText = szTemp; + TabCtrl_InsertItem(hTabWnd, 1, &item); + + LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256); + memset(&item, 0, sizeof(TCITEM)); + item.mask = TCIF_TEXT; + item.pszText = szTemp; + TabCtrl_InsertItem(hTabWnd, 2, &item); + + LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256); + memset(&item, 0, sizeof(TCITEM)); + item.mask = TCIF_TEXT; + item.pszText = szTemp; + TabCtrl_InsertItem(hTabWnd, 3, &item); + + LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256); + memset(&item, 0, sizeof(TCITEM)); + item.mask = TCIF_TEXT; + item.pszText = szTemp; + TabCtrl_InsertItem(hTabWnd, 4, &item); + + LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256); + memset(&item, 0, sizeof(TCITEM)); + item.mask = TCIF_TEXT; + item.pszText = szTemp; + TabCtrl_InsertItem(hTabWnd, 5, &item); + + MsConfig_OnTabWndSelChange(); + + return TRUE; +} + + +void MsConfig_OnTabWndSelChange(void) +{ + switch (TabCtrl_GetCurSel(hTabWnd)) { + case 0: //General + ShowWindow(hGeneralPage, SW_SHOW); + ShowWindow(hSystemPage, SW_HIDE); + ShowWindow(hFreeLdrPage, SW_HIDE); + ShowWindow(hServicesPage, SW_HIDE); + ShowWindow(hStartupPage, SW_HIDE); + ShowWindow(hToolsPage, SW_HIDE); + BringWindowToTop(hGeneralPage); + break; + case 1: //SYSTEM.INI + ShowWindow(hGeneralPage, SW_HIDE); + ShowWindow(hSystemPage, SW_SHOW); + ShowWindow(hToolsPage, SW_HIDE); + ShowWindow(hStartupPage, SW_HIDE); + ShowWindow(hFreeLdrPage, SW_HIDE); + ShowWindow(hServicesPage, SW_HIDE); + BringWindowToTop(hSystemPage); + break; + case 2: //Freeldr + ShowWindow(hGeneralPage, SW_HIDE); + ShowWindow(hSystemPage, SW_HIDE); + ShowWindow(hFreeLdrPage, SW_SHOW); + ShowWindow(hServicesPage, SW_HIDE); + ShowWindow(hStartupPage, SW_HIDE); + ShowWindow(hToolsPage, SW_HIDE); + BringWindowToTop(hFreeLdrPage); + break; + case 3: //Services + ShowWindow(hGeneralPage, SW_HIDE); + ShowWindow(hSystemPage, SW_HIDE); + ShowWindow(hFreeLdrPage, SW_HIDE); + ShowWindow(hServicesPage, SW_SHOW); + ShowWindow(hStartupPage, SW_HIDE); + ShowWindow(hToolsPage, SW_HIDE); + BringWindowToTop(hServicesPage); + break; + case 4: //startup + ShowWindow(hGeneralPage, SW_HIDE); + ShowWindow(hSystemPage, SW_HIDE); + ShowWindow(hFreeLdrPage, SW_HIDE); + ShowWindow(hServicesPage, SW_HIDE); + ShowWindow(hStartupPage, SW_SHOW); + ShowWindow(hToolsPage, SW_HIDE); + BringWindowToTop(hStartupPage); + break; + case 5: //Tools + ShowWindow(hGeneralPage, SW_HIDE); + ShowWindow(hSystemPage, SW_HIDE); + ShowWindow(hFreeLdrPage, SW_HIDE); + ShowWindow(hServicesPage, SW_HIDE); + ShowWindow(hStartupPage, SW_HIDE); + ShowWindow(hToolsPage, SW_SHOW); + BringWindowToTop(hToolsPage); + break; + } +} + + +/* Message handler for dialog box. */ +INT_PTR CALLBACK +MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + int idctrl; + LPNMHDR pnmh; + + switch (message) { + case WM_INITDIALOG: + hMainWnd = hDlg; + return OnCreate(hDlg); + + case WM_COMMAND: + + if (LOWORD(wParam) == IDOK) { + //MsConfig_OnSaveChanges(); + } + + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + break; + + case WM_NOTIFY: + idctrl = (int)wParam; + pnmh = (LPNMHDR)lParam; + if ((pnmh->hwndFrom == hTabWnd) && + (pnmh->idFrom == IDC_TAB) && + (pnmh->code == TCN_SELCHANGE)) + { + MsConfig_OnTabWndSelChange(); + } + break; + + case WM_DESTROY: + DestroyWindow(hToolsPage); + DestroyWindow(hGeneralPage); + DestroyWindow(hServicesPage); + DestroyWindow(hStartupPage); + DestroyWindow(hFreeLdrPage); + DestroyWindow(hSystemPage); + return DefWindowProc(hDlg, message, wParam, lParam); + + } + + return 0; +} + +int APIENTRY WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + + INITCOMMONCONTROLSEX InitControls; + + InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitControls.dwICC = ICC_TAB_CLASSES | ICC_LISTVIEW_CLASSES; + InitCommonControlsEx(&InitControls); + + hInst = hInstance; + + DialogBox(hInst, (LPCTSTR)IDD_MSCONFIG_DIALOG, NULL, MsConfigWndProc); + + return 0; +} + +/* EOF */ diff --git a/reactos/base/applications/msconfig/msconfig.h b/reactos/base/applications/msconfig/msconfig.h new file mode 100644 index 00000000000..4a4554668a2 --- /dev/null +++ b/reactos/base/applications/msconfig/msconfig.h @@ -0,0 +1,2 @@ +extern HINSTANCE hInst; + diff --git a/reactos/base/applications/msconfig/msconfig.rc b/reactos/base/applications/msconfig/msconfig.rc new file mode 100644 index 00000000000..54b22a9d8d4 --- /dev/null +++ b/reactos/base/applications/msconfig/msconfig.rc @@ -0,0 +1,19 @@ +#include +#include + +#include "resource.h" + + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Systemconfiguration Tool\0" +#define REACTOS_STR_INTERNAL_NAME "msconfig\0" +#define REACTOS_STR_ORIGINAL_FILENAME "msconfig.exe\0" +#include + + +#include "De.rc" +#include "En.rc" +#include "Fr.rc" +#include "Hu.rc" diff --git a/reactos/base/applications/msconfig/msconfig.xml b/reactos/base/applications/msconfig/msconfig.xml new file mode 100644 index 00000000000..76d3f79486c --- /dev/null +++ b/reactos/base/applications/msconfig/msconfig.xml @@ -0,0 +1,26 @@ + + . + + + + + 0x600 + 0x501 + kernel32 + user32 + advapi32 + version + comctl32 + shell32 + + toolspage.c + srvpage.c + systempage.c + startuppage.c + freeldrpage.c + generalpage.c + msconfig.c + + msconfig.rc + precomp.h + diff --git a/reactos/base/applications/msconfig/precomp.h b/reactos/base/applications/msconfig/precomp.h new file mode 100644 index 00000000000..056a48ededd --- /dev/null +++ b/reactos/base/applications/msconfig/precomp.h @@ -0,0 +1,19 @@ +#include +#define NTOS_MODE_USER +#include +#include +#include + +#include "resource.h" +#include "msconfig.h" +#include "toolspage.h" +#include "srvpage.h" +#include "startuppage.h" +#include "freeldrpage.h" +#include "systempage.h" +#include "generalpage.h" + +#define MAX_KEY_LENGTH 255 +#define MAX_VALUE_NAME 16383 + + diff --git a/reactos/base/applications/msconfig/resource.h b/reactos/base/applications/msconfig/resource.h new file mode 100644 index 00000000000..9ad266342cd --- /dev/null +++ b/reactos/base/applications/msconfig/resource.h @@ -0,0 +1,104 @@ +#define IDD_MSCONFIG_DIALOG 101 +#define IDD_TOOLS_PAGE 102 +#define IDD_SERVICES_PAGE 103 +#define IDD_GENERAL_PAGE 104 +#define IDD_STARTUP_PAGE 105 +#define IDD_FREELDR_PAGE 106 +#define IDD_SYSTEM_PAGE 107 +#define IDD_FREELDR_ADVANCED_PAGE 108 + +#define IDC_TAB 1001 +#define IDC_BTN_APPLY 1002 +#define IDC_BTN_HELP 1003 +#define IDC_TOOLS_CMDLINE 1004 +#define IDC_BTN_RUN 1005 +#define IDC_SERVICES_LIST 1006 +#define IDC_TOOLS_LIST 1007 +#define IDC_STARTUP_LIST 1008 +#define IDC_BTN_SERVICES_ACTIVATE 1009 +#define IDC_BTN_SERVICES_DEACTIVATE 1010 +#define IDC_BTN_STARTUP_ACTIVATE 1011 +#define IDC_BTN_STARTUP_DEACTIVATE 1012 +#define IDC_CBX_NORMAL_START 1013 +#define IDC_CBX_DIAGNOSTIC_START 1014 +#define IDC_CBX_SELECTIVE_STARTUP 1015 +#define IDC_CBX_SYSTEM_INI 1016 +#define IDC_CBX_SYSTEM_SERVICE 1017 +#define IDC_CBX_STARTUP_ITEM 1018 +#define IDC_LIST_BOX 1019 +#define IDC_BTN_CHECK_BOOT_PATH 1020 +#define IDC_BTN_SET_DEFAULT_BOOT 1021 +#define IDC_BTN_MOVE_UP_BOOT_OPTION 1022 +#define IDC_BTN_MOVE_DOWN_BOOT_OPTION 1023 +#define IDC_CBX_SAFE_BOOT 1024 +#define IDC_CBX_NO_GUI_BOOT 1025 +#define IDC_CBX_BOOT_LOG 1026 +#define IDC_CBX_BASE_VIDEO 1027 +#define IDC_CBX_SOS 1028 +#define IDC_BTN_ADVANCED_OPTIONS 1029 +#define IDC_TXT_BOOT_TIMEOUT 1030 +#define IDC_CBX_MAX_MEM 1031 +#define IDC_TXT_MAX_MEM 1032 +#define IDC_SCR_MAX_MEM 1033 +#define IDC_CBX_NUM_PROC 1034 +#define IDC_DRP_NUM_PROC 1035 +#define IDC_CBX_PCI_LOCK 1036 +#define IDC_CBX_PROFILE 1037 +#define IDC_CBX_IRQ 1038 +#define IDC_TXT_IRQ 1039 +#define IDC_CBX_DEBUG 1040 +#define IDC_CBX_DEBUG_PORT 1041 +#define IDC_DRP_DEBUG_PORT 1042 +#define IDC_CBX_BAUD_RATE 1043 +#define IDC_DRP_DRP_BAUD_RATE 1044 +#define IDC_CBX_CHANNEL 1045 +#define IDC_TXT_CHANNEL 1046 +#define IDC_SCR_CHANNEL 1047 +#define IDC_OK 1048 +#define IDC_CANCEL 1049 + +#define IDS_TAB_TOOLS 2001 +#define IDS_TAB_SYSTEM 2002 +#define IDS_TAB_FREELDR 2003 +#define IDS_TAB_STARTUP 2004 +#define IDS_TAB_SERVICES 2005 +#define IDS_TAB_GENERAL 2006 + +#define IDS_TOOLS_COLUMN_NAME 2010 +#define IDS_TOOLS_COLUMN_DESCR 2011 +#define IDS_SERVICES_COLUMN_SERVICE 2012 +#define IDS_SERVICES_COLUMN_REQ 2013 +#define IDS_SERVICES_COLUMN_VENDOR 2014 +#define IDS_SERVICES_COLUMN_STATUS 2015 +#define IDS_STARTUP_COLUMN_ELEMENT 2016 +#define IDS_STARTUP_COLUMN_CMD 2017 +#define IDS_STARTUP_COLUMN_PATH 2018 + +#define IDS_TOOLS_CMD_NAME 2100 +#define IDS_TOOLS_CMD_DESCR 2101 +#define IDS_TOOLS_CMD_CMD 2102 +#define IDS_TOOLS_CMD_PARAM 2103 + +#define IDS_TOOLS_INFO_NAME 2104 +#define IDS_TOOLS_INFO_DESCR 2105 +#define IDS_TOOLS_INFO_CMD 2106 +#define IDS_TOOLS_INFO_PARAM 2107 + +#define IDS_TOOLS_REGEDIT_NAME 2108 +#define IDS_TOOLS_REGEDIT_DESCR 2109 +#define IDS_TOOLS_REGEDIT_CMD 2110 +#define IDS_TOOLS_REGEDIT_PARAM 2111 + +#define IDS_TOOLS_SYSDM_NAME 2112 +#define IDS_TOOLS_SYSDM_DESCR 2113 +#define IDS_TOOLS_SYSDM_CMD 2114 +#define IDS_TOOLS_SYSDM_PARAM 2115 + +#define IDS_SERVICES_STATUS_STOPPED 2200 +#define IDS_SERVICES_STATUS_RUNNING 2201 +#define IDS_SERVICES_YES 2202 +#define IDS_SERVICES_UNKNOWN 2203 + +#define IDS_MSCONFIG 3000 + +/* EOF */ diff --git a/reactos/base/applications/msconfig/srvpage.c b/reactos/base/applications/msconfig/srvpage.c new file mode 100644 index 00000000000..aed2e01abcd --- /dev/null +++ b/reactos/base/applications/msconfig/srvpage.c @@ -0,0 +1,251 @@ +#include + +HWND hServicesPage; +HWND hServicesListCtrl; +HWND hServicesDialog; + +void GetServices ( void ); + +INT_PTR CALLBACK +ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + LV_COLUMN column; + TCHAR szTemp[256]; + DWORD dwStyle; + + switch (message) { + case WM_INITDIALOG: + + hServicesListCtrl = GetDlgItem(hDlg, IDC_SERVICES_LIST); + hServicesDialog = hDlg; + + dwStyle = (DWORD) SendMessage(hServicesListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES; + SendMessage(hServicesListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); + + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + + // Initialize the application page's controls + column.mask = LVCF_TEXT | LVCF_WIDTH; + + LoadString(hInst, IDS_SERVICES_COLUMN_SERVICE, szTemp, 256); + column.pszText = szTemp; + column.cx = 200; + ListView_InsertColumn(hServicesListCtrl, 0, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_SERVICES_COLUMN_REQ, szTemp, 256); + column.pszText = szTemp; + column.cx = 70; + ListView_InsertColumn(hServicesListCtrl, 1, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_SERVICES_COLUMN_VENDOR, szTemp, 256); + column.pszText = szTemp; + column.cx = 200; + ListView_InsertColumn(hServicesListCtrl, 2, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_SERVICES_COLUMN_STATUS, szTemp, 256); + column.pszText = szTemp; + column.cx = 70; + ListView_InsertColumn(hServicesListCtrl, 3, &column); + + GetServices(); + return TRUE; + } + + return 0; +} + +void +GetServices ( void ) +{ + LV_ITEM item; + WORD wCodePage; + WORD wLangID; + SC_HANDLE ScHandle; + SC_HANDLE hService; + DWORD BytesNeeded = 0; + DWORD ResumeHandle = 0; + DWORD NumServices = 0; + DWORD dwHandle, dwLen; + size_t Index; + UINT BufLen; + TCHAR szStatus[128]; + TCHAR* lpData; + TCHAR* lpBuffer; + TCHAR szStrFileInfo[80]; + TCHAR FileName[MAX_PATH]; + LPVOID pvData; + + LPSERVICE_FAILURE_ACTIONS pServiceFailureActions = NULL; + LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; + ENUM_SERVICE_STATUS_PROCESS *pServiceStatus = NULL; + + ScHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE); + if (ScHandle != INVALID_HANDLE_VALUE) + { + if (EnumServicesStatusEx(ScHandle, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, (LPBYTE)pServiceStatus, 0, &BytesNeeded, &NumServices, &ResumeHandle, 0) == 0) + { + /* Call function again if required size was returned */ + if (GetLastError() == ERROR_MORE_DATA) + { + /* reserve memory for service info array */ + pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (!pServiceStatus) + return; + + /* fill array with service info */ + if (EnumServicesStatusEx(ScHandle, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, (LPBYTE)pServiceStatus, BytesNeeded, &BytesNeeded, &NumServices, &ResumeHandle, 0) == 0) + { + HeapFree(GetProcessHeap(), 0, pServiceStatus); + return; + } + } + else /* exit on failure */ + { + return; + } + } + + if (NumServices) + { + if (!pServiceStatus) + return; + for (Index = 0; Index < NumServices; Index++) + { + memset(&item, 0, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT; + item.iImage = 0; + item.pszText = pServiceStatus[Index].lpDisplayName; + item.iItem = ListView_GetItemCount(hServicesListCtrl); + item.lParam = 0; + item.iItem = ListView_InsertItem(hServicesListCtrl, &item); + + BytesNeeded = 0; + hService = OpenService(ScHandle, pServiceStatus[Index].lpServiceName, SC_MANAGER_CONNECT); + if (hService != INVALID_HANDLE_VALUE) + { + /* check if service is required by the system*/ + if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, 0, &BytesNeeded)) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceFailureActions == NULL) + return; + + if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, BytesNeeded, &BytesNeeded)) + { + HeapFree(GetProcessHeap(), 0, pServiceFailureActions); + return; + } + } + else /* exit on failure */ + { + return; + } + } + if (pServiceFailureActions->cActions) + { + if (pServiceFailureActions->lpsaActions[0].Type == SC_ACTION_REBOOT) + { + LoadString(hInst, IDS_SERVICES_YES, szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 1; + SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + } + + if (pServiceFailureActions != NULL) + { + HeapFree(GetProcessHeap(), 0, pServiceFailureActions); + pServiceFailureActions = NULL; + } + + /* get vendor of service binary */ + BytesNeeded = 0; + if (!QueryServiceConfig(hService, pServiceConfig, 0, &BytesNeeded)) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pServiceConfig = (LPQUERY_SERVICE_CONFIG) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceConfig == NULL) + return; + + if (!QueryServiceConfig(hService, pServiceConfig, BytesNeeded, &BytesNeeded)) + { + HeapFree(GetProcessHeap(), 0, pServiceConfig); + return; + } + } + else /* exit on failure */ + { + return; + } + } + + memset(&FileName, 0, MAX_PATH); + if (_tcscspn(pServiceConfig->lpBinaryPathName, _T("\""))) + { + _tcsncpy(FileName, pServiceConfig->lpBinaryPathName, _tcscspn(pServiceConfig->lpBinaryPathName, _T(" ")) ); + } + else + { + _tcscpy(FileName, pServiceConfig->lpBinaryPathName); + } + + HeapFree(GetProcessHeap(), 0, pServiceConfig); + pServiceConfig = NULL; + + dwLen = GetFileVersionInfoSize(FileName, &dwHandle); + if (dwLen) + { + lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen); + if (lpData == NULL) + return; + + if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) { + HeapFree(GetProcessHeap(), 0, lpData); + return; + } + + if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), &pvData, (PUINT) &BufLen)) + { + wCodePage = LOWORD(*(DWORD*) pvData); + wLangID = HIWORD(*(DWORD*) pvData); + wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID); + } + + if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) { + item.pszText = lpBuffer; + item.iSubItem = 2; + SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + HeapFree(GetProcessHeap(), 0, lpData); + } + else + { + LoadString(hInst, IDS_SERVICES_UNKNOWN, szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 2; + SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + CloseServiceHandle(hService); + } + + LoadString(hInst, ((pServiceStatus[Index].ServiceStatusProcess.dwCurrentState == SERVICE_STOPPED) ? IDS_SERVICES_STATUS_STOPPED : IDS_SERVICES_STATUS_RUNNING), szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 3; + SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + + } + } + + HeapFree(GetProcessHeap(), 0, pServiceStatus); + CloseServiceHandle(ScHandle); + } + + +} diff --git a/reactos/base/applications/msconfig/srvpage.h b/reactos/base/applications/msconfig/srvpage.h new file mode 100644 index 00000000000..89c8f3e6112 --- /dev/null +++ b/reactos/base/applications/msconfig/srvpage.h @@ -0,0 +1,4 @@ +extern HWND hServicesPage; +extern HWND hServicesListCtrl; + +INT_PTR CALLBACK ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/reactos/base/applications/msconfig/startuppage.c b/reactos/base/applications/msconfig/startuppage.c new file mode 100644 index 00000000000..2ebe2ac98d6 --- /dev/null +++ b/reactos/base/applications/msconfig/startuppage.c @@ -0,0 +1,123 @@ +#include + +HWND hStartupPage; +HWND hStartupListCtrl; +HWND hStartupDialog; + +void GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ); + +INT_PTR CALLBACK +StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + LV_COLUMN column; + TCHAR szTemp[256]; + DWORD dwStyle; + + switch (message) { + case WM_INITDIALOG: + + hStartupListCtrl = GetDlgItem(hDlg, IDC_STARTUP_LIST); + hStartupDialog = hDlg; + + dwStyle = (DWORD) SendMessage(hStartupListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES; + SendMessage(hStartupListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); + + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + + // Initialize the application page's controls + column.mask = LVCF_TEXT | LVCF_WIDTH; + + LoadString(hInst, IDS_STARTUP_COLUMN_ELEMENT, szTemp, 256); + column.pszText = szTemp; + column.cx = 150; + ListView_InsertColumn(hStartupListCtrl, 0, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_STARTUP_COLUMN_CMD, szTemp, 256); + column.pszText = szTemp; + column.cx = 150; + ListView_InsertColumn(hStartupListCtrl, 1, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_STARTUP_COLUMN_PATH, szTemp, 256); + column.pszText = szTemp; + column.cx = 250; + ListView_InsertColumn(hStartupListCtrl, 2, &column); + + GetAutostartEntriesFromRegistry(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); + GetAutostartEntriesFromRegistry(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); + //FIXME: What about HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit + //FIXME: Common Startup (startmenu) + + return TRUE; + } + + return 0; +} + +void +GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ) +{ + HKEY hKey; + DWORD Index, dwValues, retVal, dwType; + DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; + TCHAR* Data; + TCHAR lpValueName[MAX_KEY_LENGTH]; + TCHAR Path[MAX_KEY_LENGTH + 5]; + LV_ITEM item; + + if (RegOpenKeyEx(hRootKey, KeyName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) + { + dwValueLength = MAX_KEY_LENGTH; + dwDataLength = MAX_VALUE_NAME; + Data = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, MAX_VALUE_NAME * sizeof(TCHAR)); + if (Data == NULL) + break; + retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength); + if (retVal == ERROR_SUCCESS) + { + memset(&item, 0, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT; + item.iImage = 0; + item.pszText = lpValueName; + item.iItem = ListView_GetItemCount(hStartupListCtrl); + item.lParam = 0; + ListView_InsertItem(hStartupListCtrl, &item); + + if (dwType == REG_SZ) + { + GetLongPathName(Data, Data, (DWORD) _tcsclen(Data)); + item.pszText = Data; + item.iSubItem = 1; + SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + switch (PtrToLong(hRootKey)) + { + case PtrToLong(HKEY_LOCAL_MACHINE): + _tcscpy(Path, _T("HKLM\\\0")); + break; + case PtrToLong(HKEY_CURRENT_USER): + _tcscpy(Path, _T("HKCU\\\0")); + break; + default: + _tcscpy(Path, _T("\0")); + } + + _tcscat(Path, KeyName); + item.pszText = Path; + item.iSubItem = 2; + SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + HeapFree(GetProcessHeap(), 0, Data); + } + } + } + RegCloseKey(hKey); + } + +} diff --git a/reactos/base/applications/msconfig/startuppage.h b/reactos/base/applications/msconfig/startuppage.h new file mode 100644 index 00000000000..9ac644081f0 --- /dev/null +++ b/reactos/base/applications/msconfig/startuppage.h @@ -0,0 +1,4 @@ +extern HWND hStartupPage; +extern HWND hStartupPageListCtrl; + +INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/reactos/base/applications/msconfig/systempage.c b/reactos/base/applications/msconfig/systempage.c new file mode 100644 index 00000000000..316f196776f --- /dev/null +++ b/reactos/base/applications/msconfig/systempage.c @@ -0,0 +1,17 @@ +#include + +HWND hSystemPage; +HWND hSystemDialog; + +INT_PTR CALLBACK +SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_INITDIALOG: + hSystemDialog = hDlg; + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + return TRUE; + } + + return 0; +} diff --git a/reactos/base/applications/msconfig/systempage.h b/reactos/base/applications/msconfig/systempage.h new file mode 100644 index 00000000000..d928c77389c --- /dev/null +++ b/reactos/base/applications/msconfig/systempage.h @@ -0,0 +1,3 @@ +extern HWND hSystemPage; + +INT_PTR CALLBACK SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/reactos/base/applications/msconfig/toolspage.c b/reactos/base/applications/msconfig/toolspage.c new file mode 100644 index 00000000000..d020a454425 --- /dev/null +++ b/reactos/base/applications/msconfig/toolspage.c @@ -0,0 +1,124 @@ +#include + +HWND hToolsPage; +HWND hToolsListCtrl; +HWND hToolsDialog; + +void AddItem ( DWORD, DWORD, DWORD, DWORD ); +void FillListView ( void ); + +DWORD ListItems_Cmds[20]; +DWORD ListItems_Params[20]; + +void AddItem ( DWORD name_id, DWORD descr_id, DWORD cmd_id , DWORD param_id ) { + TCHAR szTemp[256]; + LV_ITEM item; + + LoadString(hInst, name_id, szTemp, 256); + memset(&item, 0, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT; + item.iImage = 0; + item.pszText = szTemp; + item.iItem = ListView_GetItemCount(hToolsListCtrl); + item.lParam = 0; + ListView_InsertItem(hToolsListCtrl, &item); + + ListItems_Cmds[item.iItem] = cmd_id; + ListItems_Params[item.iItem] = param_id; + + LoadString(hInst, descr_id, szTemp, 256); + item.pszText = szTemp; + item.iSubItem = 1; + SendMessage(hToolsListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); +} + +void FillListView ( void ) { + AddItem(IDS_TOOLS_CMD_NAME, IDS_TOOLS_CMD_DESCR, IDS_TOOLS_CMD_CMD, IDS_TOOLS_CMD_PARAM); + AddItem(IDS_TOOLS_REGEDIT_NAME, IDS_TOOLS_REGEDIT_DESCR, IDS_TOOLS_REGEDIT_CMD,IDS_TOOLS_REGEDIT_PARAM); + AddItem(IDS_TOOLS_SYSDM_NAME, IDS_TOOLS_SYSDM_DESCR, IDS_TOOLS_SYSDM_CMD, IDS_TOOLS_SYSDM_PARAM); + AddItem(IDS_TOOLS_INFO_NAME, IDS_TOOLS_INFO_DESCR, IDS_TOOLS_INFO_CMD, IDS_TOOLS_INFO_PARAM); +} + +INT_PTR CALLBACK +ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + LV_COLUMN column; + TCHAR szTemp[256]; + TCHAR szTemp2[256]; + LPNMITEMACTIVATE lpnmitem; + LPNMHDR nmh; + DWORD dwStyle; + + switch (message) { + case WM_INITDIALOG: + + hToolsListCtrl = GetDlgItem(hDlg, IDC_TOOLS_LIST); + hToolsDialog = hDlg; + + dwStyle = (DWORD) SendMessage(hToolsListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + dwStyle = dwStyle | LVS_EX_FULLROWSELECT; + SendMessage(hToolsListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); + + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + + // Initialize the application page's controls + column.mask = LVCF_TEXT | LVCF_WIDTH; + + LoadString(hInst, IDS_TOOLS_COLUMN_NAME, szTemp, 256); + column.pszText = szTemp; + column.cx = 150; + ListView_InsertColumn(hToolsListCtrl, 0, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_TOOLS_COLUMN_DESCR, szTemp, 256); + column.pszText = szTemp; + column.cx = 500; + ListView_InsertColumn(hToolsListCtrl, 1, &column); + + FillListView(); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_BTN_RUN: + if (ListView_GetSelectionMark(hToolsListCtrl) != -1) { + LoadString(hInst, ListItems_Cmds[ListView_GetSelectionMark(hToolsListCtrl)], szTemp, 256); + LoadString(hInst, ListItems_Params[ListView_GetSelectionMark(hToolsListCtrl)], szTemp2, 256); + ShellExecute(0, _T("open"), szTemp, szTemp2, _T(""), SW_NORMAL); + } + } + break; + + case WM_NOTIFY: + nmh = (LPNMHDR) lParam; + if (nmh->hwndFrom == hToolsListCtrl) + { + switch (nmh->code) + { + case NM_CLICK: + lpnmitem = (LPNMITEMACTIVATE) lParam; + if (lpnmitem->iItem > -1) { + LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp, 256); + LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256); + _tcscat(szTemp, _T(" ")); + _tcscat(szTemp, szTemp2); + SendDlgItemMessage(hToolsDialog, IDC_TOOLS_CMDLINE, WM_SETTEXT, 0, (LPARAM) szTemp); + } + break; + case NM_DBLCLK: + lpnmitem = (LPNMITEMACTIVATE) lParam; + if (lpnmitem->iItem > -1) { + LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp, 256); + LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256); + ShellExecute(0, _T("open"), szTemp, szTemp2, _T(""), SW_NORMAL); + } + break; + } + } + break; + } + + return 0; +} + diff --git a/reactos/base/applications/msconfig/toolspage.h b/reactos/base/applications/msconfig/toolspage.h new file mode 100644 index 00000000000..daa938fec80 --- /dev/null +++ b/reactos/base/applications/msconfig/toolspage.h @@ -0,0 +1,5 @@ +extern HWND hToolsPage; +extern HWND hToolsListCtrl; + +INT_PTR CALLBACK ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + diff --git a/reactos/base/applications/sc/control.c b/reactos/base/applications/sc/control.c new file mode 100644 index 00000000000..2fac5fe6198 --- /dev/null +++ b/reactos/base/applications/sc/control.c @@ -0,0 +1,61 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS SC utility + * FILE: subsys/system/sc/control.c + * PURPOSE: control ReactOS services + * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com) + * REVISIONS: + * Ged Murphy 20/10/05 Created + * + */ + +#include "sc.h" + +/* + * handles the following commands: + * control, continue, interrogate, pause, stop + */ + +BOOL Control(DWORD Control, LPCTSTR ServiceName, LPCTSTR *Args) +{ + SC_HANDLE hSc; + SERVICE_STATUS Status; + +#ifdef SCDBG + /* testing */ + _tprintf(_T("service to control - %s\n\n"), ServiceName); + _tprintf(_T("command - %lu\n\n"), Control); + _tprintf(_T("Arguments :\n")); + while (*Args) + { + printf("%s\n", *Args); + Args++; + } +#endif /* SCDBG */ + + hSc = OpenService(hSCManager, ServiceName, + SERVICE_INTERROGATE | SERVICE_PAUSE_CONTINUE | + SERVICE_STOP | SERVICE_USER_DEFINED_CONTROL | + SERVICE_QUERY_STATUS); + + if (hSc == NULL) + { + _tprintf(_T("openService failed\n")); + ReportLastError(); + return FALSE; + } + + if (! ControlService(hSc, Control, &Status)) + { + _tprintf(_T("[SC] controlService FAILED %lu:\n\n"), GetLastError()); + ReportLastError(); + return FALSE; + } + + CloseServiceHandle(hSc); + + /* print the status information */ + + return TRUE; + +} diff --git a/reactos/base/applications/sc/create.c b/reactos/base/applications/sc/create.c new file mode 100644 index 00000000000..89e1ea5a2e8 --- /dev/null +++ b/reactos/base/applications/sc/create.c @@ -0,0 +1,58 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS SC utility + * FILE: subsys/system/sc/create.c + * PURPOSE: control ReactOS services + * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com) + * REVISIONS: + * Ged Murphy 20/10/05 Created + * + */ + +#include "sc.h" + +BOOL Create(LPCTSTR ServiceName, LPCTSTR *ServiceArgs) +{ + SC_HANDLE hSc; + LPCTSTR BinaryPathName = *++ServiceArgs; +// LPCTSTR *Options = ++ServiceArgs; + + if ((! ServiceName) || (! BinaryPathName)) + return CreateUsage(); + +#ifdef SCDBG + /* testing */ + printf("service to create - %s\n", ServiceName); + printf("Binary path - %s\n", BinaryPathName); + printf("Arguments :\n"); + while (*Options) + { + printf("%s\n", *Options); + Options++; + } +#endif + hSc = CreateService(hSCManager, + ServiceName, + ServiceName, + SERVICE_ALL_ACCESS, + SERVICE_WIN32_OWN_PROCESS, + SERVICE_DEMAND_START, + SERVICE_ERROR_NORMAL, + BinaryPathName, + NULL, + NULL, + NULL, + NULL, + NULL); + + if (hSc == NULL) + { + _tprintf(_T("CreateService failed\n")); + ReportLastError(); + return FALSE; + } + + _tprintf(_T("[SC] CreateService SUCCESS\n")); + CloseServiceHandle(hSc); + return TRUE; +} diff --git a/reactos/base/applications/sc/delete.c b/reactos/base/applications/sc/delete.c new file mode 100644 index 00000000000..2873108ee3e --- /dev/null +++ b/reactos/base/applications/sc/delete.c @@ -0,0 +1,42 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS SC utility + * FILE: subsys/system/sc/delete.c + * PURPOSE: control ReactOS services + * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com) + * REVISIONS: + * Ged Murphy 20/10/05 Created + * + */ + +#include "sc.h" + +BOOL Delete(LPCTSTR ServiceName) +{ + SC_HANDLE hSc; + +#ifdef SCDBG + /* testing */ + printf("service to delete - %s\n\n", ServiceName); +#endif + + hSc = OpenService(hSCManager, ServiceName, DELETE); + + if (hSc == NULL) + { + _tprintf(_T("openService failed\n")); + ReportLastError(); + return FALSE; + } + + if (! DeleteService(hSc)) + { + _tprintf(_T("DeleteService failed\n")); + ReportLastError(); + return FALSE; + } + + _tprintf(_T("[SC] DeleteService SUCCESS\n")); + CloseServiceHandle(hSc); + return TRUE; +} diff --git a/reactos/base/applications/sc/query.c b/reactos/base/applications/sc/query.c new file mode 100644 index 00000000000..c9515844690 --- /dev/null +++ b/reactos/base/applications/sc/query.c @@ -0,0 +1,327 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS SC utility + * FILE: subsys/system/sc/query.c + * PURPOSE: control ReactOS services + * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com) + * REVISIONS: + * Ged Murphy 20/10/05 Created + * + */ +/* + * TODO: + * Allow calling of 2 options e.g.: + * type= driver state= inactive + */ + +#include "sc.h" + +/* local function decs */ +VOID PrintService(BOOL bExtended); +BOOL EnumServices(DWORD ServiceType, DWORD ServiceState); +BOOL QueryService(LPCTSTR ServiceName, BOOL bExtended); + +/* global variables */ +static ENUM_SERVICE_STATUS_PROCESS *pServiceStatus = NULL; +DWORD NumServices = 0; + + +BOOL +Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended) +{ + if (! ServiceName) /* display all running services and drivers */ + { + /* get default values */ + EnumServices(SERVICE_WIN32, SERVICE_ACTIVE); + + /* print default values */ + PrintService(bExtended); + } + else if (_tcsicmp(ServiceName, _T("type=")) == 0) + { + LPCTSTR Type = *ServiceArgs; + + if (_tcsicmp(Type, _T("driver")) == 0) + EnumServices(SERVICE_DRIVER, SERVICE_ACTIVE); + else if (_tcsicmp(Type, _T("service")) == 0) + EnumServices(SERVICE_WIN32, SERVICE_ACTIVE); + else if (_tcsicmp(Type, _T("all")) == 0) + EnumServices(SERVICE_DRIVER|SERVICE_WIN32, SERVICE_ACTIVE); + else + { + _tprintf(_T("\nERROR following \"type=\"!\n")); + _tprintf(_T("Must be \"driver\" or \"service\" or \"all\"\n")); + } + + PrintService(bExtended); + } + else if(_tcsicmp(ServiceName, _T("state=")) == 0) + { + LPCTSTR State = *ServiceArgs; + + if (_tcsicmp(State, _T("inactive")) == 0) + EnumServices(SERVICE_WIN32, SERVICE_INACTIVE); + else if (_tcsicmp(State, _T("all")) == 0) + EnumServices(SERVICE_WIN32, SERVICE_STATE_ALL); + else + { + _tprintf(_T("\nERROR following \"state=\"!\n")); + _tprintf(_T("Must be \"active\" or \"inactive\" or \"all\"\n")); + } + + PrintService(bExtended); + } +/* + else if(_tcsicmp(ServiceName, _T("bufsize="))) + + else if(_tcsicmp(ServiceName, _T("ri="))) + + else if(_tcsicmp(ServiceName, _T("group="))) +*/ + else /* print only the service requested */ + { + QueryService(ServiceName, bExtended); + } + + return TRUE; +} + + +BOOL +QueryService(LPCTSTR ServiceName, BOOL bExtended) +{ + SERVICE_STATUS_PROCESS *pServiceInfo = NULL; + SC_HANDLE hSc; + DWORD BufSiz = 0; + DWORD BytesNeeded = 0; + DWORD Ret; + + hSc = OpenService(hSCManager, ServiceName, SERVICE_QUERY_STATUS); + + if (hSc == NULL) + { + _tprintf(_T("QueryService: openService failed\n")); + ReportLastError(); + return FALSE; + } + + Ret = QueryServiceStatusEx(hSc, + SC_STATUS_PROCESS_INFO, + NULL, + BufSiz, + &BytesNeeded); + + if ((Ret != 0) || (GetLastError() != ERROR_INSUFFICIENT_BUFFER)) + { + _tprintf(_T("QueryService: First call to QueryServiceStatusEx failed : ")); + ReportLastError(); + return FALSE; + } + else /* Call function again if required size was returned */ + { + /* reserve memory for service info array */ + pServiceInfo = (SERVICE_STATUS_PROCESS *) + HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceInfo == NULL) + { + _tprintf(_T("QueryService: Failed to allocate memory : ")); + ReportLastError(); + return FALSE; + } + + /* fill array with service info */ + if (! QueryServiceStatusEx(hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)pServiceInfo, + BytesNeeded, + &BytesNeeded)) + { + _tprintf(_T("QueryService: Second call to QueryServiceStatusEx failed : ")); + ReportLastError(); + HeapFree(GetProcessHeap(), 0, pServiceInfo); + return FALSE; + } + } + + + _tprintf(_T("SERVICE_NAME: %s\n"), ServiceName); + + _tprintf(_T("\tTYPE : %x "), + (unsigned int)pServiceInfo->dwServiceType); + switch (pServiceInfo->dwServiceType) + { + case 1 : _tprintf(_T("KERNEL_DRIVER\n")); break; + case 2 : _tprintf(_T("FILE_SYSTEM_DRIVER\n")); break; + case 16 : _tprintf(_T("WIN32_OWN_PROCESS\n")); break; + case 32 : _tprintf(_T("WIN32_SHARE_PROCESS\n")); break; + default : _tprintf(_T("\n")); break; + } + + _tprintf(_T("\tSTATE : %x "), + (unsigned int)pServiceInfo->dwCurrentState); + + switch (pServiceInfo->dwCurrentState) + { + case 1 : _tprintf(_T("STOPPED\n")); break; + case 2 : _tprintf(_T("START_PENDING\n")); break; + case 3 : _tprintf(_T("STOP_PENDING\n")); break; + case 4 : _tprintf(_T("RUNNING\n")); break; + case 5 : _tprintf(_T("CONTINUE_PENDING\n")); break; + case 6 : _tprintf(_T("PAUSE_PENDING\n")); break; + case 7 : _tprintf(_T("PAUSED\n")); break; + default : _tprintf(_T("\n")); break; + } + +// _tprintf(_T("\n\taccepted : 0x%x\n\n"), +// pServiceStatus[i].ServiceStatusProcess.dwControlsAccepted); +// (STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDOWN) + + _tprintf(_T("\tWIN32_EXIT_CODE : %d (0x%x)\n"), + (unsigned int)pServiceInfo->dwWin32ExitCode, + (unsigned int)pServiceInfo->dwWin32ExitCode); + _tprintf(_T("\tSERVICE_EXIT_CODE : %d (0x%x)\n"), + (unsigned int)pServiceInfo->dwServiceSpecificExitCode, + (unsigned int)pServiceInfo->dwServiceSpecificExitCode); + _tprintf(_T("\tCHECKPOINT : 0x%x\n"), + (unsigned int)pServiceInfo->dwCheckPoint); + _tprintf(_T("\tWAIT_HINT : 0x%x\n"), + (unsigned int)pServiceInfo->dwWaitHint); + if (bExtended) + { + _tprintf(_T("\tPID : %lu\n"), + pServiceInfo->dwProcessId); + _tprintf(_T("\tFLAGS : %lu\n"), + pServiceInfo->dwServiceFlags); + } + + HeapFree(GetProcessHeap(), 0, pServiceInfo); + + return TRUE; +} + + +BOOL +EnumServices(DWORD ServiceType, DWORD ServiceState) +{ + DWORD BufSize = 0; + DWORD BytesNeeded = 0; + DWORD ResumeHandle = 0; + DWORD Ret; + + /* determine required buffer size */ + Ret = EnumServicesStatusEx(hSCManager, + SC_ENUM_PROCESS_INFO, + ServiceType, + ServiceState, + (LPBYTE)pServiceStatus, + BufSize, + &BytesNeeded, + &NumServices, + &ResumeHandle, + 0); + + if ((Ret != 0) && (GetLastError() != ERROR_MORE_DATA)) + { + _tprintf(_T("EnumServices: First call to EnumServicesStatusEx failed : ")); + ReportLastError(); + return FALSE; + } + else /* Call function again if required size was returned */ + { + /* reserve memory for service info array */ + pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) + HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceStatus == NULL) + { + _tprintf(_T("EnumServices: Failed to allocate memory : ")); + ReportLastError(); + return FALSE; + } + + /* fill array with service info */ + if (! EnumServicesStatusEx(hSCManager, + SC_ENUM_PROCESS_INFO, + ServiceType, + ServiceState, + (LPBYTE)pServiceStatus, + BytesNeeded, + &BytesNeeded, + &NumServices, + &ResumeHandle, + 0)) + { + _tprintf(_T("EnumServices: Second call to EnumServicesStatusEx failed : ")); + ReportLastError(); + HeapFree(GetProcessHeap(), 0, pServiceStatus); + return FALSE; + } + } + + return TRUE; +} + + +VOID +PrintService(BOOL bExtended) +{ + DWORD i; + + for (i=0; i < NumServices; i++) + { + + _tprintf(_T("SERVICE_NAME: %s\n"), pServiceStatus[i].lpServiceName); + _tprintf(_T("DISPLAY_NAME: %s\n"), pServiceStatus[i].lpDisplayName); + + _tprintf(_T("\tTYPE : %x "), + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwServiceType); + switch (pServiceStatus[i].ServiceStatusProcess.dwServiceType) + { + case 1 : _tprintf(_T("KERNEL_DRIVER\n")); break; + case 2 : _tprintf(_T("FILE_SYSTEM_DRIVER\n")); break; + case 16 : _tprintf(_T("WIN32_OWN_PROCESS\n")); break; + case 32 : _tprintf(_T("WIN32_SHARE_PROCESS\n")); break; + default : _tprintf(_T("\n")); break; + } + + _tprintf(_T("\tSTATE : %x "), + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwCurrentState); + + switch (pServiceStatus[i].ServiceStatusProcess.dwCurrentState) + { + case 1 : _tprintf(_T("STOPPED\n")); break; + case 2 : _tprintf(_T("START_PENDING\n")); break; + case 3 : _tprintf(_T("STOP_PENDING\n")); break; + case 4 : _tprintf(_T("RUNNING\n")); break; + case 5 : _tprintf(_T("CONTINUE_PENDING\n")); break; + case 6 : _tprintf(_T("PAUSE_PENDING\n")); break; + case 7 : _tprintf(_T("PAUSED\n")); break; + default : _tprintf(_T("\n")); break; + } + + // _tprintf(_T("\n\taccepted : 0x%x\n\n"), + // pServiceStatus[i].ServiceStatusProcess.dwControlsAccepted); + // (STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDOWN) + + _tprintf(_T("\tWIN32_EXIT_CODE : %d (0x%x)\n"), + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwWin32ExitCode, + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwWin32ExitCode); + _tprintf(_T("\tSERVICE_EXIT_CODE : %d (0x%x)\n"), + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwServiceSpecificExitCode, + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwServiceSpecificExitCode); + _tprintf(_T("\tCHECKPOINT : 0x%x\n"), + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwCheckPoint); + _tprintf(_T("\tWAIT_HINT : 0x%x\n"), + (unsigned int)pServiceStatus[i].ServiceStatusProcess.dwWaitHint); + if (bExtended) + { + _tprintf(_T("\tPID : %lu\n"), + pServiceStatus[i].ServiceStatusProcess.dwProcessId); + _tprintf(_T("\tFLAGS : %lu\n"), + pServiceStatus[i].ServiceStatusProcess.dwServiceFlags); + } + + _tprintf(_T("\n")); + } + + _tprintf(_T("number : %lu\n"), NumServices); +} diff --git a/reactos/base/applications/sc/sc.c b/reactos/base/applications/sc/sc.c new file mode 100644 index 00000000000..de8333d5306 --- /dev/null +++ b/reactos/base/applications/sc/sc.c @@ -0,0 +1,212 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS SC utility + * FILE: subsys/system/sc/sc.c + * PURPOSE: control ReactOS services + * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com) + * REVISIONS: + * Ged Murphy 20/10/05 Created + * + */ + +#include "sc.h" + +SC_HANDLE hSCManager; + +DWORD ReportLastError(VOID) +{ + LPVOID lpMsgBuf; + DWORD RetVal; + + DWORD ErrorCode = GetLastError(); + if (ErrorCode != ERROR_SUCCESS) + { + RetVal = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + ErrorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ + (LPTSTR) &lpMsgBuf, + 0, + NULL ); + + if (RetVal != 0) + { + _tprintf(_T("%s"), (LPTSTR)lpMsgBuf); + + LocalFree(lpMsgBuf); + /* return number of TCHAR's stored in output buffer + * excluding '\0' - as FormatMessage does*/ + return RetVal; + } + } + return 0; +} + + +INT ScControl(LPTSTR MachineName, // remote machine name + LPCTSTR Command, // sc command + LPCTSTR ServiceName, // name of service + LPCTSTR *ServiceArgs, // any options + DWORD ArgCount) // argument counter +{ + /* count trailing arguments */ + ArgCount -= 3; + + if (MachineName) + { + _tprintf(_T("Remote service control is not yet implemented\n")); + return 2; + } + + /* if we are emurating the services, we don't need administrator access */ + if ( (_tcsicmp(Command, _T("query")) == 0) || (_tcsicmp(Command, _T("queryex")) == 0) ) + hSCManager = OpenSCManager(MachineName, NULL, SC_MANAGER_ENUMERATE_SERVICE); + else + hSCManager = OpenSCManager(MachineName, NULL, SC_MANAGER_ALL_ACCESS); + if (hSCManager == NULL) + { + _tprintf(_T("[SC] OpenSCManager FAILED %lu:\n\n"), GetLastError()); + ReportLastError(); + return -1; + } + + /* emurate command */ + if (_tcsicmp(Command, _T("query")) == 0) + Query(ServiceName, ServiceArgs, FALSE); + + else if (_tcsicmp(Command, _T("queryex")) == 0) + Query(ServiceName, ServiceArgs, TRUE); + + else if (_tcsicmp(Command, _T("start")) == 0) + { + if (ServiceName) + Start(ServiceName, ServiceArgs, ArgCount); + else + StartUsage(); + } + else if (_tcsicmp(Command, _T("pause")) == 0) + { + if (ServiceName) + Control(SERVICE_CONTROL_PAUSE, ServiceName, ServiceArgs); + else + PauseUsage(); + } + else if (_tcsicmp(Command, _T("interrogate")) == 0) + { + if (ServiceName) + Control(SERVICE_CONTROL_INTERROGATE, ServiceName, ServiceArgs); + else + InterrogateUsage(); + } + else if (_tcsicmp(Command, _T("stop")) == 0) + { + if (ServiceName) + Control(SERVICE_CONTROL_STOP, ServiceName, ServiceArgs); + else + StopUsage(); + } + else if (_tcsicmp(Command, _T("continue")) == 0) + { + if (ServiceName) + Control(SERVICE_CONTROL_CONTINUE, ServiceName, ServiceArgs); + else + ContinueUsage(); + } + else if (_tcsicmp(Command, _T("delete")) == 0) + { + if (ServiceName) + Delete(ServiceName); + else + DeleteUsage(); + } + else if (_tcsicmp(Command, _T("create")) == 0) + { + if (*ServiceArgs) + Create(ServiceName, ServiceArgs); + else + CreateUsage(); + } + else if (_tcsicmp(Command, _T("control")) == 0) + { + if (ServiceName) + Control(0, ServiceName, ServiceArgs); + else + ContinueUsage(); + } + return 0; +} + +#if defined(_UNICODE) && defined(__GNUC__) +static +#endif + +int _tmain(int argc, LPCTSTR argv[]) +{ + LPTSTR MachineName = NULL; // remote machine + LPCTSTR Command = NULL; // sc command + LPCTSTR ServiceName = NULL; // Name of service + + if (argc < 2) + return MainUsage(); + + /* get server name */ + if ((argv[1][0] == '\\') && (argv[1][1] == '\\')) + { + if (argc < 3) + return MainUsage(); + + _tcscpy(MachineName, argv[1]); + Command = argv[2]; + if (argc > 3) + ServiceName = argv[3]; + return ScControl(MachineName, Command, ServiceName, &argv[4], argc); + } + else + { + Command = argv[1]; + if (argc > 2) + ServiceName = argv[2]; + return ScControl(MachineName, Command, ServiceName, &argv[3], argc); + } +} + + +#if defined(_UNICODE) && defined(__GNUC__) +/* HACK - MINGW HAS NO OFFICIAL SUPPORT FOR wmain()!!! */ +int main( int argc, char **argv ) +{ + WCHAR **argvW; + int i, j, Ret = 1; + + if ((argvW = malloc(argc * sizeof(WCHAR*)))) + { + /* convert the arguments */ + for (i = 0, j = 0; i < argc; i++) + { + if (!(argvW[i] = malloc((strlen(argv[i]) + 1) * sizeof(WCHAR)))) + { + j++; + } + swprintf(argvW[i], L"%hs", argv[i]); + } + + if (j == 0) + { + /* no error converting the parameters, call wmain() */ + Ret = wmain(argc, (LPCTSTR *)argvW); + } + + /* free the arguments */ + for (i = 0; i < argc; i++) + { + if (argvW[i]) + free(argvW[i]); + } + free(argvW); + } + + return Ret; +} +#endif diff --git a/reactos/base/applications/sc/sc.h b/reactos/base/applications/sc/sc.h new file mode 100644 index 00000000000..f6c977c1b26 --- /dev/null +++ b/reactos/base/applications/sc/sc.h @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +extern SC_HANDLE hSCManager; // declared in sc.c + +//#define SCDBG + +/* control functions */ +BOOL Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended); +BOOL Start(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, INT ArgCount); +BOOL Create(LPCTSTR ServiceName, LPCTSTR *ServiceArgs); +BOOL Delete(LPCTSTR ServiceName); +BOOL Control(DWORD Control, LPCTSTR ServiceName, LPCTSTR *Args); + +/* print and error functions */ +DWORD ReportLastError(VOID); + +/* usage functions */ +INT MainUsage(VOID); +INT StartUsage(VOID); +INT PauseUsage(VOID); +INT InterrogateUsage(VOID); +INT ContinueUsage(VOID); +INT StopUsage(VOID); +INT ConfigUsage(VOID); +INT DescriptionUsage(VOID); +INT DeleteUsage(VOID); +INT CreateUsage(VOID); diff --git a/reactos/base/applications/sc/sc.rc b/reactos/base/applications/sc/sc.rc new file mode 100644 index 00000000000..86777430848 --- /dev/null +++ b/reactos/base/applications/sc/sc.rc @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Services control application\0" +#define REACTOS_STR_INTERNAL_NAME "sc\0" +#define REACTOS_STR_ORIGINAL_FILENAME "sc.exe\0" +#include diff --git a/reactos/base/applications/sc/sc.xml b/reactos/base/applications/sc/sc.xml new file mode 100644 index 00000000000..076fb90fc96 --- /dev/null +++ b/reactos/base/applications/sc/sc.xml @@ -0,0 +1,17 @@ + + + + + + kernel32 + advapi32 + sc.c + start.c + query.c + control.c + create.c + delete.c + usage.c + sc.rc + sc.h + diff --git a/reactos/base/applications/sc/start.c b/reactos/base/applications/sc/start.c new file mode 100644 index 00000000000..bb4277d74ae --- /dev/null +++ b/reactos/base/applications/sc/start.c @@ -0,0 +1,111 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS SC utility + * FILE: subsys/system/sc/start.c + * PURPOSE: control ReactOS services + * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com) + * REVISIONS: + * Ged Murphy 20/10/05 Created + * + */ + +#include "sc.h" + +BOOL Start(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, INT ArgCount) +{ + SC_HANDLE hSc; + SERVICE_STATUS_PROCESS ServiceStatus, ServiceStatus2; + DWORD BytesNeeded; + +#ifdef SCDBG + /* testing */ + _tprintf(_T("service to start - %s\n\n"), ServiceName); + _tprintf(_T("Arguments :\n")); + while (*ServiceArgs) + { + printf("%s\n", *ServiceArgs); + ServiceArgs++; + } +#endif + + /* get a handle to the service requested for starting */ + hSc = OpenService(hSCManager, ServiceName, SERVICE_ALL_ACCESS); + + if (hSc == NULL) + { + _tprintf(_T("openService failed\n")); + ReportLastError(); + return FALSE; + } + + /* start the service opened */ + if (! StartService(hSc, ArgCount, ServiceArgs)) + { + _tprintf(_T("[SC] StartService FAILED %lu:\n\n"), GetLastError()); + ReportLastError(); + return FALSE; + } + + if (! QueryServiceStatusEx( + hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)&ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS), + &BytesNeeded)) + { + _tprintf(_T("QueryServiceStatusEx 1 failed\n")); + ReportLastError(); + return FALSE; + } + + + while (ServiceStatus.dwCurrentState == SERVICE_START_PENDING) + { + /* wait before checking status */ + Sleep(ServiceStatus.dwWaitHint); + + /* check status again */ + if (! QueryServiceStatusEx( + hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)&ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS), + &BytesNeeded)) + { + _tprintf(_T("QueryServiceStatusEx 2 failed\n")); + ReportLastError(); + return FALSE; + } + } + + QueryServiceStatusEx(hSc, SC_STATUS_PROCESS_INFO, (LPBYTE)&ServiceStatus2, + sizeof(SERVICE_STATUS_PROCESS), &BytesNeeded); + + CloseServiceHandle(hSc); + + if (ServiceStatus.dwCurrentState == SERVICE_RUNNING) + { + _tprintf(_T("\nSERVICE_NAME: %s\n"), ServiceName); + _tprintf(_T("\tTYPE : %lu\n"), ServiceStatus2.dwServiceType); + _tprintf(_T("\tSTATE : %lu\n"), ServiceStatus2.dwCurrentState); + _tprintf(_T("\tWIN32_EXIT_CODE : %lu\n"), ServiceStatus2.dwWin32ExitCode); + _tprintf(_T("\tCHECKPOINT : %lu\n"), ServiceStatus2.dwCheckPoint); + _tprintf(_T("\tWAIT_HINT : %lu\n"), ServiceStatus2.dwWaitHint); + _tprintf(_T("\tPID : %lu\n"), ServiceStatus2.dwProcessId); + _tprintf(_T("\tFLAGS : %lu\n"), ServiceStatus2.dwServiceFlags); + + return TRUE; + } + else + { + _tprintf(_T("Failed to start %s\n"), ServiceName); + _tprintf(_T("Curent state: %lu\n"), ServiceStatus.dwCurrentState); + _tprintf(_T("Exit code: %lu\n"), ServiceStatus.dwWin32ExitCode); + _tprintf(_T("Service Specific exit code: %lu\n"), + ServiceStatus.dwServiceSpecificExitCode); + _tprintf(_T("Check point: %lu\n"), ServiceStatus.dwCheckPoint); + _tprintf(_T("Wait hint: %lu\n"), ServiceStatus.dwWaitHint); + + return FALSE; + } +} diff --git a/reactos/base/applications/sc/usage.c b/reactos/base/applications/sc/usage.c new file mode 100644 index 00000000000..eb0254229a8 --- /dev/null +++ b/reactos/base/applications/sc/usage.c @@ -0,0 +1,204 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS SC utility + * FILE: subsys/system/sc/usage.c + * PURPOSE: control ReactOS services + * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com) + * REVISIONS: + * Ged Murphy 20/10/05 Created + * + */ +#include "sc.h" + +INT MainUsage(VOID) +{ + INT c; + + _tprintf(_T("DESCRIPTION:\n") + _T("\tSC is a command line program used for communicating with\n") + _T("\tthe Service Control Manager and its services.\n") + _T("USAGE:\n") + _T("\tsc [command] [service name] ...\n") + + _T("\tThe optional parameter has the form \"\\ServerName\"\n") + _T("\tFurther help on commands can be obtained by typing: \"sc [command]\"\n") + _T("\tService Commands:\n") + _T("\t query : Queries the status for a service, or\n") + _T("\t enumerates the status for types of services.\n") + _T("\t queryex : Queries the extended status for a service, or\n") +// _T("\t enumerates the status for types of services.\n" + _T("\t start : Starts a service.\n") + _T("\t pause : Sends a PAUSE control request to a service.\n") + _T("\t interrogate : Sends a INTERROGATE control request to a service.\n") + _T("\t continue : Sends a CONTINUE control request to a service.\n") + _T("\t stop : Sends a STOP request to a service.\n") +// "\t config : Changes the configuration of a service (persistant).\n" +// "\t description : Changes the description of a service.\n" +// "\t failure : Changes the actions taken by a service upon failure.\n" +// "\t qc : Queries the configuration information for a service.\n" +// "\t qdescription : Queries the description for a service.\n" +// "\t qfailure : Queries the actions taken by a service upon failure.\n" + _T("\t delete : Deletes a service (from the registry).\n") + _T("\t create : Creates a service. (adds it to the registry).\n") + _T("\t control : Sends a control to a service.\n")); +// "\t sdshow : Displays a service's security descriptor.\n") +// "\t sdset : Sets a service's security descriptor.\n") +// "\t GetDisplayName : Gets the DisplayName for a service.\n") +// "\t GetKeyName : Gets the ServiceKeyName for a service.\n") +// "\t EnumDepend : Enumerates Service Dependencies.\n") +// "\n") +// "\tService Name Independant Commands:\n") +// "\t boot : (ok | bad) Indicates whether the last boot should\n") +// "\t be saved as the last-known-good boot configuration\n") +// "\t Lock : Locks the SCM Database\n") +// "\t QueryLock : Queries the LockStatus for the SCM Database\n") + + _tprintf(_T("\nWould you like to see help for the QUERY and QUERYEX commands? [ y | n ]: ")); + c = _getch(); // _gettch isn't defined in our tchar.h + _tprintf(_T("%c\n"), c); + if (tolower(c) == 'y') + { + _tprintf(_T("QUERY and QUERYEX OPTIONS :\n") + _T(" If the query command is followed by a service name, the status\n") + _T(" for that service is returned. Further options do not apply in\n") + _T(" this case. If the query command is followed by nothing or one of\n") + _T(" the options listed below, the services are enumerated.\n") + _T(" type= Type of services to enumerate (driver, service, all)\n") + _T(" (default = service)\n") + _T(" state= State of services to enumerate (inactive, all)\n") + _T(" (default = active)\n") +/* + _T(" bufsize= The size (in bytes) of the enumeration buffer\n") + _T(" (default = 4096)\n") + _T(" ri= The resume index number at which to begin the enumeration\n") + _T(" (default = 0)\n") + _T(" group= Service group to enumerate\n") + _T(" (default = all groups)\n") +*/ + _T("SYNTAX EXAMPLES\n") + _T("sc query - Enumerates status for active services & drivers\n") + _T("sc query messenger - Displays status for the messenger service\n") + _T("sc queryex messenger - Displays extended status for the messenger service\n") + _T("sc query type= driver - Enumerates only active drivers\n") + _T("sc query type= service - Enumerates only Win32 services\n") + _T("sc query state= all - Enumerates all services & drivers\n") +// _T("sc query bufsize= 50 - Enumerates with a 50 byte buffer.\n") +// _T("sc query ri= 14 - Enumerates with resume index = 14\n") +// _T("sc queryex group= "" - Enumerates active services not in a group\n") + _T("sc query type= service type= interact - Enumerates all interactive services\n")); +// _T("sc query type= driver group= NDIS - Enumerates all NDIS drivers\n")); + } + + + return 0; +} + + +INT StartUsage(VOID) +{ + _tprintf(_T("DESCRIPTION:\n") + _T(" Starts a service running.\n") + _T("USAGE:\n") + _T(" sc start [service name] ...\n")); + + return 0; +} + + +INT PauseUsage(VOID) +{ + _tprintf(_T("DESCRIPTION:\n") + _T(" Sends a PAUSE control request to a service.\n") + _T("USAGE:\n") + _T(" sc pause [service name]\n")); + + return 0; +} + +INT InterrogateUsage(VOID) +{ + _tprintf(_T("DESCRIPTION:\n") + _T(" Sends an INTERROGATE control request to a service.\n") + _T("USAGE:\n") + _T(" sc interrogate [service name]\n")); + + return 0; +} + + +INT StopUsage(VOID) +{ + _tprintf(_T("DESCRIPTION:\n") + _T(" Sends an STOP control request to a service.\n") + _T("USAGE:\n") + _T(" sc stop [service name]\n")); + + return 0; +} + +INT ContinueUsage(VOID) +{ + _tprintf(_T("DESCRIPTION:\n") + _T(" Sends an CONTINUE control request to a service.\n") + _T("USAGE:\n") + _T(" sc continue [service name]\n")); + + return 0; +} + + +INT ConfigUsage(VOID) +{ + _tprintf(_T("not yet implemented\n")); + + return 0; +} + + +INT DescriptionUsage(VOID) +{ + _tprintf(_T("DESCRIPTION:\n") + _T(" Sets the description string for a service.\n") + _T("USAGE:\n") + _T(" sc description [service name]\n")); + + return 0; +} + +INT DeleteUsage(VOID) +{ + _tprintf(_T("DESCRIPTION:\n") + _T(" Deletes a service entry from the registry.\n") + _T(" If the service is running, or another process has an\n") + _T(" open handle to the service, the service is simply marked\n") + _T(" for deletion.\n") + _T("USAGE:\n") + _T(" sc delete [service name]\n")); + + return 0; +} + +INT CreateUsage(VOID) +{ + _tprintf(_T("Creates a service entry in the registry and Service Database.\n") + _T("SYNTAX:\n") + _T("sc create [service name] [binPath= ] ...\n") + _T("CREATE OPTIONS:\n") + _T("NOTE: The option name includes the equal sign.\n") + _T(" type= \n") + _T(" (default = own)\n") + _T(" start= \n") + _T(" (default = demand)\n") + _T(" error= \n") + _T(" (default = normal)\n") + _T(" binPath= \n") + _T(" group= \n") + _T(" tag= \n") + _T(" depend= \n") + _T(" obj= \n") + _T(" (default = LocalSystem)\n") + _T(" DisplayName= \n") + _T(" password= \n")); + + return 0; +} diff --git a/reactos/base/applications/servman/De.rc b/reactos/base/applications/servman/De.rc new file mode 100644 index 00000000000..a19ef86fb2d --- /dev/null +++ b/reactos/base/applications/servman/De.rc @@ -0,0 +1,121 @@ +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +IDR_MAINMENU MENU +BEGIN + POPUP "&Datei" + BEGIN + MENUITEM "B&eenden",ID_FILE_EXIT + END + POPUP "Action" + BEGIN + MENUITEM "Start",ID_START + MENUITEM "Stopp",ID_STOP + MENUITEM "Pause",ID_PAUSE + MENUITEM "Fortsetzen",ID_RESUME + MENUITEM "Neustart",ID_RESTART + MENUITEM SEPARATOR + MENUITEM "Aktualisieren",ID_REFRESH + MENUITEM SEPARATOR + MENUITEM "Eigenschaften",ID_PROP + END + POPUP "Ansicht" + BEGIN + MENUITEM "Anpassen",ID_VIEW_CUSTOMIZE + END + POPUP "Hilfe" + BEGIN + MENUITEM "Info",ID_HELP_ABOUT + END +END + +IDD_ABOUTBOX DIALOG DISCARDABLE 22,16,190,182 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "Über den Service Manager" +FONT 8, "Tahoma" +BEGIN + CONTROL "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy@gmail.com)", + IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,48,7,130,26 + DEFPUSHBUTTON "Schließen",IDOK,140,162,44,15,WS_GROUP + ICON IDI_SM_ICON,IDC_STATIC,12,7,30,20 + EDITTEXT IDC_LICENSE_EDIT,8,44,174,107,ES_MULTILINE | + ES_READONLY | WS_VSCROLL +END + + +IDD_DLG_GENERAL DIALOGEX 6,6,253,225 +CAPTION "Allgemein" +FONT 8,"MS Sans Serif",0,0 +STYLE 0x10CF0000 +BEGIN + CONTROL "Dienstname:",IDC_STATIC,"Static",0x50000000,4,11,53,11 + CONTROL "Anzeigename:",IDC_STATIC,"Static",0x50000000,4,29,53,11 + CONTROL "Beschreibung",IDC_STATIC,"Static",0x50000000,4,51,53,11 + CONTROL "",IDC_SERV_NAME,"Static",0x50000000,70,11,176,11 + CONTROL "",IDC_DISP_NAME,"Static",0x50001000,70,29,176,12 + CONTROL "",IDC_DESCRIPTION,"Static",0x50201000,70,46,176,22 + CONTROL "Pfad zum ausführbarem Programm:",IDC_STATIC,"Static",0x50000000,6,73,150,9 + CONTROL "",IDC_STATIC,"Static",0x50001000,6,86,238,12 + CONTROL "Starttyp:",IDC_STATIC,"Static",0x50000000,6,108,53,11 + CONTROL "",IDC_START_TYPE,"ComboBox",0x50010003,70,107,176,11 + CONTROL "Status des Dienstes:",IDC_STATIC,"Static",0x50000000,4,138,100,11 + CONTROL "",IDC_SERV_STATUS,"Static",0x50000000,70,138,176,11 + CONTROL "Start",IDC_START,"Button",0x50010000,6,155,54,15 + CONTROL "Stopp",IDC_STOP,"Button",0x50010000,68,155,54,15 + CONTROL "Pause",IDC_PAUSE,"Button",0x50010000,130,155,54,15 + CONTROL "Fortsetzen",IDC_RESUME,"Button",0x50010000,192,155,54,15 + CONTROL "Sie können die Startparameter festlegen, die verwendet werden, wenn Sie den Dienst von hier aus starten.",IDC_STATIC,"Static",0x50000000,6,177,240,15 + CONTROL "Startparameter",IDC_STATIC,"Static",0x50000000,6,199,53,11 + CONTROL "",IDC_START_PARAM,"Static",0x50001000,70,199,176,11 +END + +IDB_BUTTONS BITMAP "buttons.bmp" + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIRSTCOLUMN "Name" + IDS_SECONDCOLUMN "Beschreibung" + IDS_THIRDCOLUMN "Status" + IDS_FOURTHCOLUMN "Starttyp" + IDS_FITHCOLUMN "Anmelden als" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "Gestartet" + IDS_SERVICES_STATUS_STOPPED "Gestoppt" + IDS_SERVICES_YES "Ja" + IDS_SERVICES_UNKNOWN "Unbekannt" + IDS_SERVICES_AUTO "Automatisch" + IDS_SERVICES_MAN "Manuel" + IDS_SERVICES_DIS "Deaktiviert" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_NUM_SERVICES "Dienste: %d" + IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." + /*"This program is free software; you can redistribute it " + "and/or modify it under the terms of the GNU Lesser General " + "Public License as published by the Free Software Foundation; " + "either version 2.1 of the License, or (at your option) any " + "later version.\r\n\r\nThis program is distributed in the hope " + "that it will be useful, but WITHOUT ANY WARRANTY; without even " + "the implied warranty of MERCHANTABILITY or FITNESS FOR A " + "PARTICULAR PURPOSE. See the GNU General Public License for more " + "details.\r\n\r\nYou should have received a copy of the GNU " + "General Public License along with this program; if not, write " + "to the Free Software Foundation, Inc., 59 Temple Place - Suite " + "330, Boston, MA 02111-1307, USA." */ + +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_PROP "Eigenschaften" + IDS_TOOLTIP_REFRESH "Aktualisieren" + IDS_TOOLTIP_EXPORT "Liste exportieren" + IDS_TOOLTIP_START "Dienst starten" + IDS_TOOLTIP_STOP "Dienst beenden" + IDS_TOOLTIP_PAUSE "Diest pausieren" + IDS_TOOLTIP_RESTART "Diest neustarten" +END diff --git a/reactos/base/applications/servman/En.rc b/reactos/base/applications/servman/En.rc new file mode 100644 index 00000000000..32de9319940 --- /dev/null +++ b/reactos/base/applications/servman/En.rc @@ -0,0 +1,182 @@ +IDR_MAINMENU MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "E&xit",ID_EXIT + END + POPUP "Action" + BEGIN + MENUITEM "Start",ID_START + MENUITEM "Stop",ID_STOP + MENUITEM "Pause",ID_PAUSE + MENUITEM "Resume",ID_RESUME + MENUITEM "Restart",ID_RESTART + MENUITEM SEPARATOR + MENUITEM "Refresh",ID_REFRESH + MENUITEM SEPARATOR + MENUITEM "Properties",ID_PROP + END + POPUP "View" + BEGIN + MENUITEM "Customize",ID_VIEW_CUSTOMIZE + END + POPUP "Help" + BEGIN + MENUITEM "About",ID_ABOUT + END +END +IDR_POPUP MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "Start",ID_START + MENUITEM "Stop",ID_STOP + MENUITEM "Pause",ID_PAUSE + MENUITEM "Resume",ID_RESUME + MENUITEM "Restart",ID_RESTART + MENUITEM SEPARATOR + POPUP "All tasks" + BEGIN + MENUITEM "Start",ID_START + MENUITEM "Stop",ID_STOP + MENUITEM "Pause",ID_PAUSE + MENUITEM "Resume",ID_RESUME + MENUITEM "Restart",ID_RESTART + MENUITEM "Refresh",ID_REFRESH + END + MENUITEM SEPARATOR + MENUITEM "Refresh",ID_REFRESH + MENUITEM SEPARATOR + MENUITEM "Properties",ID_PROP + MENUITEM SEPARATOR + MENUITEM "Help",ID_HELP + END +END + +IDD_ABOUTBOX DIALOGEX 22,16,190,182 +CAPTION "About Service Manager" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + LTEXT "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy@gmail.com)", IDC_STATIC, 48, 7, 130, 26 + PUSHBUTTON "Close", IDOK, 75, 162, 44, 15 + ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30 + EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE +END + +IDD_DLG_GENERAL DIALOGEX 6,6,253,225 +CAPTION "General" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP +BEGIN + LTEXT "", IDC_SERV_NAME, 70,11,176,11, WS_CHILD | WS_VISIBLE + EDITTEXT IDC_DISP_NAME, 70, 29, 176, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY + EDITTEXT IDC_DESCRIPTION, 70, 46, 176, 24, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_MULTILINE | ES_READONLY + EDITTEXT IDC_EXEPATH, 6, 86, 240, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "",IDC_START_TYPE,"ComboBox",0x50010003,70,107,176,11 + PUSHBUTTON "Start", IDC_START, 6, 155, 54, 15 + PUSHBUTTON "Stop", IDC_STOP, 68, 155, 54, 15 + PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15 + PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15 + LTEXT "Service name:", IDC_STATIC, 4, 11, 53, 11 + LTEXT "Display name:", IDC_STATIC, 4, 29, 53, 11 + LTEXT "Description", IDC_STATIC, 4, 51, 53, 11 + LTEXT "Path to executable:", IDC_STATIC, 6, 73, 82, 9 + LTEXT "Startup type:", IDC_STATIC, 6, 108, 53, 11 + LTEXT "Service status:", IDC_STATIC, 4, 138, 53, 11 + CONTROL "",IDC_SERV_STATUS,"Static",0x50000000,70,138,176,11 + LTEXT "You can specify the start parameters that apply when you start the service from here.",IDC_STATIC, 6,177,240,15 + LTEXT "Start parameters", IDC_STATIC, 6, 199, 53, 11 + EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_DLG_DEPEND DIALOGEX 6,6,253,225 +CAPTION "Dependencies" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP +BEGIN + CONTROL "",IDC_DEPEND_TREE1,"SysTreeView32",0x50010007,8,70,236,68,0x00000200 + CONTROL "",IDC_DEPEND_TREE2,"SysTreeView32",0x50010007,8,151,234,67,0x00000200 + CONTROL "Some services depend on other services, system drivers and load order groups. If a system component is stopped or it is not running properly, dependant services can be affected.",IDC_STATIC,"Static",0x50000000,8,7,238,26 + CONTROL "This service depends on the following components",IDC_STATIC,"Static",0x50000000,8,57,236,9 + CONTROL "",IDC_DEPEND_SERVICE,"Static",0x50000000,8,38,236,13 +END + +IDD_DLG_CREATE DIALOGEX 6,6,225,209 +CAPTION "Create a service" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP +BEGIN + CONTROL "",IDC_CREATE_SERVNAME,"Edit",0x50010000,72,12,150,11,0x00000200 + CONTROL "",IDC_CREATE_DISPNAME,"Edit",0x50010000,72,31,150,11,0x00000200 + CONTROL "",IDC_CREATE_PATH,"Edit",0x50010000,8,62,214,13,0x00000200 + CONTROL "",IDC_CREATE_DESC,"Edit",0x50010000,10,97,210,48,0x00000200 + CONTROL "",IDC_CREATE_OPTIONS,"Edit",0x50010000,10,162,210,13,0x00000200 + CONTROL "Service Name :",IDC_STATIC,"Static",0x50000202,12,12,54,9 + CONTROL "Display Name :",IDC_STATIC,"Static",0x50000202,12,33,54,9 + CONTROL "Path to executable :",IDC_STATIC,"Static",0x50000000,10,51,68,9 + CONTROL "Description :",IDC_STATIC,"Static",0x50000000,12,86,44,9 + CONTROL "OK",IDOK,"Button",0x50010000,126,192,44,13 + CONTROL "Cancel",IDCANCEL,"Button",0x50010000,176,192,46,13 + CONTROL "Additional options (click help for details)",IDC_STATIC,"Static",0x50000000,10,151,134,9 + CONTROL "Help",ID_CREATE_HELP,"Button",0x50010000,6,192,44,13 +END + +IDD_DLG_PROGRESS DIALOGEX 6,6,255,89 +CAPTION "Service Control" +FONT 8,"MS Sans Serif",0,0 +STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +EXSTYLE WS_EX_TOOLWINDOW +BEGIN + CONTROL "",IDC_SERVCON_PROGRESS,"msctls_progress32",0x50000000,8,46,238,13 + CONTROL "",IDC_SERVCON_INFO,"Static",0x50000000,8,5,236,11 + CONTROL "",IDC_SERVCON_NAME,"Static",0x50000000,8,25,66,11 + CONTROL "&Close",IDOK,"Button",0x50010000,100,70,54,13 +END + + +IDB_BUTTONS BITMAP DISCARDABLE "res/toolbar.bmp" + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIRSTCOLUMN "Name" + IDS_SECONDCOLUMN "Description" + IDS_THIRDCOLUMN "Status" + IDS_FOURTHCOLUMN "Startup Type" + IDS_FITHCOLUMN "Log On As" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STARTED "Started" + IDS_SERVICES_STOPPED "Stopped" + IDS_SERVICES_AUTO "Automatic" + IDS_SERVICES_MAN "Manual" + IDS_SERVICES_DIS "Disabled" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NUM_SERVICES "Num Services: %d" + IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_PROP "Properties" + IDS_TOOLTIP_REFRESH "Refresh" + IDS_TOOLTIP_EXPORT "Export list" + IDS_TOOLTIP_START "Start service" + IDS_TOOLTIP_STOP "Stop service" + IDS_TOOLTIP_PAUSE "Pause service" + IDS_TOOLTIP_RESTART "Restart service" + IDS_TOOLTIP_NEW "Create a new service" + IDS_TOOLTIP_HELP "Help" + IDS_TOOLTIP_EXIT "Exit" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROGRESS_INFO "ReactOS is attempting to %s the following service" +END diff --git a/reactos/base/applications/servman/about.c b/reactos/base/applications/servman/about.c new file mode 100644 index 00000000000..64da2c9f332 --- /dev/null +++ b/reactos/base/applications/servman/about.c @@ -0,0 +1,54 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsys/system/servman/about.c + * PURPOSE: About dialog box message handler + * COPYRIGHT: Copyright 2005 Ged Murphy + * + */ + +//ShellAbout(hwnd, _T("test"), _T("test2"), MAKEINTRESOURCE(IDI_SM_ICON)); + +#include "servman.h" + +extern HINSTANCE hInstance; + +#ifdef _MSC_VER +#pragma warning(disable : 4100) +#endif +BOOL CALLBACK +AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + HWND hLicenseEditWnd; + HICON hIcon = NULL; + TCHAR strLicense[0x1000]; + + switch (message) + { + case WM_INITDIALOG: + + hIcon = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0); + SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); + + hLicenseEditWnd = GetDlgItem(hDlg, IDC_LICENSE_EDIT); + + LoadString(hInstance, IDS_LICENSE, strLicense, 0x1000); + + SetWindowText(hLicenseEditWnd, strLicense); + + return TRUE; + + case WM_COMMAND: + + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + DestroyIcon(hIcon); + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + + break; + } + + return FALSE; +} diff --git a/reactos/base/applications/servman/control.c b/reactos/base/applications/servman/control.c new file mode 100644 index 00000000000..b1a17850acb --- /dev/null +++ b/reactos/base/applications/servman/control.c @@ -0,0 +1,138 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsys/system/servman/control + * PURPOSE: Stops, pauses and resumes a service + * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy + * + */ + +#include "servman.h" + +extern HWND hListView; + + +BOOL Control(HWND hProgDlg, DWORD Control) +{ + HWND hProgBar; + SC_HANDLE hSCManager; + SC_HANDLE hSc; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + SERVICE_STATUS_PROCESS ServiceStatus; + SERVICE_STATUS Status; + LVITEM item; + DWORD BytesNeeded = 0; + DWORD dwStartTickCount, dwOldCheckPoint; + + item.mask = LVIF_PARAM; + item.iItem = GetSelectedItem(); + SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item); + + /* copy pointer to selected service */ + Service = (ENUM_SERVICE_STATUS_PROCESS *)item.lParam; + + /* set the progress bar range and step */ + hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS); + SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE)); + SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0); + + /* open handle to the SCM */ + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + if (hSCManager == NULL) + { + GetError(0); + return FALSE; + } + + /* open handle to the service */ + hSc = OpenService(hSCManager, Service->lpServiceName, + SC_MANAGER_ALL_ACCESS); + if (hSc == NULL) + { + GetError(0); + return FALSE; + } + + /* process requested action */ + if (! ControlService(hSc, Control, &Status)) + { + GetError(0); + CloseServiceHandle(hSc); + return FALSE; + } + + /* query the state of the service */ + if (! QueryServiceStatusEx(hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)&ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS), + &BytesNeeded)) + { + GetError(0); + return FALSE; + } + + /* Save the tick count and initial checkpoint. */ + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + + /* loop whilst service is not running */ + /* FIXME: needs more control adding. 'Loop' is temparary */ + while (ServiceStatus.dwCurrentState != Control) + { + DWORD dwWaitTime; + + dwWaitTime = ServiceStatus.dwWaitHint / 10; + + if( dwWaitTime < 500 ) + dwWaitTime = 500; + else if ( dwWaitTime > 5000 ) + dwWaitTime = 5000; + + /* increment the progress bar */ + SendMessage(hProgBar, PBM_STEPIT, 0, 0); + + /* wait before checking status */ + Sleep(dwWaitTime); + + /* check status again */ + if (! QueryServiceStatusEx( + hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)&ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS), + &BytesNeeded)) + { + GetError(0); + return FALSE; + } + + if (ServiceStatus.dwCheckPoint > dwOldCheckPoint) + { + /* The service is making progress. increment the progress bar */ + SendMessage(hProgBar, PBM_STEPIT, 0, 0); + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + } + else + { + if(GetTickCount() - dwStartTickCount > ServiceStatus.dwWaitHint) + { + /* No progress made within the wait hint */ + break; + } + } + } + + CloseServiceHandle(hSc); + + if (ServiceStatus.dwCurrentState == Control) + { + SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0); + Sleep(1000); + return TRUE; + } + else + return FALSE; + +} diff --git a/reactos/base/applications/servman/geterror.c b/reactos/base/applications/servman/geterror.c new file mode 100644 index 00000000000..29c28f4ace1 --- /dev/null +++ b/reactos/base/applications/servman/geterror.c @@ -0,0 +1,33 @@ +//#include +#include "servman.h" +/* temp file for debugging */ + +VOID GetError(DWORD err) +{ + LPVOID lpMsgBuf; + + if (err == 0) + err = GetLastError(); + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + err, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ + (LPTSTR) &lpMsgBuf, + 0, + NULL ); + + MessageBox(NULL, lpMsgBuf, _T("Error!"), MB_OK | MB_ICONERROR); + + LocalFree(lpMsgBuf); +} + + +VOID DisplayString(PTCHAR Msg) +{ + + MessageBox(NULL, Msg, _T("Error!"), MB_OK | MB_ICONERROR); + +} diff --git a/reactos/base/applications/servman/progress.c b/reactos/base/applications/servman/progress.c new file mode 100644 index 00000000000..afe157516b5 --- /dev/null +++ b/reactos/base/applications/servman/progress.c @@ -0,0 +1,45 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsys/system/servman/progress.c + * PURPOSE: Progress dialog box message handler + * COPYRIGHT: Copyright 2006 Ged Murphy + * + */ + +#include "servman.h" + +extern HINSTANCE hInstance; +//extern HWND hMainWnd; + + +BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) +{ + switch(Message) + { + case WM_INITDIALOG: + + break; + + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDOK: + DestroyWindow(hDlg); + break; + + } + break; + + case WM_DESTROY: + DestroyWindow(hDlg); + break; + + default: + return FALSE; + } + + return TRUE; + +} + diff --git a/reactos/base/applications/servman/propsheet.c b/reactos/base/applications/servman/propsheet.c new file mode 100644 index 00000000000..50e514b2abc --- /dev/null +++ b/reactos/base/applications/servman/propsheet.c @@ -0,0 +1,295 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsys/system/servman/propsheet.c + * PURPOSE: Property dialog box message handler + * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy + * + */ + +#include "servman.h" + +extern ENUM_SERVICE_STATUS_PROCESS *pServiceStatus; +extern HINSTANCE hInstance; +extern HWND hListView; +extern HWND hMainWnd; + + +typedef struct _PROP_DLG_INFO +{ + LPTSTR lpServiceName; + LPTSTR lpDisplayName; + LPTSTR lpDescription; + LPTSTR lpPathToExe; + TCHAR szStartupType; + TCHAR szServiceStatus[25]; + LPTSTR lpStartParams; +} PROP_DLG_INFO, *PPROP_DLG_INFO; + + +/* + * Fills the 'startup type' combo box with possible + * values and sets it to value of the selected item + */ +VOID SetStartupType(HKEY hKey, HWND hwndDlg) +{ + HWND hList; + TCHAR buf[25]; + DWORD dwValueSize = 0; + DWORD StartUp = 0; + + hList = GetDlgItem(hwndDlg, IDC_START_TYPE); + + LoadString(hInstance, IDS_SERVICES_AUTO, buf, sizeof(buf) / sizeof(TCHAR)); + SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf); + LoadString(hInstance, IDS_SERVICES_MAN, buf, sizeof(buf) / sizeof(TCHAR)); + SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf); + LoadString(hInstance, IDS_SERVICES_DIS, buf, sizeof(buf) / sizeof(TCHAR)); + SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf); + + dwValueSize = sizeof(DWORD); + if (RegQueryValueEx(hKey, + _T("Start"), + NULL, + NULL, + (LPBYTE)&StartUp, + &dwValueSize)) + { + RegCloseKey(hKey); + return; + } + + if (StartUp == 0x02) + SendMessage(hList, CB_SETCURSEL, 0, 0); + else if (StartUp == 0x03) + SendMessage(hList, CB_SETCURSEL, 1, 0); + else if (StartUp == 0x04) + SendMessage(hList, CB_SETCURSEL, 2, 0); + +} + + +/* + * Populates the General Properties dialog with + * the relevant service information + */ +VOID GetDlgInfo(HWND hwndDlg) +{ + HKEY hKey; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + PROP_DLG_INFO DlgInfo; + LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s"); + TCHAR buf[300]; + + /* get pointer to selected service */ + Service = GetSelectedService(); + + /* open the registry key for the service */ + _sntprintf(buf, sizeof(buf) / sizeof(TCHAR), Path, Service->lpServiceName); + RegOpenKeyEx(HKEY_LOCAL_MACHINE, + buf, + 0, + KEY_READ, + &hKey); + + /* set the service name */ + DlgInfo.lpServiceName = Service->lpServiceName; + SendDlgItemMessage(hwndDlg, IDC_SERV_NAME, WM_SETTEXT, 0, ( + LPARAM)DlgInfo.lpServiceName); + + + /* set the display name */ + DlgInfo.lpDisplayName = Service->lpDisplayName; + SendDlgItemMessage(hwndDlg, IDC_DISP_NAME, WM_SETTEXT, 0, + (LPARAM)DlgInfo.lpDisplayName); + + + /* set the description */ + if (GetDescription(hKey, &DlgInfo.lpDescription)) + SendDlgItemMessage(hwndDlg, IDC_DESCRIPTION, WM_SETTEXT, 0, + (LPARAM)DlgInfo.lpDescription); + + + /* set the executable path */ + if (GetExecutablePath(&DlgInfo.lpPathToExe)) + SendDlgItemMessage(hwndDlg, IDC_EXEPATH, WM_SETTEXT, 0, (LPARAM)DlgInfo.lpPathToExe); + + + /* set startup type */ + SetStartupType(hKey, hwndDlg); + + + + /* set service status */ + if (Service->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING) + { + LoadString(hInstance, IDS_SERVICES_STARTED, DlgInfo.szServiceStatus, + sizeof(DlgInfo.szServiceStatus) / sizeof(TCHAR)); + SendDlgItemMessageW(hwndDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus); + } + else + { + LoadString(hInstance, IDS_SERVICES_STOPPED, DlgInfo.szServiceStatus, + sizeof(DlgInfo.szServiceStatus) / sizeof(TCHAR)); + SendDlgItemMessageW(hwndDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus); + } + + + + +} + + +#ifdef _MSC_VER +#pragma warning(disable : 4100) +#endif + +/* + * General Property dialog callback. + * Controls messages to the General dialog + */ +/* FIXME: this may be better as a modeless dialog */ +INT_PTR CALLBACK +GeneralPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + + switch (uMsg) + { + case WM_INITDIALOG: + GetDlgInfo(hwndDlg); + break; + + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDC_START: + SendMessage(hMainWnd, WM_COMMAND, ID_START, 0); + break; + + case IDC_STOP: + SendMessage(hMainWnd, WM_COMMAND, ID_STOP, 0); + break; + + case IDC_PAUSE: + SendMessage(hMainWnd, WM_COMMAND, ID_PAUSE, 0); + break; + + case IDC_RESUME: + SendMessage(hMainWnd, WM_COMMAND, ID_RESUME, 0); + break; + } + break; + + case WM_DESTROY: + break; + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + + default: + break; + } + break; + } + + return FALSE; +} + + + +/* + * Dependancies Property dialog callback. + * Controls messages to the Dependancies dialog + */ +/* FIXME: this may be better as a modeless dialog */ +INT_PTR CALLBACK +DependanciesPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + + switch (uMsg) + { + case WM_INITDIALOG: + + break; + + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDC_START: + break; + + case IDC_STOP: + + break; + } + break; + + case WM_DESTROY: + break; + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + + default: + break; + } + break; + } + + return FALSE; +} + + +static VOID +InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc) +{ + ZeroMemory(psp, sizeof(PROPSHEETPAGE)); + psp->dwSize = sizeof(PROPSHEETPAGE); + psp->dwFlags = PSP_DEFAULT; + psp->hInstance = hInstance; + psp->pszTemplate = MAKEINTRESOURCE(idDlg); + psp->pfnDlgProc = DlgProc; +} + + +LONG APIENTRY +OpenPropSheet(HWND hwnd) +{ + PROPSHEETHEADER psh; + PROPSHEETPAGE psp[2]; + TCHAR Caption[256]; + + LoadString(hInstance, IDS_PROP_SHEET, Caption, sizeof(Caption) / sizeof(TCHAR)); + + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; + psh.hwndParent = NULL; + psh.hInstance = hInstance; + psh.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON)); + psh.pszCaption = Caption; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = psp; + + InitPropSheetPage(&psp[0], IDD_DLG_GENERAL, GeneralPageProc); + //InitPropSheetPage(&psp[1], IDD_DLG_GENERAL, LogonPageProc); + //InitPropSheetPage(&psp[2], IDD_DLG_GENERAL, RecoveryPageProc); + InitPropSheetPage(&psp[1], IDD_DLG_DEPEND, DependanciesPageProc); + + + return (LONG)(PropertySheet(&psh) != -1); +} + diff --git a/reactos/base/applications/servman/query.c b/reactos/base/applications/servman/query.c new file mode 100644 index 00000000000..4922e20ef0a --- /dev/null +++ b/reactos/base/applications/servman/query.c @@ -0,0 +1,619 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsys/system/servman/query.c + * PURPOSE: Query service information + * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy + * + */ + +#include "servman.h" + +extern HINSTANCE hInstance; +extern HWND hListView; +extern HWND hStatus; + +/* Stores the complete services array */ +ENUM_SERVICE_STATUS_PROCESS *pServiceStatus = NULL; + + +/* Free service array */ +VOID FreeMemory(VOID) +{ + HeapFree(GetProcessHeap(), 0, pServiceStatus); +} + + + +ENUM_SERVICE_STATUS_PROCESS* +GetSelectedService(VOID) +{ + ENUM_SERVICE_STATUS_PROCESS *pSelectedService = NULL; + LVITEM item; + + item.mask = LVIF_PARAM; + item.iItem = GetSelectedItem(); + SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item); + + /* copy pointer to selected service */ + pSelectedService = (ENUM_SERVICE_STATUS_PROCESS *)item.lParam; + + return pSelectedService; +} + + +/* Retrives the service description from the registry */ +BOOL GetDescription(HKEY hKey, LPTSTR *retDescription) +{ + + LPTSTR Description = NULL; + DWORD dwValueSize = 0; + LONG ret = RegQueryValueEx(hKey, + _T("Description"), + NULL, + NULL, + NULL, + &dwValueSize); + if (ret != ERROR_SUCCESS && ret != ERROR_FILE_NOT_FOUND && ret != ERROR_INVALID_HANDLE) + { + RegCloseKey(hKey); + return FALSE; + } + + if (ret != ERROR_FILE_NOT_FOUND) + { + Description = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize); + if (Description == NULL) + { + RegCloseKey(hKey); + return FALSE; + } + + if(RegQueryValueEx(hKey, + _T("Description"), + NULL, + NULL, + (LPBYTE)Description, + &dwValueSize)) + { + HeapFree(GetProcessHeap(), 0, Description); + RegCloseKey(hKey); + return FALSE; + } + } + + /* copy pointer over */ + *retDescription = Description; + + return TRUE; +} + + +/* get vendor of service binary */ +BOOL GetExecutablePath(LPTSTR *ExePath) +{ + SC_HANDLE hSCManager = NULL; + SC_HANDLE hSc = NULL; + LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + DWORD BytesNeeded = 0; + + /* copy pointer to selected service */ + Service = GetSelectedService(); + + /* open handle to the SCM */ + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE); + if (hSCManager == NULL) + { + GetError(0); + return FALSE; + } + + /* get a handle to the service requested for starting */ + hSc = OpenService(hSCManager, Service->lpServiceName, SERVICE_QUERY_CONFIG); + if (hSc == NULL) + { + GetError(0); + goto cleanup; + } + + + if (!QueryServiceConfig(hSc, pServiceConfig, 0, &BytesNeeded)) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pServiceConfig = (LPQUERY_SERVICE_CONFIG) + HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceConfig == NULL) + goto cleanup; + + if (!QueryServiceConfig(hSc, + pServiceConfig, + BytesNeeded, + &BytesNeeded)) + { + HeapFree(GetProcessHeap(), 0, pServiceConfig); + goto cleanup; + } + } + else /* exit on failure */ + { + goto cleanup; + } + } + + *ExePath = pServiceConfig->lpBinaryPathName; + + CloseServiceHandle(hSCManager); + CloseServiceHandle(hSc); + + return TRUE; + +cleanup: + if (hSCManager != NULL) + CloseServiceHandle(hSCManager); + if (hSc != NULL) + CloseServiceHandle(hSc); + return FALSE; +} + + + + +BOOL +RefreshServiceList(VOID) +{ + LVITEM item; + TCHAR szNumServices[32]; + TCHAR szStatus[64]; + DWORD NumServices = 0; + DWORD Index; + LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s"); + + ListView_DeleteAllItems(hListView); + + NumServices = GetServiceList(); + + if (NumServices) + { + HICON hiconItem; /* icon for list-view items */ + HIMAGELIST hSmall; /* image list for other views */ + TCHAR buf[300]; /* buffer to hold key path */ + INT NumListedServ = 0; /* how many services were listed */ + + /* Create the icon image lists */ + hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR16, 1, 1); + + /* Add an icon to each image list */ + hiconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), + IMAGE_ICON, 16, 16, 0); + ImageList_AddIcon(hSmall, hiconItem); + + /* assign the image to the list view */ + ListView_SetImageList(hListView, hSmall, LVSIL_SMALL); + + for (Index = 0; Index < NumServices; Index++) + { + HKEY hKey = NULL; + LPTSTR Description = NULL; + LPTSTR LogOnAs = NULL; + DWORD StartUp = 0; + DWORD dwValueSize; + + /* open the registry key for the service */ + _sntprintf(buf, 300, Path, + pServiceStatus[Index].lpServiceName); + + RegOpenKeyEx(HKEY_LOCAL_MACHINE, + buf, + 0, + KEY_READ, + &hKey); + + + /* set the display name */ + + ZeroMemory(&item, sizeof(LVITEM)); + item.mask = LVIF_TEXT | LVIF_PARAM; + item.pszText = pServiceStatus[Index].lpDisplayName; + + /* Set a pointer for each service so we can query it later. + * Not all services are added to the list, so we can't query + * the item number as they become out of sync with the array */ + item.lParam = (LPARAM)&pServiceStatus[Index]; + + item.iItem = ListView_GetItemCount(hListView); + item.iItem = ListView_InsertItem(hListView, &item); + + + + + /* set the description */ + + if (GetDescription(hKey, &Description)) + { + item.pszText = Description; + item.iSubItem = 1; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + + HeapFree(GetProcessHeap(), 0, Description); + } + + + /* set the status */ + + if (pServiceStatus[Index].ServiceStatusProcess.dwCurrentState + == SERVICE_RUNNING) + { + LoadString(hInstance, IDS_SERVICES_STARTED, szStatus, + sizeof(szStatus) / sizeof(TCHAR)); + item.pszText = szStatus; + item.iSubItem = 2; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + + + /* set the startup type */ + + dwValueSize = sizeof(DWORD); + if (RegQueryValueEx(hKey, + _T("Start"), + NULL, + NULL, + (LPBYTE)&StartUp, + &dwValueSize)) + { + RegCloseKey(hKey); + continue; + } + + if (StartUp == 0x02) + { + LoadString(hInstance, IDS_SERVICES_AUTO, szStatus, + sizeof(szStatus) / sizeof(TCHAR)); + item.pszText = szStatus; + item.iSubItem = 3; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + else if (StartUp == 0x03) + { + LoadString(hInstance, IDS_SERVICES_MAN, szStatus, + sizeof(szStatus) / sizeof(TCHAR)); + item.pszText = szStatus; + item.iSubItem = 3; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + else if (StartUp == 0x04) + { + LoadString(hInstance, IDS_SERVICES_DIS, szStatus, + sizeof(szStatus) / sizeof(TCHAR)); + item.pszText = szStatus; + item.iSubItem = 3; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + + + /* set Log On As */ + + dwValueSize = 0; + if (RegQueryValueEx(hKey, + _T("ObjectName"), + NULL, + NULL, + NULL, + &dwValueSize)) + { + RegCloseKey(hKey); + continue; + } + + LogOnAs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize); + if (LogOnAs == NULL) + { + RegCloseKey(hKey); + return FALSE; + } + if(RegQueryValueEx(hKey, + _T("ObjectName"), + NULL, + NULL, + (LPBYTE)LogOnAs, + &dwValueSize)) + { + HeapFree(GetProcessHeap(), 0, LogOnAs); + RegCloseKey(hKey); + continue; + } + + item.pszText = LogOnAs; + item.iSubItem = 4; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + + HeapFree(GetProcessHeap(), 0, LogOnAs); + + RegCloseKey(hKey); + + } + + NumListedServ = ListView_GetItemCount(hListView); + + /* set the number of listed services in the status bar */ + LoadString(hInstance, IDS_NUM_SERVICES, szNumServices, + sizeof(szNumServices) / sizeof(TCHAR)); + _sntprintf(buf, 300, szNumServices, NumListedServ); + SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)buf); + } + + /* turn redraw flag on. It's turned off initially via the LBS_NOREDRAW flag */ + SendMessage (hListView, WM_SETREDRAW, TRUE, 0) ; + + return TRUE; +} + + + + +DWORD +GetServiceList(VOID) +{ + SC_HANDLE ScHandle; + + DWORD BytesNeeded = 0; + DWORD ResumeHandle = 0; + DWORD NumServices = 0; + + ScHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE); + if (ScHandle != INVALID_HANDLE_VALUE) + { + if (EnumServicesStatusEx(ScHandle, + SC_ENUM_PROCESS_INFO, + SERVICE_WIN32, + SERVICE_STATE_ALL, + (LPBYTE)pServiceStatus, + 0, &BytesNeeded, + &NumServices, + &ResumeHandle, + 0) == 0) + { + /* Call function again if required size was returned */ + if (GetLastError() == ERROR_MORE_DATA) + { + /* reserve memory for service info array */ + pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) + HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceStatus == NULL) + return FALSE; + + /* fill array with service info */ + if (EnumServicesStatusEx(ScHandle, + SC_ENUM_PROCESS_INFO, + SERVICE_WIN32, + SERVICE_STATE_ALL, + (LPBYTE)pServiceStatus, + BytesNeeded, + &BytesNeeded, + &NumServices, + &ResumeHandle, + 0) == 0) + { + HeapFree(GetProcessHeap(), 0, pServiceStatus); + return FALSE; + } + } + else /* exit on failure */ + { + return FALSE; + } + } + } + + CloseServiceHandle(ScHandle); + + return NumServices; +} + + + + + + + + + + + +/* + //WORD wCodePage; + //WORD wLangID; + //SC_HANDLE hService; + //DWORD dwHandle, dwLen; + //UINT BufLen; + //TCHAR* lpData; + //TCHAR* lpBuffer; + //TCHAR szStrFileInfo[80]; + //TCHAR FileName[MAX_PATH]; + //LPVOID pvData; + + //LPSERVICE_FAILURE_ACTIONS pServiceFailureActions = NULL; + //LPQUERY_SERVICE_CONFIG pServiceConfig = NULL; + + BytesNeeded = 0; + hService = OpenService(ScHandle, + pServiceStatus[Index].lpServiceName, + SC_MANAGER_CONNECT); + if (hService != INVALID_HANDLE_VALUE) + { + / * check if service is required by the system* / + if (!QueryServiceConfig2(hService, + SERVICE_CONFIG_FAILURE_ACTIONS, + (LPBYTE)pServiceFailureActions, + 0, + &BytesNeeded)) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS) + HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceFailureActions == NULL) + return FALSE; + + if (!QueryServiceConfig2(hService, + SERVICE_CONFIG_FAILURE_ACTIONS, + (LPBYTE)pServiceFailureActions, + BytesNeeded, + &BytesNeeded)) + { + HeapFree(GetProcessHeap(), 0, pServiceFailureActions); + return FALSE; + } + } + else / * exit on failure * / + { + return FALSE; + } + } + if (pServiceFailureActions->cActions) + { + if (pServiceFailureActions->lpsaActions[0].Type == SC_ACTION_REBOOT) + { + LoadString(hInstance, IDS_SERVICES_YES, szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 1; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + } + + if (pServiceFailureActions != NULL) + { + HeapFree(GetProcessHeap(), 0, pServiceFailureActions); + pServiceFailureActions = NULL; + } + + / * get vendor of service binary * / + BytesNeeded = 0; + if (!QueryServiceConfig(hService, pServiceConfig, 0, &BytesNeeded)) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + pServiceConfig = (LPQUERY_SERVICE_CONFIG) + HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceConfig == NULL) + return FALSE; + + if (!QueryServiceConfig(hService, + pServiceConfig, + BytesNeeded, + &BytesNeeded)) + { + HeapFree(GetProcessHeap(), 0, pServiceConfig); + return FALSE; + } + } + else / * exit on failure * / + { + return FALSE; + } + } + + memset(&FileName, 0, MAX_PATH); + if (_tcscspn(pServiceConfig->lpBinaryPathName, _T("\""))) + { + _tcsncpy(FileName, pServiceConfig->lpBinaryPathName, + _tcscspn(pServiceConfig->lpBinaryPathName, _T(" ")) ); + } + else + { + _tcscpy(FileName, pServiceConfig->lpBinaryPathName); + } + + HeapFree(GetProcessHeap(), 0, pServiceConfig); + pServiceConfig = NULL; + + dwLen = GetFileVersionInfoSize(FileName, &dwHandle); + if (dwLen) + { + lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen); + if (lpData == NULL) + return FALSE; + + if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) { + HeapFree(GetProcessHeap(), 0, lpData); + return FALSE; + } + + if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), &pvData, (PUINT) &BufLen)) + { + wCodePage = LOWORD(*(DWORD*) pvData); + wLangID = HIWORD(*(DWORD*) pvData); + wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID); + } + + if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) { + item.pszText = lpBuffer; + item.iSubItem = 2; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + HeapFree(GetProcessHeap(), 0, lpData); + } + else + { + LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 2; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + CloseServiceHandle(hService); + } + + + + + + + + HeapFree(GetProcessHeap(), 0, pServiceConfig); + pServiceConfig = NULL; + + dwLen = GetFileVersionInfoSize(FileName, &dwHandle); + if (dwLen) + { + lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen); + if (lpData == NULL) + return FALSE; + + if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) { + HeapFree(GetProcessHeap(), 0, lpData); + return FALSE; + } + + if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), + &pvData, (PUINT) &BufLen)) + { + wCodePage = LOWORD(*(DWORD*) pvData); + wLangID = HIWORD(*(DWORD*) pvData); + wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), + wCodePage, wLangID); + } + + if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) + { + item.pszText = lpBuffer; + item.iSubItem = 2; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + HeapFree(GetProcessHeap(), 0, lpData); + } + else + { + LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 2; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + +*/ + diff --git a/reactos/base/applications/servman/res/system.ico b/reactos/base/applications/servman/res/system.ico new file mode 100644 index 0000000000000000000000000000000000000000..2d8f32231876693215bd45c8337bda2995625556 GIT binary patch literal 29926 zcmeI534CN#ndooQX{tJ@q*AG_bkgaU4x2awDk#ij?^eLkdE*Q`eY^n`6cHHlNee;; zR659#C_-FO0TE>p7ZeczK_m!@0*V`ph|+8#$kMDGpsViu|L5LYsdOj3BJaK5uMeEu z<(%`KZ~wk??nyd|nxaCq?Y5m1lFTuf_0Rh{9v;aL)6f8a1Q2nca?rUO_z=gV;VBm&4Fy2Mi$_5xPG(yo zu7frVj-oDcJd$+sH4TdwMKHlx$HUktrH;v#jN5%Y?(C(2;~0X6 z#W|roycea>@sYuVlmOB9P~!|B%YUPzb^b?#00Jpr^I!daz=Ai)h>7=TIAl7)F{7FK z2*!y6*)*iAg&6vWA|y&Wfnd;2H6jMr2?Cakjx5UiVsvCMza(QJ^p3!gyd${gCg_bc zhX}R?Oa|-t`!?{hj$!g9`I#GUfY8u@?o8bubQ-$VZ}W@MntDkn48Dll#_Nh=@|<1A z)93MA@;<%ZI-aXKF1K{XxYwqkXz3DsxHBx6xY87!;~}oJhbu4RF`mrl8x zxn;?~_T(Bzj4uirc)*E=W{jot_%h%T<_Dh) zkL;Sv4_=H5bY<5CjDy}Gp5qgj&R80Ay>(gfNw0C8Um4$4zRs7A#+d=?LTVOgB4Xs! zWr(0c3vne}_{r@{8D|!+4aIW0-IfL;umBk>NdhApZfU?hScia2^4B&yXQi z$9uGV2=}kLk&-ysh&mJi*c=mL)3_R14p1{W4{<+r8A@cpVn|4;-|j5wuHJMik6nCGpOj0 z^~CF`W7O+-1}Wd!{s1+MVVr!@7T!g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fat*-PofJ|5J^;0K;Wo(rjal3!klFOUw;9|m5q zM}9XlKbrQ}0`pJiqOOI>4c|E(eBaaF2_0u~owQ#G->%W0QiK1b&!l#2@Kfmc+g1mA zb#074P5Ah=8Zm6W&Nr+MK74qaYk&7j;n&#e`Zl)JNCEu!MwSxttt;P$e|v=O^`$+z zXh;w04m{QSq|&)9-$ezFt12{E4ErCrRk-w)Jr_u3}Om}kq3O*h^2Ke%pAb^MNe zi+N7pzsDYXoWryE($@Tn=k{F9$(pG3f)0PgbsYZdx9pXlOb+ok?aFl&ad@0>59e>S z)m8`Llb^?bUsoTP-ms6dpS~*fTS2GIDU5^0aATBl(JQ|4kpmArP+m+b|101IvTU}?n2Tktf z_pN$i?%(NqvTp_Egz)h~zO8J7?q3XD_c*t{M;Oq!Pd1ouCLQD%E6mBvnOtj<3%h>( zKUp8*ahJX`+v5O-7x4{4&~Z5YyHD84MxTc--#;7Ictz&7XzS)^`aON2MY{CC@)lm! z8pmY!%=5pEt~4JA(df*5!Vw1X_9^mL zWpuN!VAqecagA5T)z^IdK5*F_L|q^^s>>U>)#chacB*^MYCq||{o#inzDhjL`Y%I^ h$FS%ztSP%L^_ki)`6J}=Gsa{nk_5B)cP{tI-%*slNp literal 0 HcmV?d00001 diff --git a/reactos/base/applications/servman/res/toolbar.bmp b/reactos/base/applications/servman/res/toolbar.bmp new file mode 100644 index 0000000000000000000000000000000000000000..5f26621db3fcdca321ebc1b1bf3966799a1ef825 GIT binary patch literal 3638 zcmcJRzm6L>5QiBc0Cxk+2yk(if@Pk-HIeR$6sN!mkVPzZY4Q%oS4gXE2urpaBkIzM zbsj-TK}hATVHeh_NU`~bl;k_vhGQd{)we@(|M17*kgIRMdw5@Ed-%Ch-%twhC48nT z&e#{ly?ypd@l)Ox$C;vvF{=1iRImPgrj)VZfD0x-grt;JV1R;k;2}VSq?A)&zycNL zAwYz5=-1#aIPef4LMnp@25-TEhX4^0A{7|0;J`zG2uUe^DjBfgz(artNm+$VWk3!G z9s)#2WoX9WEjaKHAVMm`wgzv(frkJQQVEGOcnc0Z1c;DIxV*tzaNr?8gj7Nq4BmnR z4*?>i66R>|794m85FzC$u*u*pIPef4LQikjiw^iT4&9cnA<7l~f1@Z^40w01;A2lW6c39C!#2A>|bE z$>1$G@DLzEQjzgTWx#?14*}#zCAEyfTX5hZK!jA%&KkT02Oa`MNF^nm!CP?PAwYyw z($yQh1qU7iL`Wr-gTY&H;2}VSRMI>eyafjyf_nA$pyu4?d7n~4{;6S*5^zWpCw*?6 zG}PP8dXr0fcE`@|{_pEocTMa0Eu*`2r|ZqO+tuC8y4HGjSHW5J?!`~4HO*c(V(ngv z`U*u?7hfOjO3#Vn$>!+WZnw2q*LCZxkB6{5N0IwxJo$p=p-;DFsIn}*pEr7FL?8X2 z@Z#btO!V~!+v`E}^}D{WyX_idiV4_03q0wYAMfw`q71!v^u47&-yp4WTfVBB<0DPg z+$CZ-ko&g2o=$HmJl$|;q)v%> z%5}Lq*KI#<%OlN$$z(~}SzTUUmiU$YY^!7Z zb{o-$p^q00Lp7bg7$gzir%x1?M~Z^1?+~H)>Fb~KNTd6gKTF)2C7IOf(P(sE1fmal zMPFO2>a#vcy!H0j*=*>CUQg?Kx~K3?eN7gVgOs0=*kt>VzCpLT=_|=Ptm#GVXfnAk z0$cR473TOgBxc)I1nLw6-K{q)rMIXD$PFHNw^svs`W7SQ&*HgB|qAw@t`uX*0wYnC4 z<3W$#B*wqhw?90>!hIm?^U-4R`1?xMugJq%(y!#7bRw4ZbvK=?4^h|EvVMoEx|!Cy zSw-CP`uHu|uh*+#l><2bDMzBbgLB>u@~JdQv9wCPTsVchYF;iEH1~Qkxz}WUSsoEP z>65@@%j;v^<5q^N&;honQH=x_p1LY=wi9|FeiLiqIEzgJiP E0LPXT+yDRo literal 0 HcmV?d00001 diff --git a/reactos/base/applications/servman/resource.h b/reactos/base/applications/servman/resource.h new file mode 100644 index 00000000000..927e91eef3f --- /dev/null +++ b/reactos/base/applications/servman/resource.h @@ -0,0 +1,105 @@ +#define IDC_STATIC -1 + +/* about box info */ +#define IDD_ABOUTBOX 200 +#define IDC_LICENSE_EDIT 201 +#define IDS_LICENSE 202 + +#define IDC_SERVLIST 1000 +#define IDC_TOOLBAR 1001 +#define IDC_STATUSBAR 1002 + +#define ID_PROP 2000 +#define ID_REFRESH 2001 +#define ID_EXPORT 2002 +#define ID_START 2003 +#define ID_STOP 2004 +#define ID_PAUSE 2005 +#define ID_RESUME 2006 +#define ID_RESTART 2007 +#define ID_NEW 2008 +#define ID_HELP 2009 +#define ID_EXIT 2010 + +#define IDR_MAINMENU 102 +#define IDR_POPUP 103 +#define ID_VIEW_CUSTOMIZE 4021 +#define ID_ABOUT 4031 + +/* List view columns */ +#define IDS_FIRSTCOLUMN 1 +#define IDS_SECONDCOLUMN 2 +#define IDS_THIRDCOLUMN 3 +#define IDS_FOURTHCOLUMN 4 +#define IDS_FITHCOLUMN 5 + +/* tooltips */ +#define IDS_TOOLTIP_PROP 6000 +#define IDS_TOOLTIP_REFRESH 6001 +#define IDS_TOOLTIP_EXPORT 6002 +#define IDS_TOOLTIP_START 6003 +#define IDS_TOOLTIP_STOP 6004 +#define IDS_TOOLTIP_PAUSE 6005 +#define IDS_TOOLTIP_RESTART 6006 +#define IDS_TOOLTIP_NEW 6007 +#define IDS_TOOLTIP_HELP 6008 +#define IDS_TOOLTIP_EXIT 6009 + +#define IDS_SERVICES_STARTED 5000 +#define IDS_SERVICES_STOPPED 5001 +#define IDS_SERVICES_AUTO 5004 +#define IDS_SERVICES_MAN 5005 +#define IDS_SERVICES_DIS 5006 +#define IDS_NUM_SERVICES 5010 + +#define IDI_SM_ICON 50 +#define IDB_BUTTONS 51 + +/* toolbar buttons */ +#define TBICON_PROP 0 +#define TBICON_REFRESH 1 +#define TBICON_EXPORT 2 +#define TBICON_NEW 3 +#define TBICON_START 4 +#define TBICON_STOP 5 +#define TBICON_PAUSE 6 +#define TBICON_RESTART 7 +#define TBICON_HELP 8 +#define TBICON_EXIT 9 + +/* properties dialog */ +#define IDS_PROP_SHEET 10000 +#define IDD_DLG_GENERAL 10001 +#define IDC_SERV_NAME 10041 +#define IDC_DISP_NAME 10051 +#define IDC_DESCRIPTION 10061 +#define IDC_EXEPATH 10062 +#define IDC_START_TYPE 10101 +#define IDC_SERV_STATUS 10121 +#define IDC_START 10131 +#define IDC_STOP 10141 +#define IDC_PAUSE 10151 +#define IDC_RESUME 10161 +#define IDC_START_PARAM 10191 + +#define IDD_DLG_DEPEND 20001 +#define IDC_DEPEND_TREE1 20002 +#define IDC_DEPEND_TREE2 20003 +#define IDC_DEPEND_SERVICE 20004 + + +/* create service dialog */ +#define IDD_DLG_CREATE 8000 +#define IDC_CREATE_SERVNAME 8001 +#define IDC_CREATE_DISPNAME 8002 +#define IDC_CREATE_PATH 8003 +#define IDC_CREATE_DESC 8004 +#define IDC_CREATE_OPTIONS 8005 +#define ID_CREATE_HELP 8006 + +/* progress bar */ +#define IDD_DLG_PROGRESS 7000 +#define IDC_SERVCON_PROGRESS 7001 +#define IDC_SERVCON_INFO 7002 +#define IDC_SERVCON_NAME 7003 +#define IDS_PROGRESS_INFO 7004 diff --git a/reactos/base/applications/servman/servman.c b/reactos/base/applications/servman/servman.c new file mode 100644 index 00000000000..f186361c93f --- /dev/null +++ b/reactos/base/applications/servman/servman.c @@ -0,0 +1,552 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsys/system/servman/servman.c + * PURPOSE: Main window message handler + * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy + * + */ + +#include "servman.h" + +const TCHAR ClassName[] = _T("ServiceManager"); + +HINSTANCE hInstance; +HWND hMainWnd; +HWND hListView; +HWND hStatus; +HWND hTool; +HWND hProgDlg; +HMENU hShortcutMenu; +INT SelectedItem; + + +INT GetSelectedItem(VOID) +{ + return SelectedItem; +} + + +LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_CREATE: + { + TBADDBITMAP tbab; + INT iImageOffset; + INT statwidths[] = {110, -1}; /* widths of status bar */ + TCHAR szTemp[256]; + LVCOLUMN lvc = { 0 }; + + /* Toolbar buttons */ + TBBUTTON tbb [NUM_BUTTONS] = + { /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */ + {TBICON_PROP, ID_PROP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* properties */ + {TBICON_REFRESH, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* refresh */ + {TBICON_EXPORT, ID_EXPORT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* export */ + + /* Note: First item for a seperator is its width in pixels */ + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ + + {TBICON_NEW, ID_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* create */ + + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ + + {TBICON_START, ID_START, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* start */ + {TBICON_STOP, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* stop */ + {TBICON_PAUSE, ID_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* pause */ + {TBICON_RESTART, ID_RESTART, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* restart */ + + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */ + + {TBICON_HELP, ID_HELP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* help */ + {TBICON_EXIT, ID_EXIT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* exit */ + + }; + +/* ======================== Create Toolbar ============================== */ + + /* Create Toolbar */ + hTool = CreateWindowEx(0, + TOOLBARCLASSNAME, + NULL, + WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, + 0, 0, 0, 0, + hwnd, + (HMENU)IDC_TOOLBAR, + hInstance, + NULL); + if(hTool == NULL) + MessageBox(hwnd, _T("Could not create tool bar."), _T("Error"), MB_OK | MB_ICONERROR); + + /* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */ + SendMessage(hTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); + + /* Add custom images */ + tbab.hInst = hInstance; + tbab.nID = IDB_BUTTONS; + iImageOffset = (INT)SendMessage(hTool, TB_ADDBITMAP, NUM_BUTTONS, (LPARAM)&tbab); + tbb[0].iBitmap += iImageOffset; /* properties */ + tbb[1].iBitmap += iImageOffset; /* refresh */ + tbb[2].iBitmap += iImageOffset; /* export */ + tbb[4].iBitmap += iImageOffset; /* new */ + tbb[6].iBitmap += iImageOffset; /* start */ + tbb[7].iBitmap += iImageOffset; /* stop */ + tbb[8].iBitmap += iImageOffset; /* pause */ + tbb[9].iBitmap += iImageOffset; /* restart */ + tbb[11].iBitmap += iImageOffset; /* help */ + tbb[12].iBitmap += iImageOffset; /* exit */ + + /* Add buttons to toolbar */ + SendMessage(hTool, TB_ADDBUTTONS, NUM_BUTTONS, (LPARAM) &tbb); + + /* Show toolbar */ + ShowWindow(hTool, SW_SHOWNORMAL); + + + +/* ======================== Create List View ============================== */ + + hListView = CreateWindowEx(0, + WC_LISTVIEW, + NULL, + WS_CHILD | WS_VISIBLE | LVS_REPORT | WS_BORDER | + LBS_NOTIFY | LVS_SORTASCENDING | LBS_NOREDRAW, + 0, 0, 0, 0, /* sized via WM_SIZE */ + hwnd, + (HMENU) IDC_SERVLIST, + hInstance, + NULL); + if (hListView == NULL) + MessageBox(hwnd, _T("Could not create List View."), _T("Error"), MB_OK | MB_ICONERROR); + + ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT | + LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP); + + lvc.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT; + lvc.fmt = LVCFMT_LEFT; + + /* Add columns to the list-view */ + + /* name */ + lvc.iSubItem = 0; + lvc.cx = 150; + LoadString(hInstance, IDS_FIRSTCOLUMN, szTemp, 256); + lvc.pszText = szTemp; + ListView_InsertColumn(hListView, 0, &lvc); + + /* description */ + lvc.iSubItem = 1; + lvc.cx = 240; + LoadString(hInstance, IDS_SECONDCOLUMN, szTemp, 256); + lvc.pszText = szTemp; + ListView_InsertColumn(hListView, 1, &lvc); + + /* status */ + lvc.iSubItem = 2; + lvc.cx = 55; + LoadString(hInstance, IDS_THIRDCOLUMN, szTemp, 256); + lvc.pszText = szTemp; + ListView_InsertColumn(hListView, 2, &lvc); + + /* startup type */ + lvc.iSubItem = 3; + lvc.cx = 80; + LoadString(hInstance, IDS_FOURTHCOLUMN, szTemp, 256); + lvc.pszText = szTemp; + ListView_InsertColumn(hListView, 3, &lvc); + + /* logon as */ + lvc.iSubItem = 4; + lvc.cx = 100; + LoadString(hInstance, IDS_FITHCOLUMN, szTemp, 256); + lvc.pszText = szTemp; + ListView_InsertColumn(hListView, 4, &lvc); + + + +/* ======================== Create Status Bar ============================== */ + + hStatus = CreateWindowEx(0, + STATUSCLASSNAME, + NULL, + WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, + 0, 0, 0, 0, + hwnd, + (HMENU)IDC_STATUSBAR, + hInstance, + NULL); + if(hStatus == NULL) + MessageBox(hwnd, _T("Could not create status bar."), + _T("Error!"), MB_OK | MB_ICONERROR); + + SendMessage(hStatus, SB_SETPARTS, sizeof(statwidths)/sizeof(int), (LPARAM)statwidths); + + +/* ======================== Create Popup Menu ============================== */ + + hShortcutMenu = LoadMenu(hInstance, MAKEINTRESOURCE (IDR_POPUP)); + hShortcutMenu = GetSubMenu(hShortcutMenu, 0); + + + + +/* ================= populate the list view with all services =================== */ + + RefreshServiceList(); + + } + break; + + case WM_SIZE: + { + RECT rcTool; + int iToolHeight; + + RECT rcStatus; + int iStatusHeight; + + int lvHeight; + RECT rcClient; + + /* Size toolbar and get height */ + hTool = GetDlgItem(hwnd, IDC_TOOLBAR); + SendMessage(hTool, TB_AUTOSIZE, 0, 0); + + GetWindowRect(hTool, &rcTool); + iToolHeight = rcTool.bottom - rcTool.top; + + /* Size status bar and get height */ + hStatus = GetDlgItem(hwnd, IDC_STATUSBAR); + SendMessage(hStatus, WM_SIZE, 0, 0); + + GetWindowRect(hStatus, &rcStatus); + iStatusHeight = rcStatus.bottom - rcStatus.top; + + /* Calculate remaining height and size list view */ + GetClientRect(hwnd, &rcClient); + + lvHeight = rcClient.bottom - iToolHeight - iStatusHeight; + + hListView = GetDlgItem(hwnd, IDC_SERVLIST); + SetWindowPos(hListView, NULL, 0, iToolHeight, rcClient.right, lvHeight, SWP_NOZORDER); + } + break; + + case WM_NOTIFY: + { + NMHDR* nm = (NMHDR*) lParam; + + switch (nm->code) + { + case NM_DBLCLK: + OpenPropSheet(hwnd); + break; + + case LVN_ITEMCHANGED: + { + LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam; + + SelectedItem = pnmv->iItem; + + } + break; + + case TTN_GETDISPINFO: + { + LPTOOLTIPTEXT lpttt; + UINT idButton; + + lpttt = (LPTOOLTIPTEXT) lParam; + + /* Specify the resource identifier of the descriptive + * text for the given button. */ + idButton = (UINT)lpttt->hdr.idFrom; + switch (idButton) + { + case ID_PROP: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PROP); + break; + + case ID_REFRESH: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_REFRESH); + break; + + case ID_EXPORT: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXPORT); + break; + + case ID_START: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_START); + break; + + case ID_STOP: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_STOP); + break; + + case ID_PAUSE: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PAUSE); + break; + + case ID_RESTART: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_RESTART); + break; + + case ID_NEW: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_NEW); + break; + + case ID_HELP: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_HELP); + break; + + case ID_EXIT: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXIT); + break; + + } + } + break; + + default: + break; + } + } + break; + + case WM_CONTEXTMENU: + { + int xPos, yPos; + + xPos = GET_X_LPARAM(lParam); + yPos = GET_Y_LPARAM(lParam); + + TrackPopupMenuEx(hShortcutMenu, TPM_RIGHTBUTTON, + xPos, yPos, hwnd, NULL); + } + break; + + case WM_COMMAND: + + switch(LOWORD(wParam)) + { + case ID_PROP: + OpenPropSheet(hwnd); + + break; + + case ID_REFRESH: + RefreshServiceList(); + break; + + case ID_EXPORT: + break; + + case ID_START: + { + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + TCHAR buf1[100]; + TCHAR buf2[100]; + /* open the progress dialog */ + hProgDlg = CreateDialog(GetModuleHandle(NULL), + MAKEINTRESOURCE(IDD_DLG_PROGRESS), + hMainWnd, + (DLGPROC)ProgressDialogProc); + if (hProgDlg != NULL) + { + ShowWindow(hProgDlg, SW_SHOW); + + /* write the info to the progress dialog */ + LoadString(hInstance, IDS_PROGRESS_INFO, buf1, + sizeof(buf1) / sizeof(TCHAR)); + _sntprintf(buf2, 100, buf1, _T("start")); + SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, 0, (LPARAM)buf2); + + /* get pointer to selected service */ + Service = GetSelectedService(); + + /* write the service name to the progress dialog */ + SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, + (LPARAM)Service->lpServiceName); + } + + if ( DoStartService(hProgDlg) ) + { + LVITEM item; + TCHAR szStatus[64]; + + LoadString(hInstance, IDS_SERVICES_STARTED, szStatus, + sizeof(szStatus) / sizeof(TCHAR)); + item.pszText = szStatus; + item.iItem = GetSelectedItem(); + item.iSubItem = 2; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + SendMessage(hProgDlg, WM_DESTROY, 0, 0); + } + break; + + case ID_STOP: + { + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + TCHAR buf1[100]; + TCHAR buf2[100]; + /* open the progress dialog */ + hProgDlg = CreateDialog(GetModuleHandle(NULL), + MAKEINTRESOURCE(IDD_DLG_PROGRESS), + hMainWnd, + (DLGPROC)ProgressDialogProc); + if (hProgDlg != NULL) + { + ShowWindow(hProgDlg, SW_SHOW); + + /* write the info to the progress dialog */ + LoadString(hInstance, IDS_PROGRESS_INFO, buf1, + sizeof(buf1) / sizeof(TCHAR)); + _sntprintf(buf2, 100, buf1, _T("stop")); + SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, 0, (LPARAM)buf2); + + /* get pointer to selected service */ + Service = GetSelectedService(); + + /* write the service name to the progress dialog */ + SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, + (LPARAM)Service->lpServiceName); + } + + if( Control(hProgDlg, SERVICE_CONTROL_STOP) ) + { + LVITEM item; + + item.pszText = '\0'; + item.iItem = GetSelectedItem(); + item.iSubItem = 2; + SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + SendMessage(hProgDlg, WM_DESTROY, 0, 0); + } + break; + + case ID_PAUSE: + Control(hProgDlg, SERVICE_CONTROL_PAUSE); + break; + + case ID_RESUME: + Control(hProgDlg, SERVICE_CONTROL_CONTINUE ); + break; + + case ID_RESTART: + SendMessage(hMainWnd, WM_COMMAND, 0, ID_STOP); + SendMessage(hMainWnd, WM_COMMAND, 0, ID_START); + break; + + case ID_NEW: + break; + + case ID_HELP: + MessageBox(NULL, _T("Help is not yet implemented\n"), + _T("Note!"), MB_OK | MB_ICONINFORMATION); + break; + + case ID_EXIT: + PostMessage(hwnd, WM_CLOSE, 0, 0); + break; + + case ID_VIEW_CUSTOMIZE: + break; + + case ID_ABOUT: + DialogBox(hInstance, + MAKEINTRESOURCE(IDD_ABOUTBOX), + hMainWnd, + (DLGPROC)AboutDialogProc); + break; + + } + break; + + case WM_CLOSE: + FreeMemory(); /* free the service array */ + DestroyMenu(hShortcutMenu); + DestroyWindow(hwnd); + break; + + case WM_DESTROY: + PostQuitMessage(0); + break; + + default: + return DefWindowProc(hwnd, msg, wParam, lParam); + } + return 0; +} + +#ifdef _MSC_VER +#pragma warning(disable : 4100) +#endif +int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, + LPSTR lpCmdLine, int nCmdShow) +{ + WNDCLASSEX wc; + MSG Msg; + + hInstance = hThisInstance; + + InitCommonControls(); + + wc.cbSize = sizeof(WNDCLASSEX); + wc.style = 0; + wc.lpfnWndProc = WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON)); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAINMENU); + wc.lpszClassName = ClassName; + wc.hIconSm = (HICON)LoadImage(hInstance, + MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0); + + if(!RegisterClassEx(&wc)) + { + MessageBox(NULL, _T("Window Registration Failed!"), _T("Error!"), + MB_ICONEXCLAMATION | MB_OK); + return 0; + } + + hMainWnd = CreateWindowEx( + 0, + ClassName, + _T("ReactOS Service Manager"), + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, + CW_USEDEFAULT, CW_USEDEFAULT, 650, 450, + NULL, NULL, hInstance, NULL); + + if(hMainWnd == NULL) + { + MessageBox(NULL, _T("Window Creation Failed!"), _T("Error!"), + MB_ICONEXCLAMATION | MB_OK); + return 0; + } + + ShowWindow(hMainWnd, nCmdShow); + UpdateWindow(hMainWnd); + + while( GetMessage( &Msg, NULL, 0, 0 ) ) + { + if(! IsDialogMessage(hProgDlg, &Msg) ) + { + TranslateMessage(&Msg); + DispatchMessage(&Msg); + } + + } + return (int)Msg.wParam; +} + + + diff --git a/reactos/base/applications/servman/servman.h b/reactos/base/applications/servman/servman.h new file mode 100644 index 00000000000..be22a04f1c3 --- /dev/null +++ b/reactos/base/applications/servman/servman.h @@ -0,0 +1,40 @@ +#ifndef __SERVMAN_H +#define __SERVMAN_H + +#define WIN32_LEAN_AND_MEAN +#include +#include /* GET_X/Y_LPARAM */ +#include +#include +#include +#include "resource.h" + +#define MAX_KEY_LENGTH 256 +#define NUM_BUTTONS 13 +#define PROGRESSRANGE 8 + +BOOL RefreshServiceList(VOID); + +BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam); + +BOOL DoStartService(HWND hProgDlg); +BOOL Control(HWND hProgBar, DWORD Control); + +INT GetSelectedItem(VOID); + +ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(VOID); + +VOID GetError(DWORD); +VOID FreeMemory(VOID); +VOID DisplayString(PTCHAR); + +BOOL GetDescription(HKEY, LPTSTR *); +BOOL GetExecutablePath(LPTSTR *); + +LONG APIENTRY OpenPropSheet(HWND); + +DWORD GetServiceList(VOID); + + +#endif /* __SERVMAN_H */ diff --git a/reactos/base/applications/servman/servman.rc b/reactos/base/applications/servman/servman.rc new file mode 100644 index 00000000000..b771ab94f12 --- /dev/null +++ b/reactos/base/applications/servman/servman.rc @@ -0,0 +1,17 @@ +#include +#include +#include "resource.h" + + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Service Manager\0" +#define REACTOS_STR_INTERNAL_NAME "services\0" +#define REACTOS_STR_ORIGINAL_FILENAME "services.exe\0" +//#include + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +IDI_SM_ICON ICON "res/system.ico" + +#include "En.rc" +//#include "De.rc" /* I don't want to have to keep altering 2 files whilst developing */ + diff --git a/reactos/base/applications/servman/servman.xml b/reactos/base/applications/servman/servman.xml new file mode 100644 index 00000000000..37e8bce68b9 --- /dev/null +++ b/reactos/base/applications/servman/servman.xml @@ -0,0 +1,27 @@ + + . + + + + + 0x600 + 0x501 + kernel32 + user32 + advapi32 + version + comctl32 + shell32 + + about.c + control.c + geterror.c + progress.c + propsheet.c + query.c + servman.c + start.c + + servman.rc + servman.h + diff --git a/reactos/base/applications/servman/start.c b/reactos/base/applications/servman/start.c new file mode 100644 index 00000000000..25908fb8a7d --- /dev/null +++ b/reactos/base/applications/servman/start.c @@ -0,0 +1,132 @@ +/* + * PROJECT: ReactOS Services + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsys/system/servman/start.c + * PURPOSE: Start a service + * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy + * + */ + +#include "servman.h" + +extern HWND hListView; +extern HWND hMainWnd; + +BOOL DoStartService(HWND hProgDlg) +{ + HWND hProgBar; + SC_HANDLE hSCManager; + SC_HANDLE hSc; + SERVICE_STATUS_PROCESS ServiceStatus; + ENUM_SERVICE_STATUS_PROCESS *Service = NULL; + DWORD BytesNeeded = 0; + INT ArgCount = 0; + DWORD dwStartTickCount, dwOldCheckPoint; + + /* copy pointer to selected service */ + Service = GetSelectedService(); + + /* set the progress bar range and step */ + hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS); + SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE)); + SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0); + + /* open handle to the SCM */ + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + if (hSCManager == NULL) + { + GetError(0); + return FALSE; + } + + /* get a handle to the service requested for starting */ + hSc = OpenService(hSCManager, Service->lpServiceName, SERVICE_ALL_ACCESS); + if (hSc == NULL) + { + GetError(0); + return FALSE; + } + + /* start the service opened */ + if (! StartService(hSc, ArgCount, NULL)) + { + GetError(0); + return FALSE; + } + + /* query the state of the service */ + if (! QueryServiceStatusEx(hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)&ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS), + &BytesNeeded)) + { + GetError(0); + return FALSE; + } + + /* Save the tick count and initial checkpoint. */ + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + + /* loop whilst service is not running */ + /* FIXME: needs more control adding. 'Loop' is temparary */ + while (ServiceStatus.dwCurrentState != SERVICE_RUNNING) + { + DWORD dwWaitTime; + + dwWaitTime = ServiceStatus.dwWaitHint / 10; + + if( dwWaitTime < 500 ) + dwWaitTime = 500; + else if ( dwWaitTime > 5000 ) + dwWaitTime = 5000; + + /* increment the progress bar */ + SendMessage(hProgBar, PBM_STEPIT, 0, 0); + + /* wait before checking status */ + Sleep(ServiceStatus.dwWaitHint / 8); + + /* check status again */ + if (! QueryServiceStatusEx( + hSc, + SC_STATUS_PROCESS_INFO, + (LPBYTE)&ServiceStatus, + sizeof(SERVICE_STATUS_PROCESS), + &BytesNeeded)) + { + GetError(0); + return FALSE; + } + + if (ServiceStatus.dwCheckPoint > dwOldCheckPoint) + { + /* The service is making progress. increment the progress bar */ + SendMessage(hProgBar, PBM_STEPIT, 0, 0); + dwStartTickCount = GetTickCount(); + dwOldCheckPoint = ServiceStatus.dwCheckPoint; + } + else + { + if(GetTickCount() - dwStartTickCount > ServiceStatus.dwWaitHint) + { + /* No progress made within the wait hint */ + break; + } + } + } + + CloseServiceHandle(hSc); + + if (ServiceStatus.dwCurrentState == SERVICE_RUNNING) + { + SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0); + Sleep(1000); + return TRUE; + } + else + return FALSE; + +} + diff --git a/reactos/base/applications/winefile/Doxyfile b/reactos/base/applications/winefile/Doxyfile new file mode 100644 index 00000000000..41ba87a3ce4 --- /dev/null +++ b/reactos/base/applications/winefile/Doxyfile @@ -0,0 +1,1213 @@ +# Doxyfile 1.4.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = Winefile + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doxy-doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, +# Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = YES + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. + +SHOW_DIRECTORIES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the progam writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = NO + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = NO + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = . + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm + +FILE_PATTERNS = *.c \ + *.h + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = YES + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = doxy-footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 240 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = YES + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = YES + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = NO + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that a graph may be further truncated if the graph's +# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH +# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), +# the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = YES diff --git a/reactos/base/applications/winefile/Makefile.MinGW b/reactos/base/applications/winefile/Makefile.MinGW new file mode 100644 index 00000000000..b0ac8fdc320 --- /dev/null +++ b/reactos/base/applications/winefile/Makefile.MinGW @@ -0,0 +1,56 @@ +# +# Winefile Makefile for MinGW +# + +CC = gcc +LD = gcc + +CFLAGS = -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 +RCFLAGS = -D__WINDRES__ +LFLAGS = -Wl,--subsystem,windows + +ifdef DEBUG +CFLAGS += -D_DEBUG -g +RCFLAGS += -D_DEBUG +LFLAGS += -g +else +CFLAGS += -DNDEBUG -Os +RCFLAGS += -DNDEBUG +LFLAGS += -s +endif + +ifndef UNICODE +UNICODE = 1 +endif + +ifeq ($(UNICODE),1) +CFLAGS += -DUNICODE +#LFLAGS += -Wl,--entry,_wWinMain@16 +RCFLAGS += -DUNICODE +endif + +CXXFLAGS = $(CFLAGS) + +EXEC_SUFFIX = .exe +RES_SUFFIX = .coff + +PROGRAM = winefile + +OBJECTS = winefile.o + +LIBS = uuid user32 gdi32 advapi32 comctl32 shell32 comdlg32 ole32 version mpr + +DELAYIMPORTS = + +TARGET = $(PROGRAM)$(EXEC_SUFFIX) + +all: $(TARGET) + +$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) + $(LD) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS)) + +$(PROGRAM)$(RES_SUFFIX): $(PROGRAM).rc *.bmp *.ico + windres $(RCFLAGS) -o $@ $(PROGRAM).rc + +clean: + rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) diff --git a/reactos/base/applications/winefile/Sv.rc b/reactos/base/applications/winefile/Sv.rc new file mode 100644 index 00000000000..99984cf9cf3 --- /dev/null +++ b/reactos/base/applications/winefile/Sv.rc @@ -0,0 +1,209 @@ +/* + * WineFile + * Swedish Language Support + * + * Copyright 2005 David Nordenberg + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL +#pragma code_page(1252) + + +/* Menu */ + + +IDM_WINEFILE MENU FIXED IMPURE +{ + POPUP "&Arkiv" { + MENUITEM "&Öppna\tEnter", ID_ACTIVATE + MENUITEM "&Flytta...\tF7", ID_FILE_MOVE + MENUITEM "&Kopiera...\tF8", ID_FILE_COPY + MENUITEM "&I urklipp...\tF9", 118 + MENUITEM "&Ta bort\tDel", ID_FILE_DELETE + MENUITEM "&Byt namn...", 109 + MENUITEM "&Egenskaper...\tAlt+Enter", ID_EDIT_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "&Komprimera...", 119 + MENUITEM "Packa &upp...", 120 + MENUITEM SEPARATOR + MENUITEM "&Kör...", ID_EXECUTE + MENUITEM "&Skriv ut...", 102 + MENUITEM "Associera...", 103 + MENUITEM SEPARATOR + MENUITEM "Skapa mapp...", 111 + MENUITEM "&Sök...", 104 + MENUITEM "&Välj filer...", 116 + MENUITEM SEPARATOR +#ifndef _NO_EXTENSIONS + MENUITEM "&Avsluta\tAlt+X", ID_FILE_EXIT +#else + MENUITEM "&Avsluta", ID_FILE_EXIT +#endif + } + + POPUP "&Disk" { + MENUITEM "&Kopiera disk...", 201 + MENUITEM "&Namnge disk...", 202 + MENUITEM SEPARATOR + MENUITEM "&Formatera disk...", ID_FORMAT_DISK +#ifdef _WIN95 + MENUITEM "&Skapa systemdisk...", -1 /*TODO*/ +#endif + MENUITEM SEPARATOR + MENUITEM "Anslut &Nätverksenhet", ID_CONNECT_NETWORK_DRIVE + MENUITEM "&Koppla ifrån Nätverksenhet", ID_DISCONNECT_NETWORK_DRIVE + MENUITEM SEPARATOR + MENUITEM "Dela ut...", 254 + MENUITEM "&Ta bort utdelning...", 255 + MENUITEM SEPARATOR + MENUITEM "&Välj enhet...", 251 + } + + POPUP "&Träd" { + MENUITEM "&Nästa nivå\t+", 301 + MENUITEM "Utöka &träd\t*", 302 + MENUITEM "Utöka &alla\tCtrl+*", 303 + MENUITEM "Kollapsa &träd\t-", 304 + MENUITEM SEPARATOR + MENUITEM "&Markera undermappar", 505 + } + + POPUP "&Visa" { + MENUITEM "&Träd och mapp", 413 + MENUITEM "Bara tr&äd", 411 + MENUITEM "Bara &mapp", 412 + MENUITEM SEPARATOR + MENUITEM "De&la", ID_VIEW_SPLIT + MENUITEM SEPARATOR + MENUITEM "&Namn", ID_VIEW_NAME + MENUITEM "&Alla Fildetaljer", ID_VIEW_ALL_ATTRIBUTES, CHECKED + MENUITEM "&Vissa detaljer...", ID_VIEW_SELECTED_ATTRIBUTES + MENUITEM SEPARATOR + MENUITEM "&Sortera efter namn", ID_VIEW_SORT_NAME + MENUITEM "Sortera efter t&yp", ID_VIEW_SORT_TYPE + MENUITEM "Sortera efter st&orlek", ID_VIEW_SORT_SIZE + MENUITEM "Sortera efter &datum", ID_VIEW_SORT_DATE + MENUITEM SEPARATOR + MENUITEM "Sortera efter &...", ID_VIEW_FILTER + } + + POPUP "&Inställningar" { + MENUITEM "&Bekräftelse...", 501 + MENUITEM "&Teckensnitt...", ID_SELECT_FONT + MENUITEM "&Konfigurera verktygsfält...", 512 + MENUITEM SEPARATOR + MENUITEM "&Verktygsfält", ID_VIEW_TOOL_BAR, CHECKED + MENUITEM "&Enhetsfält", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "St&atusfält", ID_VIEW_STATUSBAR, CHECKED +#ifndef _NO_EXTENSIONS + MENUITEM "F&ullskärm\tCtrl+Shift+S", ID_VIEW_FULLSCREEN +#endif + MENUITEM SEPARATOR + MENUITEM "&Minimera vid körning", 504 + MENUITEM "&Spara ändringar vid stängning", 511 + } + + POPUP "&Säkerhet" { + MENUITEM "&Åtkomst...", 605 + MENUITEM "&Loggning...", 606 + MENUITEM "&Ägare...", 607 + } + + POPUP "&Fönster" { + MENUITEM "Nytt &fönster", ID_WINDOW_NEW + MENUITEM "Överlappande\tCtrl+F5", ID_WINDOW_CASCADE + MENUITEM "Ordna &horizontellt", ID_WINDOW_TILE_HORZ + MENUITEM "Ordna &vertikalt\tCtrl+F4", ID_WINDOW_TILE_VERT +#ifndef _NO_EXTENSIONS + MENUITEM "Ordna automatiskt", ID_WINDOW_AUTOSORT +#endif + MENUITEM "Ordna &symboler", ID_WINDOW_ARRANGE + MENUITEM "&Uppdatera\tF5", ID_REFRESH + } + + POPUP "&?" { + MENUITEM "&Hjälpavsnitt\tF1", ID_HELP + MENUITEM "Hjälp &sök...\tF1", ID_HELP + MENUITEM "&Använda hjälpen\tF1", ID_HELP_USING + MENUITEM SEPARATOR + MENUITEM "Information om &Winefile...", ID_ABOUT +#ifdef __WINE__ + MENUITEM "Info about &Wine...", ID_ABOUT_WINE +#endif + } +} + + +IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Kör" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Kommando:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + CONTROL "Som &symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14 + PUSHBUTTON "&Hjälp", 254, 158, 43, 47, 14 +} + +IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Välj mål" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Sökväg:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14 + PUSHBUTTON "&Bläddra", 254, 158, 43, 47, 14 +} + +STRINGTABLE +{ + IDS_FONT_SEL_DLG_NAME "Verkställ teckensnittsinställningar" + IDS_FONT_SEL_ERROR "Ett fel uppstog när ett nytt teckensnitt valdes." +} + +STRINGTABLE +{ + IDS_WINEFILE "Winefile" + IDS_ERROR "Fel" + IDS_ROOT_FS "root fs" + IDS_UNIXFS "unixfs" + IDS_DESKTOP "Skrivbord" + IDS_SHELL "Skal" + IDS_TITLEFMT "%s - %s" + IDS_NO_IMPL "Ej implementerat ännu" + IDS_WINE "WINE" + IDS_WINE_FILE "Wine File" +} + +STRINGTABLE +{ + IDS_COL_NAME "Namn" + IDS_COL_SIZE "Storlek" + IDS_COL_CDATE "CDatum" + IDS_COL_ADATE "ADatum" + IDS_COL_MDATE "MDatum" + IDS_COL_IDX "Index/Inode" + IDS_COL_LINKS "Länkar" + IDS_COL_ATTR "Attribut" + IDS_COL_SEC "Säkerhet" +} diff --git a/reactos/base/applications/winefile/cs.rc b/reactos/base/applications/winefile/cs.rc new file mode 100644 index 00000000000..26b10d8e7c7 --- /dev/null +++ b/reactos/base/applications/winefile/cs.rc @@ -0,0 +1,212 @@ +/* + * WineFile + * Czech Language Support + * + * Copyright 2000 Martin Fuchs + * Copyright 2002 Steven Edwards + * Copyright 2002 Alexandre Julliard + * Copyright 2004 David Kredba + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_CZECH, SUBLANG_NEUTRAL +#pragma code_page(1250) + + +/* Menu */ + +IDM_WINEFILE MENU FIXED IMPURE +{ + POPUP "&Soubor" { + MENUITEM "&Otevøít\tEnter", ID_ACTIVATE + MENUITEM "&Pøesunout...\tF7", ID_FILE_MOVE + MENUITEM "&Kopírovat...\tF8", ID_FILE_COPY + MENUITEM "&Ve schránce...\tF9", 118 + MENUITEM "&Smazat\tDel", ID_FILE_DELETE + MENUITEM "Pø&ejmenovat...", 109 + MENUITEM "V&lastnosti...\tAlt+Enter", ID_EDIT_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "&Komprese...", 119 + MENUITEM "&Dekomprese...", 120 + MENUITEM SEPARATOR + MENUITEM "&Spustit...", ID_EXECUTE + MENUITEM "&Tisknout...", 102 + MENUITEM "Asociovat...", 103 + MENUITEM SEPARATOR + MENUITEM "V&ytvoøit adresáø...", 111 + MENUITEM "&Hledat...", 104 + MENUITEM "&Zvolit voubory...", 116 + MENUITEM SEPARATOR +#ifndef _NO_EXTENSIONS + MENUITEM "K&onec\tAlt+X", ID_FILE_EXIT +#else + MENUITEM "K&onec", ID_FILE_EXIT +#endif + } + + POPUP "&Disk" { + MENUITEM "&Kopírovat disk...", 201 + MENUITEM "&Jmenovka disk...", 202 + MENUITEM SEPARATOR + MENUITEM "&Formátovat disk...", ID_FORMAT_DISK +#ifdef _WIN95 + MENUITEM "&Vytvoøit systemový disk...", -1 /*TODO*/ +#endif + MENUITEM SEPARATOR + MENUITEM "Pøipojit &síové zaøízení", ID_CONNECT_NETWORK_DRIVE + MENUITEM "&Odpojit &síové zaøízení", ID_DISCONNECT_NETWORK_DRIVE + MENUITEM SEPARATOR + MENUITEM "Sdílet jako...", 254 + MENUITEM "&Odstranit sdílení...", 255 + MENUITEM SEPARATOR + MENUITEM "&Zvolit zaøízení...", 251 + } + + POPUP "&Adresáøe" { + MENUITEM "&Další úroveò\t+", 301 + MENUITEM "Rozbalit &strom\t*", 302 + MENUITEM "Rozbalit &vše\tStrg+*", 303 + MENUITEM "Sbalit &strom\t-", 304 + MENUITEM SEPARATOR + MENUITEM "&Oznaèit potomky", 505 + } + + POPUP "&Zobrazení" { + MENUITEM "&Strom a adresáøe", 413 + MENUITEM "&Jen strom", 411 + MENUITEM "Jen &adresáøe", 412 + MENUITEM SEPARATOR + MENUITEM "&Rozdìlit", ID_VIEW_SPLIT + MENUITEM SEPARATOR + MENUITEM "&Jméno", ID_VIEW_NAME + MENUITEM "&Detaily všech souborù", ID_VIEW_ALL_ATTRIBUTES, CHECKED + MENUITEM "Èá&steèné detaily...", ID_VIEW_SELECTED_ATTRIBUTES + MENUITEM SEPARATOR + MENUITEM "&Tøídit podle jména", ID_VIEW_SORT_NAME + MENUITEM "Tøídit &podle typu", ID_VIEW_SORT_TYPE + MENUITEM "Tøídit podle &velikosti", ID_VIEW_SORT_SIZE + MENUITEM "Tøídit podle &data", ID_VIEW_SORT_DATE + MENUITEM SEPARATOR + MENUITEM "Tøídit podle &...", ID_VIEW_FILTER + } + + POPUP "&Nastavení" { + MENUITEM "&Potvrzování...", 501 + MENUITEM "&Písmo...", ID_SELECT_FONT + MENUITEM "Upravit panel &nástrojù...", 512 + MENUITEM SEPARATOR + MENUITEM "&Panel nástrojù", ID_VIEW_TOOL_BAR, CHECKED + MENUITEM "&Panel zaøíení", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "&Stavový øádek", ID_VIEW_STATUSBAR, CHECKED +#ifndef _NO_EXTENSIONS + MENUITEM "&Celaá obrazovka\tCtrl+Shift+S", ID_VIEW_FULLSCREEN +#endif + MENUITEM SEPARATOR + MENUITEM "&Minimalizovat pøi spuštìní", 504 + MENUITEM "&Uložit nastavení pøi vypnutí",511 + } + + + POPUP "&Zabezpeèení" { + MENUITEM "&Pøístup...", 605 + MENUITEM "&Logování...", 606 + MENUITEM "&Vlastník...", 607 + } + + POPUP "&Okno" { + MENUITEM "Nové &okno", ID_WINDOW_NEW + MENUITEM "Kaskádování\tCtrl+F5", ID_WINDOW_CASCADE + MENUITEM "Uspoøádat &horizontálnì", ID_WINDOW_TILE_HORZ + MENUITEM "Uspoøádat &vertikálnì\tCtrl+F4",ID_WINDOW_TILE_VERT +#ifndef _NO_EXTENSIONS + MENUITEM "Zarovnat automaticky", ID_WINDOW_AUTOSORT +#endif + MENUITEM "Zarovnat &symboly", ID_WINDOW_ARRANGE + MENUITEM "&Aktualizovat\tF5", ID_REFRESH + } + + POPUP "&?" { + MENUITEM "&Témata nápovìdy\tF1", ID_HELP + MENUITEM "Hledání v &nápovìdì...\tF1", ID_HELP + MENUITEM "&Jak používat nápovìdu\tF1", ID_HELP_USING + MENUITEM SEPARATOR + MENUITEM "&Informace o Winefile...", ID_ABOUT +#ifdef __WINE__ + MENUITEM "Informace o &Wine...", ID_ABOUT_WINE +#endif + } +} + + +IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Spustit" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Pøíkaz:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + CONTROL "Jako &Symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Zrušit", 2, 158, 23, 47, 14 + PUSHBUTTON "&Pomoc", 254, 158, 43, 47, 14 +} + +IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Zvolte cíl" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Cesta:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Zrušit", 2, 158, 23, 47, 14 + PUSHBUTTON "&Procházet", 254, 158, 43, 47, 14 +} + +STRINGTABLE +{ + IDS_FONT_SEL_DLG_NAME "Aplikování nastavení písma" + IDS_FONT_SEL_ERROR "Chyba pøi volbì nového písma." +} + +STRINGTABLE +{ + IDS_WINEFILE "Winefile" + IDS_ERROR "Chyba" + IDS_ROOT_FS "root fs" + IDS_UNIXFS "unixfs" + IDS_DESKTOP "Plocha" + IDS_SHELL "Pøíkazový øádek" + IDS_TITLEFMT "%s - %s" + IDS_NO_IMPL "Zatím neimplementováno" + IDS_WINE "WINE" + IDS_WINE_FILE "Wine File" +} + +STRINGTABLE +{ + IDS_COL_NAME "Jméno" + IDS_COL_SIZE "Velikost" + IDS_COL_CDATE "Datum vytvoøení" + IDS_COL_ADATE "Datum posledního pøístupu" + IDS_COL_MDATE "Datum poslední modifikace" + IDS_COL_IDX "Index/Inode" + IDS_COL_LINKS "Linky" + IDS_COL_ATTR "Atributy" + IDS_COL_SEC "Zabezpeèení" +} diff --git a/reactos/base/applications/winefile/de.rc b/reactos/base/applications/winefile/de.rc new file mode 100644 index 00000000000..a922f8327c4 --- /dev/null +++ b/reactos/base/applications/winefile/de.rc @@ -0,0 +1,262 @@ +/* + * Winefile + * German Language Support + * + * Copyright 2000, 2005 Martin Fuchs + * Copyright 2002 Steven Edwards + * Copyright 2002 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) + + +/* Menu */ + +IDM_WINEFILE MENU FIXED IMPURE +{ + POPUP "&Datei" { + MENUITEM "Ö&ffnen\tEingabetaste", ID_ACTIVATE + MENUITEM "&Verschieben...\tF7", ID_FILE_MOVE + MENUITEM "&Kopieren...\tF8", ID_FILE_COPY + MENUITEM "&In Zwischenablage...\tF9", 118 + MENUITEM "&Löschen\tEntf", ID_FILE_DELETE + MENUITEM "&Umbenennen...", 109 + MENUITEM "&Eigenschaften...\tAlt+Eingabetaste", ID_EDIT_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "K&omprimieren...", 119 + MENUITEM "Deko&mprimieren...", 120 + MENUITEM SEPARATOR + MENUITEM "&Ausführen...", ID_EXECUTE + MENUITEM "&Drucken...", 102 + MENUITEM "Zuord&nen...", 103 + MENUITEM SEPARATOR + MENUITEM "Ver&zeichnis erstellen...", 111 + MENUITEM "&Suchen...", 104 + MENUITEM "Dateien aus&wählen...", 116 + MENUITEM SEPARATOR + MENUITEM "&Beenden\tAlt+X", ID_FILE_EXIT + } + + POPUP "Da&tenträger" { + MENUITEM "Datenträger &kopieren...", 201 + MENUITEM "Datenträger &benennen...", 202 + MENUITEM SEPARATOR + MENUITEM "Datenträger &formatieren...", ID_FORMAT_DISK +#ifdef _WIN95 + MENUITEM "...", -1 /*TODO*/ +#endif + MENUITEM SEPARATOR + MENUITEM "Netzwerklaufwerk &verbinden...",ID_CONNECT_NETWORK_DRIVE + MENUITEM "Netzwerklaufwerk &trennen...",ID_DISCONNECT_NETWORK_DRIVE + MENUITEM SEPARATOR + MENUITEM "F&reigeben als...", 254 + MENUITEM "Freigabe been&den...", 255 + MENUITEM SEPARATOR + MENUITEM "Laufwerk aus&wählen...", 251 + } + + + POPUP "&Verzeichnisse" { + MENUITEM "&Nächste Ebene einblenden\t+",301 + MENUITEM "&Zweig einblenden\t*", 302 + MENUITEM "Alle &Ebenen einblenden\tStrg+*",303 + MENUITEM "Zweig &ausblenden\t-", 304 + MENUITEM SEPARATOR + MENUITEM "&Verzweigungen kennzeichnen", 505 + } + + POPUP "&Ansicht" { + MENUITEM "Struktur &und Verzeichnis", 413 + MENUITEM "Nur St&ruktur", 411 + MENUITEM "Nur &Verzeichnis", 412 + MENUITEM SEPARATOR + MENUITEM "&Teilen", ID_VIEW_SPLIT + MENUITEM SEPARATOR + MENUITEM "&Name", ID_VIEW_NAME + MENUITEM "A&lle Dateiangaben", ID_VIEW_ALL_ATTRIBUTES, CHECKED + MENUITEM "&Bestimmte Dateiangaben...", ID_VIEW_SELECTED_ATTRIBUTES + MENUITEM SEPARATOR + MENUITEM "Nach N&ame", ID_VIEW_SORT_NAME + MENUITEM "Nach T&yp", ID_VIEW_SORT_TYPE + MENUITEM "Nach &Größe", ID_VIEW_SORT_SIZE + MENUITEM "Nach &Datum", ID_VIEW_SORT_DATE + MENUITEM SEPARATOR + MENUITEM "Angaben ausw&ählen...", ID_VIEW_FILTER + } + + POPUP "&Optionen" { + MENUITEM "&Bestätigen...", 501 + MENUITEM "Schrift&art...", ID_SELECT_FONT + MENUITEM "Symbolleiste &definieren...", 512 + MENUITEM SEPARATOR + MENUITEM "Sy&mbolleiste", ID_VIEW_TOOL_BAR, CHECKED + MENUITEM "Lauf&werkleiste", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "&Statusleiste", ID_VIEW_STATUSBAR, CHECKED +#ifndef _NO_EXTENSIONS + MENUITEM "Vollb&ild\tStrg+Umschalt+S", ID_VIEW_FULLSCREEN +#endif + MENUITEM SEPARATOR + MENUITEM "&Symbol nach Programmstart", 504 + MENUITEM "&Einstellungen beim Beenden speichern", 511 + } + + POPUP "&Sicherheit" { + MENUITEM "&Berechtigungen...", 605 + MENUITEM "Über&wachen...", 606 + MENUITEM "Besi&tzer...", 607 + } + + POPUP "&Fenster" { + MENUITEM "Neues &Fenster", ID_WINDOW_NEW + MENUITEM "Über&lappend\tUmschalt+F5", ID_WINDOW_CASCADE + MENUITEM "&Untereinander", ID_WINDOW_TILE_HORZ + MENUITEM "&Nebeneinander\tUmschalt+F4", ID_WINDOW_TILE_VERT +#ifndef _NO_EXTENSIONS + MENUITEM "au&tomatisch anordnen", ID_WINDOW_AUTOSORT +#endif + MENUITEM "&Symbole anordnen", ID_WINDOW_ARRANGE + MENUITEM "&Aktualisieren\tF5", ID_REFRESH + } + + POPUP "&?" { + MENUITEM "&Hilfethemen\tF1", ID_HELP + MENUITEM "&Suchen...\tF1", ID_HELP + MENUITEM "Hilfe &verwenden\tF1", ID_HELP_USING + MENUITEM SEPARATOR + MENUITEM "&Info über Winefile...", ID_ABOUT +#ifdef __WINE__ + MENUITEM "Info über &Wine...", ID_ABOUT_WINE +#endif + } +} + + +IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ausführen" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "Befehls&zeile:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + CONTROL "Als &Symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Abbrechen", 2, 158, 23, 47, 14 + PUSHBUTTON "&Hilfe", 254, 158, 43, 47, 14 +} + +IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ziel auswählen" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Verzeichnis:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Abbrechen", 2, 158, 23, 47, 14 + PUSHBUTTON "&Durchsuchen", 254, 158, 43, 47, 14 +} + +IDD_DIALOG_VIEW_TYPE DIALOG DISCARDABLE 15, 13, 161, 97 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Angaben auswählen" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Name:",-1,7,8,22,10 + EDITTEXT IDC_VIEW_PATTERN,31,7,63,12,ES_AUTOHSCROLL + GROUPBOX "Dateityp",-1,7,23,87,56 + CONTROL "&Verzeichnisse",IDC_VIEW_TYPE_DIRECTORIES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,32,70,10 + CONTROL "&Programme",IDC_VIEW_TYPE_PROGRAMS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,43,70,10 + CONTROL "&Dokumente",IDC_VIEW_TYPE_DOCUMENTS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,54,70,10 + CONTROL "&Andere Dateien",IDC_VIEW_TYPE_OTHERS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,65,70,10 + CONTROL "Vers&teckte/Systemdateien anzeigen",IDC_VIEW_TYPE_HIDDEN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,81,106,9 + DEFPUSHBUTTON "OK",IDOK,104,7,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,104,24,50,14 +END + +IDD_DIALOG_PROPERTIES DIALOG DISCARDABLE 0, 0, 248, 215 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Eigenschaften für %s" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,191,7,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,191,29,50,14 + LTEXT "&Dateiname:",-1,7,7,59,9 + EDITTEXT IDC_STATIC_PROP_FILENAME,71,7,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "&Pfad:",-1,7,18,59,9 + EDITTEXT IDC_STATIC_PROP_PATH,71,18,120,9, ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "Letzte &Änderung:",-1,7,29,59,9 + EDITTEXT IDC_STATIC_PROP_LASTCHANGE,71,29,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "&Version:",-1,7,40,59,9 + EDITTEXT IDC_STATIC_PROP_VERSION,71,40,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "&Copyright:",-1,7,51,59,9 + EDITTEXT IDC_STATIC_PROP_COPYRIGHT,71,51,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "&Größe:",-1,7,62,59,9 + EDITTEXT IDC_STATIC_PROP_SIZE,71,62,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + GROUPBOX "Attribute",-1,7,79,158,46 + CONTROL "&Schreibgeschützt",IDC_CHECK_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,91,68,9 + CONTROL "&Versteckt",IDC_CHECK_HIDDEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,91,68,9 + CONTROL "&Archiv",IDC_CHECK_ARCHIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,101,68,9 + CONTROL "Sys&tem",IDC_CHECK_SYSTEM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,101,68,9 + CONTROL "&Komprimiert",IDC_CHECK_COMPRESSED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,17,111,68,9 + GROUPBOX "&Versionsinformationen",-1,7,129,234,79 + LISTBOX IDC_LIST_PROP_VERSION_TYPES,13,139,107,63,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_LIST_PROP_VERSION_VALUES,123,139,111,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL +END + + +STRINGTABLE +{ + IDS_FONT_SEL_DLG_NAME "Anwenden der Schriftarteinstellung" + IDS_FONT_SEL_ERROR "Fehler während der Schriftart-Auswahl." +} + +STRINGTABLE +{ + IDS_WINEFILE "Winefile" + IDS_ERROR "Fehler" + IDS_ROOT_FS "root fs" + IDS_UNIXFS "unixfs" + IDS_DESKTOP "Desktop" + IDS_SHELL "Shell" + IDS_TITLEFMT "%s - %s" + IDS_NO_IMPL "Noch nicht implementiert" + IDS_WINE "WINE" + IDS_WINE_FILE "Wine File" +} + +STRINGTABLE +{ + IDS_COL_NAME "Name" + IDS_COL_SIZE "Größe" + IDS_COL_CDATE "CDatum" + IDS_COL_ADATE "ZDatum" + IDS_COL_MDATE "ÄDatum" + IDS_COL_IDX "Index/Inode" + IDS_COL_LINKS "Links" + IDS_COL_ATTR "Attribute" + IDS_COL_SEC "Sicherheit" + + IDS_FREE_SPACE_FMT "%s von %s frei" +} diff --git a/reactos/base/applications/winefile/doxy-footer.html b/reactos/base/applications/winefile/doxy-footer.html new file mode 100644 index 00000000000..e0ea3bbe01a --- /dev/null +++ b/reactos/base/applications/winefile/doxy-footer.html @@ -0,0 +1,16 @@ +
+ + + + + +
+Winefile Source Code Documentation +
generated on 02.10.2005 by +doxygen +
+
+

Winefile Homepage +

+ + diff --git a/reactos/base/applications/winefile/doxy-footer.htmt b/reactos/base/applications/winefile/doxy-footer.htmt new file mode 100644 index 00000000000..0cb373766ad --- /dev/null +++ b/reactos/base/applications/winefile/doxy-footer.htmt @@ -0,0 +1,16 @@ +
+ + + + + +
+Winefile Source Code Documentation +
@GEN@ by +doxygen +
+
+

Winefile Homepage +

+ + diff --git a/reactos/base/applications/winefile/drivebar.bmp b/reactos/base/applications/winefile/drivebar.bmp new file mode 100644 index 0000000000000000000000000000000000000000..6feabbde6949a4e45390b18dc597c6fc4ef4fc4a GIT binary patch literal 742 zcmcJMu?+$-3`IW(DKzNTU=DhAU<6kLD%`;ataH;a1KshQLx9A^eb48t|$N8J)@ql+
diff --git a/reactos/base/applications/winefile/zh.rc b/reactos/base/applications/winefile/zh.rc new file mode 100644 index 00000000000..d68cd5e101b --- /dev/null +++ b/reactos/base/applications/winefile/zh.rc @@ -0,0 +1,161 @@ +/* + * WineFile + * Simplified Chinese Language Support + * + * Copyright 2002 liuspider + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED + +/* Menu */ + +IDM_WINEFILE MENU FIXED IMPURE +{ + POPUP "Îļþ£¨&F£©" { + MENUITEM "´ò¿ª£¨&O£©\tEnter", ID_ACTIVATE + MENUITEM "Òƶ¯£¨&M£©...\tF7", ID_FILE_MOVE + MENUITEM "¸´ÖÆ£¨&C£©...\tF8", ID_FILE_COPY + MENUITEM "λÓÚ¼ôÌù°å£¨&I£©...\tF9", 118 + MENUITEM "ɾ³ý£¨&D£©\tDel", ID_FILE_DELETE + MENUITEM "¸ÄÃû£¨&N£©...", 109 + MENUITEM "ÊôÐÔ£¨&I£©...\tAlt+Enter", ID_EDIT_PROPERTIES + MENUITEM SEPARATOR + MENUITEM "ѹËõ£¨&O£©...", 119 + MENUITEM "½âѹËõ£¨&O£©...", 120 + MENUITEM SEPARATOR + MENUITEM "ÔËÐУ¨&R£©...", ID_EXECUTE + MENUITEM "´òÓ¡£¨&P£©...", 102 + MENUITEM "ÅäÖÃÎļþÏà¹Ø...", 103 + MENUITEM SEPARATOR + MENUITEM "½¨Á¢Ä¿Â¼£¨&E£©...", 111 + MENUITEM "²éÕÒ£¨&H£©...", 104 + MENUITEM "Ñ¡ÔñÎļþ£¨&S£©...", 116 + MENUITEM SEPARATOR +#ifndef _NO_EXTENSIONS + MENUITEM "Í˳ö£¨&X£©\tAlt+X", ID_FILE_EXIT +#else + MENUITEM "Í˳ö£¨&X£©", ID_FILE_EXIT +#endif + } + + POPUP "´ÅÅÌ£¨&D£©" { + MENUITEM "¸´ÖÆ£¨&C£©...", 201 + MENUITEM "ÃüÃû£¨&L£©...", 202 + MENUITEM SEPARATOR + MENUITEM "¸ñʽ»¯£¨&£©...", ID_FORMAT_DISK +#ifdef _WIN95 + MENUITEM "½¨Á¢ÏµÍ³ÅÌ£¨&M£©...", -1 /*TODO*/ +#endif + MENUITEM SEPARATOR + MENUITEM "Á¬½ÓÍøÂçÇý¶¯Æ÷£¨&N£©", ID_CONNECT_NETWORK_DRIVE + MENUITEM "¶Ï¿ªÍøÂçÇý¶¯Æ÷Á¬½Ó£¨&D£©", ID_DISCONNECT_NETWORK_DRIVE + MENUITEM SEPARATOR + MENUITEM "¹²ÏíΪ...", 254 + MENUITEM "ɾ³ý¹²Ïí£¨&R£©...", 255 + MENUITEM SEPARATOR + MENUITEM "Ñ¡ÔñÇý¶¯Æ÷£¨&S£©...", 251 + } + + POPUP "Ŀ¼£¨&D£©" { + MENUITEM "ÏÂÒ»²ã£¨&N£©\t+", 301 + MENUITEM "Õ¹¿ª£¨&T£©\t*", 302 + MENUITEM "È«²¿Õ¹¿ª£¨&A£©\tStrg+*", 303 + MENUITEM "ÕÛµþ£¨&R£©\t-", 304 + MENUITEM SEPARATOR + MENUITEM "±ê¼Ç×ÓĿ¼£¨&M£©", 505 + } + + POPUP "ÊÓͼ£¨&V£©" { + MENUITEM "Ŀ¼Ê÷»úÆ÷ÄÚÈÝ£¨&R£©", 413 + MENUITEM "½öÏÔʾĿ¼Ê÷£¨&E£©", 411 + MENUITEM "½öÏÔʾĿ¼ÄÚÈÝ£¨&O£©", 412 + MENUITEM SEPARATOR + MENUITEM "·Ö¸î£¨&L£©", ID_VIEW_SPLIT + MENUITEM SEPARATOR + MENUITEM "ÎļþÃûÃû£¨&N£©", ID_VIEW_NAME + MENUITEM "ÎļþÏêϤÁÐ±í£¨&A£©", ID_VIEW_ALL_ATTRIBUTES, CHECKED + MENUITEM "²¿·ÖÊôÐÔ£¨&P£©...", ID_VIEW_SELECTED_ATTRIBUTES + MENUITEM SEPARATOR + MENUITEM "°´ÎļþÃûÅÅÐò£¨&S£©", ID_VIEW_SORT_NAME + MENUITEM "°´ÀàÐÍÅÅÐò£¨&B£©", ID_VIEW_SORT_TYPE + MENUITEM "°´´óСÅÅÐò£¨&Z£©", ID_VIEW_SORT_SIZE + MENUITEM "°´ÈÕÆÚÅÅÐò£¨&D£©", ID_VIEW_SORT_DATE + MENUITEM SEPARATOR + MENUITEM "¶¨ÖÆÅÅÐò...", ID_VIEW_FILTER + } + + POPUP "Ñ¡Ï&O£©" { + MENUITEM "È·¶¨·½Ê½£¨&C£©...", 501 + MENUITEM "×ÖÌ壨&F£©...", ID_SELECT_FONT + MENUITEM "¶¨Öƹ¤¾ßÌõ£¨&B£©...", 512 + MENUITEM SEPARATOR + MENUITEM "¹¤¾ßÌõ£¨&T£©", ID_VIEW_TOOL_BAR, CHECKED + MENUITEM "Çý¶¯Æ÷ÁÐ±í£¨&D£©", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "״̬À¸£¨&S£©", ID_VIEW_STATUSBAR, CHECKED +#ifndef _NO_EXTENSIONS + MENUITEM "È«ÆÁ£¨&U£©\tCtrl+Shift+S", ID_VIEW_FULLSCREEN +#endif + MENUITEM SEPARATOR + MENUITEM "&Minimize on run", 504 + MENUITEM "&Save settings on exit", 511 + } + + + POPUP "°²È«£¨&S£©" { + MENUITEM "·ÃÎÊ£¨&A£©...", 605 + MENUITEM "µÇ¼£¨&L£©...", 606 + MENUITEM "ËùÓÐÕߣ¨&O£©...", 607 + } + + POPUP "´°¿Ú£¨&W£©" { + MENUITEM "н¨£¨&W)", ID_WINDOW_NEW + MENUITEM "²ãµþ\tCtrl+F5", ID_WINDOW_CASCADE + MENUITEM "ˮƽƽÆÌ£¨&H£©", ID_WINDOW_TILE_HORZ + MENUITEM "´¹Ö±Æ½ÆÌ£¨&£©\tCtrl+F4", ID_WINDOW_TILE_VERT +#ifndef _NO_EXTENSIONS + MENUITEM "×Ô¶¯ÅÅÁÐ", ID_WINDOW_AUTOSORT +#endif + MENUITEM "×Ô¶¯ÅÅÁÐͼ±ê£¨&S£©", ID_WINDOW_ARRANGE + MENUITEM "ˢУ¨&R£©\tF5", ID_REFRESH + } + + POPUP "&?" { + MENUITEM "°ïÖúÖ÷Ì⣨&H£©\tF1", ID_HELP + MENUITEM "ËÑË÷°ïÖú£¨&S£©...\tF1", ID_HELP + MENUITEM "ʹÓðïÖú£¨&U£©\tF1", ID_HELP_USING + MENUITEM SEPARATOR + MENUITEM "&¹ØÓÚ Winefile...", ID_ABOUT +#ifdef __WINE__ + MENUITEM "¹ØÓÚ &Wine...", ID_ABOUT_WINE +#endif + } +} + + +IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ÔËÐÐ" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "ÃüÁ&C£©£º", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + CONTROL "×÷ΪÁ¬½Ó£¨&S£©", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12 + DEFPUSHBUTTON "È·¶¨", 1, 158, 6, 47, 14 + PUSHBUTTON "È¡Ïû", 2, 158, 23, 47, 14 + PUSHBUTTON "°ïÖú£¨&H£©", 254, 158, 43, 47, 14 +}