--- /dev/null
+/* Device manager
+ * (C) 2005 - Hervé Poussineau (hpoussin@reactos.org)
+ * GUI: Michael Fritscher (michael@fritscher.net)
+ *
+ */
+
+#define INITGUID
+#include <windows.h>
+#include <setupapi.h>
+#include <stdio.h>
+#include <tchar.h>
+#include <commctrl.h>
+#include <windows.h>
+#include <commctrl.h>
+#if defined (__GNUC__)
+#include <winioctl.h>
+#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
+ );
+}
--- /dev/null
+/* $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 <reactos/version.rc>
--- /dev/null
+<module name="devmgrapp" type="win32cui" installbase="system32" installname="devmgr.exe">
+ <define name="__USE_W32API" />
+ <define name="DEFINE_GUID" />
+ <library>ntdll</library>
+ <library>setupapi</library>
+ <library>gdi32</library>
+ <library>kernel32</library>
+ <library>user32</library>
+ <library>comctl32</library>
+ <file>devmgr.c</file>
+ <efile>devmgr.rc</efile>
+</module>
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*\r
+ * PROJECT: ReactOS utilities\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: apps/utils/getfirefox/En.rc\r
+ * PURPOSE: French resources\r
+ * COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers\r
+ * Copyright 2005 Ge van Geldorp (gvg@reactos.org)\r
+ * Copyright 2005 G. Maton (mustang9@gmail.com) - French translation\r
+ */\r
+/*\r
+ * Based on Wine dlls/shdocvw/En.rc\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT\r
+\r
+IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76\r
+STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Téléchargement de Firefox"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12\r
+ LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER\r
+ CHECKBOX "Supprimer ""Obtenir Firefox"" du Menu démarrer une fois terminé", IDC_REMOVE,\r
+ 10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP\r
+ PUSHBUTTON "Annuler", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP\r
+}\r
+\r
+STRINGTABLE\r
+BEGIN\r
+ IDS_START_MENU_NAME "Obtenir Firefox"\r
+END\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS utilities\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: apps/utils/getfirefox/En.rc\r
+ * PURPOSE: English resources\r
+ * COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers\r
+ * Copyright 2005 Ge van Geldorp (gvg@reactos.org)\r
+ * Copyright 2005 Robert Horvath (talley@cubeclub.hu) - Hungarian translation\r
+ */\r
+/*\r
+ * Based on Wine dlls/shdocvw/En.rc\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+LANGUAGE LANG_HUNGARIAN, SUBLANG_NEUTRAL\r
+\r
+IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76\r
+STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "A Firefox letöltése"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12\r
+ LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER\r
+ CHECKBOX "A ""Szerezd meg a Firefoxot"" elvátolítása a Start Menübõl befejezés után", IDC_REMOVE,\r
+ 10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP\r
+ PUSHBUTTON "Mégse", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP\r
+}\r
+\r
+STRINGTABLE\r
+BEGIN\r
+ IDS_START_MENU_NAME "Szerezd meg Firefoxot"\r
+END\r
--- /dev/null
+/*
+ * 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 <precomp.h>
+
+#define NDEBUG
+#include <debug.h>
+
+#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;
+}
--- /dev/null
+/*
+ * 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 <windows.h>
+#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 <reactos/version.rc>
+
+/*
+ * 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"
--- /dev/null
+<module name="getfirefox" type="win32gui" installbase="system32" installname="getfirefox.exe">
+ <include base="getfirefox">.</include>
+ <define name="UNICODE" />
+ <define name="_UNICODE" />
+ <define name="__USE_W32API" />
+ <define name="WINVER">0x0501</define>
+ <define name="_WIN32_IE>0x0600</define>
+ <library>comctl32</library>
+ <library>ntdll</library>
+ <library>shell32</library>
+ <library>shlwapi</library>
+ <library>urlmon</library>
+ <library>uuid</library>
+ <pch>precomp.h</pch>
+ <file>getfirefox.c</file>
+ <file>getfirefox.rc</file>
+</module>
--- /dev/null
+/*
+ * PROJECT: ReactOS utilities
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: apps/utils/getfirefox/precomp.h
+ * PURPOSE: Precompiled header file
+ * COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg@reactos.org)
+ */
+
+#define COBJMACROS
+#define NTOS_MODE_USER
+#define WIN32_NO_STATUS
+#include <windows.h>
+#include <ndk/ntndk.h>
+#include <commctrl.h>
+#include <shlobj.h>
+#include <shlwapi.h>
+#include <urlmon.h>
+
+#include "resource.h"
--- /dev/null
+/*
+ * PROJECT: ReactOS utilities
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: apps/utils/getfirefox/resource.h
+ * PURPOSE: Resource constants
+ * COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg@reactos.org)
+ */
+
+#define IDI_ICON_MAIN 1
+
+#define IDD_GETFIREFOX 100
+
+#define IDC_PROGRESS 1000
+#define IDC_STATUS 1001
+#define IDC_REMOVE 1002
+
+#define IDS_START_MENU_NAME 1100
--- /dev/null
+/*
+ * ReactOS Win32 Applications
+ * Copyright (C) 2005 ReactOS Team
+ *
+ * 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.
+ *
+ * This 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/* $Id$
+ *
+ * COPYRIGHT : See COPYING in the top level directory
+ * PROJECT : ReactOS/Win32 get host name
+ * FILE : subsys/system/hostname/hostname.c
+ * PROGRAMMER: Emanuele Aliberti (ea@reactos.com)
+ */
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+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 */
--- /dev/null
+#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 <reactos/version.rc>
--- /dev/null
+<module name="hostname" type="win32cui" installbase="system32" installname="hostname.exe" allowwarnings="true">
+ <define name="__USE_W32API" />
+ <library>kernel32</library>
+ <file>hostname.c</file>
+ <file>hostname.rc</file>
+</module>
+
--- /dev/null
+//Microsoft Developer Studio generated resource script.\r
+//\r
+#include "ibrowser_intres.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include <windows.h>\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// German (Germany) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "ibrowser_intres.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#include <windows.h>\0"\r
+END\r
+\r
+3 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#ifndef _ROS_\r\n"\r
+ "LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r\n"\r
+ "STRINGTABLE DISCARDABLE \r\n"\r
+ "BEGIN\r\n"\r
+ "#ifdef UNICODE\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n"\r
+ "#else\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n"\r
+ "#endif\r\n"\r
+ "END\r\n"\r
+ "#endif\r\n"\r
+ "\0"\r
+END\r
+\r
+#endif // APSTUDIO_INVOKED\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Menu\r
+//\r
+\r
+IDM_SDIFRAME MENU PRELOAD DISCARDABLE \r
+BEGIN\r
+ POPUP "&Datei"\r
+ BEGIN\r
+ MENUITEM "&Beenden", ID_FILE_EXIT\r
+ END\r
+ POPUP "&Ansicht"\r
+ BEGIN\r
+ MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR\r
+ MENUITEM "S&ide Bar", ID_VIEW_SIDE_BAR, GRAYED\r
+ MENUITEM "&Status Bar", ID_VIEW_STATUSBAR\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Aktualisieren\tF5", ID_REFRESH\r
+ MENUITEM "&Vollbild\tCtrl+Shift+S", ID_VIEW_FULLSCREEN\r
+ END\r
+ POPUP "&Hilfe"\r
+ BEGIN\r
+ MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ\r
+ MENUITEM "&About IBrowser...", ID_ABOUT_IBROWSER\r
+ MENUITEM "About &OS...", ID_ABOUT_WINDOWS\r
+ END\r
+END\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Dialog\r
+//\r
+\r
+IDD_ABOUT_IBROWSER DIALOG DISCARDABLE 0, 0, 199, 106\r
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "About ReactOS Web Browser"\r
+FONT 10, "MS Sans Serif"\r
+BEGIN\r
+ LTEXT "ReactOS Web Browser",IDC_ROS_IBROWSER,91,13,104,11\r
+ LTEXT "V 0.9",IDC_VERSION_TXT,91,27,104,8\r
+ LTEXT "(c) 2005 Martin Fuchs",IDC_STATIC,91,42,104,8\r
+ LTEXT "",IDC_WIN_VERSION,91,58,98,22\r
+ LTEXT "http://www.sky.franken.de/explorer/",IDC_WWW,17,84,129,\r
+ 8\r
+ CONTROL "&OK",IDOK,"Button",BS_OWNERDRAW | BS_FLAT | WS_GROUP,\r
+ 154,90,38,12\r
+END\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// String Table\r
+//\r
+\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+ IDS_TITLE "Reactos Internet Web Browser"\r
+ IDS_EMPTY "(Empty)"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+ IDS_ABOUT_IBROWSER "&Über..."\r
+END\r
+\r
+#endif // German (Germany) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+#ifndef _ROS_\r
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+#ifdef UNICODE\r
+IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s"\r
+#else\r
+IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s"\r
+#endif\r
+END\r
+#endif\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif // not APSTUDIO_INVOKED\r
+\r
--- /dev/null
+//Microsoft Developer Studio generated resource script.
+//
+#include "ibrowser_intres.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include <windows.h>
+/////////////////////////////////////////////////////////////////////////////
+#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 <windows.h>\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
+
--- /dev/null
+//Microsoft Developer Studio generated resource script.
+//
+#include "ibrowser_intres.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include <windows.h>
+/////////////////////////////////////////////////////////////////////////////
+#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 <windows.h>\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
+
--- /dev/null
+//Microsoft Developer Studio generated resource script.\r
+//\r
+#include "ibrowser_intres.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include <windows.h>\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// German (Germany) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "ibrowser_intres.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#include <windows.h>\r\n"\r
+ "\0"\r
+END\r
+\r
+#endif // APSTUDIO_INVOKED\r
+\r
+#endif // German (Germany) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// French (France) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+3 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#ifndef _ROS_\r\n"\r
+ "LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r\n"\r
+ "STRINGTABLE DISCARDABLE \r\n"\r
+ "BEGIN\r\n"\r
+ "#ifdef UNICODE\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""Navigateur Internet de ReactOS%0s""\r\n"\r
+ "#else\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""Navigateur Internet de ReactOS Ansi%0s""\r\n"\r
+ "#endif\r\n"\r
+ "END\r\n"\r
+ "#endif\r\n"\r
+ "\0"\r
+END\r
+\r
+#endif // APSTUDIO_INVOKED\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Menu\r
+//\r
+\r
+IDM_SDIFRAME MENU PRELOAD DISCARDABLE \r
+BEGIN\r
+ POPUP "&Fichier"\r
+ BEGIN\r
+ MENUITEM "&Ouvrir", ID_FILE_OPEN\r
+ MENUITEM "&Quitter", ID_FILE_EXIT\r
+ END\r
+ POPUP "&Affichage"\r
+ BEGIN\r
+ MENUITEM "Barre d'ou&tils", ID_VIEW_TOOL_BAR\r
+ MENUITEM "Pann&eau lat?al", ID_VIEW_SIDE_BAR, GRAYED\r
+ MENUITEM "&Barre d'?at", ID_VIEW_STATUSBAR\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Actualise&r", ID_REFRESH\r
+ MENUITEM "&Plein ?ran", ID_VIEW_FULLSCREEN\r
+ END\r
+ POPUP "&Aide"\r
+ BEGIN\r
+ MENUITEM "&Rubriques d'aide de iBrowser", ID_IBROWSER_FAQ\r
+ MENUITEM "? propos de iBrowser...", ID_ABOUT_IBROWSER\r
+ MENUITEM "? propos de ReactOS...", ID_ABOUT_WINDOWS\r
+ END\r
+END\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// String Table\r
+//\r
+\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+ IDS_TITLE "Navigateur internet de Reactos"\r
+ IDS_EMPTY "(Vide)"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+ IDS_ABOUT_IBROWSER "? propos de iBrowser..."\r
+END\r
+\r
+#endif // French (France) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+#ifndef _ROS_\r
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+#ifdef UNICODE\r
+IDS_IBROWSER_VERSION_STR "Navigateur Internet de ReactOS%0s"\r
+#else\r
+IDS_IBROWSER_VERSION_STR "Navigateur Internet de ReactOS Ansi%0s"\r
+#endif\r
+END\r
+#endif\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif // not APSTUDIO_INVOKED\r
+\r
--- /dev/null
+//Microsoft Developer Studio generated resource script.\r
+//\r
+#include "ibrowser_intres.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include <windows.h>\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// German (Germany) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "ibrowser_intres.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#include <windows.h>\0"\r
+END\r
+\r
+3 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#ifndef _ROS_\r\n"\r
+ "LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT\r\n"\r
+ "STRINGTABLE DISCARDABLE \r\n"\r
+ "BEGIN\r\n"\r
+ "#ifdef UNICODE\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""A ReactOS %s webböngészõ%0s""\r\n"\r
+ "#else\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""A ReactOS %s webböngészõ Ansi%0s""\r\n"\r
+ "#endif\r\n"\r
+ "END\r\n"\r
+ "#endif\r\n"\r
+ "\0"\r
+END\r
+\r
+#endif // APSTUDIO_INVOKED\r
+\r
+#endif // German (Germany) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+#ifndef _ROS_\r
+LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+#ifdef UNICODE\r
+IDS_IBROWSER_VERSION_STR "A ReactOS %s webböngészõ%0s"\r
+#else\r
+IDS_IBROWSER_VERSION_STR "A ReactOS %s webböngészõ Ansi%0s"\r
+#endif\r
+END\r
+#endif\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif // not APSTUDIO_INVOKED\r
+\r
--- /dev/null
+//Microsoft Developer Studio generated resource script.
+//
+#include "ibrowser_intres.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include <windows.h>
+/////////////////////////////////////////////////////////////////////////////
+#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 "\83t\83@\83C\83\8b(&F)"
+ BEGIN
+ MENUITEM "\8aJ\82(&O)", ID_FILE_OPEN
+ MENUITEM "\8fI\97¹(&X)", ID_FILE_EXIT
+ END
+ POPUP "\95\\\8e¦(&V)"
+ BEGIN
+ MENUITEM "\83c\81[\83\8b \83o\81[(&T)", ID_VIEW_TOOL_BAR
+ MENUITEM "\83T\83C\83h \83o\81[(&I)", ID_VIEW_SIDE_BAR, GRAYED
+ MENUITEM "\83X\83e\81[\83^\83X \83o\81[(&S)", ID_VIEW_STATUSBAR
+ MENUITEM SEPARATOR
+ MENUITEM "\8dÅ\90V\82Ì\8fî\95ñ\82É\8dX\90V(&R)\tF5", ID_REFRESH
+ MENUITEM "\91S\89æ\96Ê\95\\\8e¦(&I)\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+ END
+ POPUP "\83w\83\8b\83v(&H)"
+ BEGIN
+ MENUITEM "IBrowser FAQ (&F)...", ID_IBROWSER_FAQ
+ MENUITEM "IBrowser \82É\82Â\82¢\82Ä(&A)...", ID_ABOUT_IBROWSER
+ MENUITEM "OS \82É\82Â\82¢\82Ä(&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 "\83o\81[\83W\83\87\83\93\8fî\95ñ(&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 <windows.h>\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
+
--- /dev/null
+#\r
+# ROS Internet Web Browser\r
+#\r
+# Makefile.MinGW\r
+#\r
+\r
+CC = gcc\r
+CXX = g++\r
+LINK = g++\r
+\r
+CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -Wno-unused-value -I. -I$(EXPAT_INC)\r
+RCFLAGS = -DWIN32 -D__WINDRES__\r
+LFLAGS = -Wl,--subsystem,windows\r
+\r
+ifdef DEBUG\r
+CFLAGS += -D_DEBUG -g\r
+RCFLAGS += -D_DEBUG\r
+LFLAGS += -g\r
+else\r
+CFLAGS += -DNDEBUG -Os\r
+RCFLAGS += -DNDEBUG\r
+LFLAGS += -s\r
+endif\r
+\r
+ifndef UNICODE\r
+UNICODE = 1\r
+endif\r
+\r
+ifeq ($(UNICODE),1)\r
+CFLAGS += -DUNICODE\r
+# LFLAGS+= -Wl,--entry,_wWinMain@16\r
+RCFLAGS += -DUNICODE\r
+endif\r
+\r
+CXXFLAGS = $(CFLAGS)\r
+\r
+EXEC_SUFFIX = .exe\r
+RES_SUFFIX = .coff\r
+\r
+VPATH = utility\r
+\r
+PROGRAM = ibrowser\r
+\r
+TARGET = $(PROGRAM)$(EXEC_SUFFIX)\r
+\r
+OBJECTS = \\r
+ utility.o \\r
+ window.o \\r
+ ibrowser.o \\r
+ webchild.o \\r
+ mainframe.o \\r
+ favorites.o \\r
+ xmlstorage.o\r
+\r
+LIBS = gdi32 comctl32 shell32 ole32 uuid oleaut32\r
+\r
+all: $(TARGET)\r
+\r
+$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) libexpat.dll\r
+ $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS))\r
+\r
+ibrowser$(RES_SUFFIX): $(PROGRAM)_intres.rc res/*.bmp res/*.ico\r
+ windres $(RCFLAGS) -o $@ $(PROGRAM)_intres.rc\r
+\r
+clean:\r
+ rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) \\r
+ desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o\r
--- /dev/null
+#\r
+# ROS Internet Web Browser\r
+#\r
+# Makefile.PCH\r
+#\r
+# MinGW Makefile with precompiled header support\r
+#\r
+\r
+CC = gcc\r
+CXX = g++\r
+LINK = g++\r
+\r
+CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -Wno-unused-value -I. -I$(EXPAT_INC)\r
+RCFLAGS = -DWIN32 -D__WINDRES__\r
+LFLAGS = -Wl,--subsystem,windows\r
+\r
+ifdef DEBUG\r
+CFLAGS += -D_DEBUG -g\r
+RCFLAGS += -D_DEBUG\r
+LFLAGS += -g\r
+else\r
+CFLAGS += -DNDEBUG -Os -march=pentium4\r
+RCFLAGS += -DNDEBUG\r
+LFLAGS += -s\r
+endif\r
+\r
+ifndef UNICODE\r
+UNICODE = 1\r
+endif\r
+\r
+ifeq ($(UNICODE),1)\r
+CFLAGS += -DUNICODE\r
+# LFLAGS+= -Wl,--entry,_wWinMain@16\r
+RCFLAGS += -DUNICODE\r
+endif\r
+\r
+CXXFLAGS = $(CFLAGS)\r
+\r
+EXEC_SUFFIX = .exe\r
+RES_SUFFIX = .coff\r
+\r
+VPATH = utility\r
+\r
+PROGRAM = ibrowser\r
+\r
+TARGET = $(PROGRAM)$(EXEC_SUFFIX)\r
+\r
+OBJECTS = \\r
+ utility.o \\r
+ window.o \\r
+ ibrowser.o \\r
+ webchild.o \\r
+ mainframe.o \\r
+ favorites.o \\r
+ xmlstorage.o\r
+\r
+LIBS = gdi32 comctl32 shell32 ole32 oleaut32 uuid\r
+\r
+all: precomp.h.gch $(TARGET)\r
+\r
+precomp.h.gch: *.h utility/*.h\r
+ $(CXX) $(CFLAGS) precomp.h\r
+\r
+$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) libexpat.dll\r
+ $(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS))\r
+\r
+ibrowser$(RES_SUFFIX): $(PROGRAM)_intres.rc res/*.bmp res/*.ico\r
+ windres $(RCFLAGS) -o $@ $(PROGRAM)_intres.rc\r
+\r
+clean:\r
+ rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) precomp.h.gch \\r
+ utility/*.o\r
--- /dev/null
+//Microsoft Developer Studio generated resource script.\r
+//\r
+#include "ibrowser_intres.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include <windows.h>\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// Neutral (Default) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Menu\r
+//\r
+\r
+IDM_SDIFRAME MENU PRELOAD DISCARDABLE \r
+BEGIN\r
+ POPUP "&Fisier"\r
+ BEGIN\r
+ MENUITEM "&Iesire", ID_FILE_EXIT\r
+ END\r
+ POPUP "&Prezentare"\r
+ BEGIN\r
+ MENUITEM "&Bara cu instrumente", ID_VIEW_TOOL_BAR\r
+ MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR, GRAYED\r
+ MENUITEM "&Bara de stare", ID_VIEW_STATUSBAR\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Resetare\tF5", ID_REFRESH\r
+ MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN\r
+ END\r
+ POPUP "&Ajutor"\r
+ BEGIN\r
+ MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ\r
+ MENUITEM "&Despre IBrowser...", ID_ABOUT_IBROWSER\r
+ MENUITEM "Despre &OS...", ID_ABOUT_WINDOWS\r
+ END\r
+END\r
+\r
+#endif // Neutral (Default) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// German (Germany) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "ibrowser_intres.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#include <windows.h>\0"\r
+END\r
+\r
+3 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#ifndef _ROS_\r\n"\r
+ "LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT\r\n"\r
+ "STRINGTABLE DISCARDABLE \r\n"\r
+ "BEGIN\r\n"\r
+ "#ifdef UNICODE\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n"\r
+ "#else\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n"\r
+ "#endif\r\n"\r
+ "END\r\n"\r
+ "#endif\r\n"\r
+ "\0"\r
+END\r
+\r
+#endif // APSTUDIO_INVOKED\r
+\r
+#endif // German (Germany) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+#ifndef _ROS_\r
+LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+#ifdef UNICODE\r
+IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s"\r
+#else\r
+IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s"\r
+#endif\r
+END\r
+#endif\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif // not APSTUDIO_INVOKED\r
+\r
--- /dev/null
+//Microsoft Developer Studio generated resource script.\r
+//\r
+#include "ibrowser_intres.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include <windows.h>\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// German (Germany) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "ibrowser_intres.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#include <windows.h>\0"\r
+END\r
+\r
+3 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#ifndef _ROS_\r\n"\r
+ "LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT\r\n"\r
+ "STRINGTABLE DISCARDABLE \r\n"\r
+ "BEGIN\r\n"\r
+ "#ifdef UNICODE\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""ROS IBrowser%0s""\r\n"\r
+ "#else\r\n"\r
+ "IDS_IBROWSER_VERSION_STR ""ROS IBrowser Ansi%0s""\r\n"\r
+ "#endif\r\n"\r
+ "END\r\n"\r
+ "#endif\r\n"\r
+ "\0"\r
+END\r
+\r
+#endif // APSTUDIO_INVOKED\r
+\r
+#endif // German (Germany) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// Swedish resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Menu\r
+//\r
+\r
+IDM_SDIFRAME MENU PRELOAD DISCARDABLE \r
+BEGIN\r
+ POPUP "&Arkiv"\r
+ BEGIN\r
+ MENUITEM "&Öppna", ID_FILE_OPEN\r
+ MENUITEM "&Avsluta", ID_FILE_EXIT\r
+ END\r
+ POPUP "&Visa"\r
+ BEGIN\r
+ MENUITEM "&Verktygsfält", ID_VIEW_TOOL_BAR\r
+ MENUITEM "S&idfält", ID_VIEW_SIDE_BAR, GRAYED\r
+ MENUITEM "&Statusfält", ID_VIEW_STATUSBAR\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Uppdatera\tF5", ID_REFRESH\r
+ MENUITEM "&Fullskärm\tCtrl+Shift+S", ID_VIEW_FULLSCREEN\r
+ END\r
+ POPUP "&Hjälp"\r
+ BEGIN\r
+ MENUITEM "IBrowser &FAQ...", ID_IBROWSER_FAQ\r
+ MENUITEM "Om &IBrowser...", ID_ABOUT_IBROWSER\r
+ MENUITEM "Om &operativsystemet...", ID_ABOUT_WINDOWS\r
+ END\r
+END\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// String Table\r
+//\r
+\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+ IDS_TITLE "ReactOS webbläsare"\r
+ IDS_EMPTY "(Tom)"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+ IDS_ABOUT_IBROWSER "&Om..."\r
+END\r
+\r
+#endif // Swedish resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+#ifndef _ROS_\r
+LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT\r
+STRINGTABLE DISCARDABLE \r
+BEGIN\r
+#ifdef UNICODE\r
+IDS_IBROWSER_VERSION_STR "ROS IBrowser%0s"\r
+#else\r
+IDS_IBROWSER_VERSION_STR "ROS IBrowser Ansi%0s"\r
+#endif\r
+END\r
+#endif\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif // not APSTUDIO_INVOKED\r
+\r
--- /dev/null
+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.
--- /dev/null
+/*
+ * 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 <precomp.h>
+
+
+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(); // </icon>
+ }
+ }
+ }
+
+ pos.back(); // </metadata>
+ pos.back(); // </info>
+ }
+
+ 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(); // </icon>
+ pos.back(); // </metadata>
+ pos.back(); // </info>
+ }
+
+ 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<ShellEntry*>(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<ShellEntry*>(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 = "<!DOCTYPE xbel"
+ " PUBLIC \"+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML\"\n"
+ " \"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd\">";
+
+ 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;
+}
+
+*/
--- /dev/null
+/*
+ * 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<BookmarkNode>
+{
+ 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);
+};
--- /dev/null
+/*
+ * 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 <precomp.h>
+
+#include "ibrowser_intres.h"
+
+#include <locale.h> // for setlocale()
+
+#ifndef __WINE__
+#include <io.h> // for dup2()
+#include <fcntl.h> // 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<Dialog>
+ >
+{
+ typedef CtlColorParent<
+ OwnerDrawParent<Dialog>
+ > 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;
+}
--- /dev/null
+# Microsoft Developer Studio Project File - Name="ibrowser" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=IBROWSER - WIN32 DEBUG\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "ibrowser.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "ibrowser.mak" CFG="IBROWSER - WIN32 DEBUG"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "ibrowser - Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "ibrowser - Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "ibrowser - Win32 Debug Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "ibrowser - Win32 Unicode Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "ibrowser - Win32 Unicode Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF "$(CFG)" == "ibrowser - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release"\r
+# PROP Intermediate_Dir "Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# 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\r
+# ADD BASE RSC /l 0x407 /d "NDEBUG"\r
+# ADD RSC /l 0x407 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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\r
+# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /machine:I386 /libpath:"Release"\r
+# SUBTRACT LINK32 /pdb:none\r
+\r
+!ELSEIF "$(CFG)" == "ibrowser - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# 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\r
+# ADD BASE RSC /l 0x407 /d "_DEBUG"\r
+# ADD RSC /l 0x407 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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\r
+# ADD LINK32 kernel32.lib gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"Debug"\r
+# SUBTRACT LINK32 /pdb:none\r
+\r
+!ELSEIF "$(CFG)" == "ibrowser - Win32 Debug Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "DRelease"\r
+# PROP BASE Intermediate_Dir "DRelease"\r
+# PROP BASE Ignore_Export_Lib 0\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "DRelease"\r
+# PROP Intermediate_Dir "DRelease"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_ROS_" /YX /FD /c\r
+# 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\r
+# ADD BASE RSC /l 0x407 /d "NDEBUG"\r
+# ADD RSC /l 0x407 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386\r
+# SUBTRACT LINK32 /pdb:none\r
+\r
+!ELSEIF "$(CFG)" == "ibrowser - Win32 Unicode Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "URelease"\r
+# PROP BASE Intermediate_Dir "URelease"\r
+# PROP BASE Ignore_Export_Lib 0\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "URelease"\r
+# PROP Intermediate_Dir "URelease"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /YX /FD /c\r
+# 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\r
+# ADD BASE RSC /l 0x407 /d "NDEBUG"\r
+# ADD RSC /l 0x407 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /machine:I386 /libpath:"Release"\r
+# SUBTRACT LINK32 /pdb:none\r
+\r
+!ELSEIF "$(CFG)" == "ibrowser - Win32 Unicode Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "UDebug"\r
+# PROP BASE Intermediate_Dir "UDebug"\r
+# PROP BASE Ignore_Export_Lib 0\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "UDebug"\r
+# PROP Intermediate_Dir "UDebug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /FR /YX /FD /GZ /c\r
+# 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\r
+# ADD BASE RSC /l 0x407 /d "_DEBUG"\r
+# ADD RSC /l 0x407 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 gdi32.lib comctl32.lib shell32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"Debug"\r
+# SUBTRACT LINK32 /pdb:none\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "ibrowser - Win32 Release"\r
+# Name "ibrowser - Win32 Debug"\r
+# Name "ibrowser - Win32 Debug Release"\r
+# Name "ibrowser - Win32 Unicode Release"\r
+# Name "ibrowser - Win32 Unicode Debug"\r
+# Begin Group "utility"\r
+\r
+# PROP Default_Filter ""\r
+# Begin Source File\r
+\r
+SOURCE=.\utility\comutil.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\utility\utility.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\utility\utility.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\utility\window.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\utility\window.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\utility\xmlstorage.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\utility\xmlstorage.h\r
+# End Source File\r
+# End Group\r
+# Begin Group "resources"\r
+\r
+# PROP Default_Filter "bmp,ico"\r
+# Begin Source File\r
+\r
+SOURCE=.\De.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\dot.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\dot_red.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\dot_trans.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\En.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Es.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\favorites.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Fr.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Hu.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\ibrowser.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\ibrowser.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\ibrowser_intres.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\ibrowser_intres.rc\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\iexplore.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Ja.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\network.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\reactos.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Ro.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Sv.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\res\toolbar.bmp\r
+# End Source File\r
+# End Group\r
+# Begin Group "main"\r
+\r
+# PROP Default_Filter ""\r
+# Begin Source File\r
+\r
+SOURCE=.\favorites.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\favorites.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\ibrowser.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\ibrowser.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\mainframe.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\mainframe.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\precomp.cpp\r
+# ADD CPP /Yc"precomp.h"\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\precomp.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\webchild.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\webchild.h\r
+# End Source File\r
+# End Group\r
+# Begin Source File\r
+\r
+SOURCE=.\readme.txt\r
+# End Source File\r
+# End Target\r
+# End Project\r
--- /dev/null
+Microsoft Developer Studio Workspace File, Format Version 6.00\r
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
+\r
+###############################################################################\r
+\r
+Project: "ibrowser"=.\ibrowser.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "make_ibrowser"=.\make_ibrowser.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Global:\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<3>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
--- /dev/null
+/*
+ * 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<int, Icon> IconMap;
+ IconMap _icons;
+
+ typedef map<String, ICON_ID> PathMap;
+ PathMap _pathMap;
+
+ typedef pair<String, int> CachePair;
+ typedef map<CachePair, ICON_ID> 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).
--- /dev/null
+#include <windows.h>\r
+\r
+#include "ibrowser_intres.rc"\r
+\r
+#define REACTOS_STR_FILE_DESCRIPTION "ROS Internet Web Browser\0"\r
+#define REACTOS_STR_INTERNAL_NAME "ibrowser\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME "ibrowser.exe\0"\r
+#include <reactos/version.rc>\r
+\r
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
+\r
+#define IDS_VERSION_STR 5000\r
+#define IDS_IBROWSER_VERSION_STR 5001\r
--- /dev/null
+<module name="ibrowser" type="win32gui" installbase="system32" installname="ibrowser.exe" allowwarnings ="true">
+ <linkerflag>-fexceptions</linkerflag>
+ <include base="ibrowser">.</include>
+ <include base="ReactOS">include/expat</include>
+ <define name="__USE_W32API" />
+ <define name="UNICODE" />
+ <define name="WIN32" />
+ <define name="_ROS_" />
+ <define name="_WIN32_IE">0x0600</define>
+ <define name="_WIN32_WINNT">0x0501</define>
+ <define name="WINVER">0x0500</define>
+ <library>uuid</library>
+ <library>kernel32</library>
+ <library>gdi32</library>
+ <library>comctl32</library>
+ <library>ole32</library>
+ <library>oleaut32</library>
+ <library>shell32</library>
+ <library>expat</library>
+ <pch>precomp.h</pch>
+ <directory name="utility">
+ <file>utility.cpp</file>
+ <file>window.cpp</file>
+ <file>xmlstorage.cpp</file>
+ </directory>
+ <file>ibrowser.cpp</file>
+ <file>favorites.cpp</file>
+ <file>mainframe.cpp</file>
+ <file>webchild.cpp</file>
+ <file>ibrowser.rc</file>
+</module>
--- /dev/null
+//{{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
--- /dev/null
+//Microsoft Developer Studio generated resource script.\r
+//\r
+#include "ibrowser_intres.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include <windows.h>\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// Neutral resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Bitmap\r
+//\r
+\r
+IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp"\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Accelerator\r
+//\r
+\r
+IDA_IBROWSER ACCELERATORS DISCARDABLE \r
+BEGIN\r
+ "X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT\r
+ "S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, \r
+ NOINVERT\r
+END\r
+\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "ibrowser_intres.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#include <windows.h>\r\n"\r
+ "\0"\r
+END\r
+\r
+3 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+ "#include ""En.rc""\r\n"\r
+ "#include ""Es.rc""\r\n"\r
+ "#include ""Fr.rc""\r\n"\r
+ "#include ""Sv.rc""\r\n"\r
+ "#include ""Hu.rc""\r\n"\r
+ "#include ""Ro.rc""\r\n"\r
+ "#include ""Ja.rc""\0"\r
+END\r
+\r
+#endif // APSTUDIO_INVOKED\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Icon\r
+//\r
+\r
+// Icon with lowest ID value placed first to ensure application icon\r
+// remains consistent on all systems.\r
+IDI_REACTOS ICON DISCARDABLE "res/reactos.ico"\r
+IDI_FAVORITES ICON DISCARDABLE "res/favorites.ico"\r
+IDI_DOT ICON DISCARDABLE "res/dot.ico"\r
+IDI_DOT_TRANS ICON DISCARDABLE "res/dot_trans.ico"\r
+IDI_DOT_RED ICON DISCARDABLE "res/dot_red.ico"\r
+IDI_IBROWSER ICON DISCARDABLE "res/ibrowser.ico"\r
+#endif // Neutral resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+#include "En.rc"\r
+#include "Es.rc"\r
+#include "Fr.rc"\r
+#include "Sv.rc"\r
+#include "Hu.rc"\r
+#include "Ro.rc"\r
+#include "Ja.rc"\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif // not APSTUDIO_INVOKED\r
+\r
--- /dev/null
+/*
+ * 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 <precomp.h>
+
+/* 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<rt.right) {
+ _split_pos = x;
+ resize_children();
+ rt.left = x-SPLIT_WIDTH/2;
+ rt.right = x+SPLIT_WIDTH/2+1;
+ InvalidateRect(_hwnd, &rt, FALSE);
+ UpdateWindow(_left_hwnd);
+ UpdateWindow(_hwnd);
+ UpdateWindow(_right_hwnd);
+ }
+ }
+ break;
+
+ case PM_OPEN_WINDOW: {CONTEXT("MainFrame PM_OPEN_WINDOW");
+ LPCTSTR url = (LPCTSTR)lparam;
+
+ if (!url || !*url)
+#ifdef _DEBUG
+ url = TEXT("http://localhost");
+#else
+ url = TEXT("about:blank");
+#endif
+
+ if (!_right_hwnd) {
+ _right_hwnd = create_webchildwindow(WebChildWndInfo(_hwnd, url));
+ resize_children();
+ } else
+ set_url(url);
+ return TRUE;} // success
+
+ default: def:
+ return super::WndProc(nmsg, wparam, lparam);
+ }
+
+ return 0;
+}
+
+int MainFrame::Command(int id, int code)
+{
+ if (_right_hwnd)
+ if (SendMessage(_right_hwnd, PM_DISPATCH_COMMAND, MAKELONG(id,code), 0))
+ return 0;
+
+ return super::Command(id, code);
+}
+
+void MainFrame::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);
+ }
+
+ _clnt_rect = rect;
+
+ resize_children();
+}
+
+void MainFrame::resize_children()
+{
+ HDWP hdwp = BeginDeferWindowPos(2);
+
+ int cx = _clnt_rect.left;
+
+ if (_left_hwnd) {
+ cx = _split_pos + SPLIT_WIDTH/2;
+
+ hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, _clnt_rect.left, _clnt_rect.top, _split_pos-SPLIT_WIDTH/2-_clnt_rect.left, _clnt_rect.bottom-_clnt_rect.top, SWP_NOZORDER|SWP_NOACTIVATE);
+ } else {
+ //_split_pos = 0;
+ cx = 0;
+ }
+
+ if (_right_hwnd)
+ hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, _clnt_rect.left+cx, _clnt_rect.top, _clnt_rect.right-cx, _clnt_rect.bottom-_clnt_rect.top, SWP_NOZORDER|SWP_NOACTIVATE);
+
+ EndDeferWindowPos(hdwp);
+}
+
+void MainFrame::update_clnt_rect()
+{
+ ClientRect rect(_hwnd);
+
+ resize_frame(rect.right, rect.bottom);
+}
+
+void MainFrame::set_url(LPCTSTR url)
+{
+ if (_url != url) {
+ _url = url;
+
+ SetWindowText(_haddressedit, url); //SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)url);
+ }
+}
+
+bool MainFrame::go_to(LPCTSTR url, bool new_window)
+{
+ if (_right_hwnd) {
+ SendMessage(_right_hwnd, PM_JUMP_TO_URL, 0, (LPARAM)url);
+ return true;
+ }
+
+ return false;
+}
--- /dev/null
+/*
+ * 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.h
+ //
+ // Martin Fuchs, 25.01.2005
+ //
+
+
+#define PM_OPEN_WINDOW (WM_APP+0x07)
+
+
+ /// Explorer frame window base class
+struct MainFrameBase : public PreTranslateWindow
+{
+ typedef PreTranslateWindow super;
+
+ MainFrameBase(HWND hwnd);
+ ~MainFrameBase();
+
+ static HWND Create(LPCTSTR url, UINT cmdshow=SW_SHOWNORMAL);
+
+ WindowHandle _hwndrebar;
+
+ WindowHandle _htoolbar;
+ WindowHandle _hstatusbar;
+
+ WindowHandle _haddressedit;
+
+ WindowHandle _hsidebar;
+ HIMAGELIST _himl;
+
+ HMENU _hMenuFrame;
+ HMENU _hMenuWindow;
+
+ MenuInfo _menu_info;
+
+protected:
+ FullScreenParameters _fullscreen;
+
+ HACCEL _hAccel;
+
+ LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
+ bool ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT* pres);
+ int Command(int id, int code);
+ int Notify(int id, NMHDR* pnmh);
+
+ virtual BOOL TranslateMsg(MSG* pmsg);
+
+ void toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1);
+
+ void resize_frame_client();
+ virtual void resize_frame(int cx, int cy);
+ virtual void frame_get_clientspace(PRECT prect);
+
+ BOOL toggle_fullscreen();
+ void fullscreen_move();
+
+ void FillBookmarks();
+ virtual bool go_to(LPCTSTR url, bool new_window) {return false;}
+};
+
+
+struct MainFrame : public MainFrameBase
+{
+ typedef MainFrameBase super;
+
+ MainFrame(HWND hwnd);
+
+ static HWND Create();
+ //@@static HWND Create(LPCTSTR url);
+
+protected:
+ WindowHandle _left_hwnd;
+ WindowHandle _right_hwnd;
+
+ int _split_pos;
+ int _last_split;
+ RECT _clnt_rect;
+
+ String _url;
+
+ LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
+ int Command(int id, int code);
+
+ void resize_frame(int cx, int cy);
+ void resize_children();
+ void update_clnt_rect();
+
+ void set_url(LPCTSTR url);
+
+ virtual bool go_to(LPCTSTR url, bool new_window);
+};
+
+
+struct WebChildWndInfo : public ChildWndInfo
+{
+ WebChildWndInfo(HWND hwndFrame, LPCTSTR url)
+ : ChildWndInfo(hwndFrame),
+ _url(url)
+ {
+ }
+
+ String _url;
+};
+
--- /dev/null
+# Microsoft Developer Studio Project File - Name="make_ibrowser" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) External Target" 0x0106\r
+\r
+CFG=make_ibrowser - Win32 bjam\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "make_ibrowser.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "make_ibrowser.mak" CFG="make_ibrowser - Win32 bjam"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "make_ibrowser - Win32 Release" (based on "Win32 (x86) External Target")\r
+!MESSAGE "make_ibrowser - Win32 Debug" (based on "Win32 (x86) External Target")\r
+!MESSAGE "make_ibrowser - Win32 Unicode Debug" (based on "Win32 (x86) External Target")\r
+!MESSAGE "make_ibrowser - Win32 Unicode Release" (based on "Win32 (x86) External Target")\r
+!MESSAGE "make_ibrowser - Win32 bjam" (based on "Win32 (x86) External Target")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+\r
+!IF "$(CFG)" == "make_ibrowser - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Cmd_Line "NMAKE /f make_ibrowser.mak"\r
+# PROP BASE Rebuild_Opt "/a"\r
+# PROP BASE Target_File "make_ibrowser.exe"\r
+# PROP BASE Bsc_Name "make_ibrowser.bsc"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release"\r
+# PROP Intermediate_Dir "Release"\r
+# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.PCH UNICODE=0"\r
+# PROP Rebuild_Opt "clean all"\r
+# PROP Target_File "ibrowser.exe"\r
+# PROP Bsc_Name ""\r
+# PROP Target_Dir ""\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Cmd_Line "NMAKE /f make_ibrowser.mak"\r
+# PROP BASE Rebuild_Opt "/a"\r
+# PROP BASE Target_File "make_ibrowser.exe"\r
+# PROP BASE Bsc_Name "make_ibrowser.bsc"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
+# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.PCH UNICODE=0 DEBUG=1"\r
+# PROP Rebuild_Opt "clean all"\r
+# PROP Target_File "ibrowser.exe"\r
+# PROP Bsc_Name "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=0 DEBUG=1"\r
+# PROP Target_Dir ""\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "UDebug"\r
+# PROP BASE Intermediate_Dir "UDebug"\r
+# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1 DEBUG=1"\r
+# PROP BASE Rebuild_Opt "clean all"\r
+# PROP BASE Target_File "ibrowser.exe"\r
+# PROP BASE Bsc_Name ""\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "UDebug"\r
+# PROP Intermediate_Dir "UDebug"\r
+# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1 DEBUG=1"\r
+# PROP Rebuild_Opt "clean all"\r
+# PROP Target_File "ibrowser.exe"\r
+# PROP Bsc_Name ""\r
+# PROP Target_Dir ""\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "URelease"\r
+# PROP BASE Intermediate_Dir "URelease"\r
+# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1"\r
+# PROP BASE Rebuild_Opt "clean all"\r
+# PROP BASE Target_File "ibrowser.exe"\r
+# PROP BASE Bsc_Name ""\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "URelease"\r
+# PROP Intermediate_Dir "URelease"\r
+# PROP Cmd_Line "msdevfilt -gcc make -f Makefile.PCH UNICODE=1"\r
+# PROP Rebuild_Opt "clean all"\r
+# PROP Target_File "ibrowser.exe"\r
+# PROP Bsc_Name ""\r
+# PROP Target_Dir ""\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 bjam"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW DEBUG=1"\r
+# PROP BASE Rebuild_Opt "clean all"\r
+# PROP BASE Target_File "ibrowser.exe"\r
+# PROP BASE Bsc_Name ""\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
+# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" bjam"\r
+# PROP Rebuild_Opt "clean&bjam release"\r
+# PROP Target_File "ibrowser.exe"\r
+# PROP Bsc_Name ""\r
+# PROP Target_Dir ""\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "make_ibrowser - Win32 Release"\r
+# Name "make_ibrowser - Win32 Debug"\r
+# Name "make_ibrowser - Win32 Unicode Debug"\r
+# Name "make_ibrowser - Win32 Unicode Release"\r
+# Name "make_ibrowser - Win32 bjam"\r
+\r
+!IF "$(CFG)" == "make_ibrowser - Win32 Release"\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Debug"\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Debug"\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 Unicode Release"\r
+\r
+!ELSEIF "$(CFG)" == "make_ibrowser - Win32 bjam"\r
+\r
+!ENDIF \r
+\r
+# Begin Source File\r
+\r
+SOURCE=.\Makefile\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Makefile.MinGW\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Makefile.PCH\r
+# End Source File\r
+# End Target\r
+# End Project\r
--- /dev/null
+/*
+ * 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"
--- /dev/null
+/*
+ * 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"
+
--- /dev/null
+\r
+IBrowser is a Web Browser User Interface similar derived from ROS Explorer.\r
+It encapsulates the Mozilla or MS Web Browser Control.\r
+\r
+\r
+For more information about ReactOS Explorer please look at the FAQ web page:\r
+\r
+http://www.sky.franken.de/explorer/\r
+\r
--- /dev/null
+/*
+ * 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 <shellapi.h>
+#include <shlobj.h>
+
+/*@@
+#if _MSC_VER>=1300 // VS.Net
+#include <comdefsp.h>
+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<typename T> 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<typename I> 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;
+};
--- /dev/null
+/*
+ * 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 <precomp.h>
+
+//#include <shellapi.h>
+
+#include <time.h>
+#include <sstream>
+
+
+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
+ <Windows NT/2000>
+ 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<l; i++) {
+ memcpy(path, hole_path, i*sizeof(TCHAR));
+
+ for(; hole_path[i] && hole_path[i]!='/' && hole_path[i]!='\\'; i++)
+ path[i] = hole_path[i];
+
+ path[i] = '\0';
+
+ hFind = FindFirstFile(path, &w32fd);
+
+ if (hFind != INVALID_HANDLE_VALUE)
+ FindClose(hFind);
+ else {
+ LOG(FmtString(TEXT("CreateDirectory(\"%s\")"), path));
+
+ if (!CreateDirectory(path, 0))
+ return FALSE;
+ }
+ }
+ } else
+ FindClose(hFind);
+
+ return TRUE;
+}
+
+
+BOOL exists_path(LPCTSTR path)
+{
+ WIN32_FIND_DATA fd;
+
+ HANDLE hfind = FindFirstFile(path, &fd);
+
+ if (hfind != INVALID_HANDLE_VALUE) {
+ FindClose(hfind);
+
+ return TRUE;
+ } else
+ return FALSE;
+}
+
+
+bool SplitFileSysURL(LPCTSTR url, String& dir_out, String& fname_out)
+{
+ if (!_tcsnicmp(url, TEXT("file://"), 7)) {
+ url += 7;
+
+ // remove third slash in front of drive characters
+ if (*url == '/')
+ ++url;
+ }
+
+ if (exists_path(url)) {
+ TCHAR path[_MAX_PATH];
+
+ // convert slashes to back slashes
+ GetFullPathName(url, _MAX_PATH, path, NULL);
+
+ if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY)
+ fname_out.erase();
+ else {
+ TCHAR drv[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
+
+ _tsplitpath(path, drv, dir, fname, ext);
+ _stprintf(path, TEXT("%s%s"), drv, dir);
+
+ fname_out.printf(TEXT("%s%s"), fname, ext);
+ }
+
+ dir_out = path;
+
+ return true;
+ } else
+ return false;
+}
+
+
+ /// Exception Handler for COM exceptions
+
+void HandleException(COMException& e, HWND hwnd)
+{
+ String msg = e.toString();
+
+ SetLastError(0);
+
+ if (hwnd && !IsWindowVisible(hwnd))
+ hwnd = 0;
+
+ MessageBox(hwnd, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
+
+ // If displaying the error message box _with_ parent was not successfull, display it now without a parent window.
+ if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
+ MessageBox(0, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
+}
+
+
+String COMException::toString() const
+{
+ TCHAR msg[4*BUFFER_LEN];
+ LPTSTR p = msg;
+
+ p += _stprintf(p, TEXT("%s\nContext: %s"), super::ErrorMessage(), (LPCTSTR)_context.toString());
+
+ if (_file)
+ p += _stprintf(p, TEXT("\nLocation: %hs:%d"), _file, _line);
+
+ return msg;
+}
--- /dev/null
+/*
+ * 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.h
+ //
+ // Martin Fuchs, 23.07.2003
+ //
+
+
+ // standard windows headers
+#define WIN32_LEAN_AND_MEAN
+#define WIN32_EXTRA_LEAN
+#include <windows.h>
+
+ // Unicode support
+#ifdef UNICODE
+#define _UNICODE
+#endif
+#include <tchar.h>
+
+#include <windowsx.h> // for SelectBrush(), ListBox_SetSel(), SubclassWindow(), ...
+#include <commctrl.h>
+
+#ifndef _MSC_VER
+#include <objbase.h>
+#endif
+#include <oleauto.h> // for VARIANT
+
+#include <malloc.h> // for alloca()
+#include <assert.h>
+#include <stdlib.h> // for _MAX_DIR, ...
+#include <stdio.h> // for sprintf()
+#include <time.h>
+
+#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 <string>
+#include <iostream>
+using namespace std;
+
+ // containers
+#include <map>
+#include <set>
+#include <list>
+#include <stack>
+#include <vector>
+
+
+#if _MSC_VER>=1300 // VS.Net
+#define _NO_COMUTIL //@@
+#endif
+
+#if defined(_MSC_VER) && !defined(_NO_COMUTIL)
+
+ // COM utility headers
+#include <comdef.h>
+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<typename FCT> 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<typename FCT> 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
--- /dev/null
+/*
+ * 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 <precomp.h>
+
+#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.right && pt.y>=clntRect.top && pt.y<clntRect.bottom)
+ active = true;
+ }
+ }
+
+ if (active != _active) {
+ _active = active;
+
+ if (active) {
+ TRACKMOUSEEVENT tme = {sizeof(tme), /*TME_HOVER|*/TME_LEAVE, _hwnd/*, HOVER_DEFAULT*/};
+ _TrackMouseEvent(&tme);
+ }
+
+ InvalidateRect(_hwnd, NULL, TRUE);
+ }
+
+ return 0;}
+
+ case WM_LBUTTONUP: {
+ POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
+ ClientRect clntRect(_hwnd);
+
+ // no more in the active rectangle?
+ if (pt.x<clntRect.left || pt.x>=clntRect.right || pt.y<clntRect.top || 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<PropSheetPageDlg*>(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;
+}
--- /dev/null
+/*
+ * 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<HWND> 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<HWND,Window*> 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<typename CLASS> static CLASS* get_window(HWND hwnd) {return static_cast<CLASS*>(get_window(hwnd));}
+#define GET_WINDOW(CLASS, hwnd) Window::get_window<CLASS>(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<typename CLASS> struct GetWindowHelper
+{
+ static CLASS* get_window(HWND hwnd) {
+ return static_cast<CLASS*>(Window::get_window(hwnd));
+ }
+};
+#define GET_WINDOW(CLASS, hwnd) GetWindowHelper<CLASS>::get_window(hwnd)
+#endif
+
+
+ /// dynamic casting of Window pointers
+template<typename CLASS> struct TypeCheck
+{
+ static CLASS* dyn_cast(Window* wnd)
+ {return dynamic_cast<CLASS*>(wnd);}
+};
+
+#define WINDOW_DYNAMIC_CAST(CLASS, hwnd) \
+ TypeCheck<CLASS>::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<typename WND_CLASS> struct WindowCreator
+{
+ static WND_CLASS* window_creator(HWND hwnd)
+ {
+ return new WND_CLASS(hwnd);
+ }
+};
+
+#define WINDOW_CREATOR(WND_CLASS) \
+ ((Window::CREATORFUNC) WindowCreator<WND_CLASS>::window_creator)
+
+
+ /// template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects with additional creation information
+template<typename WND_CLASS, typename INFO_CLASS> struct WindowCreatorInfo
+{
+ static WND_CLASS* window_creator(HWND hwnd, const void* info)
+ {
+ return new WND_CLASS(hwnd, *static_cast<const INFO_CLASS*>(info));
+ }
+};
+
+#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS) \
+ ((Window::CREATORFUNC_INFO) WindowCreatorInfo<WND_CLASS, INFO_CLASS>::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<String> _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<PROPSHEETPAGE> 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<ResizeEntry>
+{
+ typedef std::list<ResizeEntry> 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<typename BASE> 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<typename BASE> 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<typename BASE> 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<typename BASE> 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);
+ }
+};
--- /dev/null
+
+ //
+ // XML storage classes
+ //
+ // xmlstorage.cpp
+ //
+ // Copyright (c) 2004, 2005 Martin Fuchs <martin-fuchs@gmx.net>
+ //
+
+
+/*
+
+ 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 <precomp.h>
+
+
+ // 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<e; ++p)
+ if (*p == '\n') {
+ ++p;
+ break;
+ }
+
+ if (p != s)
+ if (pos->_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<e; ++p)
+ if (*p == '\n') {
+ ++p;
+ break;
+ }
+
+ if (p != s)
+ if (pos->_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 << "</" << EncodeXMLString(*this) << '>';
+ } 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 << "</" << EncodeXMLString(*this) << ">\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 << "</" << EncodeXMLString(*this) << '>';
+ }
+
+ if (_trailing.empty())
+ out << '\n';
+ else
+ out << _trailing;
+}
+
+
+} // namespace XMLStorage
--- /dev/null
+
+ //
+ // XML storage classes
+ //
+ // xmlstorage.h
+ //
+ // Copyright (c) 2004, 2005 Martin Fuchs <martin-fuchs@gmx.net>
+ //
+
+
+/*
+
+ 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 <expat/expat.h>
+
+#ifdef _MSC_VER
+#pragma comment(lib, "libexpat.lib")
+#pragma warning(disable: 4786)
+#endif
+
+
+#include <windows.h> // for LPCTSTR
+
+#ifdef UNICODE
+#define _UNICODE
+#endif
+
+#include <tchar.h>
+#include <malloc.h>
+
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <stack>
+#include <list>
+#include <map>
+
+
+#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 <ext/stdio_filebuf.h>
+typedef __gnu_cxx::stdio_filebuf<char> 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<XS_String, XS_String>
+ {
+ typedef std::map<XS_String, XS_String> 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<XS_String, XS_String> AttributeMap;
+#endif
+
+ struct Children : public std::list<XMLNode*>
+ {
+ 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<typename T> 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<typename T, typename U>
+ 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<XMLNode*>(const_cast<const XMLNode*>(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<typename T> 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<typename T, typename U>
+ 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<XMLNode*> _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<typename T> 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<const XMLNode*> _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<typename T>
+ 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 << "<?xml version=\"" << _version << "\" encoding=\"" << _encoding << "\"?>\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
--- /dev/null
+/*
+ * 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 <precomp.h>
+
+#include "ibrowser_intres.h"
+
+#include "webchild.h"
+
+
+#ifdef _MSC_VER
+
+#if _MSC_VER>=1300 // vtMissing for VS.Net
+#include <comutil.h>
+#pragma comment(lib, "comsupp")
+#endif
+
+#else
+
+#ifdef __MINGW32__ // MinGW is lacking vtMissing (as of 07.02.2004)
+static Variant vtMissing;
+#endif
+
+#endif
+
+//#include <mshtml.h>
+
+
+Variant::Variant(const VARIANT& var)
+{
+ VariantInit(this);
+ CheckError(VariantCopy(this, const_cast<VARIANT*>(&var)));
+}
+
+Variant::Variant(const VARIANT* var)
+{
+ VariantInit(this);
+ CheckError(VariantCopy(this, const_cast<VARIANT*>(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<VARIANT*>(&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<IStream> pStream;
+ HRESULT hr = CreateStreamOnHGlobal(hHtmlText, TRUE, &pStream);
+
+ if (SUCCEEDED(hr)) {
+ SIfacePtr<IDispatch> pHtmlDoc;
+ CheckError(_browser->get_Document(&pHtmlDoc));
+
+ SIfacePtr<IPersistStreamInit> 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<EventConnector>(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;
+}
--- /dev/null
+/*
+ * 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 <exdisp.h> // for IConnectionPointContainer
+#include <exdispid.h> // 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<typename BASE> 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<BASE*>(this); this->AddRef(); return S_OK;}
+
+ return E_NOINTERFACE;
+ }
+
+protected:
+ IComSrvQI() {}
+ virtual ~IComSrvQI() {}
+
+ REFIID _uuid_base;
+};
+
+template<> struct IComSrvQI<IUnknown> : 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<IUnknown>() {}
+ virtual ~IComSrvQI<IUnknown>() {}
+};
+
+
+template<typename BASE, typename OBJ>
+ class IComSrvBase : public IComSrvQI<BASE>
+{
+ typedef IComSrvQI<BASE> super;
+
+protected:
+ IComSrvBase(REFIID uuid_base)
+ : super(uuid_base)
+ {
+ }
+
+public:
+ STDMETHODIMP_(ULONG) AddRef() {return static_cast<OBJ*>(this)->IncRef();}
+ STDMETHODIMP_(ULONG) Release() {return static_cast<OBJ*>(this)->DecRef();}
+};
+
+
+template<typename T> struct ConnectionPoint : public SIfacePtr<T>
+{
+ 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<typename T> EventConnection(T& connectionpoint, IUnknown* sink)
+ {
+ CheckError(connectionpoint->Advise(sink, &_cookie));
+ _connectionpoint = connectionpoint;
+ }
+
+/* template<typename T> EventConnection(SIfacePtr<T>& connectionpoint, IUnknown* sink)
+ {
+ CheckError(connectionpoint->Advise(sink, &_cookie));
+ _connectionpoint = connectionpoint.GetPtr();
+ } */
+
+/* template<typename T> EventConnection(T& connectionpoint, IUnknown* sink)
+ {
+ CheckError(connectionpoint->Advise(sink, &_cookie));
+ _connectionpoint = connectionpoint;
+ } */
+
+ ~EventConnection()
+ {
+ if (_connectionpoint)
+ _connectionpoint->Unadvise(_cookie);
+ }
+
+protected:
+ SIfacePtr<IConnectionPoint> _connectionpoint;
+ DWORD _cookie;
+};
+
+struct EventConnector : public EventConnection
+{
+ EventConnector(IUnknown* unknown, REFIID riid, IUnknown* sink)
+ : EventConnection(ConnectionPoint<IConnectionPoint>(
+ SIfacePtr<IConnectionPointContainer>(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<IOleClientSite*>(this); IncRef(); return S_OK;}
+
+ if (IsEqualIID(riid, IID_IOleInPlaceSite))
+ {*ppv=static_cast<IOleInPlaceSite*>(this); IncRef(); return S_OK;}
+
+ if (IsEqualIID(riid, IID_IUnknown))
+ {*ppv=static_cast<IOleClientSite/*oder auch IOleInPlaceSite*/*>(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<typename BASE, typename SMARTPTR> struct IPCtrlWindow : public BASE
+{
+ typedef BASE super;
+
+ IPCtrlWindow(HWND hwnd)
+ : super(hwnd)
+ {
+ }
+
+ template<typename T> 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<IOleObject>(_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<IOleObject>(_control, IID_IOleObject), OLECLOSE_NOSAVE);
+ _control = NULL;
+ }
+ }
+
+ return super::WndProc(nmsg, wparam, lparam);
+ }
+
+ ComInit _usingCOM;
+ SMARTPTR _control;
+ OleInPlaceClient _client_side;
+ SIfacePtr<IOleInPlaceObject> _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<IWebBrowser> _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<FixedDWebBrowserEvents2, DWebBrowserEvents2Impl>,
+ public DWebBrowserEvents2IF
+{
+ typedef IComSrvBase<FixedDWebBrowserEvents2, DWebBrowserEvents2Impl> 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<ChildWindow, SIfacePtr<IWebBrowser2> >,
+ public DWebBrowserEvents2Impl
+{
+ typedef IPCtrlWindow<ChildWindow, SIfacePtr<IWebBrowser2> > 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<WebChildWindow*>(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 && Progress<ProgressMax)
+ txt.printf(TEXT("%3d %%"), (int)(100.*Progress/ProgressMax+.5));
+
+ SendMessage(_hwndFrame, PM_SETSTATUSTEXT, 1, (LPARAM)txt.c_str());
+ }
+
+ void WindowMove()
+ {
+ }
+
+ void WindowResize()
+ {
+ }
+
+ void WindowActivate()
+ {
+ }
+
+ void PropertyChange(const BStr& Property)
+ {
+ Variant value;
+ _control->GetProperty(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<EventConnector> _connector;
+
+ LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
+
+ virtual String jump_to_int(LPCTSTR url);
+};
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+// Hungarian resources, by Robert Horvath (Talley at cubeclub.hu)\r
+\r
+LANGUAGE LANG_HUNGARIAN, SUBLANG_NEUTRAL\r
+\r
+IDD_MSCONFIG_DIALOG DIALOG DISCARDABLE 0, 0, 378, 220\r
+STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP |\r
+ WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |\r
+ WS_THICKFRAME\r
+CAPTION "Rendszerbeállítások"\r
+FONT 8, "Tahoma"\r
+BEGIN\r
+ CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,2,2,374,195\r
+ DEFPUSHBUTTON "OK", IDOK, 211, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP\r
+ PUSHBUTTON "&Súgó", IDC_BTN_HELP, 2, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP\r
+ PUSHBUTTON "Mégse", IDCANCEL, 267, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP\r
+ PUSHBUTTON "Alkalmaz", IDC_BTN_APPLY, 323, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP\r
+END\r
+\r
+IDD_STARTUP_PAGE DIALOG DISCARDABLE 0, 0, 362, 175\r
+STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN\r
+FONT 8, "Tahoma"\r
+BEGIN\r
+ CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148\r
+ PUSHBUTTON "Mindet &bekapcsol",IDC_BTN_STARTUP_ACTIVATE,223,155,66,14\r
+ PUSHBUTTON "Mindet &kikapcsol",IDC_BTN_STARTUP_DEACTIVATE,295,155,66,14\r
+END\r
+\r
+IDD_TOOLS_PAGE DIALOG DISCARDABLE 0, 0, 362, 175\r
+STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN\r
+FONT 8, "Tahoma"\r
+BEGIN\r
+ CONTROL "List2",IDC_TOOLS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 134\r
+ EDITTEXT IDC_TOOLS_CMDLINE, 1, 139, 360, 12, ES_READONLY\r
+ PUSHBUTTON "&Futtat", IDC_BTN_RUN, 311, 155, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP\r
+END\r
+\r
+IDD_SERVICES_PAGE DIALOG DISCARDABLE 0, 0, 362, 175\r
+STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN\r
+FONT 8, "Tahoma"\r
+BEGIN\r
+ CONTROL "List1",IDC_SERVICES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,2,1,360,148\r
+ PUSHBUTTON "Mindet &bekapcsol",IDC_BTN_SERVICES_ACTIVATE,223,155,66,14\r
+ PUSHBUTTON "Mindet &kikapcsol",IDC_BTN_SERVICES_DEACTIVATE,295,155,66,14\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_MSCONFIG "Rendszerkonfiguráciüs segédprogram"\r
+ IDS_TAB_GENERAL "Általános"\r
+ IDS_TAB_SYSTEM "SYSTEM.INI"\r
+ IDS_TAB_FREELDR "FREELDR.INI" \r
+ IDS_TAB_SERVICES "Szolgáltatások" \r
+ IDS_TAB_STARTUP "Automatikus indítás" \r
+ IDS_TAB_TOOLS "Segédprogramok"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_SERVICES_COLUMN_SERVICE "Szolgálgatás"\r
+ IDS_SERVICES_COLUMN_REQ "Lényeges"\r
+ IDS_SERVICES_COLUMN_VENDOR "Gyártó"\r
+ IDS_SERVICES_COLUMN_STATUS "Állapot"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_TOOLS_COLUMN_NAME "Név"\r
+ IDS_TOOLS_COLUMN_DESCR "Description"\r
+\r
+ IDS_TOOLS_CMD_NAME "Konzol"\r
+ IDS_TOOLS_CMD_DESCR ""\r
+ IDS_TOOLS_CMD_CMD "cmd.exe"\r
+\r
+ IDS_TOOLS_INFO_NAME "Verzió"\r
+ IDS_TOOLS_INFO_DESCR "Megjeleníti a verzió-információkat."\r
+ IDS_TOOLS_INFO_CMD "winver.exe"\r
+\r
+ IDS_TOOLS_REGEDIT_NAME "Rendszerleíróadatbázis-szerkesztõ"\r
+ IDS_TOOLS_REGEDIT_DESCR "Megnyitja a szerkesztõ programot."\r
+ IDS_TOOLS_REGEDIT_CMD "regedit.exe"\r
+\r
+ IDS_TOOLS_SYSDM_NAME "Rendszertulajdonságok"\r
+ IDS_TOOLS_SYSDM_DESCR "Megjeleníti a számítógép információkat."\r
+ IDS_TOOLS_SYSDM_CMD "control"\r
+ IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"\r
+\r
+ IDS_STARTUP_COLUMN_ELEMENT "Element"\r
+ IDS_STARTUP_COLUMN_CMD "Parancs"\r
+ IDS_STARTUP_COLUMN_PATH "Elérési út"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_SERVICES_STATUS_RUNNING "Fut"\r
+ IDS_SERVICES_STATUS_STOPPED "Leállítva"\r
+ IDS_SERVICES_YES "Igen"\r
+ IDS_SERVICES_UNKNOWN "Ismeretlen"\r
+END\r
--- /dev/null
+#include <precomp.h>
+
+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;
+}
--- /dev/null
+extern HWND hFreeLdrPage;
+
+INT_PTR CALLBACK FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
--- /dev/null
+#include <precomp.h>
+
+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;
+}
--- /dev/null
+extern HWND hGeneralPage;
+
+INT_PTR CALLBACK GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
--- /dev/null
+#include <precomp.h>
+
+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 */
--- /dev/null
+extern HINSTANCE hInst;
+
--- /dev/null
+#include <windows.h>
+#include <commctrl.h>
+
+#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 <reactos/version.rc>
+
+
+#include "De.rc"
+#include "En.rc"
+#include "Fr.rc"
+#include "Hu.rc"
--- /dev/null
+<module name="msconfig" type="win32gui" installbase="system32" installname="msconfig.exe">
+ <include base="msconfig">.</include>
+ <define name="UNICODE" />
+ <define name="_UNICODE" />
+ <define name="__REACTOS__" />
+ <define name="__USE_W32API" />
+ <define name="_WIN32_IE">0x600</define>
+ <define name="_WIN32_WINNT">0x501</define>
+ <library>kernel32</library>
+ <library>user32</library>
+ <library>advapi32</library>
+ <library>version</library>
+ <library>comctl32</library>
+ <library>shell32</library>
+ <compilationunit name="unit.c">
+ <file>toolspage.c</file>
+ <file>srvpage.c</file>
+ <file>systempage.c</file>
+ <file>startuppage.c</file>
+ <file>freeldrpage.c</file>
+ <file>generalpage.c</file>
+ <file>msconfig.c</file>
+ </compilationunit>
+ <file>msconfig.rc</file>
+ <pch>precomp.h</pch>
+</module>
--- /dev/null
+#include <windows.h>
+#define NTOS_MODE_USER
+#include <commctrl.h>
+#include <winuser.h>
+#include <tchar.h>
+
+#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
+
+
--- /dev/null
+#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 */
--- /dev/null
+#include <precomp.h>
+
+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);
+ }
+
+
+}
--- /dev/null
+extern HWND hServicesPage;
+extern HWND hServicesListCtrl;
+
+INT_PTR CALLBACK ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
--- /dev/null
+#include <precomp.h>
+
+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);
+ }
+
+}
--- /dev/null
+extern HWND hStartupPage;
+extern HWND hStartupPageListCtrl;
+
+INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
--- /dev/null
+#include <precomp.h>
+
+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;
+}
--- /dev/null
+extern HWND hSystemPage;
+
+INT_PTR CALLBACK SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
--- /dev/null
+#include <precomp.h>
+
+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;
+}
+
--- /dev/null
+extern HWND hToolsPage;
+extern HWND hToolsListCtrl;
+
+INT_PTR CALLBACK ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
+
--- /dev/null
+/*
+ * 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;
+
+}
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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);
+}
--- /dev/null
+/*
+ * 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
--- /dev/null
+#include <windows.h>
+#include <conio.h>
+#include <stdio.h>
+#include <tchar.h>
+
+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);
--- /dev/null
+#define REACTOS_STR_FILE_DESCRIPTION "Services control application\0"\r
+#define REACTOS_STR_INTERNAL_NAME "sc\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME "sc.exe\0"\r
+#include <reactos/version.rc>\r
--- /dev/null
+<module name="sc" type="win32cui" installbase="system32" installname="sc.exe">\r
+ <define name="__USE_W32API" />\r
+ <define name="DEFINE_GUID" />\r
+ <define name="UNICODE" />\r
+ <define name="_UNICODE" />\r
+ <library>kernel32</library>\r
+ <library>advapi32</library>\r
+ <file>sc.c</file>\r
+ <file>start.c</file>\r
+ <file>query.c</file>\r
+ <file>control.c</file>\r
+ <file>create.c</file>\r
+ <file>delete.c</file>\r
+ <file>usage.c</file>\r
+ <file>sc.rc</file>\r
+ <pch>sc.h</pch>\r
+</module>\r
--- /dev/null
+/*
+ * 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;
+ }
+}
--- /dev/null
+/*
+ * 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 <server> [command] [service name] <option1> <option2>...\n")
+
+ _T("\tThe optional parameter <server> 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 <server> start [service name] <arg1> <arg2> ...\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 <server> 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 <server> 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 <server> 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 <server> 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 <server> 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 <server> 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= ] <option1> <option2>...\n")
+ _T("CREATE OPTIONS:\n")
+ _T("NOTE: The option name includes the equal sign.\n")
+ _T(" type= <own|share|interact|kernel|filesys|rec>\n")
+ _T(" (default = own)\n")
+ _T(" start= <boot|system|auto|demand|disabled>\n")
+ _T(" (default = demand)\n")
+ _T(" error= <normal|severe|critical|ignore>\n")
+ _T(" (default = normal)\n")
+ _T(" binPath= <BinaryPathName>\n")
+ _T(" group= <LoadOrderGroup>\n")
+ _T(" tag= <yes|no>\n")
+ _T(" depend= <Dependencies(separated by / (forward slash))>\n")
+ _T(" obj= <AccountName|ObjectName>\n")
+ _T(" (default = LocalSystem)\n")
+ _T(" DisplayName= <display name>\n")
+ _T(" password= <password>\n"));
+
+ return 0;
+}
--- /dev/null
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN\r
+\r
+IDR_MAINMENU MENU\r
+BEGIN\r
+ POPUP "&Datei"\r
+ BEGIN\r
+ MENUITEM "B&eenden",ID_FILE_EXIT\r
+ END\r
+ POPUP "Action"\r
+ BEGIN\r
+ MENUITEM "Start",ID_START\r
+ MENUITEM "Stopp",ID_STOP\r
+ MENUITEM "Pause",ID_PAUSE\r
+ MENUITEM "Fortsetzen",ID_RESUME\r
+ MENUITEM "Neustart",ID_RESTART\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Aktualisieren",ID_REFRESH\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Eigenschaften",ID_PROP\r
+ END\r
+ POPUP "Ansicht"\r
+ BEGIN\r
+ MENUITEM "Anpassen",ID_VIEW_CUSTOMIZE\r
+ END\r
+ POPUP "Hilfe"\r
+ BEGIN\r
+ MENUITEM "Info",ID_HELP_ABOUT\r
+ END\r
+END\r
+\r
+IDD_ABOUTBOX DIALOG DISCARDABLE 22,16,190,182\r
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Über den Service Manager"\r
+FONT 8, "Tahoma"\r
+BEGIN\r
+ CONTROL "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy@gmail.com)",\r
+ IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,48,7,130,26\r
+ DEFPUSHBUTTON "Schließen",IDOK,140,162,44,15,WS_GROUP\r
+ ICON IDI_SM_ICON,IDC_STATIC,12,7,30,20\r
+ EDITTEXT IDC_LICENSE_EDIT,8,44,174,107,ES_MULTILINE |\r
+ ES_READONLY | WS_VSCROLL\r
+END\r
+\r
+\r
+IDD_DLG_GENERAL DIALOGEX 6,6,253,225\r
+CAPTION "Allgemein"\r
+FONT 8,"MS Sans Serif",0,0\r
+STYLE 0x10CF0000\r
+BEGIN\r
+ CONTROL "Dienstname:",IDC_STATIC,"Static",0x50000000,4,11,53,11\r
+ CONTROL "Anzeigename:",IDC_STATIC,"Static",0x50000000,4,29,53,11\r
+ CONTROL "Beschreibung",IDC_STATIC,"Static",0x50000000,4,51,53,11\r
+ CONTROL "",IDC_SERV_NAME,"Static",0x50000000,70,11,176,11\r
+ CONTROL "",IDC_DISP_NAME,"Static",0x50001000,70,29,176,12\r
+ CONTROL "",IDC_DESCRIPTION,"Static",0x50201000,70,46,176,22\r
+ CONTROL "Pfad zum ausführbarem Programm:",IDC_STATIC,"Static",0x50000000,6,73,150,9\r
+ CONTROL "",IDC_STATIC,"Static",0x50001000,6,86,238,12\r
+ CONTROL "Starttyp:",IDC_STATIC,"Static",0x50000000,6,108,53,11\r
+ CONTROL "",IDC_START_TYPE,"ComboBox",0x50010003,70,107,176,11\r
+ CONTROL "Status des Dienstes:",IDC_STATIC,"Static",0x50000000,4,138,100,11\r
+ CONTROL "",IDC_SERV_STATUS,"Static",0x50000000,70,138,176,11\r
+ CONTROL "Start",IDC_START,"Button",0x50010000,6,155,54,15\r
+ CONTROL "Stopp",IDC_STOP,"Button",0x50010000,68,155,54,15\r
+ CONTROL "Pause",IDC_PAUSE,"Button",0x50010000,130,155,54,15\r
+ CONTROL "Fortsetzen",IDC_RESUME,"Button",0x50010000,192,155,54,15\r
+ 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\r
+ CONTROL "Startparameter",IDC_STATIC,"Static",0x50000000,6,199,53,11\r
+ CONTROL "",IDC_START_PARAM,"Static",0x50001000,70,199,176,11\r
+END\r
+\r
+IDB_BUTTONS BITMAP "buttons.bmp"\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_FIRSTCOLUMN "Name"\r
+ IDS_SECONDCOLUMN "Beschreibung"\r
+ IDS_THIRDCOLUMN "Status"\r
+ IDS_FOURTHCOLUMN "Starttyp"\r
+ IDS_FITHCOLUMN "Anmelden als"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_SERVICES_STATUS_RUNNING "Gestartet"\r
+ IDS_SERVICES_STATUS_STOPPED "Gestoppt"\r
+ IDS_SERVICES_YES "Ja"\r
+ IDS_SERVICES_UNKNOWN "Unbekannt"\r
+ IDS_SERVICES_AUTO "Automatisch"\r
+ IDS_SERVICES_MAN "Manuel"\r
+ IDS_SERVICES_DIS "Deaktiviert"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_SERVICES_NUM_SERVICES "Dienste: %d"\r
+ 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."\r
+ /*"This program is free software; you can redistribute it "\r
+ "and/or modify it under the terms of the GNU Lesser General "\r
+ "Public License as published by the Free Software Foundation; "\r
+ "either version 2.1 of the License, or (at your option) any "\r
+ "later version.\r\n\r\nThis program is distributed in the hope "\r
+ "that it will be useful, but WITHOUT ANY WARRANTY; without even "\r
+ "the implied warranty of MERCHANTABILITY or FITNESS FOR A "\r
+ "PARTICULAR PURPOSE. See the GNU General Public License for more "\r
+ "details.\r\n\r\nYou should have received a copy of the GNU "\r
+ "General Public License along with this program; if not, write "\r
+ "to the Free Software Foundation, Inc., 59 Temple Place - Suite "\r
+ "330, Boston, MA 02111-1307, USA." */\r
+ \r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_TOOLTIP_PROP "Eigenschaften"\r
+ IDS_TOOLTIP_REFRESH "Aktualisieren"\r
+ IDS_TOOLTIP_EXPORT "Liste exportieren"\r
+ IDS_TOOLTIP_START "Dienst starten"\r
+ IDS_TOOLTIP_STOP "Dienst beenden"\r
+ IDS_TOOLTIP_PAUSE "Diest pausieren"\r
+ IDS_TOOLTIP_RESTART "Diest neustarten"\r
+END\r
--- /dev/null
+IDR_MAINMENU MENU\r
+BEGIN\r
+ POPUP "&File"\r
+ BEGIN\r
+ MENUITEM "E&xit",ID_EXIT\r
+ END\r
+ POPUP "Action"\r
+ BEGIN\r
+ MENUITEM "Start",ID_START\r
+ MENUITEM "Stop",ID_STOP\r
+ MENUITEM "Pause",ID_PAUSE\r
+ MENUITEM "Resume",ID_RESUME\r
+ MENUITEM "Restart",ID_RESTART\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Refresh",ID_REFRESH\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Properties",ID_PROP\r
+ END\r
+ POPUP "View"\r
+ BEGIN\r
+ MENUITEM "Customize",ID_VIEW_CUSTOMIZE\r
+ END\r
+ POPUP "Help"\r
+ BEGIN\r
+ MENUITEM "About",ID_ABOUT\r
+ END\r
+END\r
+IDR_POPUP MENU\r
+BEGIN\r
+ POPUP "popup"\r
+ BEGIN\r
+ MENUITEM "Start",ID_START\r
+ MENUITEM "Stop",ID_STOP\r
+ MENUITEM "Pause",ID_PAUSE\r
+ MENUITEM "Resume",ID_RESUME\r
+ MENUITEM "Restart",ID_RESTART\r
+ MENUITEM SEPARATOR\r
+ POPUP "All tasks"\r
+ BEGIN\r
+ MENUITEM "Start",ID_START\r
+ MENUITEM "Stop",ID_STOP\r
+ MENUITEM "Pause",ID_PAUSE\r
+ MENUITEM "Resume",ID_RESUME\r
+ MENUITEM "Restart",ID_RESTART\r
+ MENUITEM "Refresh",ID_REFRESH\r
+ END\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Refresh",ID_REFRESH\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Properties",ID_PROP\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Help",ID_HELP\r
+ END\r
+END\r
+\r
+IDD_ABOUTBOX DIALOGEX 22,16,190,182\r
+CAPTION "About Service Manager"\r
+FONT 8,"Tahoma",0,0\r
+STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME\r
+BEGIN\r
+ LTEXT "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy@gmail.com)", IDC_STATIC, 48, 7, 130, 26\r
+ PUSHBUTTON "Close", IDOK, 75, 162, 44, 15\r
+ ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30\r
+ EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE\r
+END\r
+\r
+IDD_DLG_GENERAL DIALOGEX 6,6,253,225\r
+CAPTION "General"\r
+FONT 8,"Tahoma",0,0\r
+STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP\r
+BEGIN\r
+ LTEXT "", IDC_SERV_NAME, 70,11,176,11, WS_CHILD | WS_VISIBLE\r
+ EDITTEXT IDC_DISP_NAME, 70, 29, 176, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY\r
+ EDITTEXT IDC_DESCRIPTION, 70, 46, 176, 24, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_MULTILINE | ES_READONLY\r
+ EDITTEXT IDC_EXEPATH, 6, 86, 240, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY\r
+ CONTROL "",IDC_START_TYPE,"ComboBox",0x50010003,70,107,176,11\r
+ PUSHBUTTON "Start", IDC_START, 6, 155, 54, 15\r
+ PUSHBUTTON "Stop", IDC_STOP, 68, 155, 54, 15\r
+ PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15\r
+ PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15\r
+ LTEXT "Service name:", IDC_STATIC, 4, 11, 53, 11\r
+ LTEXT "Display name:", IDC_STATIC, 4, 29, 53, 11\r
+ LTEXT "Description", IDC_STATIC, 4, 51, 53, 11\r
+ LTEXT "Path to executable:", IDC_STATIC, 6, 73, 82, 9\r
+ LTEXT "Startup type:", IDC_STATIC, 6, 108, 53, 11\r
+ LTEXT "Service status:", IDC_STATIC, 4, 138, 53, 11\r
+ CONTROL "",IDC_SERV_STATUS,"Static",0x50000000,70,138,176,11\r
+ LTEXT "You can specify the start parameters that apply when you start the service from here.",IDC_STATIC, 6,177,240,15\r
+ LTEXT "Start parameters", IDC_STATIC, 6, 199, 53, 11\r
+ EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP\r
+END\r
+\r
+IDD_DLG_DEPEND DIALOGEX 6,6,253,225\r
+CAPTION "Dependencies"\r
+FONT 8,"Tahoma",0,0\r
+STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP\r
+BEGIN\r
+ CONTROL "",IDC_DEPEND_TREE1,"SysTreeView32",0x50010007,8,70,236,68,0x00000200\r
+ CONTROL "",IDC_DEPEND_TREE2,"SysTreeView32",0x50010007,8,151,234,67,0x00000200\r
+ 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\r
+ CONTROL "This service depends on the following components",IDC_STATIC,"Static",0x50000000,8,57,236,9\r
+ CONTROL "",IDC_DEPEND_SERVICE,"Static",0x50000000,8,38,236,13\r
+END\r
+\r
+IDD_DLG_CREATE DIALOGEX 6,6,225,209\r
+CAPTION "Create a service"\r
+FONT 8,"Tahoma",0,0\r
+STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP\r
+BEGIN\r
+ CONTROL "",IDC_CREATE_SERVNAME,"Edit",0x50010000,72,12,150,11,0x00000200\r
+ CONTROL "",IDC_CREATE_DISPNAME,"Edit",0x50010000,72,31,150,11,0x00000200\r
+ CONTROL "",IDC_CREATE_PATH,"Edit",0x50010000,8,62,214,13,0x00000200\r
+ CONTROL "",IDC_CREATE_DESC,"Edit",0x50010000,10,97,210,48,0x00000200\r
+ CONTROL "",IDC_CREATE_OPTIONS,"Edit",0x50010000,10,162,210,13,0x00000200\r
+ CONTROL "Service Name :",IDC_STATIC,"Static",0x50000202,12,12,54,9\r
+ CONTROL "Display Name :",IDC_STATIC,"Static",0x50000202,12,33,54,9\r
+ CONTROL "Path to executable :",IDC_STATIC,"Static",0x50000000,10,51,68,9\r
+ CONTROL "Description :",IDC_STATIC,"Static",0x50000000,12,86,44,9\r
+ CONTROL "OK",IDOK,"Button",0x50010000,126,192,44,13\r
+ CONTROL "Cancel",IDCANCEL,"Button",0x50010000,176,192,46,13\r
+ CONTROL "Additional options (click help for details)",IDC_STATIC,"Static",0x50000000,10,151,134,9\r
+ CONTROL "Help",ID_CREATE_HELP,"Button",0x50010000,6,192,44,13\r
+END\r
+\r
+IDD_DLG_PROGRESS DIALOGEX 6,6,255,89\r
+CAPTION "Service Control"\r
+FONT 8,"MS Sans Serif",0,0\r
+STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME\r
+EXSTYLE WS_EX_TOOLWINDOW\r
+BEGIN\r
+ CONTROL "",IDC_SERVCON_PROGRESS,"msctls_progress32",0x50000000,8,46,238,13\r
+ CONTROL "",IDC_SERVCON_INFO,"Static",0x50000000,8,5,236,11\r
+ CONTROL "",IDC_SERVCON_NAME,"Static",0x50000000,8,25,66,11\r
+ CONTROL "&Close",IDOK,"Button",0x50010000,100,70,54,13\r
+END\r
+\r
+\r
+IDB_BUTTONS BITMAP DISCARDABLE "res/toolbar.bmp"\r
+\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_FIRSTCOLUMN "Name"\r
+ IDS_SECONDCOLUMN "Description"\r
+ IDS_THIRDCOLUMN "Status"\r
+ IDS_FOURTHCOLUMN "Startup Type"\r
+ IDS_FITHCOLUMN "Log On As"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_SERVICES_STARTED "Started"\r
+ IDS_SERVICES_STOPPED "Stopped"\r
+ IDS_SERVICES_AUTO "Automatic"\r
+ IDS_SERVICES_MAN "Manual"\r
+ IDS_SERVICES_DIS "Disabled"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_NUM_SERVICES "Num Services: %d"\r
+ 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"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_TOOLTIP_PROP "Properties"\r
+ IDS_TOOLTIP_REFRESH "Refresh"\r
+ IDS_TOOLTIP_EXPORT "Export list"\r
+ IDS_TOOLTIP_START "Start service"\r
+ IDS_TOOLTIP_STOP "Stop service"\r
+ IDS_TOOLTIP_PAUSE "Pause service"\r
+ IDS_TOOLTIP_RESTART "Restart service"\r
+ IDS_TOOLTIP_NEW "Create a new service"\r
+ IDS_TOOLTIP_HELP "Help"\r
+ IDS_TOOLTIP_EXIT "Exit"\r
+END\r
+\r
+STRINGTABLE DISCARDABLE\r
+BEGIN\r
+ IDS_PROGRESS_INFO "ReactOS is attempting to %s the following service"\r
+END\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS Services\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: subsys/system/servman/about.c\r
+ * PURPOSE: About dialog box message handler\r
+ * COPYRIGHT: Copyright 2005 Ged Murphy <gedmurphy@gmail.com>\r
+ *\r
+ */\r
+\r
+//ShellAbout(hwnd, _T("test"), _T("test2"), MAKEINTRESOURCE(IDI_SM_ICON));\r
+\r
+#include "servman.h"\r
+\r
+extern HINSTANCE hInstance;\r
+\r
+#ifdef _MSC_VER\r
+#pragma warning(disable : 4100)\r
+#endif\r
+BOOL CALLBACK\r
+AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
+{\r
+ HWND hLicenseEditWnd;\r
+ HICON hIcon = NULL;\r
+ TCHAR strLicense[0x1000];\r
+\r
+ switch (message)\r
+ {\r
+ case WM_INITDIALOG:\r
+\r
+ hIcon = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0);\r
+ SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);\r
+\r
+ hLicenseEditWnd = GetDlgItem(hDlg, IDC_LICENSE_EDIT);\r
+\r
+ LoadString(hInstance, IDS_LICENSE, strLicense, 0x1000);\r
+\r
+ SetWindowText(hLicenseEditWnd, strLicense);\r
+\r
+ return TRUE;\r
+\r
+ case WM_COMMAND:\r
+\r
+ if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))\r
+ {\r
+ DestroyIcon(hIcon);\r
+ EndDialog(hDlg, LOWORD(wParam));\r
+ return TRUE;\r
+ }\r
+\r
+ break;\r
+ }\r
+\r
+ return FALSE;\r
+}\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS Services\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: subsys/system/servman/control\r
+ * PURPOSE: Stops, pauses and resumes a service\r
+ * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>\r
+ *\r
+ */\r
+\r
+#include "servman.h"\r
+\r
+extern HWND hListView;\r
+\r
+\r
+BOOL Control(HWND hProgDlg, DWORD Control)\r
+{\r
+ HWND hProgBar;\r
+ SC_HANDLE hSCManager;\r
+ SC_HANDLE hSc;\r
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;\r
+ SERVICE_STATUS_PROCESS ServiceStatus;\r
+ SERVICE_STATUS Status;\r
+ LVITEM item;\r
+ DWORD BytesNeeded = 0;\r
+ DWORD dwStartTickCount, dwOldCheckPoint;\r
+\r
+ item.mask = LVIF_PARAM;\r
+ item.iItem = GetSelectedItem();\r
+ SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item);\r
+\r
+ /* copy pointer to selected service */\r
+ Service = (ENUM_SERVICE_STATUS_PROCESS *)item.lParam;\r
+\r
+ /* set the progress bar range and step */\r
+ hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS);\r
+ SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE));\r
+ SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0);\r
+\r
+ /* open handle to the SCM */\r
+ hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);\r
+ if (hSCManager == NULL)\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* open handle to the service */\r
+ hSc = OpenService(hSCManager, Service->lpServiceName,\r
+ SC_MANAGER_ALL_ACCESS);\r
+ if (hSc == NULL)\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* process requested action */\r
+ if (! ControlService(hSc, Control, &Status))\r
+ {\r
+ GetError(0);\r
+ CloseServiceHandle(hSc);\r
+ return FALSE;\r
+ }\r
+\r
+ /* query the state of the service */\r
+ if (! QueryServiceStatusEx(hSc,\r
+ SC_STATUS_PROCESS_INFO,\r
+ (LPBYTE)&ServiceStatus,\r
+ sizeof(SERVICE_STATUS_PROCESS),\r
+ &BytesNeeded))\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* Save the tick count and initial checkpoint. */\r
+ dwStartTickCount = GetTickCount();\r
+ dwOldCheckPoint = ServiceStatus.dwCheckPoint;\r
+\r
+ /* loop whilst service is not running */\r
+ /* FIXME: needs more control adding. 'Loop' is temparary */\r
+ while (ServiceStatus.dwCurrentState != Control)\r
+ {\r
+ DWORD dwWaitTime;\r
+\r
+ dwWaitTime = ServiceStatus.dwWaitHint / 10;\r
+\r
+ if( dwWaitTime < 500 )\r
+ dwWaitTime = 500;\r
+ else if ( dwWaitTime > 5000 )\r
+ dwWaitTime = 5000;\r
+\r
+ /* increment the progress bar */\r
+ SendMessage(hProgBar, PBM_STEPIT, 0, 0);\r
+\r
+ /* wait before checking status */\r
+ Sleep(dwWaitTime);\r
+\r
+ /* check status again */\r
+ if (! QueryServiceStatusEx(\r
+ hSc,\r
+ SC_STATUS_PROCESS_INFO,\r
+ (LPBYTE)&ServiceStatus,\r
+ sizeof(SERVICE_STATUS_PROCESS),\r
+ &BytesNeeded))\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+ \r
+ if (ServiceStatus.dwCheckPoint > dwOldCheckPoint)\r
+ {\r
+ /* The service is making progress. increment the progress bar */\r
+ SendMessage(hProgBar, PBM_STEPIT, 0, 0);\r
+ dwStartTickCount = GetTickCount();\r
+ dwOldCheckPoint = ServiceStatus.dwCheckPoint;\r
+ }\r
+ else\r
+ {\r
+ if(GetTickCount() - dwStartTickCount > ServiceStatus.dwWaitHint)\r
+ {\r
+ /* No progress made within the wait hint */\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ CloseServiceHandle(hSc);\r
+\r
+ if (ServiceStatus.dwCurrentState == Control)\r
+ {\r
+ SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0);\r
+ Sleep(1000);\r
+ return TRUE;\r
+ }\r
+ else\r
+ return FALSE;\r
+\r
+}\r
--- /dev/null
+//#include <stdarg>\r
+#include "servman.h"\r
+/* temp file for debugging */\r
+\r
+VOID GetError(DWORD err)\r
+{\r
+ LPVOID lpMsgBuf;\r
+\r
+ if (err == 0)\r
+ err = GetLastError();\r
+\r
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |\r
+ FORMAT_MESSAGE_FROM_SYSTEM |\r
+ FORMAT_MESSAGE_IGNORE_INSERTS,\r
+ NULL,\r
+ err,\r
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */\r
+ (LPTSTR) &lpMsgBuf,\r
+ 0,\r
+ NULL );\r
+\r
+ MessageBox(NULL, lpMsgBuf, _T("Error!"), MB_OK | MB_ICONERROR);\r
+\r
+ LocalFree(lpMsgBuf);\r
+}\r
+\r
+\r
+VOID DisplayString(PTCHAR Msg)\r
+{\r
+\r
+ MessageBox(NULL, Msg, _T("Error!"), MB_OK | MB_ICONERROR);\r
+\r
+}\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS Services\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: subsys/system/servman/progress.c\r
+ * PURPOSE: Progress dialog box message handler\r
+ * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy@gmail.com>\r
+ *\r
+ */\r
+\r
+#include "servman.h"\r
+\r
+extern HINSTANCE hInstance;\r
+//extern HWND hMainWnd;\r
+\r
+\r
+BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)\r
+{\r
+ switch(Message)\r
+ {\r
+ case WM_INITDIALOG:\r
+\r
+ break;\r
+\r
+ case WM_COMMAND:\r
+ switch(LOWORD(wParam))\r
+ {\r
+ case IDOK:\r
+ DestroyWindow(hDlg);\r
+ break;\r
+\r
+ }\r
+ break;\r
+\r
+ case WM_DESTROY:\r
+ DestroyWindow(hDlg);\r
+ break;\r
+\r
+ default:\r
+ return FALSE;\r
+ }\r
+\r
+ return TRUE;\r
+\r
+}\r
+\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS Services\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: subsys/system/servman/propsheet.c\r
+ * PURPOSE: Property dialog box message handler\r
+ * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>\r
+ *\r
+ */\r
+\r
+#include "servman.h"\r
+\r
+extern ENUM_SERVICE_STATUS_PROCESS *pServiceStatus;\r
+extern HINSTANCE hInstance;\r
+extern HWND hListView;\r
+extern HWND hMainWnd;\r
+\r
+\r
+typedef struct _PROP_DLG_INFO\r
+{\r
+ LPTSTR lpServiceName;\r
+ LPTSTR lpDisplayName;\r
+ LPTSTR lpDescription;\r
+ LPTSTR lpPathToExe;\r
+ TCHAR szStartupType;\r
+ TCHAR szServiceStatus[25];\r
+ LPTSTR lpStartParams;\r
+} PROP_DLG_INFO, *PPROP_DLG_INFO;\r
+\r
+\r
+/*\r
+ * Fills the 'startup type' combo box with possible\r
+ * values and sets it to value of the selected item\r
+ */\r
+VOID SetStartupType(HKEY hKey, HWND hwndDlg)\r
+{\r
+ HWND hList;\r
+ TCHAR buf[25];\r
+ DWORD dwValueSize = 0;\r
+ DWORD StartUp = 0;\r
+\r
+ hList = GetDlgItem(hwndDlg, IDC_START_TYPE);\r
+\r
+ LoadString(hInstance, IDS_SERVICES_AUTO, buf, sizeof(buf) / sizeof(TCHAR));\r
+ SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf);\r
+ LoadString(hInstance, IDS_SERVICES_MAN, buf, sizeof(buf) / sizeof(TCHAR));\r
+ SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf);\r
+ LoadString(hInstance, IDS_SERVICES_DIS, buf, sizeof(buf) / sizeof(TCHAR));\r
+ SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf);\r
+\r
+ dwValueSize = sizeof(DWORD);\r
+ if (RegQueryValueEx(hKey,\r
+ _T("Start"),\r
+ NULL,\r
+ NULL,\r
+ (LPBYTE)&StartUp,\r
+ &dwValueSize))\r
+ {\r
+ RegCloseKey(hKey);\r
+ return;\r
+ }\r
+\r
+ if (StartUp == 0x02)\r
+ SendMessage(hList, CB_SETCURSEL, 0, 0);\r
+ else if (StartUp == 0x03)\r
+ SendMessage(hList, CB_SETCURSEL, 1, 0);\r
+ else if (StartUp == 0x04)\r
+ SendMessage(hList, CB_SETCURSEL, 2, 0);\r
+\r
+}\r
+\r
+\r
+/*\r
+ * Populates the General Properties dialog with\r
+ * the relevant service information\r
+ */\r
+VOID GetDlgInfo(HWND hwndDlg)\r
+{\r
+ HKEY hKey;\r
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;\r
+ PROP_DLG_INFO DlgInfo;\r
+ LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s");\r
+ TCHAR buf[300];\r
+\r
+ /* get pointer to selected service */\r
+ Service = GetSelectedService();\r
+\r
+ /* open the registry key for the service */\r
+ _sntprintf(buf, sizeof(buf) / sizeof(TCHAR), Path, Service->lpServiceName);\r
+ RegOpenKeyEx(HKEY_LOCAL_MACHINE,\r
+ buf,\r
+ 0,\r
+ KEY_READ,\r
+ &hKey);\r
+\r
+ /* set the service name */\r
+ DlgInfo.lpServiceName = Service->lpServiceName;\r
+ SendDlgItemMessage(hwndDlg, IDC_SERV_NAME, WM_SETTEXT, 0, (\r
+ LPARAM)DlgInfo.lpServiceName);\r
+\r
+\r
+ /* set the display name */\r
+ DlgInfo.lpDisplayName = Service->lpDisplayName;\r
+ SendDlgItemMessage(hwndDlg, IDC_DISP_NAME, WM_SETTEXT, 0,\r
+ (LPARAM)DlgInfo.lpDisplayName);\r
+\r
+\r
+ /* set the description */\r
+ if (GetDescription(hKey, &DlgInfo.lpDescription))\r
+ SendDlgItemMessage(hwndDlg, IDC_DESCRIPTION, WM_SETTEXT, 0,\r
+ (LPARAM)DlgInfo.lpDescription);\r
+\r
+\r
+ /* set the executable path */\r
+ if (GetExecutablePath(&DlgInfo.lpPathToExe))\r
+ SendDlgItemMessage(hwndDlg, IDC_EXEPATH, WM_SETTEXT, 0, (LPARAM)DlgInfo.lpPathToExe);\r
+\r
+\r
+ /* set startup type */\r
+ SetStartupType(hKey, hwndDlg);\r
+\r
+\r
+\r
+ /* set service status */\r
+ if (Service->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING)\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_STARTED, DlgInfo.szServiceStatus,\r
+ sizeof(DlgInfo.szServiceStatus) / sizeof(TCHAR));\r
+ SendDlgItemMessageW(hwndDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus);\r
+ }\r
+ else\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_STOPPED, DlgInfo.szServiceStatus,\r
+ sizeof(DlgInfo.szServiceStatus) / sizeof(TCHAR));\r
+ SendDlgItemMessageW(hwndDlg, IDC_SERV_STATUS, WM_SETTEXT, 0, (LPARAM)DlgInfo.szServiceStatus);\r
+ }\r
+\r
+\r
+\r
+\r
+}\r
+\r
+\r
+#ifdef _MSC_VER\r
+#pragma warning(disable : 4100)\r
+#endif\r
+\r
+/*\r
+ * General Property dialog callback.\r
+ * Controls messages to the General dialog\r
+ */\r
+/* FIXME: this may be better as a modeless dialog */\r
+INT_PTR CALLBACK\r
+GeneralPageProc(HWND hwndDlg,\r
+ UINT uMsg,\r
+ WPARAM wParam,\r
+ LPARAM lParam)\r
+{\r
+\r
+ switch (uMsg)\r
+ {\r
+ case WM_INITDIALOG:\r
+ GetDlgInfo(hwndDlg);\r
+ break;\r
+\r
+ case WM_COMMAND:\r
+ switch(LOWORD(wParam))\r
+ {\r
+ case IDC_START:\r
+ SendMessage(hMainWnd, WM_COMMAND, ID_START, 0);\r
+ break;\r
+\r
+ case IDC_STOP:\r
+ SendMessage(hMainWnd, WM_COMMAND, ID_STOP, 0);\r
+ break;\r
+\r
+ case IDC_PAUSE:\r
+ SendMessage(hMainWnd, WM_COMMAND, ID_PAUSE, 0);\r
+ break;\r
+\r
+ case IDC_RESUME:\r
+ SendMessage(hMainWnd, WM_COMMAND, ID_RESUME, 0);\r
+ break;\r
+ }\r
+ break;\r
+\r
+ case WM_DESTROY:\r
+ break;\r
+\r
+ case WM_NOTIFY:\r
+ {\r
+ LPNMHDR lpnm = (LPNMHDR)lParam;\r
+\r
+ switch (lpnm->code)\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+ }\r
+\r
+ return FALSE;\r
+}\r
+\r
+\r
+\r
+/*\r
+ * Dependancies Property dialog callback.\r
+ * Controls messages to the Dependancies dialog\r
+ */\r
+/* FIXME: this may be better as a modeless dialog */\r
+INT_PTR CALLBACK\r
+DependanciesPageProc(HWND hwndDlg,\r
+ UINT uMsg,\r
+ WPARAM wParam,\r
+ LPARAM lParam)\r
+{\r
+\r
+ switch (uMsg)\r
+ {\r
+ case WM_INITDIALOG:\r
+\r
+ break;\r
+\r
+ case WM_COMMAND:\r
+ switch(LOWORD(wParam))\r
+ {\r
+ case IDC_START:\r
+ break;\r
+\r
+ case IDC_STOP:\r
+\r
+ break;\r
+ }\r
+ break;\r
+\r
+ case WM_DESTROY:\r
+ break;\r
+\r
+ case WM_NOTIFY:\r
+ {\r
+ LPNMHDR lpnm = (LPNMHDR)lParam;\r
+\r
+ switch (lpnm->code)\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+ }\r
+\r
+ return FALSE;\r
+}\r
+\r
+\r
+static VOID\r
+InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)\r
+{\r
+ ZeroMemory(psp, sizeof(PROPSHEETPAGE));\r
+ psp->dwSize = sizeof(PROPSHEETPAGE);\r
+ psp->dwFlags = PSP_DEFAULT;\r
+ psp->hInstance = hInstance;\r
+ psp->pszTemplate = MAKEINTRESOURCE(idDlg);\r
+ psp->pfnDlgProc = DlgProc;\r
+}\r
+\r
+\r
+LONG APIENTRY\r
+OpenPropSheet(HWND hwnd)\r
+{\r
+ PROPSHEETHEADER psh;\r
+ PROPSHEETPAGE psp[2];\r
+ TCHAR Caption[256];\r
+\r
+ LoadString(hInstance, IDS_PROP_SHEET, Caption, sizeof(Caption) / sizeof(TCHAR));\r
+\r
+ ZeroMemory(&psh, sizeof(PROPSHEETHEADER));\r
+ psh.dwSize = sizeof(PROPSHEETHEADER);\r
+ psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;\r
+ psh.hwndParent = NULL;\r
+ psh.hInstance = hInstance;\r
+ psh.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON));\r
+ psh.pszCaption = Caption;\r
+ psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);\r
+ psh.nStartPage = 0;\r
+ psh.ppsp = psp;\r
+\r
+ InitPropSheetPage(&psp[0], IDD_DLG_GENERAL, GeneralPageProc);\r
+ //InitPropSheetPage(&psp[1], IDD_DLG_GENERAL, LogonPageProc);\r
+ //InitPropSheetPage(&psp[2], IDD_DLG_GENERAL, RecoveryPageProc);\r
+ InitPropSheetPage(&psp[1], IDD_DLG_DEPEND, DependanciesPageProc);\r
+\r
+\r
+ return (LONG)(PropertySheet(&psh) != -1);\r
+}\r
+\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS Services\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: subsys/system/servman/query.c\r
+ * PURPOSE: Query service information\r
+ * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>\r
+ *\r
+ */\r
+\r
+#include "servman.h"\r
+\r
+extern HINSTANCE hInstance;\r
+extern HWND hListView;\r
+extern HWND hStatus;\r
+\r
+/* Stores the complete services array */\r
+ENUM_SERVICE_STATUS_PROCESS *pServiceStatus = NULL;\r
+\r
+\r
+/* Free service array */\r
+VOID FreeMemory(VOID)\r
+{\r
+ HeapFree(GetProcessHeap(), 0, pServiceStatus);\r
+}\r
+\r
+\r
+\r
+ENUM_SERVICE_STATUS_PROCESS* \r
+GetSelectedService(VOID)\r
+{\r
+ ENUM_SERVICE_STATUS_PROCESS *pSelectedService = NULL;\r
+ LVITEM item;\r
+\r
+ item.mask = LVIF_PARAM;\r
+ item.iItem = GetSelectedItem();\r
+ SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item);\r
+\r
+ /* copy pointer to selected service */\r
+ pSelectedService = (ENUM_SERVICE_STATUS_PROCESS *)item.lParam;\r
+\r
+ return pSelectedService;\r
+}\r
+\r
+\r
+/* Retrives the service description from the registry */\r
+BOOL GetDescription(HKEY hKey, LPTSTR *retDescription)\r
+{\r
+\r
+ LPTSTR Description = NULL;\r
+ DWORD dwValueSize = 0;\r
+ LONG ret = RegQueryValueEx(hKey,\r
+ _T("Description"),\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ &dwValueSize);\r
+ if (ret != ERROR_SUCCESS && ret != ERROR_FILE_NOT_FOUND && ret != ERROR_INVALID_HANDLE)\r
+ {\r
+ RegCloseKey(hKey);\r
+ return FALSE;\r
+ }\r
+\r
+ if (ret != ERROR_FILE_NOT_FOUND)\r
+ {\r
+ Description = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize);\r
+ if (Description == NULL)\r
+ {\r
+ RegCloseKey(hKey);\r
+ return FALSE;\r
+ }\r
+\r
+ if(RegQueryValueEx(hKey,\r
+ _T("Description"),\r
+ NULL,\r
+ NULL,\r
+ (LPBYTE)Description,\r
+ &dwValueSize))\r
+ {\r
+ HeapFree(GetProcessHeap(), 0, Description);\r
+ RegCloseKey(hKey);\r
+ return FALSE;\r
+ }\r
+ }\r
+\r
+ /* copy pointer over */\r
+ *retDescription = Description;\r
+\r
+ return TRUE;\r
+}\r
+\r
+\r
+/* get vendor of service binary */\r
+BOOL GetExecutablePath(LPTSTR *ExePath)\r
+{\r
+ SC_HANDLE hSCManager = NULL;\r
+ SC_HANDLE hSc = NULL;\r
+ LPQUERY_SERVICE_CONFIG pServiceConfig = NULL;\r
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;\r
+ DWORD BytesNeeded = 0;\r
+\r
+ /* copy pointer to selected service */\r
+ Service = GetSelectedService();\r
+\r
+ /* open handle to the SCM */\r
+ hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE);\r
+ if (hSCManager == NULL)\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* get a handle to the service requested for starting */\r
+ hSc = OpenService(hSCManager, Service->lpServiceName, SERVICE_QUERY_CONFIG);\r
+ if (hSc == NULL)\r
+ {\r
+ GetError(0);\r
+ goto cleanup;\r
+ }\r
+\r
+\r
+ if (!QueryServiceConfig(hSc, pServiceConfig, 0, &BytesNeeded))\r
+ {\r
+ if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)\r
+ {\r
+ pServiceConfig = (LPQUERY_SERVICE_CONFIG)\r
+ HeapAlloc(GetProcessHeap(), 0, BytesNeeded);\r
+ if (pServiceConfig == NULL)\r
+ goto cleanup;\r
+\r
+ if (!QueryServiceConfig(hSc,\r
+ pServiceConfig,\r
+ BytesNeeded,\r
+ &BytesNeeded))\r
+ {\r
+ HeapFree(GetProcessHeap(), 0, pServiceConfig);\r
+ goto cleanup;\r
+ }\r
+ }\r
+ else /* exit on failure */\r
+ {\r
+ goto cleanup;\r
+ }\r
+ }\r
+\r
+ *ExePath = pServiceConfig->lpBinaryPathName;\r
+\r
+ CloseServiceHandle(hSCManager);\r
+ CloseServiceHandle(hSc);\r
+\r
+ return TRUE;\r
+\r
+cleanup:\r
+ if (hSCManager != NULL)\r
+ CloseServiceHandle(hSCManager);\r
+ if (hSc != NULL)\r
+ CloseServiceHandle(hSc);\r
+ return FALSE;\r
+}\r
+\r
+\r
+\r
+\r
+BOOL\r
+RefreshServiceList(VOID)\r
+{\r
+ LVITEM item;\r
+ TCHAR szNumServices[32];\r
+ TCHAR szStatus[64];\r
+ DWORD NumServices = 0;\r
+ DWORD Index;\r
+ LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s");\r
+\r
+ ListView_DeleteAllItems(hListView);\r
+\r
+ NumServices = GetServiceList();\r
+\r
+ if (NumServices)\r
+ {\r
+ HICON hiconItem; /* icon for list-view items */\r
+ HIMAGELIST hSmall; /* image list for other views */\r
+ TCHAR buf[300]; /* buffer to hold key path */\r
+ INT NumListedServ = 0; /* how many services were listed */\r
+\r
+ /* Create the icon image lists */\r
+ hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),\r
+ GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR16, 1, 1);\r
+\r
+ /* Add an icon to each image list */\r
+ hiconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON),\r
+ IMAGE_ICON, 16, 16, 0);\r
+ ImageList_AddIcon(hSmall, hiconItem);\r
+\r
+ /* assign the image to the list view */\r
+ ListView_SetImageList(hListView, hSmall, LVSIL_SMALL);\r
+\r
+ for (Index = 0; Index < NumServices; Index++)\r
+ {\r
+ HKEY hKey = NULL;\r
+ LPTSTR Description = NULL;\r
+ LPTSTR LogOnAs = NULL;\r
+ DWORD StartUp = 0;\r
+ DWORD dwValueSize;\r
+\r
+ /* open the registry key for the service */\r
+ _sntprintf(buf, 300, Path,\r
+ pServiceStatus[Index].lpServiceName);\r
+\r
+ RegOpenKeyEx(HKEY_LOCAL_MACHINE,\r
+ buf,\r
+ 0,\r
+ KEY_READ,\r
+ &hKey);\r
+\r
+\r
+ /* set the display name */\r
+\r
+ ZeroMemory(&item, sizeof(LVITEM));\r
+ item.mask = LVIF_TEXT | LVIF_PARAM;\r
+ item.pszText = pServiceStatus[Index].lpDisplayName;\r
+\r
+ /* Set a pointer for each service so we can query it later.\r
+ * Not all services are added to the list, so we can't query\r
+ * the item number as they become out of sync with the array */\r
+ item.lParam = (LPARAM)&pServiceStatus[Index];\r
+\r
+ item.iItem = ListView_GetItemCount(hListView);\r
+ item.iItem = ListView_InsertItem(hListView, &item);\r
+\r
+\r
+\r
+\r
+ /* set the description */\r
+\r
+ if (GetDescription(hKey, &Description))\r
+ {\r
+ item.pszText = Description;\r
+ item.iSubItem = 1;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+\r
+ HeapFree(GetProcessHeap(), 0, Description);\r
+ }\r
+\r
+\r
+ /* set the status */\r
+\r
+ if (pServiceStatus[Index].ServiceStatusProcess.dwCurrentState\r
+ == SERVICE_RUNNING)\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_STARTED, szStatus,\r
+ sizeof(szStatus) / sizeof(TCHAR));\r
+ item.pszText = szStatus;\r
+ item.iSubItem = 2;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+\r
+\r
+\r
+ /* set the startup type */\r
+\r
+ dwValueSize = sizeof(DWORD);\r
+ if (RegQueryValueEx(hKey,\r
+ _T("Start"),\r
+ NULL,\r
+ NULL,\r
+ (LPBYTE)&StartUp,\r
+ &dwValueSize))\r
+ {\r
+ RegCloseKey(hKey);\r
+ continue;\r
+ }\r
+\r
+ if (StartUp == 0x02)\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_AUTO, szStatus,\r
+ sizeof(szStatus) / sizeof(TCHAR));\r
+ item.pszText = szStatus;\r
+ item.iSubItem = 3;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+ else if (StartUp == 0x03)\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_MAN, szStatus,\r
+ sizeof(szStatus) / sizeof(TCHAR));\r
+ item.pszText = szStatus;\r
+ item.iSubItem = 3;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+ else if (StartUp == 0x04)\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_DIS, szStatus,\r
+ sizeof(szStatus) / sizeof(TCHAR));\r
+ item.pszText = szStatus;\r
+ item.iSubItem = 3;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+\r
+\r
+\r
+ /* set Log On As */\r
+\r
+ dwValueSize = 0;\r
+ if (RegQueryValueEx(hKey,\r
+ _T("ObjectName"),\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ &dwValueSize))\r
+ {\r
+ RegCloseKey(hKey);\r
+ continue;\r
+ }\r
+\r
+ LogOnAs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize);\r
+ if (LogOnAs == NULL)\r
+ {\r
+ RegCloseKey(hKey);\r
+ return FALSE;\r
+ }\r
+ if(RegQueryValueEx(hKey,\r
+ _T("ObjectName"),\r
+ NULL,\r
+ NULL,\r
+ (LPBYTE)LogOnAs,\r
+ &dwValueSize))\r
+ {\r
+ HeapFree(GetProcessHeap(), 0, LogOnAs);\r
+ RegCloseKey(hKey);\r
+ continue;\r
+ }\r
+\r
+ item.pszText = LogOnAs;\r
+ item.iSubItem = 4;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+\r
+ HeapFree(GetProcessHeap(), 0, LogOnAs);\r
+\r
+ RegCloseKey(hKey);\r
+\r
+ }\r
+\r
+ NumListedServ = ListView_GetItemCount(hListView);\r
+\r
+ /* set the number of listed services in the status bar */\r
+ LoadString(hInstance, IDS_NUM_SERVICES, szNumServices,\r
+ sizeof(szNumServices) / sizeof(TCHAR));\r
+ _sntprintf(buf, 300, szNumServices, NumListedServ);\r
+ SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)buf);\r
+ }\r
+\r
+ /* turn redraw flag on. It's turned off initially via the LBS_NOREDRAW flag */\r
+ SendMessage (hListView, WM_SETREDRAW, TRUE, 0) ;\r
+\r
+ return TRUE;\r
+}\r
+\r
+\r
+\r
+\r
+DWORD\r
+GetServiceList(VOID)\r
+{\r
+ SC_HANDLE ScHandle;\r
+\r
+ DWORD BytesNeeded = 0;\r
+ DWORD ResumeHandle = 0;\r
+ DWORD NumServices = 0;\r
+\r
+ ScHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE);\r
+ if (ScHandle != INVALID_HANDLE_VALUE)\r
+ {\r
+ if (EnumServicesStatusEx(ScHandle,\r
+ SC_ENUM_PROCESS_INFO,\r
+ SERVICE_WIN32,\r
+ SERVICE_STATE_ALL,\r
+ (LPBYTE)pServiceStatus,\r
+ 0, &BytesNeeded,\r
+ &NumServices,\r
+ &ResumeHandle,\r
+ 0) == 0)\r
+ {\r
+ /* Call function again if required size was returned */\r
+ if (GetLastError() == ERROR_MORE_DATA)\r
+ {\r
+ /* reserve memory for service info array */\r
+ pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *)\r
+ HeapAlloc(GetProcessHeap(), 0, BytesNeeded);\r
+ if (pServiceStatus == NULL)\r
+ return FALSE;\r
+\r
+ /* fill array with service info */\r
+ if (EnumServicesStatusEx(ScHandle,\r
+ SC_ENUM_PROCESS_INFO,\r
+ SERVICE_WIN32,\r
+ SERVICE_STATE_ALL,\r
+ (LPBYTE)pServiceStatus,\r
+ BytesNeeded,\r
+ &BytesNeeded,\r
+ &NumServices,\r
+ &ResumeHandle,\r
+ 0) == 0)\r
+ {\r
+ HeapFree(GetProcessHeap(), 0, pServiceStatus);\r
+ return FALSE;\r
+ }\r
+ }\r
+ else /* exit on failure */\r
+ {\r
+ return FALSE;\r
+ }\r
+ }\r
+ }\r
+\r
+ CloseServiceHandle(ScHandle);\r
+\r
+ return NumServices;\r
+}\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+/*\r
+ //WORD wCodePage;\r
+ //WORD wLangID;\r
+ //SC_HANDLE hService;\r
+ //DWORD dwHandle, dwLen;\r
+ //UINT BufLen;\r
+ //TCHAR* lpData;\r
+ //TCHAR* lpBuffer;\r
+ //TCHAR szStrFileInfo[80];\r
+ //TCHAR FileName[MAX_PATH];\r
+ //LPVOID pvData;\r
+\r
+ //LPSERVICE_FAILURE_ACTIONS pServiceFailureActions = NULL;\r
+ //LPQUERY_SERVICE_CONFIG pServiceConfig = NULL;\r
+\r
+ BytesNeeded = 0;\r
+ hService = OpenService(ScHandle,\r
+ pServiceStatus[Index].lpServiceName,\r
+ SC_MANAGER_CONNECT);\r
+ if (hService != INVALID_HANDLE_VALUE)\r
+ {\r
+ / * check if service is required by the system* /\r
+ if (!QueryServiceConfig2(hService,\r
+ SERVICE_CONFIG_FAILURE_ACTIONS,\r
+ (LPBYTE)pServiceFailureActions,\r
+ 0,\r
+ &BytesNeeded))\r
+ {\r
+ if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)\r
+ {\r
+ pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS)\r
+ HeapAlloc(GetProcessHeap(), 0, BytesNeeded);\r
+ if (pServiceFailureActions == NULL)\r
+ return FALSE;\r
+\r
+ if (!QueryServiceConfig2(hService,\r
+ SERVICE_CONFIG_FAILURE_ACTIONS,\r
+ (LPBYTE)pServiceFailureActions,\r
+ BytesNeeded,\r
+ &BytesNeeded))\r
+ {\r
+ HeapFree(GetProcessHeap(), 0, pServiceFailureActions);\r
+ return FALSE;\r
+ }\r
+ }\r
+ else / * exit on failure * /\r
+ {\r
+ return FALSE;\r
+ }\r
+ }\r
+ if (pServiceFailureActions->cActions)\r
+ {\r
+ if (pServiceFailureActions->lpsaActions[0].Type == SC_ACTION_REBOOT)\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_YES, szStatus, 128);\r
+ item.pszText = szStatus;\r
+ item.iSubItem = 1;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+ }\r
+\r
+ if (pServiceFailureActions != NULL)\r
+ {\r
+ HeapFree(GetProcessHeap(), 0, pServiceFailureActions);\r
+ pServiceFailureActions = NULL;\r
+ }\r
+\r
+ / * get vendor of service binary * /\r
+ BytesNeeded = 0;\r
+ if (!QueryServiceConfig(hService, pServiceConfig, 0, &BytesNeeded))\r
+ {\r
+ if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)\r
+ {\r
+ pServiceConfig = (LPQUERY_SERVICE_CONFIG)\r
+ HeapAlloc(GetProcessHeap(), 0, BytesNeeded);\r
+ if (pServiceConfig == NULL)\r
+ return FALSE;\r
+\r
+ if (!QueryServiceConfig(hService,\r
+ pServiceConfig,\r
+ BytesNeeded,\r
+ &BytesNeeded))\r
+ {\r
+ HeapFree(GetProcessHeap(), 0, pServiceConfig);\r
+ return FALSE;\r
+ }\r
+ }\r
+ else / * exit on failure * /\r
+ {\r
+ return FALSE;\r
+ }\r
+ }\r
+\r
+ memset(&FileName, 0, MAX_PATH);\r
+ if (_tcscspn(pServiceConfig->lpBinaryPathName, _T("\"")))\r
+ {\r
+ _tcsncpy(FileName, pServiceConfig->lpBinaryPathName,\r
+ _tcscspn(pServiceConfig->lpBinaryPathName, _T(" ")) );\r
+ }\r
+ else\r
+ {\r
+ _tcscpy(FileName, pServiceConfig->lpBinaryPathName);\r
+ }\r
+\r
+ HeapFree(GetProcessHeap(), 0, pServiceConfig);\r
+ pServiceConfig = NULL;\r
+\r
+ dwLen = GetFileVersionInfoSize(FileName, &dwHandle);\r
+ if (dwLen)\r
+ {\r
+ lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen);\r
+ if (lpData == NULL)\r
+ return FALSE;\r
+\r
+ if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) {\r
+ HeapFree(GetProcessHeap(), 0, lpData);\r
+ return FALSE;\r
+ }\r
+\r
+ if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), &pvData, (PUINT) &BufLen))\r
+ {\r
+ wCodePage = LOWORD(*(DWORD*) pvData);\r
+ wLangID = HIWORD(*(DWORD*) pvData);\r
+ wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID);\r
+ }\r
+\r
+ if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) {\r
+ item.pszText = lpBuffer;\r
+ item.iSubItem = 2;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+ HeapFree(GetProcessHeap(), 0, lpData);\r
+ }\r
+ else\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128);\r
+ item.pszText = szStatus;\r
+ item.iSubItem = 2;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+ CloseServiceHandle(hService);\r
+ }\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+ HeapFree(GetProcessHeap(), 0, pServiceConfig);\r
+ pServiceConfig = NULL;\r
+\r
+ dwLen = GetFileVersionInfoSize(FileName, &dwHandle);\r
+ if (dwLen)\r
+ {\r
+ lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen);\r
+ if (lpData == NULL)\r
+ return FALSE;\r
+\r
+ if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) {\r
+ HeapFree(GetProcessHeap(), 0, lpData);\r
+ return FALSE;\r
+ }\r
+\r
+ if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"),\r
+ &pvData, (PUINT) &BufLen))\r
+ {\r
+ wCodePage = LOWORD(*(DWORD*) pvData);\r
+ wLangID = HIWORD(*(DWORD*) pvData);\r
+ wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"),\r
+ wCodePage, wLangID);\r
+ }\r
+\r
+ if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen))\r
+ {\r
+ item.pszText = lpBuffer;\r
+ item.iSubItem = 2;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+ HeapFree(GetProcessHeap(), 0, lpData);\r
+ }\r
+ else\r
+ {\r
+ LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128);\r
+ item.pszText = szStatus;\r
+ item.iSubItem = 2;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+\r
+\r
+*/\r
+\r
--- /dev/null
+#define IDC_STATIC -1\r
+\r
+/* about box info */\r
+#define IDD_ABOUTBOX 200\r
+#define IDC_LICENSE_EDIT 201\r
+#define IDS_LICENSE 202\r
+\r
+#define IDC_SERVLIST 1000\r
+#define IDC_TOOLBAR 1001\r
+#define IDC_STATUSBAR 1002\r
+\r
+#define ID_PROP 2000\r
+#define ID_REFRESH 2001\r
+#define ID_EXPORT 2002\r
+#define ID_START 2003\r
+#define ID_STOP 2004\r
+#define ID_PAUSE 2005\r
+#define ID_RESUME 2006\r
+#define ID_RESTART 2007\r
+#define ID_NEW 2008\r
+#define ID_HELP 2009\r
+#define ID_EXIT 2010\r
+\r
+#define IDR_MAINMENU 102\r
+#define IDR_POPUP 103\r
+#define ID_VIEW_CUSTOMIZE 4021\r
+#define ID_ABOUT 4031\r
+\r
+/* List view columns */\r
+#define IDS_FIRSTCOLUMN 1\r
+#define IDS_SECONDCOLUMN 2\r
+#define IDS_THIRDCOLUMN 3\r
+#define IDS_FOURTHCOLUMN 4\r
+#define IDS_FITHCOLUMN 5\r
+\r
+/* tooltips */\r
+#define IDS_TOOLTIP_PROP 6000\r
+#define IDS_TOOLTIP_REFRESH 6001\r
+#define IDS_TOOLTIP_EXPORT 6002\r
+#define IDS_TOOLTIP_START 6003\r
+#define IDS_TOOLTIP_STOP 6004\r
+#define IDS_TOOLTIP_PAUSE 6005\r
+#define IDS_TOOLTIP_RESTART 6006\r
+#define IDS_TOOLTIP_NEW 6007\r
+#define IDS_TOOLTIP_HELP 6008\r
+#define IDS_TOOLTIP_EXIT 6009\r
+\r
+#define IDS_SERVICES_STARTED 5000\r
+#define IDS_SERVICES_STOPPED 5001\r
+#define IDS_SERVICES_AUTO 5004\r
+#define IDS_SERVICES_MAN 5005\r
+#define IDS_SERVICES_DIS 5006\r
+#define IDS_NUM_SERVICES 5010\r
+\r
+#define IDI_SM_ICON 50\r
+#define IDB_BUTTONS 51\r
+\r
+/* toolbar buttons */\r
+#define TBICON_PROP 0\r
+#define TBICON_REFRESH 1\r
+#define TBICON_EXPORT 2\r
+#define TBICON_NEW 3\r
+#define TBICON_START 4\r
+#define TBICON_STOP 5\r
+#define TBICON_PAUSE 6\r
+#define TBICON_RESTART 7\r
+#define TBICON_HELP 8\r
+#define TBICON_EXIT 9\r
+\r
+/* properties dialog */\r
+#define IDS_PROP_SHEET 10000\r
+#define IDD_DLG_GENERAL 10001\r
+#define IDC_SERV_NAME 10041\r
+#define IDC_DISP_NAME 10051\r
+#define IDC_DESCRIPTION 10061\r
+#define IDC_EXEPATH 10062\r
+#define IDC_START_TYPE 10101\r
+#define IDC_SERV_STATUS 10121\r
+#define IDC_START 10131\r
+#define IDC_STOP 10141\r
+#define IDC_PAUSE 10151\r
+#define IDC_RESUME 10161\r
+#define IDC_START_PARAM 10191\r
+\r
+#define IDD_DLG_DEPEND 20001\r
+#define IDC_DEPEND_TREE1 20002\r
+#define IDC_DEPEND_TREE2 20003\r
+#define IDC_DEPEND_SERVICE 20004\r
+\r
+\r
+/* create service dialog */\r
+#define IDD_DLG_CREATE 8000\r
+#define IDC_CREATE_SERVNAME 8001\r
+#define IDC_CREATE_DISPNAME 8002\r
+#define IDC_CREATE_PATH 8003\r
+#define IDC_CREATE_DESC 8004\r
+#define IDC_CREATE_OPTIONS 8005\r
+#define ID_CREATE_HELP 8006\r
+\r
+/* progress bar */\r
+#define IDD_DLG_PROGRESS 7000\r
+#define IDC_SERVCON_PROGRESS 7001\r
+#define IDC_SERVCON_INFO 7002\r
+#define IDC_SERVCON_NAME 7003\r
+#define IDS_PROGRESS_INFO 7004\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS Services\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: subsys/system/servman/servman.c\r
+ * PURPOSE: Main window message handler\r
+ * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>\r
+ *\r
+ */\r
+\r
+#include "servman.h"\r
+\r
+const TCHAR ClassName[] = _T("ServiceManager");\r
+\r
+HINSTANCE hInstance;\r
+HWND hMainWnd;\r
+HWND hListView;\r
+HWND hStatus;\r
+HWND hTool;\r
+HWND hProgDlg;\r
+HMENU hShortcutMenu;\r
+INT SelectedItem;\r
+\r
+\r
+INT GetSelectedItem(VOID)\r
+{\r
+ return SelectedItem;\r
+}\r
+\r
+\r
+LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
+{\r
+ switch(msg)\r
+ {\r
+ case WM_CREATE:\r
+ {\r
+ TBADDBITMAP tbab;\r
+ INT iImageOffset;\r
+ INT statwidths[] = {110, -1}; /* widths of status bar */\r
+ TCHAR szTemp[256];\r
+ LVCOLUMN lvc = { 0 };\r
+\r
+ /* Toolbar buttons */\r
+ TBBUTTON tbb [NUM_BUTTONS] =\r
+ { /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */\r
+ {TBICON_PROP, ID_PROP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* properties */\r
+ {TBICON_REFRESH, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* refresh */\r
+ {TBICON_EXPORT, ID_EXPORT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* export */\r
+\r
+ /* Note: First item for a seperator is its width in pixels */\r
+ {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */\r
+\r
+ {TBICON_NEW, ID_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* create */\r
+\r
+ {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */\r
+\r
+ {TBICON_START, ID_START, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* start */\r
+ {TBICON_STOP, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* stop */\r
+ {TBICON_PAUSE, ID_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* pause */\r
+ {TBICON_RESTART, ID_RESTART, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* restart */\r
+\r
+ {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */\r
+\r
+ {TBICON_HELP, ID_HELP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* help */\r
+ {TBICON_EXIT, ID_EXIT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* exit */\r
+\r
+ };\r
+\r
+/* ======================== Create Toolbar ============================== */\r
+\r
+ /* Create Toolbar */\r
+ hTool = CreateWindowEx(0,\r
+ TOOLBARCLASSNAME,\r
+ NULL,\r
+ WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS,\r
+ 0, 0, 0, 0,\r
+ hwnd,\r
+ (HMENU)IDC_TOOLBAR,\r
+ hInstance,\r
+ NULL);\r
+ if(hTool == NULL)\r
+ MessageBox(hwnd, _T("Could not create tool bar."), _T("Error"), MB_OK | MB_ICONERROR);\r
+\r
+ /* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */\r
+ SendMessage(hTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);\r
+\r
+ /* Add custom images */\r
+ tbab.hInst = hInstance;\r
+ tbab.nID = IDB_BUTTONS;\r
+ iImageOffset = (INT)SendMessage(hTool, TB_ADDBITMAP, NUM_BUTTONS, (LPARAM)&tbab);\r
+ tbb[0].iBitmap += iImageOffset; /* properties */\r
+ tbb[1].iBitmap += iImageOffset; /* refresh */\r
+ tbb[2].iBitmap += iImageOffset; /* export */\r
+ tbb[4].iBitmap += iImageOffset; /* new */\r
+ tbb[6].iBitmap += iImageOffset; /* start */\r
+ tbb[7].iBitmap += iImageOffset; /* stop */\r
+ tbb[8].iBitmap += iImageOffset; /* pause */\r
+ tbb[9].iBitmap += iImageOffset; /* restart */\r
+ tbb[11].iBitmap += iImageOffset; /* help */\r
+ tbb[12].iBitmap += iImageOffset; /* exit */\r
+\r
+ /* Add buttons to toolbar */\r
+ SendMessage(hTool, TB_ADDBUTTONS, NUM_BUTTONS, (LPARAM) &tbb);\r
+\r
+ /* Show toolbar */\r
+ ShowWindow(hTool, SW_SHOWNORMAL);\r
+\r
+\r
+\r
+/* ======================== Create List View ============================== */\r
+\r
+ hListView = CreateWindowEx(0,\r
+ WC_LISTVIEW,\r
+ NULL,\r
+ WS_CHILD | WS_VISIBLE | LVS_REPORT | WS_BORDER |\r
+ LBS_NOTIFY | LVS_SORTASCENDING | LBS_NOREDRAW,\r
+ 0, 0, 0, 0, /* sized via WM_SIZE */\r
+ hwnd,\r
+ (HMENU) IDC_SERVLIST,\r
+ hInstance,\r
+ NULL);\r
+ if (hListView == NULL)\r
+ MessageBox(hwnd, _T("Could not create List View."), _T("Error"), MB_OK | MB_ICONERROR);\r
+\r
+ ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT |\r
+ LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP);\r
+\r
+ lvc.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT;\r
+ lvc.fmt = LVCFMT_LEFT;\r
+\r
+ /* Add columns to the list-view */\r
+\r
+ /* name */\r
+ lvc.iSubItem = 0;\r
+ lvc.cx = 150;\r
+ LoadString(hInstance, IDS_FIRSTCOLUMN, szTemp, 256);\r
+ lvc.pszText = szTemp;\r
+ ListView_InsertColumn(hListView, 0, &lvc);\r
+\r
+ /* description */\r
+ lvc.iSubItem = 1;\r
+ lvc.cx = 240;\r
+ LoadString(hInstance, IDS_SECONDCOLUMN, szTemp, 256);\r
+ lvc.pszText = szTemp;\r
+ ListView_InsertColumn(hListView, 1, &lvc);\r
+\r
+ /* status */\r
+ lvc.iSubItem = 2;\r
+ lvc.cx = 55;\r
+ LoadString(hInstance, IDS_THIRDCOLUMN, szTemp, 256);\r
+ lvc.pszText = szTemp;\r
+ ListView_InsertColumn(hListView, 2, &lvc);\r
+\r
+ /* startup type */\r
+ lvc.iSubItem = 3;\r
+ lvc.cx = 80;\r
+ LoadString(hInstance, IDS_FOURTHCOLUMN, szTemp, 256);\r
+ lvc.pszText = szTemp;\r
+ ListView_InsertColumn(hListView, 3, &lvc);\r
+\r
+ /* logon as */\r
+ lvc.iSubItem = 4;\r
+ lvc.cx = 100;\r
+ LoadString(hInstance, IDS_FITHCOLUMN, szTemp, 256);\r
+ lvc.pszText = szTemp;\r
+ ListView_InsertColumn(hListView, 4, &lvc);\r
+\r
+\r
+\r
+/* ======================== Create Status Bar ============================== */\r
+\r
+ hStatus = CreateWindowEx(0,\r
+ STATUSCLASSNAME,\r
+ NULL,\r
+ WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP,\r
+ 0, 0, 0, 0,\r
+ hwnd,\r
+ (HMENU)IDC_STATUSBAR,\r
+ hInstance,\r
+ NULL);\r
+ if(hStatus == NULL)\r
+ MessageBox(hwnd, _T("Could not create status bar."),\r
+ _T("Error!"), MB_OK | MB_ICONERROR);\r
+\r
+ SendMessage(hStatus, SB_SETPARTS, sizeof(statwidths)/sizeof(int), (LPARAM)statwidths);\r
+\r
+\r
+/* ======================== Create Popup Menu ============================== */\r
+\r
+ hShortcutMenu = LoadMenu(hInstance, MAKEINTRESOURCE (IDR_POPUP));\r
+ hShortcutMenu = GetSubMenu(hShortcutMenu, 0);\r
+\r
+\r
+\r
+\r
+/* ================= populate the list view with all services =================== */\r
+\r
+ RefreshServiceList();\r
+\r
+ }\r
+ break;\r
+\r
+ case WM_SIZE:\r
+ {\r
+ RECT rcTool;\r
+ int iToolHeight;\r
+\r
+ RECT rcStatus;\r
+ int iStatusHeight;\r
+\r
+ int lvHeight;\r
+ RECT rcClient;\r
+\r
+ /* Size toolbar and get height */\r
+ hTool = GetDlgItem(hwnd, IDC_TOOLBAR);\r
+ SendMessage(hTool, TB_AUTOSIZE, 0, 0);\r
+\r
+ GetWindowRect(hTool, &rcTool);\r
+ iToolHeight = rcTool.bottom - rcTool.top;\r
+\r
+ /* Size status bar and get height */\r
+ hStatus = GetDlgItem(hwnd, IDC_STATUSBAR);\r
+ SendMessage(hStatus, WM_SIZE, 0, 0);\r
+\r
+ GetWindowRect(hStatus, &rcStatus);\r
+ iStatusHeight = rcStatus.bottom - rcStatus.top;\r
+\r
+ /* Calculate remaining height and size list view */\r
+ GetClientRect(hwnd, &rcClient);\r
+\r
+ lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;\r
+\r
+ hListView = GetDlgItem(hwnd, IDC_SERVLIST);\r
+ SetWindowPos(hListView, NULL, 0, iToolHeight, rcClient.right, lvHeight, SWP_NOZORDER);\r
+ }\r
+ break;\r
+\r
+ case WM_NOTIFY:\r
+ {\r
+ NMHDR* nm = (NMHDR*) lParam;\r
+\r
+ switch (nm->code)\r
+ {\r
+ case NM_DBLCLK:\r
+ OpenPropSheet(hwnd);\r
+ break;\r
+\r
+ case LVN_ITEMCHANGED:\r
+ {\r
+ LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;\r
+\r
+ SelectedItem = pnmv->iItem;\r
+\r
+ }\r
+ break;\r
+\r
+ case TTN_GETDISPINFO:\r
+ {\r
+ LPTOOLTIPTEXT lpttt;\r
+ UINT idButton;\r
+\r
+ lpttt = (LPTOOLTIPTEXT) lParam;\r
+\r
+ /* Specify the resource identifier of the descriptive\r
+ * text for the given button. */\r
+ idButton = (UINT)lpttt->hdr.idFrom;\r
+ switch (idButton)\r
+ {\r
+ case ID_PROP:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PROP);\r
+ break;\r
+\r
+ case ID_REFRESH:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_REFRESH);\r
+ break;\r
+\r
+ case ID_EXPORT:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXPORT);\r
+ break;\r
+\r
+ case ID_START:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_START);\r
+ break;\r
+\r
+ case ID_STOP:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_STOP);\r
+ break;\r
+\r
+ case ID_PAUSE:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PAUSE);\r
+ break;\r
+\r
+ case ID_RESTART:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_RESTART);\r
+ break;\r
+\r
+ case ID_NEW:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_NEW);\r
+ break;\r
+\r
+ case ID_HELP:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_HELP);\r
+ break;\r
+\r
+ case ID_EXIT:\r
+ lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXIT);\r
+ break;\r
+\r
+ }\r
+ }\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ }\r
+ break;\r
+\r
+ case WM_CONTEXTMENU:\r
+ {\r
+ int xPos, yPos;\r
+\r
+ xPos = GET_X_LPARAM(lParam);\r
+ yPos = GET_Y_LPARAM(lParam);\r
+\r
+ TrackPopupMenuEx(hShortcutMenu, TPM_RIGHTBUTTON,\r
+ xPos, yPos, hwnd, NULL);\r
+ }\r
+ break;\r
+\r
+ case WM_COMMAND:\r
+\r
+ switch(LOWORD(wParam))\r
+ {\r
+ case ID_PROP:\r
+ OpenPropSheet(hwnd);\r
+\r
+ break;\r
+\r
+ case ID_REFRESH:\r
+ RefreshServiceList();\r
+ break;\r
+\r
+ case ID_EXPORT:\r
+ break;\r
+\r
+ case ID_START:\r
+ {\r
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;\r
+ TCHAR buf1[100];\r
+ TCHAR buf2[100];\r
+ /* open the progress dialog */\r
+ hProgDlg = CreateDialog(GetModuleHandle(NULL), \r
+ MAKEINTRESOURCE(IDD_DLG_PROGRESS),\r
+ hMainWnd, \r
+ (DLGPROC)ProgressDialogProc);\r
+ if (hProgDlg != NULL)\r
+ {\r
+ ShowWindow(hProgDlg, SW_SHOW);\r
+\r
+ /* write the info to the progress dialog */\r
+ LoadString(hInstance, IDS_PROGRESS_INFO, buf1,\r
+ sizeof(buf1) / sizeof(TCHAR));\r
+ _sntprintf(buf2, 100, buf1, _T("start"));\r
+ SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, 0, (LPARAM)buf2);\r
+\r
+ /* get pointer to selected service */\r
+ Service = GetSelectedService();\r
+\r
+ /* write the service name to the progress dialog */\r
+ SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, \r
+ (LPARAM)Service->lpServiceName);\r
+ }\r
+\r
+ if ( DoStartService(hProgDlg) )\r
+ {\r
+ LVITEM item;\r
+ TCHAR szStatus[64];\r
+\r
+ LoadString(hInstance, IDS_SERVICES_STARTED, szStatus,\r
+ sizeof(szStatus) / sizeof(TCHAR));\r
+ item.pszText = szStatus;\r
+ item.iItem = GetSelectedItem();\r
+ item.iSubItem = 2;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+\r
+ SendMessage(hProgDlg, WM_DESTROY, 0, 0);\r
+ }\r
+ break;\r
+\r
+ case ID_STOP:\r
+ {\r
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;\r
+ TCHAR buf1[100];\r
+ TCHAR buf2[100];\r
+ /* open the progress dialog */\r
+ hProgDlg = CreateDialog(GetModuleHandle(NULL), \r
+ MAKEINTRESOURCE(IDD_DLG_PROGRESS),\r
+ hMainWnd, \r
+ (DLGPROC)ProgressDialogProc);\r
+ if (hProgDlg != NULL)\r
+ {\r
+ ShowWindow(hProgDlg, SW_SHOW);\r
+\r
+ /* write the info to the progress dialog */\r
+ LoadString(hInstance, IDS_PROGRESS_INFO, buf1,\r
+ sizeof(buf1) / sizeof(TCHAR));\r
+ _sntprintf(buf2, 100, buf1, _T("stop"));\r
+ SendDlgItemMessage(hProgDlg, IDC_SERVCON_INFO, WM_SETTEXT, 0, (LPARAM)buf2);\r
+\r
+ /* get pointer to selected service */\r
+ Service = GetSelectedService();\r
+\r
+ /* write the service name to the progress dialog */\r
+ SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0, \r
+ (LPARAM)Service->lpServiceName);\r
+ }\r
+\r
+ if( Control(hProgDlg, SERVICE_CONTROL_STOP) )\r
+ {\r
+ LVITEM item;\r
+\r
+ item.pszText = '\0';\r
+ item.iItem = GetSelectedItem();\r
+ item.iSubItem = 2;\r
+ SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);\r
+ }\r
+\r
+ SendMessage(hProgDlg, WM_DESTROY, 0, 0);\r
+ }\r
+ break;\r
+\r
+ case ID_PAUSE:\r
+ Control(hProgDlg, SERVICE_CONTROL_PAUSE);\r
+ break;\r
+\r
+ case ID_RESUME:\r
+ Control(hProgDlg, SERVICE_CONTROL_CONTINUE );\r
+ break;\r
+\r
+ case ID_RESTART:\r
+ SendMessage(hMainWnd, WM_COMMAND, 0, ID_STOP);\r
+ SendMessage(hMainWnd, WM_COMMAND, 0, ID_START);\r
+ break;\r
+\r
+ case ID_NEW:\r
+ break;\r
+\r
+ case ID_HELP:\r
+ MessageBox(NULL, _T("Help is not yet implemented\n"),\r
+ _T("Note!"), MB_OK | MB_ICONINFORMATION);\r
+ break;\r
+\r
+ case ID_EXIT:\r
+ PostMessage(hwnd, WM_CLOSE, 0, 0);\r
+ break;\r
+\r
+ case ID_VIEW_CUSTOMIZE:\r
+ break;\r
+\r
+ case ID_ABOUT:\r
+ DialogBox(hInstance,\r
+ MAKEINTRESOURCE(IDD_ABOUTBOX),\r
+ hMainWnd,\r
+ (DLGPROC)AboutDialogProc);\r
+ break;\r
+\r
+ }\r
+ break;\r
+\r
+ case WM_CLOSE:\r
+ FreeMemory(); /* free the service array */\r
+ DestroyMenu(hShortcutMenu);\r
+ DestroyWindow(hwnd);\r
+ break;\r
+\r
+ case WM_DESTROY:\r
+ PostQuitMessage(0);\r
+ break;\r
+\r
+ default:\r
+ return DefWindowProc(hwnd, msg, wParam, lParam);\r
+ }\r
+ return 0;\r
+}\r
+\r
+#ifdef _MSC_VER\r
+#pragma warning(disable : 4100)\r
+#endif\r
+int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance,\r
+ LPSTR lpCmdLine, int nCmdShow)\r
+{\r
+ WNDCLASSEX wc;\r
+ MSG Msg;\r
+\r
+ hInstance = hThisInstance;\r
+\r
+ InitCommonControls();\r
+\r
+ wc.cbSize = sizeof(WNDCLASSEX);\r
+ wc.style = 0;\r
+ wc.lpfnWndProc = WndProc;\r
+ wc.cbClsExtra = 0;\r
+ wc.cbWndExtra = 0;\r
+ wc.hInstance = hInstance;\r
+ wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON));\r
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);\r
+ wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);\r
+ wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAINMENU);\r
+ wc.lpszClassName = ClassName;\r
+ wc.hIconSm = (HICON)LoadImage(hInstance,\r
+ MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0);\r
+\r
+ if(!RegisterClassEx(&wc))\r
+ {\r
+ MessageBox(NULL, _T("Window Registration Failed!"), _T("Error!"),\r
+ MB_ICONEXCLAMATION | MB_OK);\r
+ return 0;\r
+ }\r
+\r
+ hMainWnd = CreateWindowEx(\r
+ 0,\r
+ ClassName,\r
+ _T("ReactOS Service Manager"),\r
+ WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,\r
+ CW_USEDEFAULT, CW_USEDEFAULT, 650, 450,\r
+ NULL, NULL, hInstance, NULL);\r
+\r
+ if(hMainWnd == NULL)\r
+ {\r
+ MessageBox(NULL, _T("Window Creation Failed!"), _T("Error!"),\r
+ MB_ICONEXCLAMATION | MB_OK);\r
+ return 0;\r
+ }\r
+\r
+ ShowWindow(hMainWnd, nCmdShow);\r
+ UpdateWindow(hMainWnd);\r
+\r
+ while( GetMessage( &Msg, NULL, 0, 0 ) )\r
+ {\r
+ if(! IsDialogMessage(hProgDlg, &Msg) )\r
+ {\r
+ TranslateMessage(&Msg);\r
+ DispatchMessage(&Msg);\r
+ }\r
+\r
+ }\r
+ return (int)Msg.wParam;\r
+}\r
+\r
+\r
+\r
--- /dev/null
+#ifndef __SERVMAN_H\r
+#define __SERVMAN_H\r
+\r
+#define WIN32_LEAN_AND_MEAN\r
+#include <windows.h>\r
+#include <windowsx.h> /* GET_X/Y_LPARAM */\r
+#include <stdio.h>\r
+#include <tchar.h>\r
+#include <commctrl.h>\r
+#include "resource.h"\r
+\r
+#define MAX_KEY_LENGTH 256\r
+#define NUM_BUTTONS 13\r
+#define PROGRESSRANGE 8\r
+\r
+BOOL RefreshServiceList(VOID);\r
+\r
+BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
+BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);\r
+\r
+BOOL DoStartService(HWND hProgDlg);\r
+BOOL Control(HWND hProgBar, DWORD Control);\r
+\r
+INT GetSelectedItem(VOID);\r
+\r
+ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(VOID);\r
+\r
+VOID GetError(DWORD);\r
+VOID FreeMemory(VOID);\r
+VOID DisplayString(PTCHAR);\r
+\r
+BOOL GetDescription(HKEY, LPTSTR *);\r
+BOOL GetExecutablePath(LPTSTR *);\r
+\r
+LONG APIENTRY OpenPropSheet(HWND);\r
+\r
+DWORD GetServiceList(VOID);\r
+\r
+\r
+#endif /* __SERVMAN_H */\r
--- /dev/null
+#include <windows.h>\r
+#include <commctrl.h>\r
+#include "resource.h"\r
+\r
+\r
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Service Manager\0"\r
+#define REACTOS_STR_INTERNAL_NAME "services\0"\r
+#define REACTOS_STR_ORIGINAL_FILENAME "services.exe\0"\r
+//#include <reactos/version.rc>\r
+\r
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
+\r
+IDI_SM_ICON ICON "res/system.ico"\r
+\r
+#include "En.rc"\r
+//#include "De.rc" /* I don't want to have to keep altering 2 files whilst developing */\r
+\r
--- /dev/null
+<module name="servman" type="win32gui" installbase="system32" installname="servman.exe">\r
+ <include base="servman">.</include>\r
+ <define name="UNICODE" />\r
+ <define name="_UNICODE" />\r
+ <define name="__REACTOS__" />\r
+ <define name="__USE_W32API" />\r
+ <define name="_WIN32_IE">0x600</define>\r
+ <define name="_WIN32_WINNT">0x501</define>\r
+ <library>kernel32</library>\r
+ <library>user32</library>\r
+ <library>advapi32</library>\r
+ <library>version</library>\r
+ <library>comctl32</library>\r
+ <library>shell32</library>\r
+ <compilationunit name="unit.c">\r
+ <file>about.c</file>\r
+ <file>control.c</file>\r
+ <file>geterror.c</file>\r
+ <file>progress.c</file>\r
+ <file>propsheet.c</file>\r
+ <file>query.c</file>\r
+ <file>servman.c</file>\r
+ <file>start.c</file>\r
+ </compilationunit>\r
+ <file>servman.rc</file>\r
+ <pch>servman.h</pch>\r
+</module>\r
--- /dev/null
+/*\r
+ * PROJECT: ReactOS Services\r
+ * LICENSE: GPL - See COPYING in the top level directory\r
+ * FILE: subsys/system/servman/start.c\r
+ * PURPOSE: Start a service\r
+ * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>\r
+ *\r
+ */\r
+\r
+#include "servman.h"\r
+\r
+extern HWND hListView;\r
+extern HWND hMainWnd;\r
+\r
+BOOL DoStartService(HWND hProgDlg)\r
+{\r
+ HWND hProgBar;\r
+ SC_HANDLE hSCManager;\r
+ SC_HANDLE hSc;\r
+ SERVICE_STATUS_PROCESS ServiceStatus;\r
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;\r
+ DWORD BytesNeeded = 0;\r
+ INT ArgCount = 0;\r
+ DWORD dwStartTickCount, dwOldCheckPoint;\r
+\r
+ /* copy pointer to selected service */\r
+ Service = GetSelectedService();\r
+\r
+ /* set the progress bar range and step */\r
+ hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS);\r
+ SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE));\r
+ SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0);\r
+\r
+ /* open handle to the SCM */\r
+ hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);\r
+ if (hSCManager == NULL)\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* get a handle to the service requested for starting */\r
+ hSc = OpenService(hSCManager, Service->lpServiceName, SERVICE_ALL_ACCESS);\r
+ if (hSc == NULL)\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* start the service opened */\r
+ if (! StartService(hSc, ArgCount, NULL))\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* query the state of the service */\r
+ if (! QueryServiceStatusEx(hSc,\r
+ SC_STATUS_PROCESS_INFO,\r
+ (LPBYTE)&ServiceStatus,\r
+ sizeof(SERVICE_STATUS_PROCESS),\r
+ &BytesNeeded))\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+\r
+ /* Save the tick count and initial checkpoint. */\r
+ dwStartTickCount = GetTickCount();\r
+ dwOldCheckPoint = ServiceStatus.dwCheckPoint;\r
+\r
+ /* loop whilst service is not running */\r
+ /* FIXME: needs more control adding. 'Loop' is temparary */\r
+ while (ServiceStatus.dwCurrentState != SERVICE_RUNNING)\r
+ {\r
+ DWORD dwWaitTime;\r
+\r
+ dwWaitTime = ServiceStatus.dwWaitHint / 10;\r
+\r
+ if( dwWaitTime < 500 )\r
+ dwWaitTime = 500;\r
+ else if ( dwWaitTime > 5000 )\r
+ dwWaitTime = 5000;\r
+\r
+ /* increment the progress bar */\r
+ SendMessage(hProgBar, PBM_STEPIT, 0, 0);\r
+\r
+ /* wait before checking status */\r
+ Sleep(ServiceStatus.dwWaitHint / 8);\r
+\r
+ /* check status again */\r
+ if (! QueryServiceStatusEx(\r
+ hSc,\r
+ SC_STATUS_PROCESS_INFO,\r
+ (LPBYTE)&ServiceStatus,\r
+ sizeof(SERVICE_STATUS_PROCESS),\r
+ &BytesNeeded))\r
+ {\r
+ GetError(0);\r
+ return FALSE;\r
+ }\r
+ \r
+ if (ServiceStatus.dwCheckPoint > dwOldCheckPoint)\r
+ {\r
+ /* The service is making progress. increment the progress bar */\r
+ SendMessage(hProgBar, PBM_STEPIT, 0, 0);\r
+ dwStartTickCount = GetTickCount();\r
+ dwOldCheckPoint = ServiceStatus.dwCheckPoint;\r
+ }\r
+ else\r
+ {\r
+ if(GetTickCount() - dwStartTickCount > ServiceStatus.dwWaitHint)\r
+ {\r
+ /* No progress made within the wait hint */\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ CloseServiceHandle(hSc);\r
+\r
+ if (ServiceStatus.dwCurrentState == SERVICE_RUNNING)\r
+ {\r
+ SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0);\r
+ Sleep(1000);\r
+ return TRUE;\r
+ }\r
+ else\r
+ return FALSE;\r
+\r
+}\r
+\r
--- /dev/null
+# 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 <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> 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 <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> 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
--- /dev/null
+#
+# 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)
--- /dev/null
+/*\r
+ * WineFile\r
+ * Swedish Language Support\r
+ *\r
+ * Copyright 2005 David Nordenberg\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL\r
+#pragma code_page(1252)\r
+\r
+\r
+/* Menu */\r
+\r
+\r
+IDM_WINEFILE MENU FIXED IMPURE\r
+{\r
+ POPUP "&Arkiv" {\r
+ MENUITEM "&Öppna\tEnter", ID_ACTIVATE\r
+ MENUITEM "&Flytta...\tF7", ID_FILE_MOVE\r
+ MENUITEM "&Kopiera...\tF8", ID_FILE_COPY\r
+ MENUITEM "&I urklipp...\tF9", 118\r
+ MENUITEM "&Ta bort\tDel", ID_FILE_DELETE\r
+ MENUITEM "&Byt namn...", 109\r
+ MENUITEM "&Egenskaper...\tAlt+Enter", ID_EDIT_PROPERTIES\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Komprimera...", 119\r
+ MENUITEM "Packa &upp...", 120\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Kör...", ID_EXECUTE\r
+ MENUITEM "&Skriv ut...", 102\r
+ MENUITEM "Associera...", 103\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Skapa mapp...", 111\r
+ MENUITEM "&Sök...", 104\r
+ MENUITEM "&Välj filer...", 116\r
+ MENUITEM SEPARATOR\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "&Avsluta\tAlt+X", ID_FILE_EXIT\r
+#else\r
+ MENUITEM "&Avsluta", ID_FILE_EXIT\r
+#endif\r
+ }\r
+\r
+ POPUP "&Disk" {\r
+ MENUITEM "&Kopiera disk...", 201\r
+ MENUITEM "&Namnge disk...", 202\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Formatera disk...", ID_FORMAT_DISK\r
+#ifdef _WIN95\r
+ MENUITEM "&Skapa systemdisk...", -1 /*TODO*/\r
+#endif\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Anslut &Nätverksenhet", ID_CONNECT_NETWORK_DRIVE\r
+ MENUITEM "&Koppla ifrån Nätverksenhet", ID_DISCONNECT_NETWORK_DRIVE\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Dela ut...", 254\r
+ MENUITEM "&Ta bort utdelning...", 255\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Välj enhet...", 251\r
+ }\r
+\r
+ POPUP "&Träd" {\r
+ MENUITEM "&Nästa nivå\t+", 301\r
+ MENUITEM "Utöka &träd\t*", 302\r
+ MENUITEM "Utöka &alla\tCtrl+*", 303\r
+ MENUITEM "Kollapsa &träd\t-", 304\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Markera undermappar", 505\r
+ }\r
+\r
+ POPUP "&Visa" {\r
+ MENUITEM "&Träd och mapp", 413\r
+ MENUITEM "Bara tr&äd", 411\r
+ MENUITEM "Bara &mapp", 412\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "De&la", ID_VIEW_SPLIT\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Namn", ID_VIEW_NAME\r
+ MENUITEM "&Alla Fildetaljer", ID_VIEW_ALL_ATTRIBUTES, CHECKED\r
+ MENUITEM "&Vissa detaljer...", ID_VIEW_SELECTED_ATTRIBUTES\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Sortera efter namn", ID_VIEW_SORT_NAME\r
+ MENUITEM "Sortera efter t&yp", ID_VIEW_SORT_TYPE\r
+ MENUITEM "Sortera efter st&orlek", ID_VIEW_SORT_SIZE\r
+ MENUITEM "Sortera efter &datum", ID_VIEW_SORT_DATE\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Sortera efter &...", ID_VIEW_FILTER\r
+ }\r
+\r
+ POPUP "&Inställningar" {\r
+ MENUITEM "&Bekräftelse...", 501\r
+ MENUITEM "&Teckensnitt...", ID_SELECT_FONT\r
+ MENUITEM "&Konfigurera verktygsfält...", 512\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Verktygsfält", ID_VIEW_TOOL_BAR, CHECKED\r
+ MENUITEM "&Enhetsfält", ID_VIEW_DRIVE_BAR, CHECKED\r
+ MENUITEM "St&atusfält", ID_VIEW_STATUSBAR, CHECKED\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "F&ullskärm\tCtrl+Shift+S", ID_VIEW_FULLSCREEN\r
+#endif\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Minimera vid körning", 504\r
+ MENUITEM "&Spara ändringar vid stängning", 511\r
+ }\r
+\r
+ POPUP "&Säkerhet" {\r
+ MENUITEM "&Åtkomst...", 605\r
+ MENUITEM "&Loggning...", 606\r
+ MENUITEM "&Ägare...", 607\r
+ }\r
+\r
+ POPUP "&Fönster" {\r
+ MENUITEM "Nytt &fönster", ID_WINDOW_NEW\r
+ MENUITEM "Överlappande\tCtrl+F5", ID_WINDOW_CASCADE\r
+ MENUITEM "Ordna &horizontellt", ID_WINDOW_TILE_HORZ\r
+ MENUITEM "Ordna &vertikalt\tCtrl+F4", ID_WINDOW_TILE_VERT\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "Ordna automatiskt", ID_WINDOW_AUTOSORT\r
+#endif\r
+ MENUITEM "Ordna &symboler", ID_WINDOW_ARRANGE\r
+ MENUITEM "&Uppdatera\tF5", ID_REFRESH\r
+ }\r
+\r
+ POPUP "&?" {\r
+ MENUITEM "&Hjälpavsnitt\tF1", ID_HELP\r
+ MENUITEM "Hjälp &sök...\tF1", ID_HELP\r
+ MENUITEM "&Använda hjälpen\tF1", ID_HELP_USING\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Information om &Winefile...", ID_ABOUT\r
+#ifdef __WINE__\r
+ MENUITEM "Info about &Wine...", ID_ABOUT_WINE\r
+#endif\r
+ }\r
+}\r
+\r
+\r
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63\r
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Kör"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10\r
+ CONTROL "&Kommando:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10\r
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL\r
+ CONTROL "Som &symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12\r
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14\r
+ PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14\r
+ PUSHBUTTON "&Hjälp", 254, 158, 43, 47, 14\r
+}\r
+\r
+IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63\r
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Välj mål"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10\r
+ CONTROL "&Sökväg:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10\r
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL\r
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14\r
+ PUSHBUTTON "Avbryt", 2, 158, 23, 47, 14\r
+ PUSHBUTTON "&Bläddra", 254, 158, 43, 47, 14\r
+}\r
+\r
+STRINGTABLE\r
+{\r
+ IDS_FONT_SEL_DLG_NAME "Verkställ teckensnittsinställningar"\r
+ IDS_FONT_SEL_ERROR "Ett fel uppstog när ett nytt teckensnitt valdes."\r
+}\r
+\r
+STRINGTABLE\r
+{\r
+ IDS_WINEFILE "Winefile"\r
+ IDS_ERROR "Fel"\r
+ IDS_ROOT_FS "root fs"\r
+ IDS_UNIXFS "unixfs"\r
+ IDS_DESKTOP "Skrivbord"\r
+ IDS_SHELL "Skal"\r
+ IDS_TITLEFMT "%s - %s"\r
+ IDS_NO_IMPL "Ej implementerat ännu"\r
+ IDS_WINE "WINE"\r
+ IDS_WINE_FILE "Wine File"\r
+}\r
+\r
+STRINGTABLE\r
+{\r
+ IDS_COL_NAME "Namn"\r
+ IDS_COL_SIZE "Storlek"\r
+ IDS_COL_CDATE "CDatum"\r
+ IDS_COL_ADATE "ADatum"\r
+ IDS_COL_MDATE "MDatum"\r
+ IDS_COL_IDX "Index/Inode"\r
+ IDS_COL_LINKS "Länkar"\r
+ IDS_COL_ATTR "Attribut"\r
+ IDS_COL_SEC "Säkerhet"\r
+}\r
--- /dev/null
+/*\r
+ * WineFile\r
+ * Czech Language Support\r
+ *\r
+ * Copyright 2000 Martin Fuchs\r
+ * Copyright 2002 Steven Edwards\r
+ * Copyright 2002 Alexandre Julliard\r
+ * Copyright 2004 David Kredba\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+LANGUAGE LANG_CZECH, SUBLANG_NEUTRAL\r
+#pragma code_page(1250)\r
+\r
+\r
+/* Menu */\r
+\r
+IDM_WINEFILE MENU FIXED IMPURE\r
+{\r
+ POPUP "&Soubor" {\r
+ MENUITEM "&Otevøít\tEnter", ID_ACTIVATE\r
+ MENUITEM "&Pøesunout...\tF7", ID_FILE_MOVE\r
+ MENUITEM "&Kopírovat...\tF8", ID_FILE_COPY\r
+ MENUITEM "&Ve schránce...\tF9", 118\r
+ MENUITEM "&Smazat\tDel", ID_FILE_DELETE\r
+ MENUITEM "Pø&ejmenovat...", 109\r
+ MENUITEM "V&lastnosti...\tAlt+Enter", ID_EDIT_PROPERTIES\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Komprese...", 119\r
+ MENUITEM "&Dekomprese...", 120\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Spustit...", ID_EXECUTE\r
+ MENUITEM "&Tisknout...", 102\r
+ MENUITEM "Asociovat...", 103\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "V&ytvoøit adresáø...", 111\r
+ MENUITEM "&Hledat...", 104\r
+ MENUITEM "&Zvolit voubory...", 116\r
+ MENUITEM SEPARATOR\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "K&onec\tAlt+X", ID_FILE_EXIT\r
+#else\r
+ MENUITEM "K&onec", ID_FILE_EXIT\r
+#endif\r
+ }\r
+\r
+ POPUP "&Disk" {\r
+ MENUITEM "&Kopírovat disk...", 201\r
+ MENUITEM "&Jmenovka disk...", 202\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Formátovat disk...", ID_FORMAT_DISK\r
+#ifdef _WIN95\r
+ MENUITEM "&Vytvoøit systemový disk...", -1 /*TODO*/\r
+#endif\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Pøipojit &sí\9dové zaøízení", ID_CONNECT_NETWORK_DRIVE\r
+ MENUITEM "&Odpojit &sí\9dové zaøízení", ID_DISCONNECT_NETWORK_DRIVE\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Sdílet jako...", 254\r
+ MENUITEM "&Odstranit sdílení...", 255\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Zvolit zaøízení...", 251\r
+ }\r
+\r
+ POPUP "&Adresáøe" {\r
+ MENUITEM "&Dal\9aí úroveò\t+", 301\r
+ MENUITEM "Rozbalit &strom\t*", 302\r
+ MENUITEM "Rozbalit &v\9ae\tStrg+*", 303\r
+ MENUITEM "Sbalit &strom\t-", 304\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Oznaèit potomky", 505\r
+ }\r
+\r
+ POPUP "&Zobrazení" {\r
+ MENUITEM "&Strom a adresáøe", 413\r
+ MENUITEM "&Jen strom", 411\r
+ MENUITEM "Jen &adresáøe", 412\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Rozdìlit", ID_VIEW_SPLIT\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Jméno", ID_VIEW_NAME\r
+ MENUITEM "&Detaily v\9aech souborù", ID_VIEW_ALL_ATTRIBUTES, CHECKED\r
+ MENUITEM "Èá&steèné detaily...", ID_VIEW_SELECTED_ATTRIBUTES\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Tøídit podle jména", ID_VIEW_SORT_NAME\r
+ MENUITEM "Tøídit &podle typu", ID_VIEW_SORT_TYPE\r
+ MENUITEM "Tøídit podle &velikosti", ID_VIEW_SORT_SIZE\r
+ MENUITEM "Tøídit podle &data", ID_VIEW_SORT_DATE\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Tøídit podle &...", ID_VIEW_FILTER\r
+ }\r
+\r
+ POPUP "&Nastavení" {\r
+ MENUITEM "&Potvrzování...", 501\r
+ MENUITEM "&Písmo...", ID_SELECT_FONT\r
+ MENUITEM "Upravit panel &nástrojù...", 512\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Panel nástrojù", ID_VIEW_TOOL_BAR, CHECKED\r
+ MENUITEM "&Panel zaøíení", ID_VIEW_DRIVE_BAR, CHECKED\r
+ MENUITEM "&Stavový øádek", ID_VIEW_STATUSBAR, CHECKED\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "&Celaá obrazovka\tCtrl+Shift+S", ID_VIEW_FULLSCREEN\r
+#endif\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Minimalizovat pøi spu\9atìní", 504\r
+ MENUITEM "&Ulo\9eit nastavení pøi vypnutí",511\r
+ }\r
+\r
+\r
+ POPUP "&Zabezpeèení" {\r
+ MENUITEM "&Pøístup...", 605\r
+ MENUITEM "&Logování...", 606\r
+ MENUITEM "&Vlastník...", 607\r
+ }\r
+\r
+ POPUP "&Okno" {\r
+ MENUITEM "Nové &okno", ID_WINDOW_NEW\r
+ MENUITEM "Kaskádování\tCtrl+F5", ID_WINDOW_CASCADE\r
+ MENUITEM "Uspoøádat &horizontálnì", ID_WINDOW_TILE_HORZ\r
+ MENUITEM "Uspoøádat &vertikálnì\tCtrl+F4",ID_WINDOW_TILE_VERT\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "Zarovnat automaticky", ID_WINDOW_AUTOSORT\r
+#endif\r
+ MENUITEM "Zarovnat &symboly", ID_WINDOW_ARRANGE\r
+ MENUITEM "&Aktualizovat\tF5", ID_REFRESH\r
+ }\r
+\r
+ POPUP "&?" {\r
+ MENUITEM "&Témata nápovìdy\tF1", ID_HELP\r
+ MENUITEM "Hledání v &nápovìdì...\tF1", ID_HELP\r
+ MENUITEM "&Jak pou\9eívat nápovìdu\tF1", ID_HELP_USING\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Informace o Winefile...", ID_ABOUT\r
+#ifdef __WINE__\r
+ MENUITEM "Informace o &Wine...", ID_ABOUT_WINE\r
+#endif\r
+ }\r
+}\r
+\r
+\r
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63\r
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Spustit"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10\r
+ CONTROL "&Pøíkaz:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10\r
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL\r
+ CONTROL "Jako &Symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12\r
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14\r
+ PUSHBUTTON "Zru\9ait", 2, 158, 23, 47, 14\r
+ PUSHBUTTON "&Pomoc", 254, 158, 43, 47, 14\r
+}\r
+\r
+IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63\r
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Zvolte cíl"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10\r
+ CONTROL "&Cesta:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10\r
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL\r
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14\r
+ PUSHBUTTON "Zru\9ait", 2, 158, 23, 47, 14\r
+ PUSHBUTTON "&Procházet", 254, 158, 43, 47, 14\r
+}\r
+\r
+STRINGTABLE\r
+{\r
+ IDS_FONT_SEL_DLG_NAME "Aplikování nastavení písma"\r
+ IDS_FONT_SEL_ERROR "Chyba pøi volbì nového písma."\r
+}\r
+\r
+STRINGTABLE\r
+{\r
+ IDS_WINEFILE "Winefile"\r
+ IDS_ERROR "Chyba"\r
+ IDS_ROOT_FS "root fs"\r
+ IDS_UNIXFS "unixfs"\r
+ IDS_DESKTOP "Plocha"\r
+ IDS_SHELL "Pøíkazový øádek"\r
+ IDS_TITLEFMT "%s - %s"\r
+ IDS_NO_IMPL "Zatím neimplementováno"\r
+ IDS_WINE "WINE"\r
+ IDS_WINE_FILE "Wine File"\r
+}\r
+\r
+STRINGTABLE\r
+{\r
+ IDS_COL_NAME "Jméno"\r
+ IDS_COL_SIZE "Velikost"\r
+ IDS_COL_CDATE "Datum vytvoøení"\r
+ IDS_COL_ADATE "Datum posledního pøístupu"\r
+ IDS_COL_MDATE "Datum poslední modifikace"\r
+ IDS_COL_IDX "Index/Inode"\r
+ IDS_COL_LINKS "Linky"\r
+ IDS_COL_ATTR "Atributy"\r
+ IDS_COL_SEC "Zabezpeèení"\r
+}\r
--- /dev/null
+/*
+ * 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"
+}
--- /dev/null
+<hr size="1">
+<table border="0" width="100%" cellspacing="0">
+ <tr>
+ <td><address style="align: right;"><small>
+Winefile Source Code Documentation
+<br>generated on 02.10.2005 by <a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0>
+ </small></address>
+ </td>
+ <td>
+ <p align="right"><a href="http://www.sky.franken.de/winefile/" target="_parent">Winefile Homepage</a>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
--- /dev/null
+<hr size="1">
+<table border="0" width="100%" cellspacing="0">
+ <tr>
+ <td><address style="align: right;"><small>
+Winefile Source Code Documentation
+<br>@GEN@ by <a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0>
+ </small></address>
+ </td>
+ <td>
+ <p align="right"><a href="http://www.sky.franken.de/winefile/" target="_parent">Winefile Homepage</a>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
--- /dev/null
+/*
+ * WineFile
+ * English Language Support
+ *
+ * Copyright 2000 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_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(850)
+
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&File" {
+ MENUITEM "&Open\tEnter", ID_ACTIVATE
+ MENUITEM "&Move...\tF7", ID_FILE_MOVE
+ MENUITEM "&Copy...\tF8", ID_FILE_COPY
+ MENUITEM "&In Clipboard...\tF9", 118
+ MENUITEM "&Delete\tDel", ID_FILE_DELETE
+ MENUITEM "Re&name...", 109
+ MENUITEM "Propert&ies...\tAlt+Enter", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "C&ompress...", 119
+ MENUITEM "Dec&ompress...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "&Run...", ID_EXECUTE
+ MENUITEM "&Print...", 102
+ MENUITEM "Associate...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Cr&eate Directory...", 111
+ MENUITEM "Searc&h...", 104
+ MENUITEM "&Select Files...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "E&xit\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "E&xit", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disk" {
+ MENUITEM "&Copy Disk...", 201
+ MENUITEM "&Label Disk...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Format Disk...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Make System Disk...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Connect &Network Drive", ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "&Disconnect Network Drive", ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "Share as...", 254
+ MENUITEM "&Remove Share...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "&Select Drive...", 251
+ }
+
+ POPUP "Di&rectories" {
+ MENUITEM "&Next Level\t+", 301
+ MENUITEM "Expand &Tree\t*", 302
+ MENUITEM "Expand &all\tStrg+*", 303
+ MENUITEM "Collapse &Tree\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Mark Children", 505
+ }
+
+ POPUP "&View" {
+ MENUITEM "T&ree and Directory", 413
+ MENUITEM "Tr&ee Only", 411
+ MENUITEM "Directory &Only", 412
+ MENUITEM SEPARATOR
+ MENUITEM "Sp&lit", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Name", ID_VIEW_NAME
+ MENUITEM "&All File Details", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "&Partial Details...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "&Sort by Name", ID_VIEW_SORT_NAME
+ MENUITEM "Sort &by Type", ID_VIEW_SORT_TYPE
+ MENUITEM "Sort by Si&ze", ID_VIEW_SORT_SIZE
+ MENUITEM "Sort by &Date", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Filter by &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Options" {
+ MENUITEM "&Confirmation...", 501
+ MENUITEM "&Font...", ID_SELECT_FONT
+ MENUITEM "Customize Tool&bar...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "&Drivebar", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "&Status Bar", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Minimize on run", 504
+ MENUITEM "&Save settings on exit", 511
+ }
+
+
+ POPUP "&Security" {
+ MENUITEM "&Access...", 605
+ MENUITEM "&Logging...", 606
+ MENUITEM "&Owner...", 607
+ }
+
+ POPUP "&Window" {
+ MENUITEM "New &Window", ID_WINDOW_NEW
+ MENUITEM "Cascading\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Tile &Horizontally", ID_WINDOW_TILE_HORZ
+ MENUITEM "Tile &Vertically\tCtrl+F4", ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Arrange Automatically", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "Arrange &Symbols", ID_WINDOW_ARRANGE
+ MENUITEM "&Refresh\tF5", ID_REFRESH
+ }
+
+ POPUP "&?" {
+ MENUITEM "&Help Topics\tF1", ID_HELP
+ MENUITEM "Help &Search...\tF1", ID_HELP
+ MENUITEM "&Using Help\tF1", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&Info about 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 "Execute"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Command:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "As &Symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Cancel", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Help", 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 "Select destination"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Path:", -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 "Cancel", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Browse", 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 "By File Type"
+FONT 8, "MS Sans Serif"
+BEGIN
+ LTEXT "&Name:",-1,7,8,22,10
+ EDITTEXT IDC_VIEW_PATTERN,31,7,63,12,ES_AUTOHSCROLL
+ GROUPBOX "File Type",-1,7,23,87,56
+ CONTROL "&Directories",IDC_VIEW_TYPE_DIRECTORIES,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,32,70,10
+ CONTROL "&Programs",IDC_VIEW_TYPE_PROGRAMS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,43,70,10
+ CONTROL "Docu&ments",IDC_VIEW_TYPE_DOCUMENTS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,54,70,10
+ CONTROL "&Other files",IDC_VIEW_TYPE_OTHERS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,65,70,10
+ CONTROL "Show Hidden/&System Files",IDC_VIEW_TYPE_HIDDEN,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,81,106,9
+ DEFPUSHBUTTON "OK",IDOK,104,7,50,14
+ PUSHBUTTON "Cancel",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 "Properties for %s"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,191,7,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,191,29,50,14
+ LTEXT "&File Name:",-1,7,7,59,9
+ EDITTEXT IDC_STATIC_PROP_FILENAME,71,7,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Full &Path:",-1,7,18,59,9
+ EDITTEXT IDC_STATIC_PROP_PATH,71,18,120,9, ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Last Change:",-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 "Cop&yright:",-1,7,51,59,9
+ EDITTEXT IDC_STATIC_PROP_COPYRIGHT,71,51,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Size:",-1,7,62,59,9
+ EDITTEXT IDC_STATIC_PROP_SIZE,71,62,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ GROUPBOX "Attributes",-1,7,79,158,46
+ CONTROL "&Read Only",IDC_CHECK_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,91,68,9
+ CONTROL "H&idden",IDC_CHECK_HIDDEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,91,68,9
+ CONTROL "&Archive",IDC_CHECK_ARCHIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,101,68,9
+ CONTROL "&System",IDC_CHECK_SYSTEM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,101,68,9
+ CONTROL "&Compressed",IDC_CHECK_COMPRESSED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,17,111,68,9
+ GROUPBOX "&Version Information",-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 "Applying font settings"
+ IDS_FONT_SEL_ERROR "Error while selecting new font."
+}
+
+STRINGTABLE
+{
+ IDS_WINEFILE "Winefile"
+ IDS_ERROR "Error"
+ IDS_ROOT_FS "root fs"
+ IDS_UNIXFS "unixfs"
+ IDS_DESKTOP "Desktop"
+ IDS_SHELL "Shell"
+ IDS_TITLEFMT "%s - %s"
+ IDS_NO_IMPL "Not yet implemented"
+ IDS_WINE "WINE"
+ IDS_WINE_FILE "Wine File"
+}
+
+STRINGTABLE
+{
+ IDS_COL_NAME "Name"
+ IDS_COL_SIZE "Size"
+ IDS_COL_CDATE "CDate"
+ IDS_COL_ADATE "ADate"
+ IDS_COL_MDATE "MDate"
+ IDS_COL_IDX "Index/Inode"
+ IDS_COL_LINKS "Links"
+ IDS_COL_ATTR "Attributes"
+ IDS_COL_SEC "Security"
+
+ IDS_FREE_SPACE_FMT "%s of %s free"
+}
--- /dev/null
+/*
+ * WineFile
+ * Spanish Language Support
+ *
+ * Copyright 2004 José Manuel Ferrer Ortiz
+ *
+ * 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_SPANISH, SUBLANG_NEUTRAL
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&Archivo" {
+ MENUITEM "&Abrir\tEnter", ID_ACTIVATE
+ MENUITEM "Mo&ver...\tF7", ID_FILE_MOVE
+ MENUITEM "&Copiar...\tF8", ID_FILE_COPY
+ MENUITEM "E&n portapapeles...\tF9", 118
+ MENUITEM "&Eliminar\tDel", ID_FILE_DELETE
+ MENUITEM "&Renombrar...", 109
+ MENUITEM "&Propiedades...\tAlt+Enter", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "C&omprimir...", 119
+ MENUITEM "&Descomprimir...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "E&jecutar...", ID_EXECUTE
+ MENUITEM "I&mprimir...", 102
+ MENUITEM "Asoc&iar...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Crear direc&torio...", 111
+ MENUITEM "&Buscar...", 104
+ MENUITEM "Se&leccionar archivos...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "&Salir\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "&Salir", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disco" {
+ MENUITEM "&Copiar disco...", 201
+ MENUITEM "E&tiquetar disco...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Formatear disco...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Hacer disco de sistema...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "C&onectar unidad de red", ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "&Desconectar unidad de red", ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "Co&mpartir como...", 254
+ MENUITEM "&Eliminar compartido...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "&Seleccionar unidad...", 251
+ }
+
+ POPUP "Di&rectorios" {
+ MENUITEM "&Siguiente nivel\t+", 301
+ MENUITEM "&Expandir árbol\t*", 302
+ MENUITEM "Expandir &todo\tStrg+*", 303
+ MENUITEM "&Colapsar árbol\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Marcar hijos", 505
+ }
+
+ POPUP "&Ver" {
+ MENUITEM "Á&rbol y directorio", 413
+ MENUITEM "Árbol &sólo", 411
+ MENUITEM "&Directorio sólo", 412
+ MENUITEM SEPARATOR
+ MENUITEM "Di&vidir", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "No&mbre", ID_VIEW_NAME
+ MENUITEM "T&odos los detalles", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "Detalles &parciales...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "Ordenar por &nombre", ID_VIEW_SORT_NAME
+ MENUITEM "Ordenar por &tipo", ID_VIEW_SORT_TYPE
+ MENUITEM "Ordenar por t&amaño", ID_VIEW_SORT_SIZE
+ MENUITEM "Ordenar por &fecha", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Ordenar por &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Opciones" {
+ MENUITEM "&Confirmación...", 501
+ MENUITEM "&Fuente...", ID_SELECT_FONT
+ MENUITEM "Personalizar barra &herramientas...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "&Barra de herramientas", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "Barra de &unidades", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "Barra de &estado", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "&Pantalla completa\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Minimizar al ejecutarse", 504
+ MENUITEM "&Guardar opciones al salir", 511
+ }
+
+
+ POPUP "&Seguridad" {
+ MENUITEM "&Acceso...", 605
+ MENUITEM "&Logging...", 606
+ MENUITEM "&Propietario...", 607
+ }
+
+ POPUP "&Ventana" {
+ MENUITEM "&Nueva ventana", ID_WINDOW_NEW
+ MENUITEM "&Cascada\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Mosaico &horizontal", ID_WINDOW_TILE_HORZ
+ MENUITEM "Mosaico &vertical\tCtrl+F4", ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "A&linear automáticamente", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "Alinear &símbolos", ID_WINDOW_ARRANGE
+ MENUITEM "&Actualizar\tF5", ID_REFRESH
+ }
+
+ POPUP "&?" {
+ MENUITEM "&Temas de ayuda\tF1", ID_HELP
+ MENUITEM "&Buscar en la ayuda...\tF1", ID_HELP
+ MENUITEM "&Usando la ayuda\tF1", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&Acerca de Winefile...", ID_ABOUT
+#ifdef __WINE__
+ MENUITEM "Acerca de &Wine...", ID_ABOUT_WINE
+#endif
+ }
+}
+
+
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ejecutar"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Comando:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "Como &símbolo", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "Aceptar", 1, 158, 6, 47, 14
+ PUSHBUTTON "Cancelar", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Ayuda", 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 "Seleccione destino"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Ruta:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ DEFPUSHBUTTON "Aceptar", 1, 158, 6, 47, 14
+ PUSHBUTTON "Cancelar", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Examinar", 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 "By File Type"
+FONT 8, "MS Sans Serif"
+BEGIN
+ LTEXT "&Nombre:",-1,7,8,22,10
+ EDITTEXT IDC_VIEW_PATTERN,31,7,63,12,ES_AUTOHSCROLL
+ GROUPBOX "Typo de Fichero",-1,7,23,87,56
+ CONTROL "&Directorios",IDC_VIEW_TYPE_DIRECTORIES,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,32,70,10
+ CONTROL "&Programas",IDC_VIEW_TYPE_PROGRAMS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,43,70,10
+ CONTROL "Docu&mentos",IDC_VIEW_TYPE_DOCUMENTS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,54,70,10
+ CONTROL "&Otros Ficheros",IDC_VIEW_TYPE_OTHERS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,65,70,10
+ CONTROL "Mostrar ficheros Escondidos/Systema (Hidden/&System) ",IDC_VIEW_TYPE_HIDDEN,
+ "Buton",BS_AUTOCHECKBOX | WS_TABSTOP,7,81,106,9
+ DEFPUSHBUTTON "Aceptar",IDOK,104,7,50,14
+ PUSHBUTTON "Cancelar",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 "Properties for %s"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "Aceptar",IDOK,191,7,50,14
+ PUSHBUTTON "Cancelar",IDCANCEL,191,29,50,14
+ LTEXT "&File Name:",-1,7,7,59,9
+ EDITTEXT IDC_STATIC_PROP_FILENAME,71,7,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Full &Path:",-1,7,18,59,9
+ EDITTEXT IDC_STATIC_PROP_PATH,71,18,120,9, ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "último Cambio:",-1,7,29,59,9
+ EDITTEXT IDC_STATIC_PROP_LASTCHANGE,71,29,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Verción:",-1,7,40,59,9
+ EDITTEXT IDC_STATIC_PROP_VERSION,71,40,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Cop&yright:",-1,7,51,59,9
+ EDITTEXT IDC_STATIC_PROP_COPYRIGHT,71,51,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "tamaño:",-1,7,62,59,9
+ EDITTEXT IDC_STATIC_PROP_SIZE,71,62,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ GROUPBOX "Atributos",-1,7,79,158,46
+ CONTROL "&Lectura Solamente",IDC_CHECK_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,91,68,9
+ CONTROL "&Escondido",IDC_CHECK_HIDDEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,91,68,9
+ CONTROL "&Archivado",IDC_CHECK_ARCHIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,101,68,9
+ CONTROL "&Sistema",IDC_CHECK_SYSTEM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,101,68,9
+ CONTROL "&Comprimido",IDC_CHECK_COMPRESSED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,17,111,68,9
+ GROUPBOX "Información de &Verción",-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 "Aplicando configuración de fuente"
+ IDS_FONT_SEL_ERROR "Error al seleccionar la nueva fuente."
+}
+
+STRINGTABLE
+{
+ IDS_WINEFILE "Winefile"
+ IDS_ERROR "Error"
+ IDS_ROOT_FS "sf raíz"
+ IDS_UNIXFS "unixfs"
+ IDS_DESKTOP "Escritorio"
+ IDS_SHELL "Shell"
+ IDS_TITLEFMT "%s - %s"
+ IDS_NO_IMPL "Aún no implementado"
+ IDS_WINE "WINE"
+ IDS_WINE_FILE "Wine File"
+}
+
+STRINGTABLE
+{
+ IDS_COL_NAME "Nombre"
+ IDS_COL_SIZE "Tamaño"
+ IDS_COL_CDATE "FechaC"
+ IDS_COL_ADATE "FechaA"
+ IDS_COL_MDATE "FechaM"
+ IDS_COL_IDX "Índice/Nodo-i"
+ IDS_COL_LINKS "Enlaces"
+ IDS_COL_ATTR "Atributos"
+ IDS_COL_SEC "Seguridad"
+}
--- /dev/null
+/*
+ * WineFile
+ * French Language Support
+ *
+ * Copyright 2000 Martin Fuchs
+ * Copyright 2002 Steven Edwards
+ * Copyright 2002 Alexandre Julliard
+ * Copyright 2003 Sylvain Petreolle
+ * Copyright 2005 Jonathan Ernst
+ *
+ * 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_NEUTRAL
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&Fichier" {
+ MENUITEM "&Ouvrir\tEntrée", ID_ACTIVATE
+ MENUITEM "&Déplacer...\tF7", ID_FILE_MOVE
+ MENUITEM "&Copier...\tF8", ID_FILE_COPY
+ MENUITEM "P&resse-Papiers...\tF9", 118
+ MENUITEM "&Effacer\tDel", ID_FILE_DELETE
+ MENUITEM "Re&nommer...", 109
+ MENUITEM "&Propriétés...\tAlt+Entree", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "Co&mpresser...", 119
+ MENUITEM "Décompre&sser...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "E&xécuter...", ID_EXECUTE
+ MENUITEM "&Imprimer...", 102
+ MENUITEM "&Associer...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Créer Réper&toire...", 111
+ MENUITEM "Rec&hercher...", 104
+ MENUITEM "Sélectionner &Fichiers...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "&Quitter\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "&Quitter", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disque" {
+ MENUITEM "&Copier Disque...", 201
+ MENUITEM "&Nommer Disque...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Formater Disque...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "Créer un disque *système...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Connecter un lecteur &réseau",ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "&Déconnecter un lecteur réseau",ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "&Partager...", 254
+ MENUITEM "Cesser de parta&ger", 255
+ MENUITEM SEPARATOR
+ MENUITEM "Choisir le &lecteur", 251
+ }
+
+ POPUP "&Répertoires" {
+ MENUITEM "&Développer un niveau\t+", 301
+ MENUITEM "Développer une &branche\t*", 302
+ MENUITEM "&Tout développer\tCtrl+*", 303
+ MENUITEM "&Réduire une branche\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Indiquer l'arborescence", 505
+ }
+
+ POPUP "&Vue" {
+ MENUITEM "Arbre et ré&pertoire", 413
+ MENUITEM "&Arbre seulement", 411
+ MENUITEM "&Répertoire seulement", 412
+ MENUITEM SEPARATOR
+ MENUITEM "&Séparer", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Nom", ID_VIEW_NAME
+ MENUITEM "Tous &les Détails", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "&Détails...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "Trier par N&om", ID_VIEW_SORT_NAME
+ MENUITEM "Trier par &Type", ID_VIEW_SORT_TYPE
+ MENUITEM "Trier par Ta&ille", ID_VIEW_SORT_SIZE
+ MENUITEM "Trier par Dat&e", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Trier par &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Options" {
+ MENUITEM "&Confirmation...", 501
+ MENUITEM "&Police...", ID_SELECT_FONT
+ MENUITEM "Personnaliser la &barre d'Outils...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "Barre d'&Outils", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "Barre de &Lecteur", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "Barre d'&État", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "P&lein Écran\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Réduire a l'utilisation", 504
+ MENUITEM "&Enregistrer la configuration en quittant",511
+ }
+
+
+ POPUP "&Sécurité" {
+ MENUITEM "&Accès...", 605
+ MENUITEM "&Surveillance...", 606
+ MENUITEM "&Propriétaire...", 607
+ }
+
+ POPUP "&Fenêtre" {
+ MENUITEM "Nouvelle &fenêtre", ID_WINDOW_NEW
+ MENUITEM "&En cascade\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Mosaïque &horizontale", ID_WINDOW_TILE_HORZ
+ MENUITEM "Mosaïque &verticale\tCtrl+F4",ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Réorganisation &Automatique", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "Réorganiser les &icônes", ID_WINDOW_ARRANGE
+ MENUITEM "&Actualiser\tF5", ID_REFRESH
+ }
+
+ POPUP "&Aide" {
+ MENUITEM "&Sommaire de l'aide\tF1", ID_HELP
+ MENUITEM "&Rechercher dans l'aide\tF1", ID_HELP
+ MENUITEM "&Utiliser l'aide\tF1", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&A propos de Winefile...", ID_ABOUT
+#ifdef __WINE__
+ MENUITEM "A propos de &Wine...", ID_ABOUT_WINE
+#endif
+ }
+}
+
+
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Exécuter"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Commande :", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "Sous forme d'icône", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Annuler", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Aide", 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 "Sélectionner la destination"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Dossier:", -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 "Annuler", 2, 158, 23, 47, 14
+ PUSHBUTTON "Pa&rcourir...", 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 "Par type de fichier"
+FONT 8, "MS Sans Serif"
+BEGIN
+ LTEXT "&Name:",-1,7,8,22,10
+ EDITTEXT IDC_VIEW_PATTERN,31,7,63,12,ES_AUTOHSCROLL
+ GROUPBOX "Type de fichier",-1,7,23,87,56
+ CONTROL "&Répertoires",IDC_VIEW_TYPE_DIRECTORIES,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,32,70,10
+ CONTROL "&Programmes",IDC_VIEW_TYPE_PROGRAMS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,43,70,10
+ CONTROL "Docu&ments",IDC_VIEW_TYPE_DOCUMENTS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,54,70,10
+ CONTROL "&Autres fichiers",IDC_VIEW_TYPE_OTHERS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,65,70,10
+ CONTROL "Montrer les fichiers cachés/&système",IDC_VIEW_TYPE_HIDDEN,
+ "Bouton",BS_AUTOCHECKBOX | WS_TABSTOP,7,81,106,9
+ DEFPUSHBUTTON "OK",IDOK,104,7,50,14
+ PUSHBUTTON "Annuler",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 "Propriétés de %s"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,191,7,50,14
+ PUSHBUTTON "Annuler",IDCANCEL,191,29,50,14
+ LTEXT "Nom du &fichier:",-1,7,7,59,9
+ EDITTEXT IDC_STATIC_PROP_FILENAME,71,7,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Chemin com&plet:",-1,7,18,59,9
+ EDITTEXT IDC_STATIC_PROP_PATH,71,18,120,9, ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Modification:",-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 "Cop&yright:",-1,7,51,59,9
+ EDITTEXT IDC_STATIC_PROP_COPYRIGHT,71,51,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ LTEXT "Taille:",-1,7,62,59,9
+ EDITTEXT IDC_STATIC_PROP_SIZE,71,62,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP
+ GROUPBOX "Attributs",-1,7,79,158,46
+ CONTROL "Lectu&re seule",IDC_CHECK_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,91,68,9
+ CONTROL "Cac&hé",IDC_CHECK_HIDDEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,91,68,9
+ CONTROL "&Archive",IDC_CHECK_ARCHIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,101,68,9
+ CONTROL "&Système",IDC_CHECK_SYSTEM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,101,68,9
+ CONTROL "&Compressé",IDC_CHECK_COMPRESSED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,17,111,68,9
+ GROUPBOX "&Version Information",-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 "Appliquer les réglages des fontes"
+ IDS_FONT_SEL_ERROR "Erreur dans la sélection de la nouvelle fonte."
+}
+
+STRINGTABLE
+{
+ IDS_WINEFILE "Winefile"
+ IDS_ERROR "Erreur"
+ IDS_ROOT_FS "root fs"
+ IDS_UNIXFS "unixfs"
+ IDS_DESKTOP "Desktop"
+ IDS_SHELL "Shell"
+ IDS_TITLEFMT "%s - %s"
+ IDS_NO_IMPL "Pas encore implémenté"
+ IDS_WINE "WINE"
+ IDS_WINE_FILE "Wine File"
+}
+
+STRINGTABLE
+{
+ IDS_COL_NAME "Nom"
+ IDS_COL_SIZE "Taille"
+ IDS_COL_CDATE "CDate"
+ IDS_COL_ADATE "ADate"
+ IDS_COL_MDATE "MDate"
+ IDS_COL_IDX "Index/Inode"
+ IDS_COL_LINKS "Liens"
+ IDS_COL_ATTR "Attributs"
+ IDS_COL_SEC "Sécurité"
+
+ IDS_FREE_SPACE_FMT "%s sur %s libre"
+}
--- /dev/null
+/*
+ * WineFile
+ * Hungarian Language Support
+ *
+ * Copyright 2000 Martin Fuchs
+ * Copyright 2002 Steven Edwards
+ * Copyright 2002 Alexandre Julliard
+ * Copyright 2002 Zoly Nagy
+ *
+ * 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
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&Fájl" {
+ MENUITEM "&Megynitás\tEnter", ID_ACTIVATE
+ MENUITEM "Át&helyezés...\tF7", ID_FILE_MOVE
+ MENUITEM "&Másolás...\tF8", ID_FILE_COPY
+ MENUITEM "&Vágólapon...\tF9", 118
+ MENUITEM "&Törlés\tDel", ID_FILE_DELETE
+ MENUITEM "Át&nevezés...", 109
+ MENUITEM "T&ulajdonságok...\tAlt+Enter", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "&Becsomagolás...", 119
+ MENUITEM "K&icsomagolás...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "&Futtatás...", ID_EXECUTE
+ MENUITEM "&Nyomtatás...", 102
+ MENUITEM "Társítás...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Új &mappa...", 111
+ MENUITEM "Kere&sés...", 104
+ MENUITEM "Fájlok ki&választása...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "&Kilépés\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "&Kilépés", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Lemez" {
+ MENUITEM "Lemez &másolása...", 201
+ MENUITEM "&Lemezcimke...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Formatálás...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Rendszerlemez készítése...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Hálózati meghajtó csatlakoztatása",ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "Hálózati meghajtó leválasztása",ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "Megosztás...", 254
+ MENUITEM "Megosztás &megszüntetése...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "Meghajtó ki&választása...", 251
+ }
+
+ POPUP "&Mappák" {
+ MENUITEM "&Következõ szint\t+", 301
+ MENUITEM "&Fa kinyitása\t*", 302
+ MENUITEM "&Minden kinyitása\tStrg+*", 303
+ MENUITEM "Fa &becsukása\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Gyermekek kijelölése", 505
+ }
+
+ POPUP "&Nézet" {
+ MENUITEM "&Teljes", 413
+ MENUITEM "&Könyvtárfa", 411
+ MENUITEM "&Csak mappák", 412
+ MENUITEM SEPARATOR
+ MENUITEM "&Felosztás", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Név", ID_VIEW_NAME
+ MENUITEM "&Minden részlet", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "&Egyedi...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "&Rendezés név szerint", ID_VIEW_SORT_NAME
+ MENUITEM "Rendezés k&iterjesztés szerint",ID_VIEW_SORT_TYPE
+ MENUITEM "Rendezés &méret szerint", ID_VIEW_SORT_SIZE
+ MENUITEM "Rendezés &dátum szerint", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Egyedi rendezés &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Beállítások" {
+ MENUITEM "&Megerõsítés...", 501
+ MENUITEM "&Betûkészlet...", ID_SELECT_FONT
+ MENUITEM "E&gyedi eszköztár...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "&Eszköztár", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "&Lemeztár", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "&Állapotsor", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "&Teljes képernyõs\tCtrl+Shift+S",ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Programfuttatás utáni &szimbólum",504
+ MENUITEM "Megszüntetés a tárolás végén",511
+ }
+
+
+ POPUP "&Biztonság" {
+ MENUITEM "&Hozzáférés...", 605
+ MENUITEM "&Naplózás...", 606
+ MENUITEM "&Tulajdonos...", 607
+ }
+
+ POPUP "&Ablakok" {
+ MENUITEM "Új a&blak", ID_WINDOW_NEW
+ MENUITEM "Lépcsõzetes elrendezés\tCtrl+F5",ID_WINDOW_CASCADE
+ MENUITEM "Mozaikszerû elrendezés &vízszintesen",ID_WINDOW_TILE_HORZ
+ MENUITEM "Mozaikszerû elrendezés fü&ggõlegesen\tCtrl+F4",ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Automatikus elrendezés", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "&Szimbólum elrendezés", ID_WINDOW_ARRANGE
+ MENUITEM "&Frissítés\tF5", ID_REFRESH
+ }
+
+ POPUP "&?" {
+ MENUITEM "&Súgó témakörök\tF1", ID_HELP
+ MENUITEM "Súgó &keresés...\tF1", ID_HELP
+ MENUITEM "&Használat\tF1", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&Winefile-ról...", ID_ABOUT
+#ifdef __WINE__
+ MENUITEM "W&ine-ról...", ID_ABOUT_WINE
+#endif
+ }
+}
+
+
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Futtatás"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Parancs:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "&Szimbólumként", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Mégse", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Súgó", 254, 158, 43, 47, 14
+}
--- /dev/null
+/*
+ * WineFile
+ * Italian Language Support
+ *
+ * Copyright 2000 Martin Fuchs
+ * Copyright 2002 Steven Edwards
+ * Copyright 2002 Alexandre Julliard
+ * Copyright 2004 Ivan Leo Puoti
+ *
+ * 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_ITALIAN, SUBLANG_NEUTRAL
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&File" {
+ MENUITEM "&Apri\tInvio", ID_ACTIVATE
+ MENUITEM "&Sposta...\tF7", ID_FILE_MOVE
+ MENUITEM "&Copia...\tF8", ID_FILE_COPY
+ MENUITEM "&Negli Appunti...\tF9", 118
+ MENUITEM "&Cancella\tDel", ID_FILE_DELETE
+ MENUITEM "Ri&nomina...", 109
+ MENUITEM "Propri&età...\tAlt+Invio", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "C&omprimi...", 119
+ MENUITEM "Dec&omprimi...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "&Esegui...", ID_EXECUTE
+ MENUITEM "&Stampa...", 102
+ MENUITEM "Associa...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Cr&ea Directory...", 111
+ MENUITEM "Cerc&a...", 104
+ MENUITEM "&Seleziona i file...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "E&sci\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "E&sci", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disco" {
+ MENUITEM "&Copia Disco...", 201
+ MENUITEM "&Etichetta Disco...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Formatta Disco...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Crea Disco di Sistema...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Connetti & Drive di Rete", ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "&Disconnetti Drive di Rete", ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "Condividi come...", 254
+ MENUITEM "&Rimuovi condivisione...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "&Seleziona Drive...", 251
+ }
+
+ POPUP "&Directory" {
+ MENUITEM "&Livello Sucessivo\t+", 301
+ MENUITEM "Espandi &Albero\t*", 302
+ MENUITEM "Espandi &tutto\tStrg+*", 303
+ MENUITEM "Riduci &Albero\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Seleziona unità", 505
+ }
+
+ POPUP "&Visualizza" {
+ MENUITEM "A&lbero e Directory", 413
+ MENUITEM "So&lo Albero", 411
+ MENUITEM "&Solo Directory", 412
+ MENUITEM SEPARATOR
+ MENUITEM "Di&vidi", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Nome", ID_VIEW_NAME
+ MENUITEM "&Mostra tutti i dettagli sui file",ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "&Mostra dettagli parziali...",ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "&Ordina per Nome", ID_VIEW_SORT_NAME
+ MENUITEM "&Ordina per Tipo", ID_VIEW_SORT_TYPE
+ MENUITEM "&Ordina per Dimensione", ID_VIEW_SORT_SIZE
+ MENUITEM "&Ordina per Data", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Ordina per &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Opzioni" {
+ MENUITEM "&Confermazione...", 501
+ MENUITEM "&Font...", ID_SELECT_FONT
+ MENUITEM "&Personalizza barra degli strumenti...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "&Barra degli strumenti", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "&Barra dei Drive", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "&Barra di stato", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "A& tutto schermo\tCtrl+Shift+S",ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Esegui minimizzato", 504
+ MENUITEM "&Salva impostazioni all'uscita",511
+ }
+
+
+ POPUP "&Sicurezza" {
+ MENUITEM "&Accessi...", 605
+ MENUITEM "&Logging...", 606
+ MENUITEM "&Proprietario...", 607
+ }
+
+ POPUP "&Finestra" {
+ MENUITEM "Nuova &Finestra", ID_WINDOW_NEW
+ MENUITEM "Finestre a cascata\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Ordina &Orizontalmente", ID_WINDOW_TILE_HORZ
+ MENUITEM "Ordina &Verticlmente\tCtrl+F4",ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Disponi automaticamente", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "Disponi &Simboli", ID_WINDOW_ARRANGE
+ MENUITEM "&Aggiorna\tF5", ID_REFRESH
+ }
+
+ POPUP "&Guida" {
+ MENUITEM "&Sommario della Guida\tF1", ID_HELP
+ MENUITEM "&Cerca nella Guida...\tF1", ID_HELP
+ MENUITEM "&Uso dell Guida\tF1", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&Informazioni su Winefile...",ID_ABOUT
+#ifdef __WINE__
+ MENUITEM "Informazioni su &Wine...", ID_ABOUT_WINE
+#endif
+ }
+}
+
+
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Esegui"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Comando:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "Come &Simbolo", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Annulla", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Aiuto", 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 "Select destination"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Statico", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Percorso:", -1, "Statico", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Annulla", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Naviga", 254, 158, 43, 47, 14
+}
+
+STRINGTABLE
+{
+ IDS_FONT_SEL_DLG_NAME "Applica le impostazioni dei font"
+ IDS_FONT_SEL_ERROR "Si è verificato un errore durante la selezione del nuovo font."
+}
--- /dev/null
+/*
+ * Copyright 2000 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
+*/
+
+#include "winefile.h"
+
+#ifdef __WINE__
+
+static const CHAR LicenseCaption[] = "LICENSE";
+static const CHAR License[] =
+"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.\n"
+
+"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.\n"
+
+"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";
+
+static const CHAR NoWarrantyCaption[] = "NO WARRANTY";
+static const CHAR NoWarranty[] =
+"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.";
+
+VOID WineLicense(HWND hwnd)
+{
+ MessageBoxA(hwnd, License, LicenseCaption, MB_ICONINFORMATION|MB_OK);
+}
+
+VOID WineWarranty(HWND hwnd)
+{
+ MessageBoxA(hwnd, NoWarranty, NoWarrantyCaption, MB_ICONEXCLAMATION|MB_OK);
+}
+
+#endif
--- /dev/null
+sed 's/@GEN@/generated on '`date +%d.%m.%Y`/ <doxy-footer.htmt >doxy-footer.html
+doxygen Doxyfile
--- /dev/null
+# Microsoft Developer Studio Project File - Name="make_winefile" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) External Target" 0x0106\r
+\r
+CFG=make_winefile - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "make_winefile.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "make_winefile.mak" CFG="make_winefile - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "make_winefile - Win32 Release" (based on "Win32 (x86) External Target")\r
+!MESSAGE "make_winefile - Win32 Debug" (based on "Win32 (x86) External Target")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+\r
+!IF "$(CFG)" == "make_winefile - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Cmd_Line "NMAKE /f make_winefile.mak"\r
+# PROP BASE Rebuild_Opt "/a"\r
+# PROP BASE Target_File "make_winefile.exe"\r
+# PROP BASE Bsc_Name "make_winefile.bsc"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release"\r
+# PROP Intermediate_Dir "Release"\r
+# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW"\r
+# PROP Rebuild_Opt "clean all"\r
+# PROP Target_File "winefile.exe"\r
+# PROP Bsc_Name ""\r
+# PROP Target_Dir ""\r
+\r
+!ELSEIF "$(CFG)" == "make_winefile - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Cmd_Line "NMAKE /f make_winefile.mak"\r
+# PROP BASE Rebuild_Opt "/a"\r
+# PROP BASE Target_File "make_winefile.exe"\r
+# PROP BASE Bsc_Name "make_winefile.bsc"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
+# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW DEBUG=1"\r
+# PROP Rebuild_Opt "clean all"\r
+# PROP Target_File "winefile.exe"\r
+# PROP Bsc_Name ""\r
+# PROP Target_Dir ""\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "make_winefile - Win32 Release"\r
+# Name "make_winefile - Win32 Debug"\r
+\r
+!IF "$(CFG)" == "make_winefile - Win32 Release"\r
+\r
+!ELSEIF "$(CFG)" == "make_winefile - Win32 Debug"\r
+\r
+!ENDIF \r
+\r
+# Begin Source File\r
+\r
+SOURCE=.\Makefile.MinGW\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\winefile.xml\r
+# End Source File\r
+# End Target\r
+# End Project\r
--- /dev/null
+doxygen Doxyfile
+cmd /c start /b /low /wait hhc doxy-doc\html\index.hhp
+move /y doxy-doc\html\index.chm winefile.chm
--- /dev/null
+/*
+ * WineFile (Dutch resources)
+ *
+ * Copyright 2003 Hans Leidekker
+ *
+ * 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_DUTCH, SUBLANG_NEUTRAL
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&Bestand" {
+ MENUITEM "&Openen\tEnter", ID_ACTIVATE
+ MENUITEM "&Verplaatsen...\tF7", ID_FILE_MOVE
+ MENUITEM "&Kopiëren...\tF8", ID_FILE_COPY
+ MENUITEM "Naar &klembord...\tF9", 118
+ MENUITEM "Ver&wijderen\tDel", ID_FILE_DELETE
+ MENUITEM "&Naam wijzigen...", 109
+ MENUITEM "&Eigenschappen...\tAlt+Enter",ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "&Comprimeren...", 119
+ MENUITEM "&Dec&omprimeren...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "&Starten...", ID_EXECUTE
+ MENUITEM "Af&drukken...", 102
+ MENUITEM "Koppelen...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Nieuwe &map...", 111
+ MENUITEM "&Zoeken...", 104
+ MENUITEM "Bestanden &selecteren...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "A&fsluiten\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "A&fsluiten", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disk" {
+ MENUITEM "Disk &kopiëren...", 201
+ MENUITEM "Disklabel maken...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "Disk &formatteren...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "Systeemdisk maken...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Verbinding &maken met netwerkchijf",ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "Verbinding &verbreken met netwerkschijf",ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "Schijf &delen...", 254
+ MENUITEM "Delen &ongedaan maken...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "Schijf &selecteren...", 251
+ }
+
+ POPUP "&Mappen" {
+ MENUITEM "&Volgende niveau\t+", 301
+ MENUITEM "&Uitklappen\t*", 302
+ MENUITEM "&Alles uitklappen\tCtrl+*", 303
+ MENUITEM "&Inklappen\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Markeer mappen", 505
+ }
+
+ POPUP "&Beeld" {
+ MENUITEM "&Hierarchie en mapinhoud", 413
+ MENUITEM "&Alleen hierarchie", 411
+ MENUITEM "Alleen &mapinhoud", 412
+ MENUITEM SEPARATOR
+ MENUITEM "Sp&litsen", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Naam", ID_VIEW_NAME
+ MENUITEM "&Alle details", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "&Gedeeltelijke details...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "Sorteer op &naam", ID_VIEW_SORT_NAME
+ MENUITEM "Sorteer op &type", ID_VIEW_SORT_TYPE
+ MENUITEM "Sorteer op &grootte", ID_VIEW_SORT_SIZE
+ MENUITEM "Sorteer op &datum", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Sorteer op &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Opties" {
+ MENUITEM "&Bevestiging...", 501
+ MENUITEM "&Lettertype...", ID_SELECT_FONT
+ MENUITEM "Gereedschappenbalk &aanpassen...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "&Gereedschappenbalk", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "&Schijvenbalk", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "S&tatusbalk", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "&Volledig scherm\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Ge&minimaliseerd starten", 504
+ MENUITEM "&Instellingen opslaan bij afsluiten", 511
+ }
+
+
+ POPUP "&Beveiliging" {
+ MENUITEM "&Toegang...", 605
+ MENUITEM "&Loggen...", 606
+ MENUITEM "&Eigenaar...", 607
+ }
+
+ POPUP "&Venster" {
+ MENUITEM "Nieuw &venster", ID_WINDOW_NEW
+ MENUITEM "Trapsgewijs\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "&Boven elkaar", ID_WINDOW_TILE_HORZ
+ MENUITEM "&Naast elkaar\tCtrl+F4", ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Automatisch schikken", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "&Pictogrammen schikken", ID_WINDOW_ARRANGE
+ MENUITEM "&Vernieuwen\tF5", ID_REFRESH
+ }
+
+ POPUP "&?" {
+ MENUITEM "&Help-onderwerpen\tF1", ID_HELP
+ MENUITEM "&Zoeken...\tF1", ID_HELP
+ MENUITEM "&Instructie\tF1", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&Over Winefile...", ID_ABOUT
+#ifdef __WINE__
+ MENUITEM "Over &Wine...", ID_ABOUT_WINE
+#endif
+ }
+}
+
+
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Uitvoeren"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Opdracht:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "Als &pictogram", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Annuleren", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Help", 254, 158, 43, 47, 14
+}
--- /dev/null
+/*\r
+ * WineFile\r
+ * Polish Language Support\r
+ *\r
+ * Copyright 2000 Martin Fuchs\r
+ * Copyright 2002 Steven Edwards\r
+ * Copyright 2002 Alexandre Julliard\r
+ * Copyright 2004 Piotr Caban\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+LANGUAGE LANG_POLISH, SUBLANG_NEUTRAL\r
+\r
+/* Menu */\r
+\r
+IDM_WINEFILE MENU FIXED IMPURE\r
+{\r
+ POPUP "&Plik" {\r
+ MENUITEM "&Otwórz\tEnter", ID_ACTIVATE\r
+ MENUITEM "&Przenie\9c...\tF7", ID_FILE_MOVE\r
+ MENUITEM "&Kopiuj...\tF8", ID_FILE_COPY\r
+ MENUITEM "W s&chowku...\tF9", 118\r
+ MENUITEM "&Usuñ\tDel", ID_FILE_DELETE\r
+ MENUITEM "&Zmieñ nazwê...", 109\r
+ MENUITEM "Ustawie&nia...\tAlt+Enter", ID_EDIT_PROPERTIES\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Kompresja...", 119\r
+ MENUITEM "&Dekompresja...", 120\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Uruchom...", ID_EXECUTE\r
+ MENUITEM "&Drukuj...", 102\r
+ MENUITEM "Skojarz...", 103\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "U&twórz folder...", 111\r
+ MENUITEM "&Szukaj...", 104\r
+ MENUITEM "&Zaznacz pliki...", 116\r
+ MENUITEM SEPARATOR\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "&Wyj\9ccie\tAlt+X", ID_FILE_EXIT\r
+#else\r
+ MENUITEM "&Wyj\9ccie", ID_FILE_EXIT\r
+#endif\r
+ }\r
+\r
+ POPUP "&Dysk" {\r
+ MENUITEM "&Kopiuj dusk...", 201\r
+ MENUITEM "&Etykieta dysku...", 202\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Formatuj dysk...", ID_FORMAT_DISK\r
+#ifdef _WIN95\r
+ MENUITEM "&Stwórz dysk systemowy...", -1 /*TODO*/\r
+#endif\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Pod³¹cz Dysk Sieciowy", ID_CONNECT_NETWORK_DRIVE\r
+ MENUITEM "&Od³¹cz Dysk Sieciowy", ID_DISCONNECT_NETWORK_DRIVE\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Udostêpnij jako...", 254\r
+ MENUITEM "&Nie udostêpniaj...", 255\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Wybór &dysku...", 251\r
+ }\r
+\r
+ POPUP "&Katalogi" {\r
+ MENUITEM "&Nastêpny poziom\t+", 301\r
+ MENUITEM "&Rozwiñ drzewo\t*", 302\r
+ MENUITEM "Rozwiñ &wszystko\tStrg+*", 303\r
+ MENUITEM "&Zwiñ drzewo\t-", 304\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Zaznacz &podkatalogi", 505\r
+ }\r
+\r
+ POPUP "&Widok" {\r
+ MENUITEM "&Drzewo i katalogi", 413\r
+ MENUITEM "D&rzewo", 411\r
+ MENUITEM "&Katalogi", 412\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Po³¹cz", ID_VIEW_SPLIT\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Nazwa", ID_VIEW_NAME\r
+ MENUITEM "&Wszystkie atrybuty pliku", ID_VIEW_ALL_ATTRIBUTES, CHECKED\r
+ MENUITEM "Wybrane &atrybuty pliku...", ID_VIEW_SELECTED_ATTRIBUTES\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "P&osortuj alfabetycznie", 404\r
+ MENUITEM "Posortuj po &typie", 405\r
+ MENUITEM "Rozmie\9cæ &po wielko\9cci", 406\r
+ MENUITEM "&Sortuj po dacie", 407\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Sortuj po &...", ID_VIEW_FILTER\r
+ }\r
+\r
+ POPUP "&Opcje" {\r
+ MENUITEM "&Potwierdzenie...", 501\r
+ MENUITEM "&Czcionka...", ID_SELECT_FONT\r
+ MENUITEM "&Ustawienia paska narzêdzi...", 512\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "Pasek &narzêdzi", ID_VIEW_TOOL_BAR, CHECKED\r
+ MENUITEM "Pasek &dysków", ID_VIEW_DRIVE_BAR, CHECKED\r
+ MENUITEM "Pasek &statusu", ID_VIEW_STATUSBAR, CHECKED\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "Pe³ny &ekran\tCtrl+Shift+S", ID_VIEW_FULLSCREEN\r
+#endif\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Zminimalizuj przy starcie", 504\r
+ MENUITEM "Z&apisz ustawienia przed zakoñczeniem",511\r
+ }\r
+\r
+\r
+ POPUP "&Bezpieczeñstwo" {\r
+ MENUITEM "&Dostêp...", 605\r
+ MENUITEM "&Logowanie...", 606\r
+ MENUITEM "&W³a\9cciciel...", 607\r
+ }\r
+\r
+ POPUP "&Okno" {\r
+ MENUITEM "&Nowe okno", ID_WINDOW_NEW\r
+ MENUITEM "&Kaskaduj¹co\tCtrl+F5", ID_WINDOW_CASCADE\r
+ MENUITEM "&Tytu³ pionowo", ID_WINDOW_TILE_HORZ\r
+ MENUITEM "Tytu³ &poziomo\tCtrl+F4", ID_WINDOW_TILE_VERT\r
+#ifndef _NO_EXTENSIONS\r
+ MENUITEM "Rozmie\9cæ automatycznie", ID_WINDOW_AUTOSORT\r
+#endif\r
+ MENUITEM "Rozmie\9cæ &symbole", ID_WINDOW_ARRANGE\r
+ MENUITEM "&Od\9cwierz\tF5", ID_REFRESH\r
+ }\r
+\r
+ POPUP "&?" {\r
+ MENUITEM "&Tematu pomocy\tF1", ID_HELP\r
+ MENUITEM "&Szukaj...", ID_HELP\r
+ MENUITEM "&U¿ywanie pomocy", ID_HELP_USING\r
+ MENUITEM SEPARATOR\r
+ MENUITEM "&Winefile...", ID_ABOUT\r
+#ifdef __WINE__\r
+ MENUITEM "W&ine...", ID_ABOUT_WINE\r
+#endif\r
+ }\r
+}\r
+\r
+\r
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63\r
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Uruchom"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10\r
+ CONTROL "&Polecenie:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10\r
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL\r
+ CONTROL "Jako &symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12\r
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14\r
+ PUSHBUTTON "Anuluj", 2, 158, 23, 47, 14\r
+ PUSHBUTTON "&Pomoc", 254, 158, 43, 47, 14\r
+}\r
+\r
+IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63\r
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Wybór celu"\r
+FONT 8, "MS Shell Dlg"\r
+{\r
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10\r
+ CONTROL "&\8ccie¿ka:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10\r
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL\r
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14\r
+ PUSHBUTTON "Anuluj", 2, 158, 23, 47, 14\r
+ PUSHBUTTON "&Przegl¹daj", 254, 158, 43, 47, 14\r
+}\r
+\r
+STRINGTABLE\r
+{\r
+ IDS_FONT_SEL_DLG_NAME "Wprowadzanie ustawieñ czcionki"\r
+ IDS_FONT_SEL_ERROR "B³¹d przy wybieraniu czcionki"\r
+}\r
--- /dev/null
+/*
+ * WineFile
+ * Portuguese Language Support
+ *
+ * Copyright 2003 Marcelo Duarte
+ * Copyright 2004 Américo José Melo
+ *
+ * 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
+ */
+
+
+/* Menu */
+
+LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&Arquivo" {
+ MENUITEM "A&brir\tEnter", ID_ACTIVATE
+ MENUITEM "&Mover...\tF7", ID_FILE_MOVE
+ MENUITEM "&Copiar...\tF8", ID_FILE_COPY
+ MENUITEM "&In Clipboard...\tF9", 118
+ MENUITEM "E&xcluir\tDel", ID_FILE_DELETE
+ MENUITEM "Re&nomear...", 109
+ MENUITEM "&Propriedades...\tAlt+Enter", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "C&omprimir...", 119
+ MENUITEM "Descomprimir...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "Execu&tar...", ID_EXECUTE
+ MENUITEM "&Imprimir...", 102
+ MENUITEM "A&ssociar...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Cri&ar pasta...", 111
+ MENUITEM "P&esquisar...", 104
+ MENUITEM "Selecionar arqui&vos...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Sai&r\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "Sai&r", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disco" {
+ MENUITEM "&Copiar disco...", 201
+ MENUITEM "&Nomear disco...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Formatar disco...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Gerar disco de sistema...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Conecta&r unidade de rede", ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "&Desconectar unidade de rede",ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "C&ompartilhar como...", 254
+ MENUITEM "&Remover compartilhamento...",255
+ MENUITEM SEPARATOR
+ MENUITEM "Selecionar &unidade...", 251
+ }
+
+ POPUP "Á&rvore" {
+ MENUITEM "&Próximo nível\t+", 301
+ MENUITEM "Expandi&r pasta\t*", 302
+ MENUITEM "Expandir &tudo\tStrg+*", 303
+ MENUITEM "Recolher p&asta\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Indicar subníveis", 505
+ }
+
+ POPUP "&Exibir" {
+ MENUITEM "Á&rvore e pasta", 413
+ MENUITEM "S&omente árvore", 411
+ MENUITEM "So&mente pasta", 412
+ MENUITEM SEPARATOR
+ MENUITEM "&Dividir", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Nome", ID_VIEW_NAME
+ MENUITEM "&Todos os delalhes", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "D&etalhes parciais...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "&Classificar por nome", ID_VIEW_SORT_NAME
+ MENUITEM "C&lassificar por tipo", ID_VIEW_SORT_TYPE
+ MENUITEM "Cl&assificar por tamanho", ID_VIEW_SORT_SIZE
+ MENUITEM "Cla&ssificar por &data", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Classificar &por...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Opções" {
+ MENUITEM "&Confirmação...", 501
+ MENUITEM "&Fonte...", ID_SELECT_FONT
+ MENUITEM "&Personalizar barra de ferramentas...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "Barra d&e ferramentas", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "&Barra de unidades", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "B&arra de &status", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Tela Cheia\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Minimizar durante o uso", 504
+ MENUITEM "&Salvar configurações ao sair",511
+ }
+
+
+ POPUP "&Segurança" {
+ MENUITEM "&Acesso...", 605
+ MENUITEM "&Logging...", 606
+ MENUITEM "&Owner...", 607
+ }
+
+ POPUP "&Janela" {
+ MENUITEM "&Nova janela", ID_WINDOW_NEW
+ MENUITEM "&Em cascata\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Lado a lado &horizontalmente",ID_WINDOW_TILE_HORZ
+ MENUITEM "Lado a lado &verticalmente\tCtrl+F4",ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Organizar automaticamente", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "&Organizar ícones", ID_WINDOW_ARRANGE
+ MENUITEM "&Atualizar\tF5", ID_REFRESH
+ }
+
+ POPUP "Aj&uda" {
+ MENUITEM "&Tópicos da ajuda\tF1", ID_HELP
+ MENUITEM "Pesquisar...", ID_HELP
+ MENUITEM "&Usando a ajuda", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&Sobre o Winefile...", ID_ABOUT
+#ifdef __WINE__
+ MENUITEM "Sobre o &Wine...", ID_ABOUT_WINE
+#endif
+ }
+}
+
+
+LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&Ficheiro" {
+ MENUITEM "A&brir\tEnter", ID_ACTIVATE
+ MENUITEM "&Mover...\tF7", ID_FILE_MOVE
+ MENUITEM "&Copiar...\tF8", ID_FILE_COPY
+ MENUITEM "&Na Area de Transferencia...\tF9", 118
+ MENUITEM "E&xcluir\tDel", ID_FILE_DELETE
+ MENUITEM "Re&nomear...", 109
+ MENUITEM "&Propriedades...\tAlt+Enter", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "C&omprimir...", 119
+ MENUITEM "&Descomprimir...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "Execu&tar...", ID_EXECUTE
+ MENUITEM "&Imprimir...", 102
+ MENUITEM "A&ssociar...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Cri&ar pasta...", 111
+ MENUITEM "P&esquisar...", 104
+ MENUITEM "Selecionar fichei&ros...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Sai&r\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "Sai&r", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disco" {
+ MENUITEM "&Copiar disco...", 201
+ MENUITEM "&Nomear disco...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Formatar disco...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Gerar disco de sistema...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Conecta&r unidade de rede", ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "&Desconectar unidade de rede",ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "&Partilhar como...", 254
+ MENUITEM "&Remover partilha...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "Seleccionar &unidade...", 251
+ }
+
+ POPUP "Á&rvore" {
+ MENUITEM "&Próximo nível\t+", 301
+ MENUITEM "Expandi&r pasta\t*", 302
+ MENUITEM "Expandir &tudo\tStrg+*", 303
+ MENUITEM "Recolher p&asta\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Indicar subníveis", 505
+ }
+
+ POPUP "&Exibir" {
+ MENUITEM "Á&rvore e pasta", 413
+ MENUITEM "S&omente árvore", 411
+ MENUITEM "So&mente pasta", 412
+ MENUITEM SEPARATOR
+ MENUITEM "&Dividir", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Nome", ID_VIEW_NAME
+ MENUITEM "&Todos os delalhes", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "D&etalhes parciais...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "&Classificar por nome", ID_VIEW_SORT_NAME
+ MENUITEM "C&lassificar por tipo", ID_VIEW_SORT_TYPE
+ MENUITEM "Cl&assificar por tamanho", ID_VIEW_SORT_SIZE
+ MENUITEM "Cla&ssificar por &data", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Classificar &por...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Opções" {
+ MENUITEM "&Confirmação...", 501
+ MENUITEM "&Fonte...", ID_SELECT_FONT
+ MENUITEM "&Personalizar barra de ferramentas...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "Barra d&e ferramentas", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "&Barra de unidades", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "B&arra de e&stado", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Ecrã Complecto\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Minimizar durante o uso", 504
+ MENUITEM "&Gravar configurações ao sair",511
+ }
+
+
+ POPUP "&Segurança" {
+ MENUITEM "&Acesso...", 605
+ MENUITEM "&Logging...", 606
+ MENUITEM "&Dono...", 607
+ }
+
+ POPUP "&Janela" {
+ MENUITEM "&Nova janela", ID_WINDOW_NEW
+ MENUITEM "&Em cascata\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Lado a lado &horizontalmente",ID_WINDOW_TILE_HORZ
+ MENUITEM "Lado a lado &verticalmente\tCtrl+F4",ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Organizar automaticamente", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "&Organizar ícones", ID_WINDOW_ARRANGE
+ MENUITEM "&Actualizar\tF5", ID_REFRESH
+ }
+
+ POPUP "Aj&uda" {
+ MENUITEM "&Tópicos da ajuda\tF1", ID_HELP
+ MENUITEM "Pesquisar...", ID_HELP
+ MENUITEM "&Usando a ajuda", ID_HELP_USING
+ MENUITEM SEPARATOR
+#ifdef __WINE__
+ MENUITEM "Acerca do &Wine...", ID_ABOUT_WINE
+#endif
+ }
+}
+
+
+LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
+
+IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Executar"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Comando:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "&Minimizado", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Cancelar", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Ajuda", 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 "Selecionar destino"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Caminho:", -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 "Cancelar", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Procurar", 254, 158, 43, 47, 14
+}
+
+STRINGTABLE
+{
+ IDS_FONT_SEL_DLG_NAME "Aplicando configurações de fonte"
+ IDS_FONT_SEL_ERROR "Erro enquanto seleciona nova fonte."
+}
+
+STRINGTABLE
+{
+ IDS_WINEFILE "Winefile"
+ IDS_ERROR "Erro"
+ IDS_ROOT_FS "root fs"
+ IDS_UNIXFS "unixfs"
+ IDS_DESKTOP "Área de trabalho"
+ IDS_SHELL "Shell"
+ IDS_TITLEFMT "%s - %s"
+ IDS_NO_IMPL "Ainda não implementado"
+ IDS_WINE "WINE"
+ IDS_WINE_FILE "Wine File"
+}
+
+STRINGTABLE
+{
+ IDS_COL_NAME "Nome"
+ IDS_COL_SIZE "Tamanho"
+ IDS_COL_CDATE "CData"
+ IDS_COL_ADATE "AData"
+ IDS_COL_MDATE "MData"
+ IDS_COL_IDX "Index/Inode"
+ IDS_COL_LINKS "Ligações"
+ IDS_COL_ATTR "Atributos"
+ IDS_COL_SEC "Segurança"
+}
--- /dev/null
+/*
+ * Copyright 2000, 2003, 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
+ */
+
+
+/* images */
+
+#define IDB_TOOLBAR 100
+#define IDB_DRIVEBAR 101
+#define IDB_IMAGES 102
+#define IDI_WINEFILE 100
+
+
+/* accellerators and menus */
+
+#define IDA_WINEFILE 101
+#define IDM_WINEFILE 102
+
+
+/* dialogs */
+
+#define IDD_EXECUTE 103
+#define IDD_SELECT_DESTINATION 104
+#define IDD_DIALOG_VIEW_TYPE 105
+#define IDD_DIALOG_PROPERTIES 106
+
+
+/* control ids */
+
+#define ID_ACTIVATE 101
+#define ID_EXECUTE 105
+#define ID_FILE_MOVE 106
+#define ID_FILE_COPY 107
+#define ID_FILE_DELETE 108
+#define ID_FILE_EXIT 115
+#define ID_FORMAT_DISK 203
+#define ID_CONNECT_NETWORK_DRIVE 252
+#define ID_DISCONNECT_NETWORK_DRIVE 253
+#define ID_VIEW_NAME 401
+#define ID_VIEW_ALL_ATTRIBUTES 402
+#define ID_VIEW_SELECTED_ATTRIBUTES 403
+#define ID_VIEW_SORT_NAME 404
+#define ID_VIEW_SORT_TYPE 405
+#define ID_VIEW_SORT_SIZE 406
+#define ID_VIEW_SORT_DATE 407
+#define ID_VIEW_FILTER 409
+#define ID_VIEW_SPLIT 414
+#define ID_SELECT_FONT 510
+#define ID_VIEW_TOOL_BAR 508
+#define ID_VIEW_DRIVE_BAR 507
+#define ID_VIEW_STATUSBAR 503
+
+#define ID_ABOUT 1803
+#define ID_REFRESH 1704
+#define ID_EDIT_PROPERTIES 57656
+#define ID_WINDOW_NEW 0xE130
+#define ID_WINDOW_ARRANGE 0xE131
+#define ID_WINDOW_CASCADE 0xE132
+#define ID_WINDOW_TILE_HORZ 0xE133
+#define ID_WINDOW_TILE_VERT 0xE134
+#define ID_WINDOW_SPLIT 0xE135
+#define ID_HELP_USING 0xE144
+#define ID_HELP 0xE146
+
+#define IDC_VIEW_PATTERN 1000
+#define IDC_VIEW_TYPE_DIRECTORIES 1001
+#define IDC_VIEW_TYPE_PROGRAMS 1002
+#define IDC_VIEW_TYPE_DOCUMENTS 1003
+#define IDC_VIEW_TYPE_OTHERS 1004
+#define IDC_VIEW_TYPE_HIDDEN 1005
+
+#define IDC_STATIC_PROP_FILENAME 1006
+#define IDC_STATIC_PROP_PATH 1007
+#define IDC_STATIC_PROP_LASTCHANGE 1008
+#define IDC_STATIC_PROP_VERSION 1009
+#define IDC_STATIC_PROP_COPYRIGHT 1010
+#define IDC_STATIC_PROP_SIZE 1011
+#define IDC_CHECK_READONLY 1012
+#define IDC_CHECK_ARCHIVE 1013
+#define IDC_CHECK_COMPRESSED 1014
+#define IDC_CHECK_HIDDEN 1015
+#define IDC_CHECK_SYSTEM 1016
+#define IDC_LIST_PROP_VERSION_TYPES 1017
+#define IDC_LIST_PROP_VERSION_VALUES 1018
+
+
+/* winefile extensions */
+
+#define ID_ABOUT_WINE 0x8000
+#define ID_LICENSE 0x8001
+#define ID_NO_WARRANTY 0x8002
+#define ID_WINDOW_AUTOSORT 0x8003
+#define ID_VIEW_FULLSCREEN 0x8004
+#define ID_PREFERRED_SIZES 0x8005
+
+
+/* string table */
+
+#define IDS_FONT_SEL_DLG_NAME 1101
+#define IDS_FONT_SEL_ERROR 1103
+
+#define IDS_WINEFILE 1200
+#define IDS_ERROR 1201
+#define IDS_ROOT_FS 1202
+#define IDS_UNIXFS 1203
+#define IDS_DESKTOP 1204
+#define IDS_SHELL 1205
+#define IDS_TITLEFMT 1206
+#define IDS_NO_IMPL 1207
+#define IDS_WINE 1208
+#define IDS_WINE_FILE 1209
+
+#define IDS_COL_NAME 1210
+#define IDS_COL_SIZE 1211
+#define IDS_COL_CDATE 1212
+#define IDS_COL_ADATE 1213
+#define IDS_COL_MDATE 1214
+#define IDS_COL_IDX 1215
+#define IDS_COL_LINKS 1216
+#define IDS_COL_ATTR 1217
+#define IDS_COL_SEC 1218
+#define IDS_FREE_SPACE_FMT 1219
+
+
+/* range for drive bar command ids: 0x9000..0x90FF */
+
+#ifdef __WINE__
+#define ID_DRIVE_UNIX_FS 0x9000
+#endif
+#define ID_DRIVE_SHELL_NS 0x9001
+
+#define ID_DRIVE_FIRST 0x9002
--- /dev/null
+/*
+ * Copyright 2000 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
+ */
+
+IDA_WINEFILE ACCELERATORS DISCARDABLE
+{
+ VK_F1, ID_HELP, VIRTKEY, NOINVERT
+ VK_F5, ID_REFRESH, VIRTKEY, NOINVERT
+ VK_F7, ID_FILE_MOVE, VIRTKEY, NOINVERT
+ VK_F8, ID_FILE_COPY, VIRTKEY, NOINVERT
+ VK_DELETE, ID_FILE_DELETE, VIRTKEY, NOINVERT
+ VK_RETURN, ID_ACTIVATE, VIRTKEY, NOINVERT
+ VK_RETURN, ID_EDIT_PROPERTIES, VIRTKEY, ALT, NOINVERT
+#ifndef _NO_EXTENSIONS
+ "X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT
+ "S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, NOINVERT
+ VK_ADD, ID_PREFERRED_SIZES, VIRTKEY, CONTROL, NOINVERT
+#endif
+}
+
+IDI_WINEFILE ICON DISCARDABLE
+#ifdef _WIN32
+ "winefile.ico"
+#else
+{
+ '00 00 01 00 01 00 20 20 10 00 00 00 00 00 E8 02'
+ '00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
+ '00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00'
+ '00 00 80 00 80 00 80 80 00 00 C0 C0 C0 00 80 80'
+ '80 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00'
+ '00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 B7'
+ 'B7 B7 B7 B7 B7 B7 B7 70 00 00 00 00 00 00 00 70'
+ '00 00 00 00 00 00 0B 73 00 00 00 00 00 00 00 B3'
+ 'F7 B7 B7 B7 B7 B7 07 73 30 00 00 00 00 00 00 73'
+ 'FB 7B 7B 7B 7B 7B 0B 73 33 00 00 00 00 00 00 B3'
+ 'F7 BF FF FF F7 B7 07 73 33 00 00 00 00 00 00 73'
+ 'FB 70 33 33 0B 7B 0B 73 33 00 0F FF FF 00 00 B3'
+ 'F7 B0 33 33 07 B7 07 73 33 00 F0 00 00 F0 00 73'
+ 'FB 70 00 00 0B 7B 0B 73 33 00 00 00 00 00 00 B3'
+ 'F7 B7 B7 B7 B7 B7 07 73 33 00 00 00 00 00 00 73'
+ 'FF FF FF FF FF FF 0B 73 33 00 00 02 00 00 00 B3'
+ '33 33 33 33 33 33 07 73 33 00 00 09 00 00 00 7B'
+ '7B 7B 7B 7B 7B 7B 7B 73 33 00 00 99 90 00 00 B0'
+ '00 00 00 00 00 00 07 73 33 00 0B BB BB 00 00 73'
+ 'FB 7B 7B 7B 7B 7B 0B 73 33 00 BB BB BB B0 00 B3'
+ 'F7 B7 B7 B7 B7 B7 07 73 33 00 00 00 E0 00 00 73'
+ 'FB 7F FF FF FB 7B 0B 73 33 00 00 00 0E 00 00 B3'
+ 'F7 B0 33 33 07 B7 07 73 33 00 00 00 00 00 00 73'
+ 'FB 70 33 33 0B 7B 0B 73 33 00 00 00 00 00 00 B3'
+ 'F7 B0 00 00 07 B7 07 73 33 00 00 00 00 00 00 73'
+ 'FB 7B 7B 7B 7B 7B 0B 73 33 00 00 00 00 00 00 B3'
+ 'FF FF FF FF FF FF 07 73 33 00 00 00 00 00 00 73'
+ '33 33 33 33 33 33 0B 73 33 00 00 00 00 00 00 B7'
+ 'B7 B7 B7 B7 B7 B7 B7 73 33 00 00 00 00 00 00 FF'
+ 'FF FF FF FF FF FF FF F3 33 00 00 00 00 00 00 07'
+ 'B7 B7 B7 B7 B7 B7 B7 BF 33 00 00 00 00 00 00 00'
+ '7B 7B 7B 7B 7B 7B 7B 7B F3 00 00 00 00 00 00 00'
+ '07 B7 B7 B7 B7 B7 B7 B7 BF 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF'
+ 'FF FF 80 00 1F FF 80 00 0F FF 80 00 07 FF 80 00'
+ '03 FF 80 00 01 FF 80 00 01 FF 80 00 01 83 80 00'
+ '01 39 80 00 01 C7 80 00 01 EF 80 00 01 EF 80 00'
+ '01 EF 80 00 01 C7 80 00 01 83 80 00 01 01 80 00'
+ '01 F7 80 00 01 FB 80 00 01 FF 80 00 01 FF 80 00'
+ '01 FF 80 00 01 FF 80 00 01 FF 80 00 01 FF 80 00'
+ '01 FF 80 00 01 FF C0 00 01 FF E0 00 01 FF F0 00'
+ '01 FF F8 00 01 FF FF FF FF FF FF FF FF FF'
+}
+#endif
+
+IDB_TOOLBAR BITMAP DISCARDABLE
+#ifdef _WIN32
+ "toolbar.bmp"
+#else
+{
+ '42 4D BE 03 00 00 00 00 00 00 76 00 00 00 28 00'
+ '00 00 70 00 00 00 0F 00 00 00 01 00 04 00 00 00'
+ '00 00 48 03 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
+ '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
+ '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF'
+ '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
+ '00 00 FF FF FF 00 77 77 77 88 88 88 88 88 77 77'
+ '77 77 77 77 77 77 77 88 88 88 88 88 88 87 77 88'
+ '88 88 88 88 88 87 77 88 88 88 88 88 88 88 78 88'
+ '88 88 88 88 88 87 77 77 77 07 07 07 07 07 77 77'
+ '74 44 44 44 44 48 77 77 77 88 88 88 88 88 74 44'
+ '44 44 44 44 44 87 74 44 44 44 44 44 44 87 74 44'
+ '44 44 44 44 44 48 44 44 44 44 44 44 44 87 77 77'
+ '77 77 77 77 77 70 77 77 74 FF FF FF FF 48 77 77'
+ '74 44 44 44 44 48 74 FF FF FF FF FF F4 87 74 FF'
+ 'FF F4 FF FF F4 87 74 FF FF F4 FF FF FF 48 4F FF'
+ 'FF 4F FF FF F4 87 07 07 07 07 77 77 77 77 77 77'
+ '74 FF FF FF FF 48 77 77 74 FF FF FF FF 48 74 FF'
+ 'FF FF FF FF F4 87 74 FF FF F4 FF FF F4 87 74 FF'
+ 'FF F4 FF FF FF 48 4F FF FF 44 44 44 44 87 77 77'
+ '77 77 77 77 77 70 77 88 88 88 88 88 FF 48 77 77'
+ '84 FF FF FF FF 48 74 FF FF FF FF FF F4 87 74 FF'
+ 'FF F4 FF FF F4 87 74 FF FF F4 44 44 44 48 4F FF'
+ 'FF 44 44 44 44 87 07 77 77 07 77 77 77 77 74 44'
+ '8B 44 44 48 44 48 77 74 44 FF FF FF FF 48 74 44'
+ '44 44 44 44 44 87 74 FF FF F4 FF FF F4 87 74 FF'
+ 'FF F4 44 44 44 48 4F FF FF 4F FF 4F F4 87 77 77'
+ '77 70 70 70 70 70 7B FF 8B FF FF 48 44 47 77 74'
+ 'F4 44 44 44 44 48 74 44 44 44 44 44 44 87 74 FF'
+ 'FF F4 FF FF F4 87 74 FF FF F4 FF F4 FF 48 44 44'
+ '44 44 44 44 44 87 07 77 77 07 07 07 07 07 78 B8'
+ '8B F8 BF 48 77 77 77 84 F4 44 44 44 44 47 74 44'
+ '44 44 44 44 44 87 74 FF FF F4 FF FF F4 87 74 44'
+ '44 44 FF F4 FF 48 44 44 44 44 44 44 44 77 70 70'
+ '70 70 70 77 77 77 74 8B 8B 8B FF 48 88 87 74 44'
+ 'FF FF FF FF 48 77 74 FF FF FF FF FF F4 87 74 FF'
+ 'FF F4 FF FF F4 87 74 44 44 44 FF F4 FF 48 77 77'
+ '77 77 77 77 77 77 00 F7 07 07 07 70 70 77 7B B8'
+ 'BB B4 44 48 44 87 74 F4 44 44 44 44 48 77 74 FF'
+ 'FF FF FF FF F4 87 74 FF FF F4 FF FF F4 87 74 FF'
+ 'FF F4 FF F4 FF 48 7C CC 77 CC 77 C7 7C 77 00 F7'
+ '78 87 77 77 77 07 74 88 BB B4 44 44 F4 87 74 F4'
+ '44 44 44 44 47 77 74 FF FF FF FF FF F4 87 74 FF'
+ 'FF F4 FF FF F4 87 74 FF FF F4 FF F4 FF 48 C7 7C'
+ '7C 7C 7C 77 C7 C7 70 0F 00 F7 77 77 77 77 77 8B'
+ '8B 8B FF FF F4 87 74 FF FF FF FF 48 77 77 74 44'
+ '44 44 44 44 44 87 74 44 44 44 44 44 44 87 74 FF'
+ 'FF F4 FF F4 FF 48 7C CC 7C 7C 7C 77 C7 C7 77 08'
+ '07 77 77 77 77 07 78 B7 8B FF FF FF F4 87 74 44'
+ '44 44 44 48 77 77 74 44 44 44 44 44 44 87 74 44'
+ '44 44 44 44 44 87 74 44 44 44 44 44 44 48 77 7C'
+ '7C 7C 7C 77 C7 C7 77 80 0F 77 77 77 77 77 7B 77'
+ '8B 44 8B 44 44 87 74 44 44 44 44 47 77 77 74 44'
+ '44 44 44 44 44 77 74 44 44 44 44 44 44 77 74 44'
+ '44 44 44 44 44 47 7C C7 7C 7C 7C C7 7C 77 80 07'
+ '70 F7 07 07 07 07 77 77 8B 44 54 44 44 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 7C 77 77 77 08 77 70 00 70 70 70 77'
+}
+#endif
+
+IDB_DRIVEBAR BITMAP DISCARDABLE
+#ifdef _WIN32
+ "drivebar.bmp"
+#else
+{
+ '42 4D E6 02 00 00 00 00 00 00 76 00 00 00 28 00'
+ '00 00 60 00 00 00 0D 00 00 00 01 00 04 00 00 00'
+ '00 00 70 02 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
+ '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
+ '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF'
+ '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
+ '00 00 FF FF FF 00 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 08 88 88 88 88 88 88 80 08 88'
+ '88 88 88 88 88 80 08 88 88 88 88 88 88 80 08 88'
+ '88 88 88 88 88 80 08 88 88 88 88 88 88 80 08 88'
+ '88 88 88 88 88 80 07 70 07 77 77 70 00 80 0F 77'
+ '77 77 77 77 77 80 0F 00 77 77 77 77 77 80 0F 77'
+ '77 77 77 79 97 80 0F 77 70 00 77 77 77 80 0F 77'
+ '07 07 07 07 77 80 07 77 70 07 00 00 77 80 0F 77'
+ '70 00 00 07 77 80 0F 00 00 00 00 00 00 80 0F 77'
+ '70 00 07 77 77 80 0F 77 77 07 77 77 77 80 0F 70'
+ '00 00 00 00 77 80 07 77 77 00 00 77 77 80 0F 00'
+ '00 00 00 00 00 80 0F 77 77 77 77 77 77 80 0F 77'
+ '07 7F 70 77 77 80 0F 77 70 00 77 77 77 80 0F 70'
+ '70 70 70 70 77 80 07 70 00 77 70 00 77 80 0F 77'
+ '70 00 00 07 77 80 0F 00 00 00 00 00 00 80 0F 00'
+ '87 F8 78 00 77 80 0F 00 00 70 00 00 07 80 0F 70'
+ '00 00 00 00 77 80 07 07 77 77 77 70 00 80 0F 77'
+ '77 77 77 77 70 80 0F 77 77 77 77 77 77 80 0F 00'
+ '00 00 00 00 77 80 0F 77 77 77 77 77 77 80 0F 77'
+ '07 07 07 07 77 80 07 77 77 77 77 77 77 80 0F FF'
+ 'FF FF FF FF FF 80 0F FF FF FF FF FF FF 80 0F FF'
+ 'FF FF FF FF FF 80 0F FF FF FF FF FF FF 80 0F FF'
+ 'FF FF FF FF FF 80 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77'
+ '77 77 77 77 77 77'
+}
+#endif
+
+IDB_IMAGES BITMAP DISCARDABLE
+#ifdef _WIN32
+ "images.bmp"
+#else
+{
+ '42 4D 86 04 00 00 00 00 00 00 76 00 00 00 28 00'
+ '00 00 A0 00 00 00 0D 00 00 00 01 00 04 00 00 00'
+ '00 00 10 04 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
+ '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
+ '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF'
+ '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
+ '00 00 FF FF FF 00 AA AA 00 00 00 00 00 AA AA AA'
+ '00 00 00 00 00 AA AA 00 00 00 00 00 00 00 AA 00'
+ '00 00 00 00 00 00 AA A0 00 00 00 00 00 0A AA 00'
+ '00 00 00 00 00 00 AA A0 00 00 00 00 00 0A AA A0'
+ '00 00 00 00 00 0A AA AA AA AA AA AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 77 77 77 77 70 AA AA A7'
+ '77 77 77 77 70 AA A7 77 77 77 77 77 77 70 A7 77'
+ '77 77 77 77 77 80 AA 77 77 77 77 77 77 0A A7 77'
+ '77 77 77 77 77 80 AA 77 77 77 77 77 77 0A AA 77'
+ '77 77 77 77 77 0A AA AA AA AA AA AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 FF FF FF FF 70 AA AA A7'
+ 'FF FF FF FF 70 AA A7 7F 7F 7F 7F 7F 7F 70 A7 FB'
+ 'FB FB FB FB FB 80 AA 7F BF BF BF BF B7 0A A7 FB'
+ 'FB FB FB FB FB 80 AA 7F BF BF BF BF B7 0A AA 7F'
+ 'BF BF BF BF B7 0A AA AA AA 00 00 00 0A AA AA AA'
+ 'AA 00 AA AA AA AA AA A7 FF FF FF FF 70 AA AA A7'
+ 'FF 44 44 FF 70 AA A7 F7 F7 F7 F7 F7 F7 70 A7 FF'
+ 'BF BF BF BF BF 80 A7 FB FB FB FB FB F0 8A A7 FF'
+ 'BF B0 BF BF BF 80 A7 FB FB F0 FB FB F0 8A A7 FB'
+ 'FB FB FB FB F0 8A AA AA A0 E6 68 86 0A AA AA AA'
+ 'A0 E8 0A AA AA AA AA A7 FF FF FF FF 70 AA AA A7'
+ 'FF FF FF FF 70 AA A7 7F 7F 7F 7F 7F 7F 70 A7 FB'
+ 'FB FB FB FB FB 80 A7 BF BF BF BF BF 70 8A A7 FB'
+ 'FB F0 FB FB FB 80 A7 BF B0 00 0F BF 70 8A A7 BF'
+ 'B0 00 0F BF 70 8A AA AA A0 E0 00 00 AA AA AA AA'
+ 'A0 E8 0A AA AA AA AA A7 FF FF FF FF 70 AA AA A7'
+ 'FF 44 44 FF 70 AA A7 F7 F7 F7 F7 F7 F7 70 A7 FF'
+ 'BF BF BF BF BF 80 7B FB FB FB FB FB 88 8A A7 FF'
+ 'B0 00 00 BF BF 80 7B FB FB 0B FB FB 88 8A 7B FB'
+ 'FB FB FB FB 88 8A AA AA A0 E0 AA AA AA AA AA AA'
+ 'AA 00 AA AA AA AA AA A7 FF FF FF FF 70 AA AA A7'
+ 'FF FF FF FF 70 AA A7 7F 7F 7F 7F 7F 7F 70 A7 FB'
+ 'FB FB FB FB FB 80 7F FF FF FF FF F7 0F 8A A7 FB'
+ 'FB F0 FB FB FB 80 7F FF FF FF FF F7 0F 8A 7F FF'
+ 'FF FF FF F7 0F 8A AA AA A0 E0 AA AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 FF FF FF FF 70 AA AA A7'
+ 'FF 44 44 FF 70 AA A7 F7 F7 F7 F7 F7 F7 70 A7 FF'
+ 'BF BF BF BF BF 80 77 77 77 77 77 78 FB 8A A7 FF'
+ 'BF B0 BF BF BF 80 77 77 77 77 77 78 FB 8A 77 77'
+ '77 77 77 78 FB 8A AA A0 00 E0 00 AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 FF FF FF FF 70 AA AA A7'
+ 'FF FF FF FF 70 AA A7 7F 7F 7F 7F 7F 7F 70 A7 FB'
+ 'FB FB FB FB FB 80 A7 BF BF BF BF BF BF 8A A7 FB'
+ 'FB FB FB FB FB 80 A7 BF BF BF BF BF BF 8A A7 BF'
+ 'BF BF BF BF BF 8A AA A0 E6 66 60 AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 FF FF F7 77 7A AA AA A7'
+ 'FF 44 F7 77 7A AA A7 F7 F7 F7 F7 F7 F7 70 A7 FF'
+ 'FF FF FF FF FF 80 A7 FB FB FB FF FF FF 8A A7 FF'
+ 'FF FF FF FF FF 80 A7 FB FB FB FF FF FF 8A A7 FB'
+ 'FB FB FF FF FF 8A AA AA 0E 66 0A AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 FF FF F7 F7 AA AA AA A7'
+ 'FF FF F7 F7 AA AA A7 77 77 77 77 77 77 70 A7 FB'
+ 'FB FB F7 77 77 8A A7 BF BF BF F7 77 77 8A A7 FB'
+ 'FB FB F7 77 77 8A A7 BF BF BF F7 77 77 8A A7 BF'
+ 'BF BF F7 77 77 8A AA AA A0 E0 AA AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 FF FF F7 7A AA AA AA A7'
+ 'FF FF F7 7A AA AA A7 EE EE EE EE EE EE 70 AA 7F'
+ 'BF BF 7A AA AA AA AA 7F FF FF 7A AA AA AA AA 7F'
+ 'BF BF 7A AA AA AA AA 7F FF FF 7A AA AA AA AA 7F'
+ 'FF FF 7A AA AA AA AA AA AA 0A AA AA AA AA AA AA'
+ 'AA AA AA AA AA AA AA A7 77 77 77 AA AA AA AA A7'
+ '77 77 77 AA AA AA A7 77 77 77 77 77 77 7A AA A7'
+ '77 77 AA AA AA AA AA A7 77 77 AA AA AA AA AA A7'
+ '77 77 AA AA AA AA AA A7 77 77 AA AA AA AA AA A7'
+ '77 77 AA AA AA AA AA AA AA AA AA AA AA AA AA AA'
+ 'AA AA AA AA AA AA'
+}
+#endif
--- /dev/null
+/*
+ * WineFile (Russian resources)
+ *
+ * Copyright 2003 Igor Stepin
+ *
+ * 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_RUSSIAN, SUBLANG_NEUTRAL
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&Ôàéë" {
+ MENUITEM "&Îòêðûòü\tEnter", ID_ACTIVATE
+ MENUITEM "&Ïåðåìåñòèòü...\tF7", ID_FILE_MOVE
+ MENUITEM "&Êîïèðîâàòü...\tF8", ID_FILE_COPY
+ MENUITEM "&Â áóôåð îáìåíà...\tF9", 118
+ MENUITEM "&Óäàëèòü\tDel", ID_FILE_DELETE
+ MENUITEM "Ïåðåèìåíîâàòü...", 109
+ MENUITEM "Ñâîéñòâà...\tAlt+Enter", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "Àðõèâèðîâàòü...", 119
+ MENUITEM "Ðàñïàêîâàòü...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "&Çàïóñòèòü...", ID_EXECUTE
+ MENUITEM "&Ïå÷àòàòü...", 102
+ MENUITEM "Àññîöèèðîâàòü...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Ñîçäàòü äèðåêòîðèþ...", 111
+ MENUITEM "Ïîèñê...", 104
+ MENUITEM "&Âûäåëèòü ôàéëû...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Âûõîä\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "Âûõîä", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Äèñê" {
+ MENUITEM "&Êîïèðîâàòü äèñê...", 201
+ MENUITEM "&Ìåòêà òîìà...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Ôîðìàòèðîâàòü...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Ñîçäàòü ñèñòåìíûé äèñê...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Ïîäêëþ&÷èòü ñåòåâîé äèñê", ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "Îòê&ëþ÷èòü ñåòåâîé äèñê", ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "Ñäåëàòü î&áùèì êàê...", 254
+ MENUITEM "&Çàêðûòü îáùèé äîñòóï...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "&Âûáðàòü äèñê...", 251
+ }
+
+ POPUP "&Ïàïêè" {
+ MENUITEM "Ñ&ëåäóþùèé óðîâåíü\t+", 301
+ MENUITEM "&Ðàçâåðíóòü äåðåâî\t*", 302
+ MENUITEM "Ðàçâåðíóòü â&ñå\tStrg+*", 303
+ MENUITEM "&Ñâåðíóòü äåðåâî\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Îòìåòèòü âåòâè", 505
+ }
+
+ POPUP "&Âèä" {
+ MENUITEM "Äåðåâî &è ïàïêà", 413
+ MENUITEM "Òîëüêî &äåðåâî", 411
+ MENUITEM "Òîëüêî &ïàïêà", 412
+ MENUITEM SEPARATOR
+ MENUITEM "Ðàç&áèòü", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "È&ìÿ", ID_VIEW_NAME
+ MENUITEM "Â&ñå ïîäðîáíîñòè î ôàéëå", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "&Âûáîðî÷íî î ôàéëå...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "&Ñîðòèðîâàòü ïî èìåíè", ID_VIEW_SORT_NAME
+ MENUITEM "Ñîðòèðîâàòü ïî &òèïó", ID_VIEW_SORT_TYPE
+ MENUITEM "Ñîðòèðîâàòü ïî &ðàçìåðó", ID_VIEW_SORT_SIZE
+ MENUITEM "Ñîðòèðîâàòü ïî ä&àòå", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Ñîðòèðîâàòü ïî &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Íàñòðîéêè" {
+ MENUITEM "Ïîä&òâåðæäåíèÿ...", 501
+ MENUITEM "&Øðèôò...", ID_SELECT_FONT
+ MENUITEM "&Íàñòðîèòü ïàíåëü èíñòðóìåíòîâ...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "&Ïàíåëü èíñòðóìåíòîâ", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "Ïàíåëü &äèñêîâ", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "&Ñòðîêà ñîñòîÿíèÿ", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Ï&îëíûé ýêðàí\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Çíà÷îê â ñïèñîê ïðîãðàìì", 504
+ MENUITEM "Ñî&õðàíÿòü íàñòðîéêè ïðè âûõîäå",511
+ }
+
+
+ POPUP "&Áåçîïàñíîñòü" {
+ MENUITEM "&Äîñòóï...", 605
+ MENUITEM "&Ïðîòîêîëû...", 606
+ MENUITEM "&Âëàäåëåö...", 607
+ }
+
+ POPUP "&Îêíî" {
+ MENUITEM "Íîâîå &îêíî", ID_WINDOW_NEW
+ MENUITEM "Îêíà &êàñêàäîì\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Îêíà ñ&âåðõó âíèç", ID_WINDOW_TILE_HORZ
+ MENUITEM "Îêíà ñ&ëåâà íàïðàâî\tCtrl+F4",ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Ðàñïîëîæèòü &àâòîìàòè÷åñêè", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "&Ðàñïîëîæèòü", ID_WINDOW_ARRANGE
+ MENUITEM "Î&áíîâèòü\tF5", ID_REFRESH
+ }
+
+ POPUP "&Ñïðàâêà" {
+ MENUITEM "&Ñîäåðæàíèå\tF1", ID_HELP
+ MENUITEM "&Ïîèñê...\tF1", ID_HELP
+ MENUITEM "&Èñïîëüçîâàíèå ñïðàâêè\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 "&Êîìàíäà:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "Êàê &ñèìâîë", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Îòìåíà", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Ñïðàâêà", 254, 158, 43, 47, 14
+}
--- /dev/null
+/*
+ * WineFile
+ * Slovenian Language Support
+ *
+ * Copyright 2003 Rok Mandeljc <rok.mandeljc@gimb.org>
+ *
+ * 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_SLOVENIAN, SUBLANG_NEUTRAL
+
+/* Menu */
+
+IDM_WINEFILE MENU FIXED IMPURE
+{
+ POPUP "&File" {
+ MENUITEM "&Open\tEnter", ID_ACTIVATE
+ MENUITEM "&Move...\tF7", ID_FILE_MOVE
+ MENUITEM "&Copy...\tF8", ID_FILE_COPY
+ MENUITEM "&In Clipboard...\tF9", 118
+ MENUITEM "&Delete\tDel", ID_FILE_DELETE
+ MENUITEM "Re&name...", 109
+ MENUITEM "Propert&ies...\tAlt+Enter", ID_EDIT_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "C&ompress...", 119
+ MENUITEM "Dec&ompress...", 120
+ MENUITEM SEPARATOR
+ MENUITEM "&Run...", ID_EXECUTE
+ MENUITEM "&Print...", 102
+ MENUITEM "Associate...", 103
+ MENUITEM SEPARATOR
+ MENUITEM "Cr&eate Directory...", 111
+ MENUITEM "Searc&h...", 104
+ MENUITEM "&Select Files...", 116
+ MENUITEM SEPARATOR
+#ifndef _NO_EXTENSIONS
+ MENUITEM "E&xit\tAlt+X", ID_FILE_EXIT
+#else
+ MENUITEM "E&xit", ID_FILE_EXIT
+#endif
+ }
+
+ POPUP "&Disk" {
+ MENUITEM "&Copy Disk...", 201
+ MENUITEM "&Label Disk...", 202
+ MENUITEM SEPARATOR
+ MENUITEM "&Format Disk...", ID_FORMAT_DISK
+#ifdef _WIN95
+ MENUITEM "&Make System Disk...", -1 /*TODO*/
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "Connect &Network Drive", ID_CONNECT_NETWORK_DRIVE
+ MENUITEM "&Disconnect Network Drive", ID_DISCONNECT_NETWORK_DRIVE
+ MENUITEM SEPARATOR
+ MENUITEM "Share as...", 254
+ MENUITEM "&Remove Share...", 255
+ MENUITEM SEPARATOR
+ MENUITEM "&Select Drive...", 251
+ }
+
+ POPUP "&Directories" {
+ MENUITEM "&Next Level\t+", 301
+ MENUITEM "Expand &Tree\t*", 302
+ MENUITEM "Expand &all\tStrg+*", 303
+ MENUITEM "Collapse &Tree\t-", 304
+ MENUITEM SEPARATOR
+ MENUITEM "&Mark Childs", 505
+ }
+
+ POPUP "&View" {
+ MENUITEM "T&ree and Directory", 413
+ MENUITEM "Tr&ee Only", 411
+ MENUITEM "Directory &Only", 412
+ MENUITEM SEPARATOR
+ MENUITEM "Sp&lit", ID_VIEW_SPLIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Name", ID_VIEW_NAME
+ MENUITEM "&All File Details", ID_VIEW_ALL_ATTRIBUTES, CHECKED
+ MENUITEM "&Partial Details...", ID_VIEW_SELECTED_ATTRIBUTES
+ MENUITEM SEPARATOR
+ MENUITEM "&Sort by Name", ID_VIEW_SORT_NAME
+ MENUITEM "Sort &by Type", ID_VIEW_SORT_TYPE
+ MENUITEM "Sort by Si&ze", ID_VIEW_SORT_SIZE
+ MENUITEM "Sort by &Date", ID_VIEW_SORT_DATE
+ MENUITEM SEPARATOR
+ MENUITEM "Filter by &...", ID_VIEW_FILTER
+ }
+
+ POPUP "&Options" {
+ MENUITEM "&Confirmation...", 501
+ MENUITEM "&Font...", ID_SELECT_FONT
+ MENUITEM "Customize Tool&bar...", 512
+ MENUITEM SEPARATOR
+ MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR, CHECKED
+ MENUITEM "&Drivebar", ID_VIEW_DRIVE_BAR, CHECKED
+ MENUITEM "&Status Bar", ID_VIEW_STATUSBAR, CHECKED
+#ifndef _NO_EXTENSIONS
+ MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
+#endif
+ MENUITEM SEPARATOR
+ MENUITEM "&Minize on run", 504
+ MENUITEM "&Save settings on exit", 511
+ }
+
+
+ POPUP "&Security" {
+ MENUITEM "&Access...", 605
+ MENUITEM "&Logging...", 606
+ MENUITEM "&Owner...", 607
+ }
+
+ POPUP "&Window" {
+ MENUITEM "New &Window", ID_WINDOW_NEW
+ MENUITEM "Cascading\tCtrl+F5", ID_WINDOW_CASCADE
+ MENUITEM "Tile &Horizontally", ID_WINDOW_TILE_HORZ
+ MENUITEM "Tile &Vertically\tCtrl+F4", ID_WINDOW_TILE_VERT
+#ifndef _NO_EXTENSIONS
+ MENUITEM "Arrange Automatically", ID_WINDOW_AUTOSORT
+#endif
+ MENUITEM "Arrange &Symbols", ID_WINDOW_ARRANGE
+ MENUITEM "&Refresh\tF5", ID_REFRESH
+ }
+
+ POPUP "&?" {
+ MENUITEM "&Help Topics\tF1", ID_HELP
+ MENUITEM "Help &Search...\tF1", ID_HELP
+ MENUITEM "&Using Help\tF1", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&Info about 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 "Execute"
+FONT 8, "MS Shell Dlg"
+{
+ CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10
+ CONTROL "&Command:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10
+ EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL
+ CONTROL "As &Symbol", 214, "Button", BS_AUTOCHECKBOX|WS_TABSTOP,3, 45, 71, 12
+ DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14
+ PUSHBUTTON "Cancel", 2, 158, 23, 47, 14
+ PUSHBUTTON "&Help", 254, 158, 43, 47, 14
+}
--- /dev/null
+/*
+ * Copyright 2000, 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
+ */
+
+#include "winefile.h"
+
+
+#ifdef __WINE__
+#ifdef UNICODE
+
+void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext)
+{
+ const WCHAR* end; /* end of processed string */
+ const WCHAR* p; /* search pointer */
+ const WCHAR* s; /* copy pointer */
+
+ /* extract drive name */
+ if (path[0] && path[1]==':') {
+ if (drv) {
+ *drv++ = *path++;
+ *drv++ = *path++;
+ *drv = L'\0';
+ }
+ } else if (drv)
+ *drv = L'\0';
+
+ /* search for end of string or stream separator */
+ for(end=path; *end && *end!=L':'; )
+ end++;
+
+ /* search for begin of file extension */
+ for(p=end; p>path && *--p!=L'\\' && *p!=L'/'; )
+ if (*p == L'.') {
+ end = p;
+ break;
+ }
+
+ if (ext)
+ for(s=end; (*ext=*s++); )
+ ext++;
+
+ /* search for end of directory name */
+ for(p=end; p>path; )
+ if (*--p=='\\' || *p=='/') {
+ p++;
+ break;
+ }
+
+ if (name) {
+ for(s=p; s<end; )
+ *name++ = *s++;
+
+ *name = L'\0';
+ }
+
+ if (dir) {
+ for(s=path; s<p; )
+ *dir++ = *s++;
+
+ *dir = L'\0';
+ }
+}
+
+#else /* UNICODE */
+
+void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext)
+{
+ const CHAR* end; /* end of processed string */
+ const CHAR* p; /* search pointer */
+ const CHAR* s; /* copy pointer */
+
+ /* extract drive name */
+ if (path[0] && path[1]==':') {
+ if (drv) {
+ *drv++ = *path++;
+ *drv++ = *path++;
+ *drv = '\0';
+ }
+ } else if (drv)
+ *drv = '\0';
+
+ /* search for end of string or stream separator */
+ for(end=path; *end && *end!=':'; )
+ end++;
+
+ /* search for begin of file extension */
+ for(p=end; p>path && *--p!='\\' && *p!='/'; )
+ if (*p == '.') {
+ end = p;
+ break;
+ }
+
+ if (ext)
+ for(s=end; (*ext=*s++); )
+ ext++;
+
+ /* search for end of directory name */
+ for(p=end; p>path; )
+ if (*--p=='\\' || *p=='/') {
+ p++;
+ break;
+ }
+
+ if (name) {
+ for(s=p; s<end; )
+ *name++ = *s++;
+
+ *name = '\0';
+ }
+
+ if (dir) {
+ for(s=path; s<p; )
+ *dir++ = *s++;
+
+ *dir = '\0';
+ }
+}
+
+#endif /* UNICODE */
+#endif /* __WINE__ */
+
+
+/*
+void main() // test splipath()
+{
+ TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
+
+ _tsplitpath(L"x\\y", drv, dir, name, ext);
+ _tsplitpath(L"x\\", drv, dir, name, ext);
+ _tsplitpath(L"\\x", drv, dir, name, ext);
+ _tsplitpath(L"x", drv, dir, name, ext);
+ _tsplitpath(L"", drv, dir, name, ext);
+ _tsplitpath(L".x", drv, dir, name, ext);
+ _tsplitpath(L":x", drv, dir, name, ext);
+ _tsplitpath(L"a:x", drv, dir, name, ext);
+ _tsplitpath(L"a.b:x", drv, dir, name, ext);
+ _tsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext);
+ _tsplitpath(L"abc.EFGH:12345", drv, dir, name, ext);
+ _tsplitpath(L"C:/dos/command.com", drv, dir, name, ext);
+}
+*/
--- /dev/null
+/*
+ * Winefile
+ *
+ * Copyright 2000, 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
+ */
+
+#ifdef __WINE__
+#include "config.h"
+#include "wine/port.h"
+
+/* for unix filesystem function calls */
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <dirent.h>
+#endif
+
+#define COBJMACROS
+
+#include "winefile.h"
+
+#include "resource.h"
+
+
+#ifdef _NO_EXTENSIONS
+#undef _LEFT_FILES
+#endif
+
+#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 NONAMELESSUNION
+#define UNION_MEMBER(x) DUMMYUNIONNAME.x
+#else
+#define UNION_MEMBER(x) x
+#endif
+
+
+#ifdef _SHELL_FOLDERS
+#define DEFAULT_SPLIT_POS 300
+#else
+#define DEFAULT_SPLIT_POS 200
+#endif
+
+
+enum ENTRY_TYPE {
+ ET_WINDOWS,
+ ET_UNIX,
+#ifdef _SHELL_FOLDERS
+ ET_SHELL
+#endif
+};
+
+typedef struct _Entry {
+ struct _Entry* next;
+ struct _Entry* down;
+ struct _Entry* up;
+
+ BOOL expanded;
+ BOOL scanned;
+ int level;
+
+ WIN32_FIND_DATA data;
+
+#ifndef _NO_EXTENSIONS
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ BOOL bhfi_valid;
+ enum ENTRY_TYPE etype;
+#endif
+#ifdef _SHELL_FOLDERS
+ LPITEMIDLIST pidl;
+ IShellFolder* folder;
+ HICON hicon;
+#endif
+} Entry;
+
+typedef struct {
+ Entry entry;
+ TCHAR path[MAX_PATH];
+ TCHAR volname[_MAX_FNAME];
+ TCHAR fs[_MAX_DIR];
+ DWORD drive_type;
+ DWORD fs_flags;
+} Root;
+
+enum COLUMN_FLAGS {
+ COL_SIZE = 0x01,
+ COL_DATE = 0x02,
+ COL_TIME = 0x04,
+ COL_ATTRIBUTES = 0x08,
+ COL_DOSNAMES = 0x10,
+#ifdef _NO_EXTENSIONS
+ COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES
+#else
+ COL_INDEX = 0x20,
+ COL_LINKS = 0x40,
+ COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS
+#endif
+};
+
+typedef enum {
+ SORT_NAME,
+ SORT_EXT,
+ SORT_SIZE,
+ SORT_DATE
+} SORT_ORDER;
+
+typedef struct {
+ HWND hwnd;
+#ifndef _NO_EXTENSIONS
+ HWND hwndHeader;
+#endif
+
+#ifndef _NO_EXTENSIONS
+#define COLUMNS 10
+#else
+#define COLUMNS 5
+#endif
+ int widths[COLUMNS];
+ int positions[COLUMNS+1];
+
+ BOOL treePane;
+ int visible_cols;
+ Entry* root;
+ Entry* cur;
+} Pane;
+
+typedef struct {
+ HWND hwnd;
+ Pane left;
+ Pane right;
+ int focus_pane; /* 0: left 1: right */
+ WINDOWPLACEMENT pos;
+ int split_pos;
+ BOOL header_wdths_ok;
+
+ TCHAR path[MAX_PATH];
+ TCHAR filter_pattern[MAX_PATH];
+ int filter_flags;
+ Root root;
+
+ SORT_ORDER sortOrder;
+} ChildWnd;
+
+
+
+static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd);
+static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd);
+static void refresh_child(ChildWnd* child);
+static void refresh_drives(void);
+static void get_path(Entry* dir, PTSTR path);
+static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols);
+
+static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
+static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
+static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
+
+
+/* globals */
+WINEFILE_GLOBALS Globals;
+
+static int last_split;
+
+
+/* some common string constants */
+const static TCHAR sEmpty[] = {'\0'};
+const static TCHAR sSpace[] = {' ', '\0'};
+const static TCHAR sNumFmt[] = {'%','d','\0'};
+const static TCHAR sQMarks[] = {'?','?','?','\0'};
+
+/* window class names */
+const static TCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'};
+const static TCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'};
+
+#ifdef _MSC_VER
+/* #define LONGLONGARG _T("I64") */
+const static TCHAR sLongHexFmt[] = {'%','I','6','4','X','\0'};
+const static TCHAR sLongNumFmt[] = {'%','I','6','4','d','\0'};
+#else
+/* #define LONGLONGARG _T("L") */
+const static TCHAR sLongHexFmt[] = {'%','L','X','\0'};
+const static TCHAR sLongNumFmt[] = {'%','L','d','\0'};
+#endif
+
+
+/* load resource string */
+static LPTSTR load_string(LPTSTR buffer, UINT id)
+{
+ LoadString(Globals.hInstance, id, buffer, BUFFER_LEN);
+
+ return buffer;
+}
+
+#define RS(b, i) load_string(b, i)
+
+
+/* display error message for the specified WIN32 error code */
+static void display_error(HWND hwnd, DWORD error)
+{
+ TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
+ PTSTR msg;
+
+ if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
+ 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL))
+ MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
+ else
+ MessageBox(hwnd, RS(b1,IDS_ERROR), RS(b2,IDS_WINEFILE), MB_OK);
+
+ LocalFree(msg);
+}
+
+
+/* display network error message using WNetGetLastError() */
+static void display_network_error(HWND hwnd)
+{
+ TCHAR msg[BUFFER_LEN], provider[BUFFER_LEN], b2[BUFFER_LEN];
+ DWORD error;
+
+ if (WNetGetLastError(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR)
+ MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
+}
+
+
+#ifdef __WINE__
+
+#ifdef UNICODE
+
+/* call vswprintf() in msvcrt.dll */
+/*TODO: fix swprintf() in non-msvcrt mode, so that this dynamic linking function can be removed */
+static int msvcrt_swprintf(WCHAR* buffer, const WCHAR* fmt, ...)
+{
+ static int (__cdecl *pvswprintf)(WCHAR*, const WCHAR*, va_list) = NULL;
+ va_list ap;
+ int ret;
+
+ if (!pvswprintf) {
+ HMODULE hModMsvcrt = LoadLibraryA("msvcrt");
+ pvswprintf = (int(__cdecl*)(WCHAR*,const WCHAR*,va_list)) GetProcAddress(hModMsvcrt, "vswprintf");
+ }
+
+ va_start(ap, fmt);
+ ret = (*pvswprintf)(buffer, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
+
+static LPCWSTR my_wcsrchr(LPCWSTR str, WCHAR c)
+{
+ LPCWSTR p = str;
+
+ while(*p)
+ ++p;
+
+ do {
+ if (--p < str)
+ return NULL;
+ } while(*p != c);
+
+ return p;
+}
+
+#define _tcsrchr my_wcsrchr
+#else /* UNICODE */
+#define _tcsrchr strrchr
+#endif /* UNICODE */
+
+#endif /* __WINE__ */
+
+
+/* allocate and initialise a directory entry */
+static Entry* alloc_entry(void)
+{
+ Entry* entry = (Entry*) malloc(sizeof(Entry));
+
+#ifdef _SHELL_FOLDERS
+ entry->pidl = NULL;
+ entry->folder = NULL;
+ entry->hicon = 0;
+#endif
+
+ return entry;
+}
+
+/* free a directory entry */
+static void free_entry(Entry* entry)
+{
+#ifdef _SHELL_FOLDERS
+ if (entry->hicon && entry->hicon!=(HICON)-1)
+ DestroyIcon(entry->hicon);
+
+ if (entry->folder && entry->folder!=Globals.iDesktop)
+ IShellFolder_Release(entry->folder);
+
+ if (entry->pidl)
+ IMalloc_Free(Globals.iMalloc, entry->pidl);
+#endif
+
+ free(entry);
+}
+
+/* recursively free all child entries */
+static void free_entries(Entry* dir)
+{
+ Entry *entry, *next=dir->down;
+
+ if (next) {
+ dir->down = 0;
+
+ do {
+ entry = next;
+ next = entry->next;
+
+ free_entries(entry);
+ free_entry(entry);
+ } while(next);
+ }
+}
+
+
+static void read_directory_win(Entry* dir, LPCTSTR path)
+{
+ Entry* first_entry = NULL;
+ Entry* last = NULL;
+ Entry* entry;
+
+ int level = dir->level + 1;
+ WIN32_FIND_DATA w32fd;
+ HANDLE hFind;
+#ifndef _NO_EXTENSIONS
+ HANDLE hFile;
+#endif
+
+ TCHAR buffer[MAX_PATH], *p;
+ for(p=buffer; *path; )
+ *p++ = *path++;
+
+ *p++ = '\\';
+ p[0] = '*';
+ p[1] = '\0';
+
+ hFind = FindFirstFile(buffer, &w32fd);
+
+ if (hFind != INVALID_HANDLE_VALUE) {
+ do {
+#ifdef _NO_EXTENSIONS
+ /* hide directory entry "." */
+ if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ LPCTSTR name = w32fd.cFileName;
+
+ if (name[0]=='.' && name[1]=='\0')
+ continue;
+ }
+#endif
+ entry = alloc_entry();
+
+ if (!first_entry)
+ first_entry = entry;
+
+ if (last)
+ last->next = entry;
+
+ memcpy(&entry->data, &w32fd, sizeof(WIN32_FIND_DATA));
+ entry->down = NULL;
+ entry->up = dir;
+ entry->expanded = FALSE;
+ entry->scanned = FALSE;
+ entry->level = level;
+
+#ifndef _NO_EXTENSIONS
+ entry->etype = ET_WINDOWS;
+ entry->bhfi_valid = FALSE;
+
+ lstrcpy(p, entry->data.cFileName);
+
+ hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
+ 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
+
+ if (hFile != INVALID_HANDLE_VALUE) {
+ if (GetFileInformationByHandle(hFile, &entry->bhfi))
+ entry->bhfi_valid = TRUE;
+
+ CloseHandle(hFile);
+ }
+#endif
+
+ last = entry;
+ } while(FindNextFile(hFind, &w32fd));
+
+ if (last)
+ last->next = NULL;
+
+ FindClose(hFind);
+ }
+
+ dir->down = first_entry;
+ dir->scanned = TRUE;
+}
+
+
+static Entry* find_entry_win(Entry* dir, LPCTSTR name)
+{
+ Entry* entry;
+
+ for(entry=dir->down; entry; entry=entry->next) {
+ LPCTSTR p = name;
+ LPCTSTR q = entry->data.cFileName;
+
+ do {
+ if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
+ return entry;
+ } while(tolower(*p++) == tolower(*q++));
+
+ p = name;
+ q = entry->data.cAlternateFileName;
+
+ do {
+ if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
+ return entry;
+ } while(tolower(*p++) == tolower(*q++));
+ }
+
+ return 0;
+}
+
+
+static Entry* read_tree_win(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
+{
+ TCHAR buffer[MAX_PATH];
+ Entry* entry = &root->entry;
+ LPCTSTR s = path;
+ PTSTR d = buffer;
+
+ HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
+
+#ifndef _NO_EXTENSIONS
+ entry->etype = ET_WINDOWS;
+#endif
+
+ while(entry) {
+ while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
+ *d++ = *s++;
+
+ while(*s==TEXT('\\') || *s==TEXT('/'))
+ s++;
+
+ *d++ = TEXT('\\');
+ *d = TEXT('\0');
+
+ read_directory(entry, buffer, sortOrder, hwnd);
+
+ if (entry->down)
+ entry->expanded = TRUE;
+
+ if (!*s)
+ break;
+
+ entry = find_entry_win(entry, s);
+ }
+
+ SetCursor(old_cursor);
+
+ return entry;
+}
+
+
+#if !defined(_NO_EXTENSIONS) && defined(__WINE__)
+
+static 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 */
+ stime.wDay = tm->tm_mday;
+ stime.wHour = tm->tm_hour;
+ stime.wMinute = tm->tm_min;
+ stime.wSecond = tm->tm_sec;
+
+ return SystemTimeToFileTime(&stime, ftime);
+}
+
+static void read_directory_unix(Entry* dir, LPCTSTR path)
+{
+ Entry* first_entry = NULL;
+ Entry* last = NULL;
+ Entry* entry;
+ DIR* pdir;
+
+ int level = dir->level + 1;
+#ifdef UNICODE
+ char cpath[MAX_PATH];
+
+ WideCharToMultiByte(CP_UNIXCP, 0, path, -1, cpath, MAX_PATH, NULL, NULL);
+#else
+ const char* cpath = path;
+#endif
+
+ pdir = opendir(cpath);
+
+ if (pdir) {
+ struct stat st;
+ struct dirent* ent;
+ char buffer[MAX_PATH], *p;
+ const char* s;
+
+ for(p=buffer,s=cpath; *s; )
+ *p++ = *s++;
+
+ if (p==buffer || p[-1]!='/')
+ *p++ = '/';
+
+ while((ent=readdir(pdir))) {
+ entry = alloc_entry();
+
+ if (!first_entry)
+ first_entry = entry;
+
+ if (last)
+ last->next = entry;
+
+ entry->etype = ET_UNIX;
+
+ strcpy(p, ent->d_name);
+#ifdef UNICODE
+ MultiByteToWideChar(CP_UNIXCP, 0, p, -1, entry->data.cFileName, MAX_PATH);
+#else
+ lstrcpy(entry->data.cFileName, p);
+#endif
+
+ if (!stat(buffer, &st)) {
+ entry->data.dwFileAttributes = p[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0;
+
+ if (S_ISDIR(st.st_mode))
+ entry->data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
+
+ entry->data.nFileSizeLow = st.st_size & 0xFFFFFFFF;
+ entry->data.nFileSizeHigh = st.st_size >> 32;
+
+ memset(&entry->data.ftCreationTime, 0, sizeof(FILETIME));
+ time_to_filetime(&st.st_atime, &entry->data.ftLastAccessTime);
+ time_to_filetime(&st.st_mtime, &entry->data.ftLastWriteTime);
+
+ entry->bhfi.nFileIndexLow = ent->d_ino;
+ entry->bhfi.nFileIndexHigh = 0;
+
+ entry->bhfi.nNumberOfLinks = st.st_nlink;
+
+ entry->bhfi_valid = TRUE;
+ } else {
+ entry->data.nFileSizeLow = 0;
+ entry->data.nFileSizeHigh = 0;
+ entry->bhfi_valid = FALSE;
+ }
+
+ entry->down = NULL;
+ entry->up = dir;
+ entry->expanded = FALSE;
+ entry->scanned = FALSE;
+ entry->level = level;
+
+ last = entry;
+ }
+
+ if (last)
+ last->next = NULL;
+
+ closedir(pdir);
+ }
+
+ dir->down = first_entry;
+ dir->scanned = TRUE;
+}
+
+static Entry* find_entry_unix(Entry* dir, LPCTSTR name)
+{
+ Entry* entry;
+
+ for(entry=dir->down; entry; entry=entry->next) {
+ LPCTSTR p = name;
+ LPCTSTR q = entry->data.cFileName;
+
+ do {
+ if (!*p || *p==TEXT('/'))
+ return entry;
+ } while(*p++ == *q++);
+ }
+
+ return 0;
+}
+
+static Entry* read_tree_unix(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
+{
+ TCHAR buffer[MAX_PATH];
+ Entry* entry = &root->entry;
+ LPCTSTR s = path;
+ PTSTR d = buffer;
+
+ HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
+
+ entry->etype = ET_UNIX;
+
+ while(entry) {
+ while(*s && *s!=TEXT('/'))
+ *d++ = *s++;
+
+ while(*s == TEXT('/'))
+ s++;
+
+ *d++ = TEXT('/');
+ *d = TEXT('\0');
+
+ read_directory(entry, buffer, sortOrder, hwnd);
+
+ if (entry->down)
+ entry->expanded = TRUE;
+
+ if (!*s)
+ break;
+
+ entry = find_entry_unix(entry, s);
+ }
+
+ SetCursor(old_cursor);
+
+ return entry;
+}
+
+#endif /* !defined(_NO_EXTENSIONS) && defined(__WINE__) */
+
+
+#ifdef _SHELL_FOLDERS
+
+#ifdef UNICODE
+#define get_strret get_strretW
+#define path_from_pidl path_from_pidlW
+#else
+#define get_strret get_strretA
+#define path_from_pidl path_from_pidlA
+#endif
+
+
+static void free_strret(STRRET* str)
+{
+ if (str->uType == STRRET_WSTR)
+ IMalloc_Free(Globals.iMalloc, str->UNION_MEMBER(pOleStr));
+}
+
+
+#ifndef UNICODE
+
+static LPSTR strcpyn(LPSTR dest, LPCSTR source, size_t count)
+{
+ LPCSTR s;
+ LPSTR d = dest;
+
+ for(s=source; count&&(*d++=*s++); )
+ count--;
+
+ return dest;
+}
+
+static void get_strretA(STRRET* str, const SHITEMID* shiid, LPSTR buffer, int len)
+{
+ switch(str->uType) {
+ case STRRET_WSTR:
+ WideCharToMultiByte(CP_ACP, 0, str->UNION_MEMBER(pOleStr), -1, buffer, len, NULL, NULL);
+ break;
+
+ case STRRET_OFFSET:
+ strcpyn(buffer, (LPCSTR)shiid+str->UNION_MEMBER(uOffset), len);
+ break;
+
+ case STRRET_CSTR:
+ strcpyn(buffer, str->UNION_MEMBER(cStr), len);
+ }
+}
+
+static HRESULT path_from_pidlA(IShellFolder* folder, LPITEMIDLIST pidl, LPSTR buffer, int len)
+{
+ STRRET str;
+
+ /* SHGDN_FORPARSING: get full path of id list */
+ HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
+
+ if (SUCCEEDED(hr)) {
+ get_strretA(&str, &pidl->mkid, buffer, len);
+ free_strret(&str);
+ } else
+ buffer[0] = '\0';
+
+ return hr;
+}
+
+#endif
+
+static LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count)
+{
+ LPCWSTR s;
+ LPWSTR d = dest;
+
+ for(s=source; count&&(*d++=*s++); )
+ count--;
+
+ return dest;
+}
+
+static void get_strretW(STRRET* str, const SHITEMID* shiid, LPWSTR buffer, int len)
+{
+ switch(str->uType) {
+ case STRRET_WSTR:
+ wcscpyn(buffer, str->UNION_MEMBER(pOleStr), len);
+ break;
+
+ case STRRET_OFFSET:
+ MultiByteToWideChar(CP_ACP, 0, (LPCSTR)shiid+str->UNION_MEMBER(uOffset), -1, buffer, len);
+ break;
+
+ case STRRET_CSTR:
+ MultiByteToWideChar(CP_ACP, 0, str->UNION_MEMBER(cStr), -1, buffer, len);
+ }
+}
+
+
+static HRESULT name_from_pidl(IShellFolder* folder, LPITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags)
+{
+ STRRET str;
+
+ HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, flags, &str);
+
+ if (SUCCEEDED(hr)) {
+ get_strret(&str, &pidl->mkid, buffer, len);
+ free_strret(&str);
+ } else
+ buffer[0] = '\0';
+
+ return hr;
+}
+
+
+static HRESULT path_from_pidlW(IShellFolder* folder, LPITEMIDLIST pidl, LPWSTR buffer, int len)
+{
+ STRRET str;
+
+ /* SHGDN_FORPARSING: get full path of id list */
+ HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
+
+ if (SUCCEEDED(hr)) {
+ get_strretW(&str, &pidl->mkid, buffer, len);
+ free_strret(&str);
+ } else
+ buffer[0] = '\0';
+
+ return hr;
+}
+
+
+ /* create an item id list from a file system path */
+
+static LPITEMIDLIST get_path_pidl(LPTSTR path, HWND hwnd)
+{
+ LPITEMIDLIST pidl;
+ HRESULT hr;
+ ULONG len;
+
+#ifdef UNICODE
+ LPWSTR buffer = path;
+#else
+ WCHAR buffer[MAX_PATH];
+ MultiByteToWideChar(CP_ACP, 0, path, -1, buffer, MAX_PATH);
+#endif
+
+ hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
+ if (FAILED(hr))
+ return NULL;
+
+ return pidl;
+}
+
+
+ /* convert an item id list from relative to absolute (=relative to the desktop) format */
+
+static LPITEMIDLIST get_to_absolute_pidl(Entry* entry, HWND hwnd)
+{
+ if (entry->up && entry->up->etype==ET_SHELL) {
+ IShellFolder* folder = entry->up->folder;
+ WCHAR buffer[MAX_PATH];
+
+ HRESULT hr = path_from_pidlW(folder, entry->pidl, buffer, MAX_PATH);
+
+ if (SUCCEEDED(hr)) {
+ LPITEMIDLIST pidl;
+ ULONG len;
+
+ hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
+
+ if (SUCCEEDED(hr))
+ return pidl;
+ }
+ } else if (entry->etype == ET_WINDOWS) {
+ TCHAR path[MAX_PATH];
+
+ get_path(entry, path);
+
+ return get_path_pidl(path, hwnd);
+ } else if (entry->pidl)
+ return ILClone(entry->pidl);
+
+ return NULL;
+}
+
+
+static HICON extract_icon(IShellFolder* folder, LPCITEMIDLIST pidl)
+{
+ IExtractIcon* pExtract;
+
+ if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) {
+ TCHAR path[_MAX_PATH];
+ unsigned flags;
+ HICON hicon;
+ int idx;
+
+ if (SUCCEEDED((*pExtract->lpVtbl->GetIconLocation)(pExtract, GIL_FORSHELL, path, _MAX_PATH, &idx, &flags))) {
+ if (!(flags & GIL_NOTFILENAME)) {
+ if (idx == -1)
+ idx = 0; /* special case for some control panel applications */
+
+ if ((int)ExtractIconEx(path, idx, 0, &hicon, 1) > 0)
+ flags &= ~GIL_DONTCACHE;
+ } else {
+ HICON hIconLarge = 0;
+
+ HRESULT hr = (*pExtract->lpVtbl->Extract)(pExtract, path, idx, &hIconLarge, &hicon, MAKELONG(0/*GetSystemMetrics(SM_CXICON)*/,GetSystemMetrics(SM_CXSMICON)));
+
+ if (SUCCEEDED(hr))
+ DestroyIcon(hIconLarge);
+ }
+
+ return hicon;
+ }
+ }
+
+ return 0;
+}
+
+
+static Entry* find_entry_shell(Entry* dir, LPCITEMIDLIST pidl)
+{
+ Entry* entry;
+
+ for(entry=dir->down; entry; entry=entry->next) {
+ if (entry->pidl->mkid.cb == pidl->mkid.cb &&
+ !memcmp(entry->pidl, pidl, entry->pidl->mkid.cb))
+ return entry;
+ }
+
+ return 0;
+}
+
+static Entry* read_tree_shell(Root* root, LPITEMIDLIST pidl, SORT_ORDER sortOrder, HWND hwnd)
+{
+ Entry* entry = &root->entry;
+ Entry* next;
+ LPITEMIDLIST next_pidl = pidl;
+ IShellFolder* folder;
+ IShellFolder* child = NULL;
+ HRESULT hr;
+
+ HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
+
+#ifndef _NO_EXTENSIONS
+ entry->etype = ET_SHELL;
+#endif
+
+ folder = Globals.iDesktop;
+
+ while(entry) {
+ entry->pidl = next_pidl;
+ entry->folder = folder;
+
+ if (!pidl->mkid.cb)
+ break;
+
+ /* copy first element of item idlist */
+ next_pidl = IMalloc_Alloc(Globals.iMalloc, pidl->mkid.cb+sizeof(USHORT));
+ memcpy(next_pidl, pidl, pidl->mkid.cb);
+ ((LPITEMIDLIST)((LPBYTE)next_pidl+pidl->mkid.cb))->mkid.cb = 0;
+
+ hr = IShellFolder_BindToObject(folder, next_pidl, 0, &IID_IShellFolder, (void**)&child);
+ if (!SUCCEEDED(hr))
+ break;
+
+ read_directory(entry, NULL, sortOrder, hwnd);
+
+ if (entry->down)
+ entry->expanded = TRUE;
+
+ next = find_entry_shell(entry, next_pidl);
+ if (!next)
+ break;
+
+ folder = child;
+ entry = next;
+
+ /* go to next element */
+ pidl = (LPITEMIDLIST) ((LPBYTE)pidl+pidl->mkid.cb);
+ }
+
+ SetCursor(old_cursor);
+
+ return entry;
+}
+
+
+static void fill_w32fdata_shell(IShellFolder* folder, LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* w32fdata)
+{
+ if (!(attribs & SFGAO_FILESYSTEM) ||
+ FAILED(SHGetDataFromIDList(folder, pidl, SHGDFIL_FINDDATA, w32fdata, sizeof(WIN32_FIND_DATA)))) {
+ WIN32_FILE_ATTRIBUTE_DATA fad;
+ IDataObject* pDataObj;
+
+ STGMEDIUM medium = {0, {0}, 0};
+ FORMATETC fmt = {Globals.cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
+
+ HRESULT hr = IShellFolder_GetUIObjectOf(folder, 0, 1, &pidl, &IID_IDataObject, 0, (LPVOID*)&pDataObj);
+
+ if (SUCCEEDED(hr)) {
+ hr = IDataObject_GetData(pDataObj, &fmt, &medium);
+
+ IDataObject_Release(pDataObj);
+
+ if (SUCCEEDED(hr)) {
+ LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal));
+ UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS);
+
+ if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) {
+ w32fdata->dwFileAttributes = fad.dwFileAttributes;
+ w32fdata->ftCreationTime = fad.ftCreationTime;
+ w32fdata->ftLastAccessTime = fad.ftLastAccessTime;
+ w32fdata->ftLastWriteTime = fad.ftLastWriteTime;
+
+ if (!(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
+ w32fdata->nFileSizeLow = fad.nFileSizeLow;
+ w32fdata->nFileSizeHigh = fad.nFileSizeHigh;
+ }
+ }
+
+ SetErrorMode(sem_org);
+
+ GlobalUnlock(medium.UNION_MEMBER(hGlobal));
+ GlobalFree(medium.UNION_MEMBER(hGlobal));
+ }
+ }
+ }
+
+ if (attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
+ w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
+
+ if (attribs & SFGAO_READONLY)
+ w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
+
+ if (attribs & SFGAO_COMPRESSED)
+ w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED;
+}
+
+
+static void read_directory_shell(Entry* dir, HWND hwnd)
+{
+ IShellFolder* folder = dir->folder;
+ int level = dir->level + 1;
+ HRESULT hr;
+
+ IShellFolder* child;
+ IEnumIDList* idlist;
+
+ Entry* first_entry = NULL;
+ Entry* last = NULL;
+ Entry* entry;
+
+ if (!folder)
+ return;
+
+ hr = IShellFolder_EnumObjects(folder, hwnd, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE, &idlist);
+
+ if (SUCCEEDED(hr)) {
+ for(;;) {
+#define FETCH_ITEM_COUNT 32
+ LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
+ SFGAOF attribs;
+ ULONG cnt = 0;
+ ULONG n;
+
+ memset(pidls, 0, sizeof(pidls));
+
+ hr = IEnumIDList_Next(idlist, FETCH_ITEM_COUNT, pidls, &cnt);
+ if (!SUCCEEDED(hr))
+ break;
+
+ if (hr == S_FALSE)
+ break;
+
+ for(n=0; n<cnt; ++n) {
+ entry = alloc_entry();
+
+ if (!first_entry)
+ first_entry = entry;
+
+ if (last)
+ last->next = entry;
+
+ memset(&entry->data, 0, sizeof(WIN32_FIND_DATA));
+ entry->bhfi_valid = FALSE;
+
+ attribs = ~SFGAO_FILESYSTEM; /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daß "My Documents" anstatt von "Martin's Documents" angezeigt wird */
+
+ hr = IShellFolder_GetAttributesOf(folder, 1, (LPCITEMIDLIST*)&pidls[n], &attribs);
+
+ if (SUCCEEDED(hr)) {
+ if (attribs != (SFGAOF)~SFGAO_FILESYSTEM) {
+ fill_w32fdata_shell(folder, pidls[n], attribs, &entry->data);
+
+ entry->bhfi_valid = TRUE;
+ } else
+ attribs = 0;
+ } else
+ attribs = 0;
+
+ entry->pidl = pidls[n];
+
+ if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ hr = IShellFolder_BindToObject(folder, pidls[n], 0, &IID_IShellFolder, (void**)&child);
+
+ if (SUCCEEDED(hr))
+ entry->folder = child;
+ else
+ entry->folder = NULL;
+ }
+ else
+ entry->folder = NULL;
+
+ if (!entry->data.cFileName[0])
+ /*hr = */name_from_pidl(folder, pidls[n], entry->data.cFileName, MAX_PATH, /*SHGDN_INFOLDER*/0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/);
+
+ /* get display icons for files and virtual objects */
+ if (!(entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
+ !(attribs & SFGAO_FILESYSTEM)) {
+ entry->hicon = extract_icon(folder, pidls[n]);
+
+ if (!entry->hicon)
+ entry->hicon = (HICON)-1; /* don't try again later */
+ }
+
+ entry->down = NULL;
+ entry->up = dir;
+ entry->expanded = FALSE;
+ entry->scanned = FALSE;
+ entry->level = level;
+
+#ifndef _NO_EXTENSIONS
+ entry->etype = ET_SHELL;
+ entry->bhfi_valid = FALSE;
+#endif
+
+ last = entry;
+ }
+ }
+
+ IEnumIDList_Release(idlist);
+ }
+
+ if (last)
+ last->next = NULL;
+
+ dir->down = first_entry;
+ dir->scanned = TRUE;
+}
+
+#endif /* _SHELL_FOLDERS */
+
+
+/* sort order for different directory/file types */
+enum TYPE_ORDER {
+ TO_DIR = 0,
+ TO_DOT = 1,
+ TO_DOTDOT = 2,
+ TO_OTHER_DIR = 3,
+ TO_FILE = 4
+};
+
+/* distinguish between ".", ".." and any other directory names */
+static int TypeOrderFromDirname(LPCTSTR name)
+{
+ if (name[0] == '.') {
+ if (name[1] == '\0')
+ return TO_DOT; /* "." */
+
+ if (name[1]=='.' && name[2]=='\0')
+ return TO_DOTDOT; /* ".." */
+ }
+
+ return TO_OTHER_DIR; /* anything else */
+}
+
+/* directories first... */
+static int __cdecl compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2)
+{
+ int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
+ int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
+
+ /* Handle "." and ".." as special case and move them at the very first beginning. */
+ if (order1==TO_DIR && order2==TO_DIR) {
+ order1 = TypeOrderFromDirname(fd1->cFileName);
+ order2 = TypeOrderFromDirname(fd2->cFileName);
+ }
+
+ return order2==order1? 0: order1<order2? -1: 1;
+}
+
+
+static int __cdecl compareName(const void* arg1, const void* arg2)
+{
+ const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
+ const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
+
+ int cmp = compareType(fd1, fd2);
+ if (cmp)
+ return cmp;
+
+ return lstrcmpi(fd1->cFileName, fd2->cFileName);
+}
+
+static int __cdecl compareExt(const void* arg1, const void* arg2)
+{
+ const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
+ const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
+ const TCHAR *name1, *name2, *ext1, *ext2;
+
+ int cmp = compareType(fd1, fd2);
+ if (cmp)
+ return cmp;
+
+ name1 = fd1->cFileName;
+ name2 = fd2->cFileName;
+
+ ext1 = _tcsrchr(name1, TEXT('.'));
+ ext2 = _tcsrchr(name2, TEXT('.'));
+
+ if (ext1)
+ ext1++;
+ else
+ ext1 = sEmpty;
+
+ if (ext2)
+ ext2++;
+ else
+ ext2 = sEmpty;
+
+ cmp = lstrcmpi(ext1, ext2);
+ if (cmp)
+ return cmp;
+
+ return lstrcmpi(name1, name2);
+}
+
+static int __cdecl compareSize(const void* arg1, const void* arg2)
+{
+ const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
+ const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
+
+ int cmp = compareType(fd1, fd2);
+ if (cmp)
+ return cmp;
+
+ cmp = fd2->nFileSizeHigh - fd1->nFileSizeHigh;
+
+ if (cmp < 0)
+ return -1;
+ else if (cmp > 0)
+ return 1;
+
+ cmp = fd2->nFileSizeLow - fd1->nFileSizeLow;
+
+ return cmp<0? -1: cmp>0? 1: 0;
+}
+
+static int __cdecl compareDate(const void* arg1, const void* arg2)
+{
+ const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
+ const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
+
+ int cmp = compareType(fd1, fd2);
+ if (cmp)
+ return cmp;
+
+ return CompareFileTime(&fd2->ftLastWriteTime, &fd1->ftLastWriteTime);
+}
+
+
+static int (__cdecl *sortFunctions[])(const void* arg1, const void* arg2) = {
+ compareName, /* SORT_NAME */
+ compareExt, /* SORT_EXT */
+ compareSize, /* SORT_SIZE */
+ compareDate /* SORT_DATE */
+};
+
+
+static void SortDirectory(Entry* dir, SORT_ORDER sortOrder)
+{
+ Entry* entry = dir->down;
+ Entry** array, **p;
+ int len;
+
+ len = 0;
+ for(entry=dir->down; entry; entry=entry->next)
+ len++;
+
+ if (len) {
+ array = HeapAlloc(GetProcessHeap(), 0, len*sizeof(Entry*));
+
+ p = array;
+ for(entry=dir->down; entry; entry=entry->next)
+ *p++ = entry;
+
+ /* call qsort with the appropriate compare function */
+ qsort(array, len, sizeof(array[0]), sortFunctions[sortOrder]);
+
+ dir->down = array[0];
+
+ for(p=array; --len; p++)
+ p[0]->next = p[1];
+
+ (*p)->next = 0;
+
+ HeapFree(GetProcessHeap(), 0, array);
+ }
+}
+
+
+static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
+{
+ TCHAR buffer[MAX_PATH];
+ Entry* entry;
+ LPCTSTR s;
+ PTSTR d;
+
+#ifdef _SHELL_FOLDERS
+ if (dir->etype == ET_SHELL)
+ {
+ read_directory_shell(dir, hwnd);
+
+ if (Globals.prescan_node) {
+ s = path;
+ d = buffer;
+
+ while(*s)
+ *d++ = *s++;
+
+ *d++ = TEXT('\\');
+
+ for(entry=dir->down; entry; entry=entry->next)
+ if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ read_directory_shell(entry, hwnd);
+ SortDirectory(entry, sortOrder);
+ }
+ }
+ }
+ else
+#endif
+#if !defined(_NO_EXTENSIONS) && defined(__WINE__)
+ if (dir->etype == ET_UNIX)
+ {
+ read_directory_unix(dir, path);
+
+ if (Globals.prescan_node) {
+ s = path;
+ d = buffer;
+
+ while(*s)
+ *d++ = *s++;
+
+ *d++ = TEXT('/');
+
+ for(entry=dir->down; entry; entry=entry->next)
+ if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ lstrcpy(d, entry->data.cFileName);
+ read_directory_unix(entry, buffer);
+ SortDirectory(entry, sortOrder);
+ }
+ }
+ }
+ else
+#endif
+ {
+ read_directory_win(dir, path);
+
+ if (Globals.prescan_node) {
+ s = path;
+ d = buffer;
+
+ while(*s)
+ *d++ = *s++;
+
+ *d++ = TEXT('\\');
+
+ for(entry=dir->down; entry; entry=entry->next)
+ if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ lstrcpy(d, entry->data.cFileName);
+ read_directory_win(entry, buffer);
+ SortDirectory(entry, sortOrder);
+ }
+ }
+ }
+
+ SortDirectory(dir, sortOrder);
+}
+
+
+static Entry* read_tree(Root* root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, SORT_ORDER sortOrder, HWND hwnd)
+{
+#if !defined(_NO_EXTENSIONS) && defined(__WINE__)
+ const static TCHAR sSlash[] = {'/', '\0'};
+#endif
+ const static TCHAR sBackslash[] = {'\\', '\0'};
+
+#ifdef _SHELL_FOLDERS
+ if (pidl)
+ {
+ /* read shell namespace tree */
+ root->drive_type = DRIVE_UNKNOWN;
+ drv[0] = '\\';
+ drv[1] = '\0';
+ load_string(root->volname, IDS_DESKTOP);
+ root->fs_flags = 0;
+ load_string(root->fs, IDS_SHELL);
+
+ return read_tree_shell(root, pidl, sortOrder, hwnd);
+ }
+ else
+#endif
+#if !defined(_NO_EXTENSIONS) && defined(__WINE__)
+ if (*path == '/')
+ {
+ /* read unix file system tree */
+ root->drive_type = GetDriveType(path);
+
+ lstrcat(drv, sSlash);
+ load_string(root->volname, IDS_ROOT_FS);
+ root->fs_flags = 0;
+ load_string(root->fs, IDS_UNIXFS);
+
+ lstrcpy(root->path, sSlash);
+
+ return read_tree_unix(root, path, sortOrder, hwnd);
+ }
+#endif
+
+ /* read WIN32 file system tree */
+ root->drive_type = GetDriveType(path);
+
+ lstrcat(drv, sBackslash);
+ GetVolumeInformation(drv, root->volname, _MAX_FNAME, 0, 0, &root->fs_flags, root->fs, _MAX_DIR);
+
+ lstrcpy(root->path, drv);
+
+ return read_tree_win(root, path, sortOrder, hwnd);
+}
+
+
+/* flags to filter different file types */
+enum TYPE_FILTER {
+ TF_DIRECTORIES = 0x01,
+ TF_PROGRAMS = 0x02,
+ TF_DOCUMENTS = 0x04,
+ TF_OTHERS = 0x08,
+ TF_HIDDEN = 0x10,
+ TF_ALL = 0x1F
+};
+
+
+static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd)
+{
+ TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
+ TCHAR b1[BUFFER_LEN];
+ const static TCHAR sAsterics[] = {'*', '\0'};
+
+ ChildWnd* child = (ChildWnd*) malloc(sizeof(ChildWnd));
+ Root* root = &child->root;
+ Entry* entry;
+
+ memset(child, 0, sizeof(ChildWnd));
+
+ child->left.treePane = TRUE;
+ child->left.visible_cols = 0;
+
+ child->right.treePane = FALSE;
+#ifndef _NO_EXTENSIONS
+ child->right.visible_cols = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS;
+#else
+ child->right.visible_cols = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES;
+#endif
+
+ child->pos.length = sizeof(WINDOWPLACEMENT);
+ child->pos.flags = 0;
+ child->pos.showCmd = SW_SHOWNORMAL;
+ child->pos.rcNormalPosition.left = CW_USEDEFAULT;
+ child->pos.rcNormalPosition.top = CW_USEDEFAULT;
+ child->pos.rcNormalPosition.right = CW_USEDEFAULT;
+ child->pos.rcNormalPosition.bottom = CW_USEDEFAULT;
+
+ child->focus_pane = 0;
+ child->split_pos = DEFAULT_SPLIT_POS;
+ child->sortOrder = SORT_NAME;
+ child->header_wdths_ok = FALSE;
+
+ if (path)
+ {
+ lstrcpy(child->path, path);
+
+ _tsplitpath(path, drv, dir, name, ext);
+ }
+
+ lstrcpy(child->filter_pattern, sAsterics);
+ child->filter_flags = TF_ALL;
+
+ root->entry.level = 0;
+
+ entry = read_tree(root, path, pidl, drv, child->sortOrder, hwnd);
+
+#ifdef _SHELL_FOLDERS
+ if (root->entry.etype == ET_SHELL)
+ load_string(root->entry.data.cFileName, IDS_DESKTOP);
+ else
+#endif
+ wsprintf(root->entry.data.cFileName, RS(b1,IDS_TITLEFMT), drv, root->fs);
+
+ root->entry.data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
+
+ child->left.root = &root->entry;
+ child->right.root = NULL;
+
+ set_curdir(child, entry, 0, hwnd);
+
+ return child;
+}
+
+
+/* free all memory associated with a child window */
+static void free_child_window(ChildWnd* child)
+{
+ free_entries(&child->root.entry);
+ free(child);
+}
+
+
+/* get full path of specified directory entry */
+static void get_path(Entry* dir, PTSTR path)
+{
+ Entry* entry;
+ int len = 0;
+ int level = 0;
+
+#ifdef _SHELL_FOLDERS
+ if (dir->etype == ET_SHELL)
+ {
+ SFGAOF attribs;
+ HRESULT hr = S_OK;
+
+ path[0] = TEXT('\0');
+
+ attribs = 0;
+
+ if (dir->folder)
+ hr = IShellFolder_GetAttributesOf(dir->folder, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs);
+
+ if (SUCCEEDED(hr) && (attribs&SFGAO_FILESYSTEM)) {
+ IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop;
+
+ hr = path_from_pidl(parent, dir->pidl, path, MAX_PATH);
+ }
+ }
+ else
+#endif
+ {
+ for(entry=dir; entry; level++) {
+ LPCTSTR name;
+ int l;
+
+ {
+ LPCTSTR s;
+ name = entry->data.cFileName;
+ s = name;
+
+ for(l=0; *s && *s!=TEXT('/') && *s!=TEXT('\\'); s++)
+ l++;
+ }
+
+ if (entry->up) {
+ if (l > 0) {
+ memmove(path+l+1, path, len*sizeof(TCHAR));
+ memcpy(path+1, name, l*sizeof(TCHAR));
+ len += l+1;
+
+#ifndef _NO_EXTENSIONS
+ if (entry->etype == ET_UNIX)
+ path[0] = TEXT('/');
+ else
+#endif
+ path[0] = TEXT('\\');
+ }
+
+ entry = entry->up;
+ } else {
+ memmove(path+l, path, len*sizeof(TCHAR));
+ memcpy(path, name, l*sizeof(TCHAR));
+ len += l;
+ break;
+ }
+ }
+
+ if (!level) {
+#ifndef _NO_EXTENSIONS
+ if (entry->etype == ET_UNIX)
+ path[len++] = TEXT('/');
+ else
+#endif
+ path[len++] = TEXT('\\');
+ }
+
+ path[len] = TEXT('\0');
+ }
+}
+
+
+static void resize_frame_rect(HWND hwnd, PRECT prect)
+{
+ int new_top;
+ RECT rt;
+
+ if (IsWindowVisible(Globals.htoolbar)) {
+ SendMessage(Globals.htoolbar, WM_SIZE, 0, 0);
+ GetClientRect(Globals.htoolbar, &rt);
+ prect->top = rt.bottom+3;
+ prect->bottom -= rt.bottom+3;
+ }
+
+ if (IsWindowVisible(Globals.hdrivebar)) {
+ SendMessage(Globals.hdrivebar, WM_SIZE, 0, 0);
+ GetClientRect(Globals.hdrivebar, &rt);
+ new_top = --prect->top + rt.bottom+3;
+ MoveWindow(Globals.hdrivebar, 0, prect->top, rt.right, new_top, TRUE);
+ prect->top = new_top;
+ prect->bottom -= rt.bottom+2;
+ }
+
+ if (IsWindowVisible(Globals.hstatusbar)) {
+ int parts[] = {300, 500};
+
+ SendMessage(Globals.hstatusbar, WM_SIZE, 0, 0);
+ SendMessage(Globals.hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
+ GetClientRect(Globals.hstatusbar, &rt);
+ prect->bottom -= rt.bottom;
+ }
+
+ MoveWindow(Globals.hmdiclient, prect->left-1,prect->top-1,prect->right+2,prect->bottom+1, TRUE);
+}
+
+static void resize_frame(HWND hwnd, int cx, int cy)
+{
+ RECT rect;
+
+ rect.left = 0;
+ rect.top = 0;
+ rect.right = cx;
+ rect.bottom = cy;
+
+ resize_frame_rect(hwnd, &rect);
+}
+
+static void resize_frame_client(HWND hwnd)
+{
+ RECT rect;
+
+ GetClientRect(hwnd, &rect);
+
+ resize_frame_rect(hwnd, &rect);
+}
+
+
+static HHOOK hcbthook;
+static ChildWnd* newchild = NULL;
+
+static LRESULT CALLBACK CBTProc(int code, WPARAM wparam, LPARAM lparam)
+{
+ if (code==HCBT_CREATEWND && newchild) {
+ ChildWnd* child = newchild;
+ newchild = NULL;
+
+ child->hwnd = (HWND) wparam;
+ SetWindowLongPtr(child->hwnd, GWLP_USERDATA, (LPARAM)child);
+ }
+
+ return CallNextHookEx(hcbthook, code, wparam, lparam);
+}
+
+static HWND create_child_window(ChildWnd* child)
+{
+ MDICREATESTRUCT mcs;
+ int idx;
+
+ mcs.szClass = sWINEFILETREE;
+ mcs.szTitle = (LPTSTR)child->path;
+ mcs.hOwner = Globals.hInstance;
+ mcs.x = child->pos.rcNormalPosition.left;
+ mcs.y = child->pos.rcNormalPosition.top;
+ mcs.cx = child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left;
+ mcs.cy = child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top;
+ mcs.style = 0;
+ mcs.lParam = 0;
+
+ hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId());
+
+ newchild = child;
+ child->hwnd = (HWND) SendMessage(Globals.hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs);
+ if (!child->hwnd) {
+ UnhookWindowsHookEx(hcbthook);
+ return 0;
+ }
+
+ UnhookWindowsHookEx(hcbthook);
+
+ ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
+ ListBox_SetItemHeight(child->right.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
+
+ idx = ListBox_FindItemData(child->left.hwnd, 0, child->left.cur);
+ ListBox_SetCurSel(child->left.hwnd, idx);
+
+ return child->hwnd;
+}
+
+
+struct ExecuteDialog {
+ TCHAR cmd[MAX_PATH];
+ int cmdshow;
+};
+
+static INT_PTR CALLBACK ExecuteDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+ static struct ExecuteDialog* dlg;
+
+ switch(nmsg) {
+ case WM_INITDIALOG:
+ dlg = (struct ExecuteDialog*) lparam;
+ return 1;
+
+ case WM_COMMAND: {
+ int id = (int)wparam;
+
+ if (id == IDOK) {
+ GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH);
+ dlg->cmdshow = Button_GetState(GetDlgItem(hwnd,214))&BST_CHECKED?
+ SW_SHOWMINIMIZED: SW_SHOWNORMAL;
+ EndDialog(hwnd, id);
+ } else if (id == IDCANCEL)
+ EndDialog(hwnd, id);
+
+ return 1;}
+ }
+
+ return 0;
+}
+
+
+static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+ TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
+
+ switch(nmsg) {
+ case WM_INITDIALOG:
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
+ SetWindowText(GetDlgItem(hwnd, 201), (LPCTSTR)lparam);
+ return 1;
+
+ case WM_COMMAND: {
+ int id = (int)wparam;
+
+ switch(id) {
+ case IDOK: {
+ LPTSTR dest = (LPTSTR) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ GetWindowText(GetDlgItem(hwnd, 201), dest, MAX_PATH);
+ EndDialog(hwnd, id);
+ break;}
+
+ case IDCANCEL:
+ EndDialog(hwnd, id);
+ break;
+
+ case 254:
+ MessageBox(hwnd, RS(b1,IDS_NO_IMPL), RS(b2,IDS_WINEFILE), MB_OK);
+ break;
+ }
+
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+struct FilterDialog {
+ TCHAR pattern[MAX_PATH];
+ int flags;
+};
+
+static INT_PTR CALLBACK FilterDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+ static struct FilterDialog* dlg;
+
+ switch(nmsg) {
+ case WM_INITDIALOG:
+ dlg = (struct FilterDialog*) lparam;
+ SetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern);
+ Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DIRECTORIES), (dlg->flags&TF_DIRECTORIES? BST_CHECKED: BST_UNCHECKED));
+ Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_PROGRAMS), dlg->flags&TF_PROGRAMS? BST_CHECKED: BST_UNCHECKED);
+ Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DOCUMENTS), dlg->flags&TF_DOCUMENTS? BST_CHECKED: BST_UNCHECKED);
+ Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_OTHERS), dlg->flags&TF_OTHERS? BST_CHECKED: BST_UNCHECKED);
+ Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_HIDDEN), dlg->flags&TF_HIDDEN? BST_CHECKED: BST_UNCHECKED);
+ return 1;
+
+ case WM_COMMAND: {
+ int id = (int)wparam;
+
+ if (id == IDOK) {
+ int flags = 0;
+
+ GetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern, MAX_PATH);
+
+ flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DIRECTORIES))&BST_CHECKED? TF_DIRECTORIES: 0;
+ flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_PROGRAMS))&BST_CHECKED? TF_PROGRAMS: 0;
+ flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DOCUMENTS))&BST_CHECKED? TF_DOCUMENTS: 0;
+ flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_OTHERS))&BST_CHECKED? TF_OTHERS: 0;
+ flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_HIDDEN))&BST_CHECKED? TF_HIDDEN: 0;
+
+ dlg->flags = flags;
+
+ EndDialog(hwnd, id);
+ } else if (id == IDCANCEL)
+ EndDialog(hwnd, id);
+
+ return 1;}
+ }
+
+ return 0;
+}
+
+
+struct PropertiesDialog {
+ TCHAR path[MAX_PATH];
+ Entry entry;
+ void* pVersionData;
+};
+
+/* Structure used to store enumerated languages and code pages. */
+struct LANGANDCODEPAGE {
+ WORD wLanguage;
+ WORD wCodePage;
+} *lpTranslate;
+
+static LPCSTR InfoStrings[] = {
+ "Comments",
+ "CompanyName",
+ "FileDescription",
+ "FileVersion",
+ "InternalName",
+ "LegalCopyright",
+ "LegalTrademarks",
+ "OriginalFilename",
+ "PrivateBuild",
+ "ProductName",
+ "ProductVersion",
+ "SpecialBuild",
+ NULL
+};
+
+static void PropDlg_DisplayValue(HWND hlbox, HWND hedit)
+{
+ int idx = ListBox_GetCurSel(hlbox);
+
+ if (idx != LB_ERR) {
+ LPCTSTR pValue = (LPCTSTR) ListBox_GetItemData(hlbox, idx);
+
+ if (pValue)
+ SetWindowText(hedit, pValue);
+ }
+}
+
+static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCTSTR strFilename)
+{
+ static TCHAR sBackSlash[] = {'\\','\0'};
+ static TCHAR sTranslation[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n','\0'};
+ static TCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
+ '%','0','4','x','%','0','4','x','\\','%','s','\0'};
+ DWORD dwVersionDataLen = GetFileVersionInfoSize((LPTSTR)strFilename, NULL); /* VC6 and MinGW headers use LPTSTR instead of LPCTSTR */
+
+ if (dwVersionDataLen) {
+ dlg->pVersionData = malloc(dwVersionDataLen);
+
+ if (GetFileVersionInfo((LPTSTR)strFilename, 0, dwVersionDataLen, dlg->pVersionData)) { /* VC6 and MinGW headers use LPTSTR instead of LPCTSTR */
+ LPVOID pVal;
+ UINT nValLen;
+
+ if (VerQueryValue(dlg->pVersionData, sBackSlash, &pVal, &nValLen)) {
+ if (nValLen == sizeof(VS_FIXEDFILEINFO)) {
+ VS_FIXEDFILEINFO* pFixedFileInfo = (VS_FIXEDFILEINFO*)pVal;
+ char buffer[BUFFER_LEN];
+
+ sprintf(buffer, "%d.%d.%d.%d",
+ HIWORD(pFixedFileInfo->dwFileVersionMS), LOWORD(pFixedFileInfo->dwFileVersionMS),
+ HIWORD(pFixedFileInfo->dwFileVersionLS), LOWORD(pFixedFileInfo->dwFileVersionLS));
+
+ SetDlgItemTextA(hwnd, IDC_STATIC_PROP_VERSION, buffer);
+ }
+ }
+
+ /* Read the list of languages and code pages. */
+ if (VerQueryValue(dlg->pVersionData, sTranslation, &pVal, &nValLen)) {
+ struct LANGANDCODEPAGE* pTranslate = (struct LANGANDCODEPAGE*)pVal;
+ struct LANGANDCODEPAGE* pEnd = (struct LANGANDCODEPAGE*)((LPBYTE)pVal+nValLen);
+
+ HWND hlbox = GetDlgItem(hwnd, IDC_LIST_PROP_VERSION_TYPES);
+
+ /* Read the file description for each language and code page. */
+ for(; pTranslate<pEnd; ++pTranslate) {
+ LPCSTR* p;
+
+ for(p=InfoStrings; *p; ++p) {
+ TCHAR subblock[200];
+#ifdef UNICODE
+ TCHAR infoStr[100];
+#endif
+ LPCTSTR pTxt;
+ UINT nValLen;
+
+ LPCSTR pInfoString = *p;
+#ifdef UNICODE
+ MultiByteToWideChar(CP_ACP, 0, pInfoString, -1, infoStr, 100);
+#else
+#define infoStr pInfoString
+#endif
+ wsprintf(subblock, sStringFileInfo, pTranslate->wLanguage, pTranslate->wCodePage, infoStr);
+
+ /* Retrieve file description for language and code page */
+ if (VerQueryValue(dlg->pVersionData, subblock, (PVOID)&pTxt, &nValLen)) {
+ int idx = ListBox_AddString(hlbox, infoStr);
+ ListBox_SetItemData(hlbox, idx, pTxt);
+ }
+ }
+ }
+
+ ListBox_SetCurSel(hlbox, 0);
+
+ PropDlg_DisplayValue(hlbox, GetDlgItem(hwnd,IDC_LIST_PROP_VERSION_VALUES));
+ }
+ }
+ }
+}
+
+static INT_PTR CALLBACK PropertiesDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+ static struct PropertiesDialog* dlg;
+
+ switch(nmsg) {
+ case WM_INITDIALOG: {
+ const static TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'};
+ TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
+ LPWIN32_FIND_DATA pWFD;
+ ULONGLONG size;
+
+ dlg = (struct PropertiesDialog*) lparam;
+ pWFD = (LPWIN32_FIND_DATA) &dlg->entry.data;
+
+ GetWindowText(hwnd, b1, MAX_PATH);
+ wsprintf(b2, b1, pWFD->cFileName);
+ SetWindowText(hwnd, b2);
+
+ format_date(&pWFD->ftLastWriteTime, b1, COL_DATE|COL_TIME);
+ SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_LASTCHANGE), b1);
+
+ size = ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow;
+ _stprintf(b1, sLongNumFmt, size);
+ wsprintf(b2, sByteFmt, b1);
+ SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_SIZE), b2);
+
+ SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_FILENAME), pWFD->cFileName);
+ SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_PATH), dlg->path);
+
+ Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_READONLY), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_READONLY? BST_CHECKED: BST_UNCHECKED));
+ Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_ARCHIVE), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_ARCHIVE? BST_CHECKED: BST_UNCHECKED));
+ Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_COMPRESSED), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_COMPRESSED? BST_CHECKED: BST_UNCHECKED));
+ Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_HIDDEN), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_HIDDEN? BST_CHECKED: BST_UNCHECKED));
+ Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_SYSTEM), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_SYSTEM? BST_CHECKED: BST_UNCHECKED));
+
+ CheckForFileInfo(dlg, hwnd, dlg->path);
+ return 1;}
+
+ case WM_COMMAND: {
+ int id = (int)wparam;
+
+ switch(HIWORD(wparam)) {
+ case LBN_SELCHANGE: {
+ HWND hlbox = GetDlgItem(hwnd, IDC_LIST_PROP_VERSION_TYPES);
+ PropDlg_DisplayValue(hlbox, GetDlgItem(hwnd,IDC_LIST_PROP_VERSION_VALUES));
+ break;
+ }
+
+ case BN_CLICKED:
+ if (id==IDOK || id==IDCANCEL)
+ EndDialog(hwnd, id);
+ }
+
+ return 1;}
+
+ case WM_NCDESTROY:
+ free(dlg->pVersionData);
+ dlg->pVersionData = NULL;
+ break;
+ }
+
+ return 0;
+}
+
+static void show_properties_dlg(Entry* entry, HWND hwnd)
+{
+ struct PropertiesDialog dlg;
+
+ memset(&dlg, 0, sizeof(struct PropertiesDialog));
+ get_path(entry, dlg.path);
+ memcpy(&dlg.entry, entry, sizeof(Entry));
+
+ DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_PROPERTIES), hwnd, PropertiesDialogDlgProc, (LPARAM)&dlg);
+}
+
+
+#ifndef _NO_EXTENSIONS
+
+static struct FullScreenParameters {
+ BOOL mode;
+ RECT orgPos;
+ BOOL wasZoomed;
+} g_fullscreen = {
+ FALSE, /* mode */
+ {0, 0, 0, 0},
+ FALSE
+};
+
+static void frame_get_clientspace(HWND hwnd, PRECT prect)
+{
+ RECT rt;
+
+ 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(Globals.htoolbar)) {
+ GetClientRect(Globals.htoolbar, &rt);
+ prect->top += rt.bottom+2;
+ }
+
+ if (IsWindowVisible(Globals.hdrivebar)) {
+ GetClientRect(Globals.hdrivebar, &rt);
+ prect->top += rt.bottom+2;
+ }
+
+ if (IsWindowVisible(Globals.hstatusbar)) {
+ GetClientRect(Globals.hstatusbar, &rt);
+ prect->bottom -= rt.bottom;
+ }
+}
+
+static BOOL toggle_fullscreen(HWND hwnd)
+{
+ RECT rt;
+
+ if ((g_fullscreen.mode=!g_fullscreen.mode)) {
+ GetWindowRect(hwnd, &g_fullscreen.orgPos);
+ g_fullscreen.wasZoomed = IsZoomed(hwnd);
+
+ Frame_CalcFrameClient(hwnd, &rt);
+ ClientToScreen(hwnd, (LPPOINT)&rt.left);
+ ClientToScreen(hwnd, (LPPOINT)&rt.right);
+
+ rt.left = g_fullscreen.orgPos.left-rt.left;
+ rt.top = g_fullscreen.orgPos.top-rt.top;
+ rt.right = GetSystemMetrics(SM_CXSCREEN)+g_fullscreen.orgPos.right-rt.right;
+ rt.bottom = GetSystemMetrics(SM_CYSCREEN)+g_fullscreen.orgPos.bottom-rt.bottom;
+
+ MoveWindow(hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
+ } else {
+ MoveWindow(hwnd, g_fullscreen.orgPos.left, g_fullscreen.orgPos.top,
+ g_fullscreen.orgPos.right-g_fullscreen.orgPos.left,
+ g_fullscreen.orgPos.bottom-g_fullscreen.orgPos.top, TRUE);
+
+ if (g_fullscreen.wasZoomed)
+ ShowWindow(hwnd, WS_MAXIMIZE);
+ }
+
+ return g_fullscreen.mode;
+}
+
+static void fullscreen_move(HWND hwnd)
+{
+ 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);
+}
+
+#endif
+
+
+static void toggle_child(HWND hwnd, UINT cmd, HWND hchild)
+{
+ BOOL vis = IsWindowVisible(hchild);
+
+ CheckMenuItem(Globals.hMenuOptions, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
+
+ ShowWindow(hchild, vis?SW_HIDE:SW_SHOW);
+
+#ifndef _NO_EXTENSIONS
+ if (g_fullscreen.mode)
+ fullscreen_move(hwnd);
+#endif
+
+ resize_frame_client(hwnd);
+}
+
+static BOOL activate_drive_window(LPCTSTR path)
+{
+ TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE];
+ HWND child_wnd;
+
+ _tsplitpath(path, drv1, 0, 0, 0);
+
+ /* search for a already open window for the same drive */
+ for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) {
+ ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA);
+
+ if (child) {
+ _tsplitpath(child->root.path, drv2, 0, 0, 0);
+
+ if (!lstrcmpi(drv2, drv1)) {
+ SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
+
+ if (IsMinimized(child_wnd))
+ ShowWindow(child_wnd, SW_SHOWNORMAL);
+
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+}
+
+static BOOL activate_fs_window(LPCTSTR filesys)
+{
+ HWND child_wnd;
+
+ /* search for a already open window of the given file system name */
+ for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) {
+ ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA);
+
+ if (child) {
+ if (!lstrcmpi(child->root.fs, filesys)) {
+ SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
+
+ if (IsMinimized(child_wnd))
+ ShowWindow(child_wnd, SW_SHOWNORMAL);
+
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+}
+
+static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+ TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
+
+ switch(nmsg) {
+ case WM_CLOSE:
+ DestroyWindow(hwnd);
+
+ /* clear handle variables */
+ Globals.hMenuFrame = 0;
+ Globals.hMenuView = 0;
+ Globals.hMenuOptions = 0;
+ Globals.hMainWnd = 0;
+ Globals.hmdiclient = 0;
+ Globals.hdrivebar = 0;
+ break;
+
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+
+ case WM_INITMENUPOPUP: {
+ HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0);
+
+ if (!SendMessage(hwndClient, WM_INITMENUPOPUP, wparam, lparam))
+ return 0;
+ break;}
+
+ case WM_COMMAND: {
+ UINT cmd = LOWORD(wparam);
+ HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0);
+
+ if (SendMessage(hwndClient, WM_DISPATCH_COMMAND, wparam, lparam))
+ break;
+
+ if (cmd>=ID_DRIVE_FIRST && cmd<=ID_DRIVE_FIRST+0xFF) {
+ TCHAR drv[_MAX_DRIVE], path[MAX_PATH];
+ ChildWnd* child;
+ LPCTSTR root = Globals.drives;
+ int i;
+
+ for(i=cmd-ID_DRIVE_FIRST; i--; root++)
+ while(*root)
+ root++;
+
+ if (activate_drive_window(root))
+ return 0;
+
+ _tsplitpath(root, drv, 0, 0, 0);
+
+ if (!SetCurrentDirectory(drv)) {
+ display_error(hwnd, GetLastError());
+ return 0;
+ }
+
+ GetCurrentDirectory(MAX_PATH, path); /*TODO: store last directory per drive */
+ child = alloc_child_window(path, NULL, hwnd);
+
+ if (!create_child_window(child))
+ free(child);
+ } else switch(cmd) {
+ case ID_FILE_EXIT:
+ SendMessage(hwnd, WM_CLOSE, 0, 0);
+ break;
+
+ case ID_WINDOW_NEW: {
+ TCHAR path[MAX_PATH];
+ ChildWnd* child;
+
+ GetCurrentDirectory(MAX_PATH, path);
+ child = alloc_child_window(path, NULL, hwnd);
+
+ if (!create_child_window(child))
+ free(child);
+ break;}
+
+ case ID_REFRESH:
+ refresh_drives();
+ break;
+
+ case ID_WINDOW_CASCADE:
+ SendMessage(Globals.hmdiclient, WM_MDICASCADE, 0, 0);
+ break;
+
+ case ID_WINDOW_TILE_HORZ:
+ SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_HORIZONTAL, 0);
+ break;
+
+ case ID_WINDOW_TILE_VERT:
+ SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_VERTICAL, 0);
+ break;
+
+ case ID_WINDOW_ARRANGE:
+ SendMessage(Globals.hmdiclient, WM_MDIICONARRANGE, 0, 0);
+ break;
+
+ case ID_SELECT_FONT: {
+ TCHAR dlg_name[BUFFER_LEN], dlg_info[BUFFER_LEN];
+ CHOOSEFONT chFont;
+ LOGFONT lFont;
+
+ HDC hdc = GetDC(hwnd);
+ chFont.lStructSize = sizeof(CHOOSEFONT);
+ chFont.hwndOwner = hwnd;
+ chFont.hDC = NULL;
+ chFont.lpLogFont = &lFont;
+ chFont.Flags = CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_LIMITSIZE | CF_NOSCRIPTSEL;
+ chFont.rgbColors = RGB(0,0,0);
+ chFont.lCustData = 0;
+ chFont.lpfnHook = NULL;
+ chFont.lpTemplateName = NULL;
+ chFont.hInstance = Globals.hInstance;
+ chFont.lpszStyle = NULL;
+ chFont.nFontType = SIMULATED_FONTTYPE;
+ chFont.nSizeMin = 0;
+ chFont.nSizeMax = 24;
+
+ if (ChooseFont(&chFont)) {
+ HWND childWnd;
+ HFONT hFontOld;
+
+ DeleteObject(Globals.hfont);
+ Globals.hfont = CreateFontIndirect(&lFont);
+ hFontOld = SelectFont(hdc, Globals.hfont);
+ GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
+
+ /* change font in all open child windows */
+ for(childWnd=GetWindow(Globals.hmdiclient,GW_CHILD); childWnd; childWnd=GetNextWindow(childWnd,GW_HWNDNEXT)) {
+ ChildWnd* child = (ChildWnd*) GetWindowLongPtr(childWnd, GWLP_USERDATA);
+ SetWindowFont(child->left.hwnd, Globals.hfont, TRUE);
+ SetWindowFont(child->right.hwnd, Globals.hfont, TRUE);
+ ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
+ ListBox_SetItemHeight(child->right.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
+ InvalidateRect(child->left.hwnd, NULL, TRUE);
+ InvalidateRect(child->right.hwnd, NULL, TRUE);
+ }
+
+ SelectFont(hdc, hFontOld);
+ }
+ else if (CommDlgExtendedError()) {
+ LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
+ LoadString(Globals.hInstance, IDS_FONT_SEL_ERROR, dlg_info, BUFFER_LEN);
+ MessageBox(hwnd, dlg_info, dlg_name, MB_OK);
+ }
+
+ ReleaseDC(hwnd, hdc);
+ break;
+ }
+
+ case ID_VIEW_TOOL_BAR:
+ toggle_child(hwnd, cmd, Globals.htoolbar);
+ break;
+
+ case ID_VIEW_DRIVE_BAR:
+ toggle_child(hwnd, cmd, Globals.hdrivebar);
+ break;
+
+ case ID_VIEW_STATUSBAR:
+ toggle_child(hwnd, cmd, Globals.hstatusbar);
+ break;
+
+ case ID_EXECUTE: {
+ struct ExecuteDialog dlg;
+
+ memset(&dlg, 0, sizeof(struct ExecuteDialog));
+
+ if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_EXECUTE), hwnd, ExecuteDialogDlgProc, (LPARAM)&dlg) == IDOK) {
+ HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
+
+ if ((int)hinst <= 32)
+ display_error(hwnd, GetLastError());
+ }
+ break;}
+
+ case ID_CONNECT_NETWORK_DRIVE: {
+ DWORD ret = WNetConnectionDialog(hwnd, RESOURCETYPE_DISK);
+ if (ret == NO_ERROR)
+ refresh_drives();
+ else if (ret != (DWORD)-1) {
+ if (ret == ERROR_EXTENDED_ERROR)
+ display_network_error(hwnd);
+ else
+ display_error(hwnd, ret);
+ }
+ break;}
+
+ case ID_DISCONNECT_NETWORK_DRIVE: {
+ DWORD ret = WNetDisconnectDialog(hwnd, RESOURCETYPE_DISK);
+ if (ret == NO_ERROR)
+ refresh_drives();
+ else if (ret != (DWORD)-1) {
+ if (ret == ERROR_EXTENDED_ERROR)
+ display_network_error(hwnd);
+ else
+ display_error(hwnd, ret);
+ }
+ break;}
+
+#ifndef __MINGW32__ /* SHFormatDrive missing in MinGW (as of 13.5.2005) */
+ case ID_FORMAT_DISK: {
+ UINT sem_org = SetErrorMode(0); /* Get the current Error Mode settings. */
+ SetErrorMode(sem_org & ~SEM_FAILCRITICALERRORS); /* Force O/S to handle */
+ SHFormatDrive(hwnd, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
+ SetErrorMode(sem_org); /* Put it back the way it was. */
+ break;}
+#endif
+
+ case ID_HELP:
+ WinHelp(hwnd, RS(b1,IDS_WINEFILE), HELP_INDEX, 0);
+ break;
+
+#ifndef _NO_EXTENSIONS
+ case ID_VIEW_FULLSCREEN:
+ CheckMenuItem(Globals.hMenuOptions, cmd, toggle_fullscreen(hwnd)?MF_CHECKED:0);
+ break;
+
+#ifdef __WINE__
+ case ID_DRIVE_UNIX_FS: {
+ TCHAR path[MAX_PATH];
+#ifdef UNICODE
+ char cpath[MAX_PATH];
+#endif
+ ChildWnd* child;
+
+ if (activate_fs_window(RS(b1,IDS_UNIXFS)))
+ break;
+
+
+#ifdef UNICODE
+ getcwd(cpath, MAX_PATH);
+ MultiByteToWideChar(CP_UNIXCP, 0, cpath, -1, path, MAX_PATH);
+#else
+ getcwd(path, MAX_PATH);
+#endif
+ child = alloc_child_window(path, NULL, hwnd);
+
+ if (!create_child_window(child))
+ free(child);
+ break;}
+#endif
+
+#ifdef _SHELL_FOLDERS
+ case ID_DRIVE_SHELL_NS: {
+ TCHAR path[MAX_PATH];
+ ChildWnd* child;
+
+ if (activate_fs_window(RS(b1,IDS_SHELL)))
+ break;
+
+ GetCurrentDirectory(MAX_PATH, path);
+ child = alloc_child_window(path, get_path_pidl(path,hwnd), hwnd);
+
+ if (!create_child_window(child))
+ free(child);
+ break;}
+#endif
+#endif
+
+ /*TODO: There are even more menu items! */
+
+#ifndef _NO_EXTENSIONS
+#ifdef __WINE__
+ case ID_LICENSE:
+ WineLicense(Globals.hMainWnd);
+ break;
+
+ case ID_NO_WARRANTY:
+ WineWarranty(Globals.hMainWnd);
+ break;
+
+ case ID_ABOUT_WINE:
+ ShellAbout(hwnd, RS(b2,IDS_WINE), RS(b1,IDS_WINEFILE), 0);
+ break;
+#endif
+
+ case ID_ABOUT:
+ ShellAbout(hwnd, RS(b1,IDS_WINEFILE), NULL, 0);
+ break;
+#endif /* _NO_EXTENSIONS */
+
+ default:
+ /*TODO: if (wParam >= PM_FIRST_LANGUAGE && wParam <= PM_LAST_LANGUAGE)
+ STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE);
+ else */if ((cmd<IDW_FIRST_CHILD || cmd>=IDW_FIRST_CHILD+0x100) &&
+ (cmd<SC_SIZE || cmd>SC_RESTORE))
+ MessageBox(hwnd, RS(b2,IDS_NO_IMPL), RS(b1,IDS_WINEFILE), MB_OK);
+
+ return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam);
+ }
+ break;}
+
+ case WM_SIZE:
+ resize_frame(hwnd, LOWORD(lparam), HIWORD(lparam));
+ break; /* do not pass message to DefFrameProc */
+
+#ifndef _NO_EXTENSIONS
+ 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 FRM_CALC_CLIENT:
+ frame_get_clientspace(hwnd, (PRECT)lparam);
+ return TRUE;
+#endif /* _NO_EXTENSIONS */
+
+ default:
+ return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam);
+ }
+
+ return 0;
+}
+
+
+static TCHAR g_pos_names[COLUMNS][20] = {
+ {'\0'} /* symbol */
+};
+
+static const int g_pos_align[] = {
+ 0,
+ HDF_LEFT, /* Name */
+ HDF_RIGHT, /* Size */
+ HDF_LEFT, /* CDate */
+#ifndef _NO_EXTENSIONS
+ HDF_LEFT, /* ADate */
+ HDF_LEFT, /* MDate */
+ HDF_LEFT, /* Index */
+ HDF_CENTER, /* Links */
+#endif
+ HDF_CENTER, /* Attributes */
+#ifndef _NO_EXTENSIONS
+ HDF_LEFT /* Security */
+#endif
+};
+
+static void resize_tree(ChildWnd* child, int cx, int cy)
+{
+ HDWP hdwp = BeginDeferWindowPos(4);
+ RECT rt;
+
+ rt.left = 0;
+ rt.top = 0;
+ rt.right = cx;
+ rt.bottom = cy;
+
+ cx = child->split_pos + SPLIT_WIDTH/2;
+
+#ifndef _NO_EXTENSIONS
+ {
+ WINDOWPOS wp;
+ HD_LAYOUT hdl;
+
+ hdl.prc = &rt;
+ hdl.pwpos = ℘
+
+ Header_Layout(child->left.hwndHeader, &hdl);
+
+ DeferWindowPos(hdwp, child->left.hwndHeader, wp.hwndInsertAfter,
+ wp.x-1, wp.y, child->split_pos-SPLIT_WIDTH/2+1, wp.cy, wp.flags);
+ DeferWindowPos(hdwp, child->right.hwndHeader, wp.hwndInsertAfter,
+ rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
+ }
+#endif /* _NO_EXTENSIONS */
+
+ DeferWindowPos(hdwp, child->left.hwnd, 0, rt.left, rt.top, child->split_pos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
+ DeferWindowPos(hdwp, child->right.hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
+
+ EndDeferWindowPos(hdwp);
+}
+
+
+#ifndef _NO_EXTENSIONS
+
+static HWND create_header(HWND parent, Pane* pane, int id)
+{
+ HD_ITEM hdi;
+ int idx;
+
+ HWND hwnd = CreateWindow(WC_HEADER, 0, WS_CHILD|WS_VISIBLE|HDS_HORZ/*TODO: |HDS_BUTTONS + sort orders*/,
+ 0, 0, 0, 0, parent, (HMENU)id, Globals.hInstance, 0);
+ if (!hwnd)
+ return 0;
+
+ SetWindowFont(hwnd, GetStockObject(DEFAULT_GUI_FONT), FALSE);
+
+ hdi.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT;
+
+ for(idx=0; idx<COLUMNS; idx++) {
+ hdi.pszText = g_pos_names[idx];
+ hdi.fmt = HDF_STRING | g_pos_align[idx];
+ hdi.cxy = pane->widths[idx];
+ Header_InsertItem(hwnd, idx, &hdi);
+ }
+
+ return hwnd;
+}
+
+#endif /* _NO_EXTENSIONS */
+
+
+static void init_output(HWND hwnd)
+{
+ const static TCHAR s1000[] = {'1','0','0','0','\0'};
+
+ TCHAR b[16];
+ HFONT old_font;
+ HDC hdc = GetDC(hwnd);
+
+ if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, s1000, 0, b, 16) > 4)
+ Globals.num_sep = b[1];
+ else
+ Globals.num_sep = TEXT('.');
+
+ old_font = SelectFont(hdc, Globals.hfont);
+ GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
+ SelectFont(hdc, old_font);
+ ReleaseDC(hwnd, hdc);
+}
+
+static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol);
+
+
+/* calculate preferred width for all visible columns */
+
+static BOOL calc_widths(Pane* pane, BOOL anyway)
+{
+ int col, x, cx, spc=3*Globals.spaceSize.cx;
+ int entries = ListBox_GetCount(pane->hwnd);
+ int orgWidths[COLUMNS];
+ int orgPositions[COLUMNS+1];
+ HFONT hfontOld;
+ HDC hdc;
+ int cnt;
+
+ if (!anyway) {
+ memcpy(orgWidths, pane->widths, sizeof(orgWidths));
+ memcpy(orgPositions, pane->positions, sizeof(orgPositions));
+ }
+
+ for(col=0; col<COLUMNS; col++)
+ pane->widths[col] = 0;
+
+ hdc = GetDC(pane->hwnd);
+ hfontOld = SelectFont(hdc, Globals.hfont);
+
+ for(cnt=0; cnt<entries; cnt++) {
+ Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt);
+
+ DRAWITEMSTRUCT dis;
+
+ dis.CtlType = 0;
+ dis.CtlID = 0;
+ dis.itemID = 0;
+ dis.itemAction = 0;
+ dis.itemState = 0;
+ dis.hwndItem = pane->hwnd;
+ dis.hDC = hdc;
+ dis.rcItem.left = 0;
+ dis.rcItem.top = 0;
+ dis.rcItem.right = 0;
+ dis.rcItem.bottom = 0;
+ /*dis.itemData = 0; */
+
+ draw_item(pane, &dis, entry, COLUMNS);
+ }
+
+ SelectObject(hdc, hfontOld);
+ ReleaseDC(pane->hwnd, hdc);
+
+ x = 0;
+ for(col=0; col<COLUMNS; col++) {
+ pane->positions[col] = x;
+ cx = pane->widths[col];
+
+ if (cx) {
+ cx += spc;
+
+ if (cx < IMAGE_WIDTH)
+ cx = IMAGE_WIDTH;
+
+ pane->widths[col] = cx;
+ }
+
+ x += cx;
+ }
+
+ pane->positions[COLUMNS] = x;
+
+ ListBox_SetHorizontalExtent(pane->hwnd, x);
+
+ /* no change? */
+ if (!memcmp(orgWidths, pane->widths, sizeof(orgWidths)))
+ return FALSE;
+
+ /* don't move, if only collapsing an entry */
+ if (!anyway && pane->widths[0]<orgWidths[0] &&
+ !memcmp(orgWidths+1, pane->widths+1, sizeof(orgWidths)-sizeof(int))) {
+ pane->widths[0] = orgWidths[0];
+ memcpy(pane->positions, orgPositions, sizeof(orgPositions));
+
+ return FALSE;
+ }
+
+ InvalidateRect(pane->hwnd, 0, TRUE);
+
+ return TRUE;
+}
+
+
+/* calculate one preferred column width */
+
+static void calc_single_width(Pane* pane, int col)
+{
+ HFONT hfontOld;
+ int x, cx;
+ int entries = ListBox_GetCount(pane->hwnd);
+ int cnt;
+ HDC hdc;
+
+ pane->widths[col] = 0;
+
+ hdc = GetDC(pane->hwnd);
+ hfontOld = SelectFont(hdc, Globals.hfont);
+
+ for(cnt=0; cnt<entries; cnt++) {
+ Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt);
+ DRAWITEMSTRUCT dis;
+
+ dis.CtlType = 0;
+ dis.CtlID = 0;
+ dis.itemID = 0;
+ dis.itemAction = 0;
+ dis.itemState = 0;
+ dis.hwndItem = pane->hwnd;
+ dis.hDC = hdc;
+ dis.rcItem.left = 0;
+ dis.rcItem.top = 0;
+ dis.rcItem.right = 0;
+ dis.rcItem.bottom = 0;
+ /*dis.itemData = 0; */
+
+ draw_item(pane, &dis, entry, col);
+ }
+
+ SelectObject(hdc, hfontOld);
+ ReleaseDC(pane->hwnd, hdc);
+
+ cx = pane->widths[col];
+
+ if (cx) {
+ cx += 3*Globals.spaceSize.cx;
+
+ if (cx < IMAGE_WIDTH)
+ cx = IMAGE_WIDTH;
+ }
+
+ pane->widths[col] = cx;
+
+ x = pane->positions[col] + cx;
+
+ for(; col<COLUMNS; ) {
+ pane->positions[++col] = x;
+ x += pane->widths[col];
+ }
+
+ ListBox_SetHorizontalExtent(pane->hwnd, x);
+}
+
+
+static BOOL pattern_match(LPCTSTR str, LPCTSTR pattern)
+{
+ for( ; *str&&*pattern; str++,pattern++) {
+ if (*pattern == '*') {
+ do pattern++;
+ while(*pattern == '*');
+
+ if (!*pattern)
+ return TRUE;
+
+ for(; *str; str++)
+ if (*str==*pattern && pattern_match(str, pattern))
+ return TRUE;
+
+ return FALSE;
+ }
+ else if (*str!=*pattern && *pattern!='?')
+ return FALSE;
+ }
+
+ if (*str || *pattern)
+ if (*pattern!='*' || pattern[1]!='\0')
+ return FALSE;
+
+ return TRUE;
+}
+
+static BOOL pattern_imatch(LPCTSTR str, LPCTSTR pattern)
+{
+ TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
+
+ lstrcpy(b1, str);
+ lstrcpy(b2, pattern);
+ CharUpper(b1);
+ CharUpper(b2);
+
+ return pattern_match(b1, b2);
+}
+
+
+enum FILE_TYPE {
+ FT_OTHER = 0,
+ FT_EXECUTABLE = 1,
+ FT_DOCUMENT = 2
+};
+
+static enum FILE_TYPE get_file_type(LPCTSTR filename);
+
+
+/* insert listbox entries after index idx */
+
+static int insert_entries(Pane* pane, Entry* dir, LPCTSTR pattern, int filter_flags, int idx)
+{
+ Entry* entry = dir;
+
+ if (!entry)
+ return idx;
+
+ ShowWindow(pane->hwnd, SW_HIDE);
+
+ for(; entry; entry=entry->next) {
+#ifndef _LEFT_FILES
+ if (pane->treePane && !(entry->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
+ continue;
+#endif
+
+ if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ /* don't display entries "." and ".." in the left pane */
+ if (pane->treePane && entry->data.cFileName[0]==TEXT('.'))
+ if (
+ #ifndef _NO_EXTENSIONS
+ entry->data.cFileName[1]==TEXT('\0') ||
+ #endif
+ (entry->data.cFileName[1]==TEXT('.') && entry->data.cFileName[2]==TEXT('\0')))
+ continue;
+
+ /* filter directories in right pane */
+ if (!pane->treePane && !(filter_flags&TF_DIRECTORIES))
+ continue;
+ }
+
+ /* filter using the file name pattern */
+ if (pattern)
+ if (!pattern_imatch(entry->data.cFileName, pattern))
+ continue;
+
+ /* filter system and hidden files */
+ if (!(filter_flags&TF_HIDDEN) && (entry->data.dwFileAttributes&(FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM)))
+ continue;
+
+ /* filter looking at the file type */
+ if ((filter_flags&(TF_PROGRAMS|TF_DOCUMENTS|TF_OTHERS)) != (TF_PROGRAMS|TF_DOCUMENTS|TF_OTHERS))
+ switch(get_file_type(entry->data.cFileName)) {
+ case FT_EXECUTABLE:
+ if (!(filter_flags & TF_PROGRAMS))
+ continue;
+ break;
+
+ case FT_DOCUMENT:
+ if (!(filter_flags & TF_DOCUMENTS))
+ continue;
+ break;
+
+ default: /* TF_OTHERS */
+ if (!(filter_flags & TF_OTHERS))
+ continue;
+ }
+
+ if (idx != -1)
+ idx++;
+
+ ListBox_InsertItemData(pane->hwnd, idx, entry);
+
+ if (pane->treePane && entry->expanded)
+ idx = insert_entries(pane, entry->down, pattern, filter_flags, idx);
+ }
+
+ ShowWindow(pane->hwnd, SW_SHOW);
+
+ return idx;
+}
+
+
+static void format_bytes(LPTSTR buffer, LONGLONG bytes)
+{
+ const static TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'};
+ const static TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'};
+ const static TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'};
+
+ float fBytes = (float)bytes;
+
+#ifdef __WINE__ /* work around for incorrect implementation of wsprintf()/_stprintf() in WINE */
+ if (bytes >= 1073741824) /* 1 GB */
+ wsprintf(buffer, sFmtGB, fBytes/1073741824.f+.5f);
+ else if (bytes >= 1048576) /* 1 MB */
+ wsprintf(buffer, sFmtMB, fBytes/1048576.f+.5f);
+ else if (bytes >= 1024) /* 1 kB */
+ wsprintf(buffer, sFmtkB, fBytes/1024.f+.5f);
+#else
+ if (bytes >= 1073741824) /* 1 GB */
+ _stprintf(buffer, sFmtGB, fBytes/1073741824.f+.5f);
+ else if (bytes >= 1048576) /* 1 MB */
+ _stprintf(buffer, sFmtMB, fBytes/1048576.f+.5f);
+ else if (bytes >= 1024) /* 1 kB */
+ _stprintf(buffer, sFmtkB, fBytes/1024.f+.5f);
+#endif
+ else
+ _stprintf(buffer, sLongNumFmt, bytes);
+}
+
+static void set_space_status(void)
+{
+ ULARGE_INTEGER ulFreeBytesToCaller, ulTotalBytes, ulFreeBytes;
+ TCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN];
+
+ if (GetDiskFreeSpaceEx(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) {
+ format_bytes(b1, ulFreeBytesToCaller.QuadPart);
+ format_bytes(b2, ulTotalBytes.QuadPart);
+ wsprintf(buffer, RS(fmt,IDS_FREE_SPACE_FMT), b1, b2);
+ } else
+ lstrcpy(buffer, sQMarks);
+
+ SendMessage(Globals.hstatusbar, SB_SETTEXT, 0, (LPARAM)buffer);
+}
+
+
+static WNDPROC g_orgTreeWndProc;
+
+static void create_tree_window(HWND parent, Pane* pane, int id, int id_header, LPCTSTR pattern, int filter_flags)
+{
+ const static TCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'};
+
+ static int s_init = 0;
+ Entry* entry = pane->root;
+
+ pane->hwnd = CreateWindow(sListBox, sEmpty, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|
+ LBS_DISABLENOSCROLL|LBS_NOINTEGRALHEIGHT|LBS_OWNERDRAWFIXED|LBS_NOTIFY,
+ 0, 0, 0, 0, parent, (HMENU)id, Globals.hInstance, 0);
+
+ SetWindowLongPtr(pane->hwnd, GWLP_USERDATA, (LPARAM)pane);
+ g_orgTreeWndProc = SubclassWindow(pane->hwnd, TreeWndProc);
+
+ SetWindowFont(pane->hwnd, Globals.hfont, FALSE);
+
+ /* insert entries into listbox */
+ if (entry)
+ insert_entries(pane, entry, pattern, filter_flags, -1);
+
+ /* calculate column widths */
+ if (!s_init) {
+ s_init = 1;
+ init_output(pane->hwnd);
+ }
+
+ calc_widths(pane, TRUE);
+
+#ifndef _NO_EXTENSIONS
+ pane->hwndHeader = create_header(parent, pane, id_header);
+#endif
+}
+
+
+static void InitChildWindow(ChildWnd* child)
+{
+ create_tree_window(child->hwnd, &child->left, IDW_TREE_LEFT, IDW_HEADER_LEFT, NULL, TF_ALL);
+ create_tree_window(child->hwnd, &child->right, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, child->filter_pattern, child->filter_flags);
+}
+
+
+static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols)
+{
+ SYSTEMTIME systime;
+ FILETIME lft;
+ int len = 0;
+
+ *buffer = TEXT('\0');
+
+ if (!ft->dwLowDateTime && !ft->dwHighDateTime)
+ return;
+
+ if (!FileTimeToLocalFileTime(ft, &lft))
+ {err: lstrcpy(buffer,sQMarks); return;}
+
+ if (!FileTimeToSystemTime(&lft, &systime))
+ goto err;
+
+ if (visible_cols & COL_DATE) {
+ len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer, BUFFER_LEN);
+ if (!len)
+ goto err;
+ }
+
+ if (visible_cols & COL_TIME) {
+ if (len)
+ buffer[len-1] = ' ';
+
+ buffer[len++] = ' ';
+
+ if (!GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer+len, BUFFER_LEN-len))
+ buffer[len] = TEXT('\0');
+ }
+}
+
+
+static void calc_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
+{
+ RECT rt = {0, 0, 0, 0};
+
+ DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
+
+ if (rt.right > pane->widths[col])
+ pane->widths[col] = rt.right;
+}
+
+static void calc_tabbed_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
+{
+ RECT rt = {0, 0, 0, 0};
+
+/* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
+ DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
+
+ DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
+ /*FIXME rt (0,0) ??? */
+
+ if (rt.right > pane->widths[col])
+ pane->widths[col] = rt.right;
+}
+
+
+static void output_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str, DWORD flags)
+{
+ int x = dis->rcItem.left;
+ RECT rt;
+
+ rt.left = x+pane->positions[col]+Globals.spaceSize.cx;
+ rt.top = dis->rcItem.top;
+ rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx;
+ rt.bottom = dis->rcItem.bottom;
+
+ DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags);
+}
+
+static void output_tabbed_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
+{
+ int x = dis->rcItem.left;
+ RECT rt;
+
+ rt.left = x+pane->positions[col]+Globals.spaceSize.cx;
+ rt.top = dis->rcItem.top;
+ rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx;
+ rt.bottom = dis->rcItem.bottom;
+
+/* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
+ DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
+
+ DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
+}
+
+static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
+{
+ int x = dis->rcItem.left;
+ RECT rt;
+ LPCTSTR s = str;
+ TCHAR b[128];
+ LPTSTR d = b;
+ int pos;
+
+ rt.left = x+pane->positions[col]+Globals.spaceSize.cx;
+ rt.top = dis->rcItem.top;
+ rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx;
+ rt.bottom = dis->rcItem.bottom;
+
+ if (*s)
+ *d++ = *s++;
+
+ /* insert number separator characters */
+ pos = lstrlen(s) % 3;
+
+ while(*s)
+ if (pos--)
+ *d++ = *s++;
+ else {
+ *d++ = Globals.num_sep;
+ pos = 3;
+ }
+
+ DrawText(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS);
+}
+
+
+static BOOL is_exe_file(LPCTSTR ext)
+{
+ static const TCHAR executable_extensions[][4] = {
+ {'C','O','M','\0'},
+ {'E','X','E','\0'},
+ {'B','A','T','\0'},
+ {'C','M','D','\0'},
+#ifndef _NO_EXTENSIONS
+ {'C','M','M','\0'},
+ {'B','T','M','\0'},
+ {'A','W','K','\0'},
+#endif /* _NO_EXTENSIONS */
+ {'\0'}
+ };
+
+ TCHAR ext_buffer[_MAX_EXT];
+ const TCHAR (*p)[4];
+ LPCTSTR s;
+ LPTSTR d;
+
+ for(s=ext+1,d=ext_buffer; (*d=tolower(*s)); s++)
+ d++;
+
+ for(p=executable_extensions; (*p)[0]; p++)
+ if (!lstrcmpi(ext_buffer, *p))
+ return TRUE;
+
+ return FALSE;
+}
+
+static BOOL is_registered_type(LPCTSTR ext)
+{
+ /* check if there exists a classname for this file extension in the registry */
+ if (!RegQueryValue(HKEY_CLASSES_ROOT, ext, NULL, NULL))
+ return TRUE;
+
+ return FALSE;
+}
+
+static enum FILE_TYPE get_file_type(LPCTSTR filename)
+{
+ LPCTSTR ext = _tcsrchr(filename, '.');
+ if (!ext)
+ ext = sEmpty;
+
+ if (is_exe_file(ext))
+ return FT_EXECUTABLE;
+ else if (is_registered_type(ext))
+ return FT_DOCUMENT;
+ else
+ return FT_OTHER;
+}
+
+
+static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol)
+{
+ TCHAR buffer[BUFFER_LEN];
+ DWORD attrs;
+ int visible_cols = pane->visible_cols;
+ COLORREF bkcolor, textcolor;
+ RECT focusRect = dis->rcItem;
+ HBRUSH hbrush;
+ enum IMAGE img;
+ int img_pos, cx;
+ int col = 0;
+
+ if (entry) {
+ attrs = entry->data.dwFileAttributes;
+
+ if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
+ if (entry->data.cFileName[0]==TEXT('.') && entry->data.cFileName[1]==TEXT('.')
+ && entry->data.cFileName[2]==TEXT('\0'))
+ img = IMG_FOLDER_UP;
+#ifndef _NO_EXTENSIONS
+ else if (entry->data.cFileName[0]==TEXT('.') && entry->data.cFileName[1]==TEXT('\0'))
+ img = IMG_FOLDER_CUR;
+#endif
+ else if (
+#ifdef _NO_EXTENSIONS
+ entry->expanded ||
+#endif
+ (pane->treePane && (dis->itemState&ODS_FOCUS)))
+ img = IMG_OPEN_FOLDER;
+ else
+ img = IMG_FOLDER;
+ } else {
+ switch(get_file_type(entry->data.cFileName)) {
+ case FT_EXECUTABLE: img = IMG_EXECUTABLE; break;
+ case FT_DOCUMENT: img = IMG_DOCUMENT; break;
+ default: img = IMG_FILE;
+ }
+ }
+ } else {
+ attrs = 0;
+ img = IMG_NONE;
+ }
+
+ if (pane->treePane) {
+ if (entry) {
+ img_pos = dis->rcItem.left + entry->level*(IMAGE_WIDTH+TREE_LINE_DX);
+
+ if (calcWidthCol == -1) {
+ int x;
+ int y = dis->rcItem.top + IMAGE_HEIGHT/2;
+ Entry* up;
+ RECT rt_clip;
+ HRGN hrgn_org = CreateRectRgn(0, 0, 0, 0);
+ HRGN hrgn;
+
+ rt_clip.left = dis->rcItem.left;
+ rt_clip.top = dis->rcItem.top;
+ rt_clip.right = dis->rcItem.left+pane->widths[col];
+ rt_clip.bottom = dis->rcItem.bottom;
+
+ hrgn = CreateRectRgnIndirect(&rt_clip);
+
+ if (!GetClipRgn(dis->hDC, hrgn_org)) {
+ DeleteObject(hrgn_org);
+ hrgn_org = 0;
+ }
+
+ /* HGDIOBJ holdPen = SelectObject(dis->hDC, GetStockObject(BLACK_PEN)); */
+ ExtSelectClipRgn(dis->hDC, hrgn, RGN_AND);
+ DeleteObject(hrgn);
+
+ if ((up=entry->up) != NULL) {
+ MoveToEx(dis->hDC, img_pos-IMAGE_WIDTH/2, y, 0);
+ LineTo(dis->hDC, img_pos-2, y);
+
+ x = img_pos - IMAGE_WIDTH/2;
+
+ do {
+ x -= IMAGE_WIDTH+TREE_LINE_DX;
+
+ if (up->next
+#ifndef _LEFT_FILES
+ && (up->next->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+#endif
+ ) {
+ MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
+ LineTo(dis->hDC, x, dis->rcItem.bottom);
+ }
+ } while((up=up->up) != NULL);
+ }
+
+ x = img_pos - IMAGE_WIDTH/2;
+
+ MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
+ LineTo(dis->hDC, x, y);
+
+ if (entry->next
+#ifndef _LEFT_FILES
+ && (entry->next->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
+#endif
+ )
+ LineTo(dis->hDC, x, dis->rcItem.bottom);
+
+ SelectClipRgn(dis->hDC, hrgn_org);
+ if (hrgn_org) DeleteObject(hrgn_org);
+ /* SelectObject(dis->hDC, holdPen); */
+ } else if (calcWidthCol==col || calcWidthCol==COLUMNS) {
+ int right = img_pos + IMAGE_WIDTH - TREE_LINE_DX;
+
+ if (right > pane->widths[col])
+ pane->widths[col] = right;
+ }
+ } else {
+ img_pos = dis->rcItem.left;
+ }
+ } else {
+ img_pos = dis->rcItem.left;
+
+ if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ pane->widths[col] = IMAGE_WIDTH;
+ }
+
+ if (calcWidthCol == -1) {
+ focusRect.left = img_pos - 2;
+
+#ifdef _NO_EXTENSIONS
+ if (pane->treePane && entry) {
+ RECT rt = {0};
+
+ DrawText(dis->hDC, entry->data.cFileName, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
+
+ focusRect.right = dis->rcItem.left+pane->positions[col+1]+TREE_LINE_DX + rt.right +2;
+ }
+#else
+
+ if (attrs & FILE_ATTRIBUTE_COMPRESSED)
+ textcolor = COLOR_COMPRESSED;
+ else
+#endif /* _NO_EXTENSIONS */
+ textcolor = RGB(0,0,0);
+
+ if (dis->itemState & ODS_FOCUS) {
+ textcolor = COLOR_SELECTION_TXT;
+ bkcolor = COLOR_SELECTION;
+ } else {
+ bkcolor = GetSysColor(COLOR_WINDOW);
+ }
+
+ hbrush = CreateSolidBrush(bkcolor);
+ FillRect(dis->hDC, &focusRect, hbrush);
+ DeleteObject(hbrush);
+
+ SetBkMode(dis->hDC, TRANSPARENT);
+ SetTextColor(dis->hDC, textcolor);
+
+ cx = pane->widths[col];
+
+ if (cx && img!=IMG_NONE) {
+ if (cx > IMAGE_WIDTH)
+ cx = IMAGE_WIDTH;
+
+#ifdef _SHELL_FOLDERS
+ if (entry->hicon && entry->hicon!=(HICON)-1)
+ DrawIconEx(dis->hDC, img_pos, dis->rcItem.top, entry->hicon, cx, GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL);
+ else
+#endif
+ ImageList_DrawEx(Globals.himl, img, dis->hDC,
+ img_pos, dis->rcItem.top, cx,
+ IMAGE_HEIGHT, bkcolor, CLR_DEFAULT, ILD_NORMAL);
+ }
+ }
+
+ if (!entry)
+ return;
+
+#ifdef _NO_EXTENSIONS
+ if (img >= IMG_FOLDER_UP)
+ return;
+#endif
+
+ col++;
+
+ /* ouput file name */
+ if (calcWidthCol == -1)
+ output_text(pane, dis, col, entry->data.cFileName, 0);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_width(pane, dis, col, entry->data.cFileName);
+
+ col++;
+
+#ifdef _NO_EXTENSIONS
+ if (!pane->treePane) {
+#endif
+
+ /* display file size */
+ if (visible_cols & COL_SIZE) {
+#ifdef _NO_EXTENSIONS
+ if (!(attrs&FILE_ATTRIBUTE_DIRECTORY))
+#endif
+ {
+ ULONGLONG size;
+
+ size = ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow;
+
+ _stprintf(buffer, sLongNumFmt, size);
+
+ if (calcWidthCol == -1)
+ output_number(pane, dis, col, buffer);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_width(pane, dis, col, buffer);/*TODO: not in every case time enough */
+ }
+
+ col++;
+ }
+
+ /* display file date */
+ if (visible_cols & (COL_DATE|COL_TIME)) {
+#ifndef _NO_EXTENSIONS
+ format_date(&entry->data.ftCreationTime, buffer, visible_cols);
+ if (calcWidthCol == -1)
+ output_text(pane, dis, col, buffer, 0);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_width(pane, dis, col, buffer);
+ col++;
+
+ format_date(&entry->data.ftLastAccessTime, buffer, visible_cols);
+ if (calcWidthCol == -1)
+ output_text(pane, dis, col, buffer, 0);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_width(pane, dis, col, buffer);
+ col++;
+#endif /* _NO_EXTENSIONS */
+
+ format_date(&entry->data.ftLastWriteTime, buffer, visible_cols);
+ if (calcWidthCol == -1)
+ output_text(pane, dis, col, buffer, 0);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_width(pane, dis, col, buffer);
+ col++;
+ }
+
+#ifndef _NO_EXTENSIONS
+ if (entry->bhfi_valid) {
+ ULONGLONG index = ((ULONGLONG)entry->bhfi.nFileIndexHigh << 32) | entry->bhfi.nFileIndexLow;
+
+ if (visible_cols & COL_INDEX) {
+ _stprintf(buffer, sLongHexFmt, index);
+
+ if (calcWidthCol == -1)
+ output_text(pane, dis, col, buffer, DT_RIGHT);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_width(pane, dis, col, buffer);
+
+ col++;
+ }
+
+ if (visible_cols & COL_LINKS) {
+ wsprintf(buffer, sNumFmt, entry->bhfi.nNumberOfLinks);
+
+ if (calcWidthCol == -1)
+ output_text(pane, dis, col, buffer, DT_CENTER);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_width(pane, dis, col, buffer);
+
+ col++;
+ }
+ } else
+ col += 2;
+#endif /* _NO_EXTENSIONS */
+
+ /* show file attributes */
+ if (visible_cols & COL_ATTRIBUTES) {
+#ifdef _NO_EXTENSIONS
+ const static TCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
+ lstrcpy(buffer, s4Tabs);
+#else
+ const static TCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
+ lstrcpy(buffer, s11Tabs);
+#endif
+
+ if (attrs & FILE_ATTRIBUTE_NORMAL) buffer[ 0] = 'N';
+ else {
+ if (attrs & FILE_ATTRIBUTE_READONLY) buffer[ 2] = 'R';
+ if (attrs & FILE_ATTRIBUTE_HIDDEN) buffer[ 4] = 'H';
+ if (attrs & FILE_ATTRIBUTE_SYSTEM) buffer[ 6] = 'S';
+ if (attrs & FILE_ATTRIBUTE_ARCHIVE) buffer[ 8] = 'A';
+ if (attrs & FILE_ATTRIBUTE_COMPRESSED) buffer[10] = 'C';
+#ifndef _NO_EXTENSIONS
+ if (attrs & FILE_ATTRIBUTE_DIRECTORY) buffer[12] = 'D';
+ if (attrs & FILE_ATTRIBUTE_ENCRYPTED) buffer[14] = 'E';
+ if (attrs & FILE_ATTRIBUTE_TEMPORARY) buffer[16] = 'T';
+ if (attrs & FILE_ATTRIBUTE_SPARSE_FILE) buffer[18] = 'P';
+ if (attrs & FILE_ATTRIBUTE_REPARSE_POINT) buffer[20] = 'Q';
+ if (attrs & FILE_ATTRIBUTE_OFFLINE) buffer[22] = 'O';
+ if (attrs & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) buffer[24] = 'X';
+#endif /* _NO_EXTENSIONS */
+ }
+
+ if (calcWidthCol == -1)
+ output_tabbed_text(pane, dis, col, buffer);
+ else if (calcWidthCol==col || calcWidthCol==COLUMNS)
+ calc_tabbed_width(pane, dis, col, buffer);
+
+ col++;
+ }
+
+/*TODO
+ if (flags.security) {
+ const static TCHAR sSecTabs[] = {
+ ' ','\t',' ','\t',' ','\t',' ',
+ ' ','\t',' ',
+ ' ','\t',' ','\t',' ','\t',' ',
+ ' ','\t',' ',
+ ' ','\t',' ','\t',' ','\t',' ',
+ '\0'
+ };
+
+ DWORD rights = get_access_mask();
+
+ lstrcpy(buffer, sSecTabs);
+
+ if (rights & FILE_READ_DATA) buffer[ 0] = 'R';
+ if (rights & FILE_WRITE_DATA) buffer[ 2] = 'W';
+ if (rights & FILE_APPEND_DATA) buffer[ 4] = 'A';
+ if (rights & FILE_READ_EA) {buffer[6] = 'entry'; buffer[ 7] = 'R';}
+ if (rights & FILE_WRITE_EA) {buffer[9] = 'entry'; buffer[10] = 'W';}
+ if (rights & FILE_EXECUTE) buffer[12] = 'X';
+ if (rights & FILE_DELETE_CHILD) buffer[14] = 'D';
+ if (rights & FILE_READ_ATTRIBUTES) {buffer[16] = 'a'; buffer[17] = 'R';}
+ if (rights & FILE_WRITE_ATTRIBUTES) {buffer[19] = 'a'; buffer[20] = 'W';}
+ if (rights & WRITE_DAC) buffer[22] = 'C';
+ if (rights & WRITE_OWNER) buffer[24] = 'O';
+ if (rights & SYNCHRONIZE) buffer[26] = 'S';
+
+ output_text(dis, col++, buffer, DT_LEFT, 3, psize);
+ }
+
+ if (flags.description) {
+ get_description(buffer);
+ output_text(dis, col++, buffer, 0, psize);
+ }
+*/
+
+#ifdef _NO_EXTENSIONS
+ }
+
+ /* draw focus frame */
+ if ((dis->itemState&ODS_FOCUS) && calcWidthCol==-1) {
+ /* Currently [04/2000] Wine neither behaves exactly the same */
+ /* way as WIN 95 nor like Windows NT... */
+ HGDIOBJ lastBrush;
+ HPEN lastPen;
+ HPEN hpen;
+
+ if (!(GetVersion() & 0x80000000)) { /* Windows NT or higher? */
+ LOGBRUSH lb = {PS_SOLID, RGB(255,255,255)};
+ hpen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, 0);
+ } else
+ hpen = CreatePen(PS_DOT, 0, RGB(255,255,255));
+
+ lastPen = SelectPen(dis->hDC, hpen);
+ lastBrush = SelectObject(dis->hDC, GetStockObject(HOLLOW_BRUSH));
+ SetROP2(dis->hDC, R2_XORPEN);
+ Rectangle(dis->hDC, focusRect.left, focusRect.top, focusRect.right, focusRect.bottom);
+ SelectObject(dis->hDC, lastBrush);
+ SelectObject(dis->hDC, lastPen);
+ DeleteObject(hpen);
+ }
+#endif /* _NO_EXTENSIONS */
+}
+
+
+#ifdef _NO_EXTENSIONS
+
+static void draw_splitbar(HWND hwnd, int x)
+{
+ RECT rt;
+ HDC hdc = GetDC(hwnd);
+
+ GetClientRect(hwnd, &rt);
+
+ rt.left = x - SPLIT_WIDTH/2;
+ rt.right = x + SPLIT_WIDTH/2+1;
+
+ InvertRect(hdc, &rt);
+
+ ReleaseDC(hwnd, hdc);
+}
+
+#endif /* _NO_EXTENSIONS */
+
+
+#ifndef _NO_EXTENSIONS
+
+static void set_header(Pane* pane)
+{
+ HD_ITEM item;
+ int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ);
+ int i=0, x=0;
+
+ item.mask = HDI_WIDTH;
+ item.cxy = 0;
+
+ for(; x+pane->widths[i]<scroll_pos && i<COLUMNS; i++) {
+ x += pane->widths[i];
+ Header_SetItem(pane->hwndHeader, i, &item);
+ }
+
+ if (i < COLUMNS) {
+ x += pane->widths[i];
+ item.cxy = x - scroll_pos;
+ Header_SetItem(pane->hwndHeader, i++, &item);
+
+ for(; i<COLUMNS; i++) {
+ item.cxy = pane->widths[i];
+ x += pane->widths[i];
+ Header_SetItem(pane->hwndHeader, i, &item);
+ }
+ }
+}
+
+static LRESULT pane_notify(Pane* pane, NMHDR* pnmh)
+{
+ switch(pnmh->code) {
+ case HDN_TRACK:
+ case HDN_ENDTRACK: {
+ HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
+ int idx = phdn->iItem;
+ int dx = phdn->pitem->cxy - pane->widths[idx];
+ int i;
+
+ RECT clnt;
+ GetClientRect(pane->hwnd, &clnt);
+
+ /* move immediate to simulate HDS_FULLDRAG (for now [04/2000] not really needed with WINELIB) */
+ Header_SetItem(pane->hwndHeader, idx, phdn->pitem);
+
+ pane->widths[idx] += dx;
+
+ for(i=idx; ++i<=COLUMNS; )
+ pane->positions[i] += dx;
+
+ {
+ int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ);
+ RECT rt_scr;
+ RECT rt_clip;
+
+ rt_scr.left = pane->positions[idx+1]-scroll_pos;
+ rt_scr.top = 0;
+ rt_scr.right = clnt.right;
+ rt_scr.bottom = clnt.bottom;
+
+ rt_clip.left = pane->positions[idx]-scroll_pos;
+ rt_clip.top = 0;
+ rt_clip.right = clnt.right;
+ rt_clip.bottom = clnt.bottom;
+
+ if (rt_scr.left < 0) rt_scr.left = 0;
+ if (rt_clip.left < 0) rt_clip.left = 0;
+
+ ScrollWindowEx(pane->hwnd, dx, 0, &rt_scr, &rt_clip, 0, 0, SW_INVALIDATE);
+
+ rt_clip.right = pane->positions[idx+1];
+ RedrawWindow(pane->hwnd, &rt_clip, 0, RDW_INVALIDATE|RDW_UPDATENOW);
+
+ if (pnmh->code == HDN_ENDTRACK) {
+ ListBox_SetHorizontalExtent(pane->hwnd, pane->positions[COLUMNS]);
+
+ if (GetScrollPos(pane->hwnd, SB_HORZ) != scroll_pos)
+ set_header(pane);
+ }
+ }
+
+ return FALSE;
+ }
+
+ case HDN_DIVIDERDBLCLICK: {
+ HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
+ HD_ITEM item;
+
+ calc_single_width(pane, phdn->iItem);
+ item.mask = HDI_WIDTH;
+ item.cxy = pane->widths[phdn->iItem];
+
+ Header_SetItem(pane->hwndHeader, phdn->iItem, &item);
+ InvalidateRect(pane->hwnd, 0, TRUE);
+ break;}
+ }
+
+ return 0;
+}
+
+#endif /* _NO_EXTENSIONS */
+
+
+static void scan_entry(ChildWnd* child, Entry* entry, int idx, HWND hwnd)
+{
+ TCHAR path[MAX_PATH];
+ HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
+
+ /* delete sub entries in left pane */
+ for(;;) {
+ LRESULT res = ListBox_GetItemData(child->left.hwnd, idx+1);
+ Entry* sub = (Entry*) res;
+
+ if (res==LB_ERR || !sub || sub->level<=entry->level)
+ break;
+
+ ListBox_DeleteString(child->left.hwnd, idx+1);
+ }
+
+ /* empty right pane */
+ ListBox_ResetContent(child->right.hwnd);
+
+ /* release memory */
+ free_entries(entry);
+
+ /* read contents from disk */
+#ifdef _SHELL_FOLDERS
+ if (entry->etype == ET_SHELL)
+ {
+ read_directory(entry, NULL, child->sortOrder, hwnd);
+ }
+ else
+#endif
+ {
+ get_path(entry, path);
+ read_directory(entry, path, child->sortOrder, hwnd);
+ }
+
+ /* insert found entries in right pane */
+ insert_entries(&child->right, entry->down, child->filter_pattern, child->filter_flags, -1);
+ calc_widths(&child->right, FALSE);
+#ifndef _NO_EXTENSIONS
+ set_header(&child->right);
+#endif
+
+ child->header_wdths_ok = FALSE;
+
+ SetCursor(old_cursor);
+}
+
+
+/* expand a directory entry */
+
+static BOOL expand_entry(ChildWnd* child, Entry* dir)
+{
+ int idx;
+ Entry* p;
+
+ if (!dir || dir->expanded || !dir->down)
+ return FALSE;
+
+ p = dir->down;
+
+ if (p->data.cFileName[0]=='.' && p->data.cFileName[1]=='\0' && p->next) {
+ p = p->next;
+
+ if (p->data.cFileName[0]=='.' && p->data.cFileName[1]=='.' &&
+ p->data.cFileName[2]=='\0' && p->next)
+ p = p->next;
+ }
+
+ /* no subdirectories ? */
+ if (!(p->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
+ return FALSE;
+
+ idx = ListBox_FindItemData(child->left.hwnd, 0, dir);
+
+ dir->expanded = TRUE;
+
+ /* insert entries in left pane */
+ insert_entries(&child->left, p, NULL, TF_ALL, idx);
+
+ if (!child->header_wdths_ok) {
+ if (calc_widths(&child->left, FALSE)) {
+#ifndef _NO_EXTENSIONS
+ set_header(&child->left);
+#endif
+
+ child->header_wdths_ok = TRUE;
+ }
+ }
+
+ return TRUE;
+}
+
+
+static void collapse_entry(Pane* pane, Entry* dir)
+{
+ int idx = ListBox_FindItemData(pane->hwnd, 0, dir);
+
+ ShowWindow(pane->hwnd, SW_HIDE);
+
+ /* hide sub entries */
+ for(;;) {
+ LRESULT res = ListBox_GetItemData(pane->hwnd, idx+1);
+ Entry* sub = (Entry*) res;
+
+ if (res==LB_ERR || !sub || sub->level<=dir->level)
+ break;
+
+ ListBox_DeleteString(pane->hwnd, idx+1);
+ }
+
+ dir->expanded = FALSE;
+
+ ShowWindow(pane->hwnd, SW_SHOW);
+}
+
+
+static void refresh_right_pane(ChildWnd* child)
+{
+ ListBox_ResetContent(child->right.hwnd);
+ insert_entries(&child->right, child->right.root, child->filter_pattern, child->filter_flags, -1);
+ calc_widths(&child->right, FALSE);
+
+#ifndef _NO_EXTENSIONS
+ set_header(&child->right);
+#endif
+}
+
+static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd)
+{
+ TCHAR path[MAX_PATH];
+
+ if (!entry)
+ return;
+
+ path[0] = '\0';
+
+ child->left.cur = entry;
+
+ child->right.root = entry->down? entry->down: entry;
+ child->right.cur = entry;
+
+ if (!entry->scanned)
+ scan_entry(child, entry, idx, hwnd);
+ else
+ refresh_right_pane(child);
+
+ get_path(entry, path);
+ lstrcpy(child->path, path);
+
+ if (child->hwnd) /* only change window title, if the window already exists */
+ SetWindowText(child->hwnd, path);
+
+ if (path[0])
+ if (SetCurrentDirectory(path))
+ set_space_status();
+}
+
+
+static void refresh_child(ChildWnd* child)
+{
+ TCHAR path[MAX_PATH], drv[_MAX_DRIVE+1];
+ Entry* entry;
+ int idx;
+
+ get_path(child->left.cur, path);
+ _tsplitpath(path, drv, NULL, NULL, NULL);
+
+ child->right.root = NULL;
+
+ scan_entry(child, &child->root.entry, 0, child->hwnd);
+
+#ifdef _SHELL_FOLDERS
+ if (child->root.entry.etype == ET_SHELL)
+ entry = read_tree(&child->root, NULL, get_path_pidl(path,child->hwnd), drv, child->sortOrder, child->hwnd);
+ else
+#endif
+ entry = read_tree(&child->root, path, NULL, drv, child->sortOrder, child->hwnd);
+
+ if (!entry)
+ entry = &child->root.entry;
+
+ insert_entries(&child->left, child->root.entry.down, NULL, TF_ALL, 0);
+
+ set_curdir(child, entry, 0, child->hwnd);
+
+ idx = ListBox_FindItemData(child->left.hwnd, 0, child->left.cur);
+ ListBox_SetCurSel(child->left.hwnd, idx);
+}
+
+
+static void create_drive_bar(void)
+{
+ TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0};
+#ifndef _NO_EXTENSIONS
+ TCHAR b1[BUFFER_LEN];
+#endif
+ int btn = 1;
+ PTSTR p;
+
+ GetLogicalDriveStrings(BUFFER_LEN, Globals.drives);
+
+ Globals.hdrivebar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
+ IDW_DRIVEBAR, 2, Globals.hInstance, IDB_DRIVEBAR, &drivebarBtn,
+ 0, 16, 13, 16, 13, sizeof(TBBUTTON));
+
+#ifndef _NO_EXTENSIONS
+#ifdef __WINE__
+ /* insert unix file system button */
+ b1[0] = '/';
+ b1[1] = '\0';
+ b1[2] = '\0';
+ SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
+
+ drivebarBtn.idCommand = ID_DRIVE_UNIX_FS;
+ SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
+ drivebarBtn.iString++;
+#endif
+#ifdef _SHELL_FOLDERS
+ /* insert shell namespace button */
+ load_string(b1, IDS_SHELL);
+ b1[lstrlen(b1)+1] = '\0';
+ SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
+
+ drivebarBtn.idCommand = ID_DRIVE_SHELL_NS;
+ SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
+ drivebarBtn.iString++;
+#endif
+
+ /* register windows drive root strings */
+ SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)Globals.drives);
+#endif
+
+ drivebarBtn.idCommand = ID_DRIVE_FIRST;
+
+ for(p=Globals.drives; *p; ) {
+#ifdef _NO_EXTENSIONS
+ /* insert drive letter */
+ TCHAR b[3] = {tolower(*p)};
+ SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b);
+#endif
+ switch(GetDriveType(p)) {
+ case DRIVE_REMOVABLE: drivebarBtn.iBitmap = 1; break;
+ case DRIVE_CDROM: drivebarBtn.iBitmap = 3; break;
+ case DRIVE_REMOTE: drivebarBtn.iBitmap = 4; break;
+ case DRIVE_RAMDISK: drivebarBtn.iBitmap = 5; break;
+ default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
+ }
+
+ SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
+ drivebarBtn.idCommand++;
+ drivebarBtn.iString++;
+
+ while(*p++);
+ }
+}
+
+static void refresh_drives(void)
+{
+ RECT rect;
+
+ /* destroy drive bar */
+ DestroyWindow(Globals.hdrivebar);
+ Globals.hdrivebar = 0;
+
+ /* re-create drive bar */
+ create_drive_bar();
+
+ /* update window layout */
+ GetClientRect(Globals.hMainWnd, &rect);
+ SendMessage(Globals.hMainWnd, WM_SIZE, 0, MAKELONG(rect.right, rect.bottom));
+}
+
+
+static BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
+{
+ HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow);
+
+ if ((int)hinst <= 32) {
+ display_error(hwnd, GetLastError());
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+static BOOL launch_entry(Entry* entry, HWND hwnd, UINT nCmdShow)
+{
+ TCHAR cmd[MAX_PATH];
+
+#ifdef _SHELL_FOLDERS
+ if (entry->etype == ET_SHELL) {
+ BOOL ret = TRUE;
+
+ SHELLEXECUTEINFO shexinfo;
+
+ shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
+ shexinfo.fMask = SEE_MASK_IDLIST;
+ shexinfo.hwnd = hwnd;
+ shexinfo.lpVerb = NULL;
+ shexinfo.lpFile = NULL;
+ shexinfo.lpParameters = NULL;
+ shexinfo.lpDirectory = NULL;
+ shexinfo.nShow = nCmdShow;
+ shexinfo.lpIDList = get_to_absolute_pidl(entry, hwnd);
+
+ if (!ShellExecuteEx(&shexinfo)) {
+ display_error(hwnd, GetLastError());
+ ret = FALSE;
+ }
+
+ if (shexinfo.lpIDList != entry->pidl)
+ IMalloc_Free(Globals.iMalloc, shexinfo.lpIDList);
+
+ return ret;
+ }
+#endif
+
+ get_path(entry, cmd);
+
+ /* start program, open document... */
+ return launch_file(hwnd, cmd, nCmdShow);
+}
+
+
+static void activate_entry(ChildWnd* child, Pane* pane, HWND hwnd)
+{
+ Entry* entry = pane->cur;
+
+ if (!entry)
+ return;
+
+ if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ int scanned_old = entry->scanned;
+
+ if (!scanned_old)
+ scan_entry(child, entry, ListBox_GetCurSel(child->left.hwnd), hwnd);
+
+#ifndef _NO_EXTENSIONS
+ if (entry->data.cFileName[0]=='.' && entry->data.cFileName[1]=='\0')
+ return;
+#endif
+
+ if (entry->data.cFileName[0]=='.' && entry->data.cFileName[1]=='.' && entry->data.cFileName[2]=='\0') {
+ entry = child->left.cur->up;
+ collapse_entry(&child->left, entry);
+ goto focus_entry;
+ } else if (entry->expanded)
+ collapse_entry(pane, child->left.cur);
+ else {
+ expand_entry(child, child->left.cur);
+
+ if (!pane->treePane) focus_entry: {
+ int idx = ListBox_FindItemData(child->left.hwnd, ListBox_GetCurSel(child->left.hwnd), entry);
+ ListBox_SetCurSel(child->left.hwnd, idx);
+ set_curdir(child, entry, idx, hwnd);
+ }
+ }
+
+ if (!scanned_old) {
+ calc_widths(pane, FALSE);
+
+#ifndef _NO_EXTENSIONS
+ set_header(pane);
+#endif
+ }
+ } else {
+ if (GetKeyState(VK_MENU) < 0)
+ show_properties_dlg(entry, child->hwnd);
+ else
+ launch_entry(entry, child->hwnd, SW_SHOWNORMAL);
+ }
+}
+
+
+static BOOL pane_command(Pane* pane, UINT cmd)
+{
+ switch(cmd) {
+ case ID_VIEW_NAME:
+ if (pane->visible_cols) {
+ pane->visible_cols = 0;
+ calc_widths(pane, TRUE);
+#ifndef _NO_EXTENSIONS
+ set_header(pane);
+#endif
+ InvalidateRect(pane->hwnd, 0, TRUE);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND|MF_CHECKED);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
+ }
+ break;
+
+ case ID_VIEW_ALL_ATTRIBUTES:
+ if (pane->visible_cols != COL_ALL) {
+ pane->visible_cols = COL_ALL;
+ calc_widths(pane, TRUE);
+#ifndef _NO_EXTENSIONS
+ set_header(pane);
+#endif
+ InvalidateRect(pane->hwnd, 0, TRUE);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND|MF_CHECKED);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
+ }
+ break;
+
+#ifndef _NO_EXTENSIONS
+ case ID_PREFERRED_SIZES: {
+ calc_widths(pane, TRUE);
+ set_header(pane);
+ InvalidateRect(pane->hwnd, 0, TRUE);
+ break;}
+#endif
+
+ /* TODO: more command ids... */
+
+ default:
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+static void set_sort_order(ChildWnd* child, SORT_ORDER sortOrder)
+{
+ if (child->sortOrder != sortOrder) {
+ child->sortOrder = sortOrder;
+ refresh_child(child);
+ }
+}
+
+static void update_view_menu(ChildWnd* child)
+{
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_NAME, child->sortOrder==SORT_NAME? MF_CHECKED: MF_UNCHECKED);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_TYPE, child->sortOrder==SORT_EXT? MF_CHECKED: MF_UNCHECKED);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_SIZE, child->sortOrder==SORT_SIZE? MF_CHECKED: MF_UNCHECKED);
+ CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_DATE, child->sortOrder==SORT_DATE? MF_CHECKED: MF_UNCHECKED);
+}
+
+
+static BOOL is_directory(LPCTSTR target)
+{
+ /*TODO correctly handle UNIX paths */
+ DWORD target_attr = GetFileAttributes(target);
+
+ if (target_attr == INVALID_FILE_ATTRIBUTES)
+ return FALSE;
+
+ return target_attr&FILE_ATTRIBUTE_DIRECTORY? TRUE: FALSE;
+}
+
+static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target)
+{
+ TCHAR path[MAX_PATH];
+ int len;
+
+ get_path(pane->cur, path);
+
+ if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_SELECT_DESTINATION), pane->hwnd, DestinationDlgProc, (LPARAM)path) != IDOK)
+ return FALSE;
+
+ get_path(pane->cur, source);
+
+ /* convert relative targets to absolute paths */
+ if (path[0]!='/' && path[1]!=':') {
+ get_path(pane->cur->up, target);
+ len = lstrlen(target);
+
+ if (target[len-1]!='\\' && target[len-1]!='/')
+ target[len++] = '/';
+
+ lstrcpy(target+len, path);
+ } else
+ lstrcpy(target, path);
+
+ /* If the target already exists as directory, create a new target below this. */
+ if (is_directory(path)) {
+ TCHAR fname[_MAX_FNAME], ext[_MAX_EXT];
+ const static TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'};
+
+ _tsplitpath(source, NULL, NULL, fname, ext);
+
+ wsprintf(target, sAppend, path, fname, ext);
+ }
+
+ return TRUE;
+}
+
+
+static IContextMenu2* s_pctxmenu2 = NULL;
+
+#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
+static IContextMenu3* s_pctxmenu3 = NULL;
+#endif
+
+static void CtxMenu_reset(void)
+{
+ s_pctxmenu2 = NULL;
+
+#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
+ s_pctxmenu3 = NULL;
+#endif
+}
+
+static IContextMenu* CtxMenu_query_interfaces(IContextMenu* pcm1)
+{
+ IContextMenu* pcm = NULL;
+
+ CtxMenu_reset();
+
+#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
+ if (IUnknown_QueryInterface(pcm1, &IID_IContextMenu3, (void**)&pcm) == NOERROR)
+ s_pctxmenu3 = (LPCONTEXTMENU3)pcm;
+ else
+#endif
+ if (IUnknown_QueryInterface(pcm1, &IID_IContextMenu2, (void**)&pcm) == NOERROR)
+ s_pctxmenu2 = (LPCONTEXTMENU2)pcm;
+
+ if (pcm) {
+ IUnknown_Release(pcm1);
+ return pcm;
+ } else
+ return pcm1;
+}
+
+static BOOL CtxMenu_HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
+ if (s_pctxmenu3) {
+ if (SUCCEEDED((*s_pctxmenu3->lpVtbl->HandleMenuMsg)(s_pctxmenu3, nmsg, wparam, lparam)))
+ return TRUE;
+ }
+#endif
+
+ if (s_pctxmenu2)
+ if (SUCCEEDED((*s_pctxmenu2->lpVtbl->HandleMenuMsg)(s_pctxmenu2, nmsg, wparam, lparam)))
+ return TRUE;
+
+ return FALSE;
+}
+
+
+static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST* apidl, int x, int y)
+{
+ IContextMenu* pcm;
+ BOOL executed = FALSE;
+
+ HRESULT hr = IShellFolder_GetUIObjectOf(shell_folder, hwndParent, cidl, apidl, &IID_IContextMenu, NULL, (LPVOID*)&pcm);
+/* HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm); */
+
+ if (SUCCEEDED(hr)) {
+ HMENU hmenu = CreatePopupMenu();
+
+ pcm = CtxMenu_query_interfaces(pcm);
+
+ if (hmenu) {
+ hr = (*pcm->lpVtbl->QueryContextMenu)(pcm, hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
+
+ if (SUCCEEDED(hr)) {
+ UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
+
+ CtxMenu_reset();
+
+ if (idCmd) {
+ CMINVOKECOMMANDINFO cmi;
+
+ cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
+ cmi.fMask = 0;
+ cmi.hwnd = hwndParent;
+ cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
+ cmi.lpParameters = NULL;
+ cmi.lpDirectory = NULL;
+ cmi.nShow = SW_SHOWNORMAL;
+ cmi.dwHotKey = 0;
+ cmi.hIcon = 0;
+
+ hr = (*pcm->lpVtbl->InvokeCommand)(pcm, &cmi);
+ executed = TRUE;
+ }
+ } else
+ CtxMenu_reset();
+ }
+
+ IUnknown_Release(pcm);
+ }
+
+ return FAILED(hr)? hr: executed? S_OK: S_FALSE;
+}
+
+
+static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+ ChildWnd* child = (ChildWnd*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ ASSERT(child);
+
+ switch(nmsg) {
+ case WM_DRAWITEM: {
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lparam;
+ Entry* entry = (Entry*) dis->itemData;
+
+ if (dis->CtlID == IDW_TREE_LEFT)
+ draw_item(&child->left, dis, entry, -1);
+ else if (dis->CtlID == IDW_TREE_RIGHT)
+ draw_item(&child->right, dis, entry, -1);
+ else
+ goto draw_menu_item;
+
+ return TRUE;}
+
+ case WM_CREATE:
+ InitChildWindow(child);
+ break;
+
+ case WM_NCDESTROY:
+ free_child_window(child);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
+ break;
+
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ HBRUSH lastBrush;
+ RECT rt;
+ GetClientRect(hwnd, &rt);
+ BeginPaint(hwnd, &ps);
+ rt.left = child->split_pos-SPLIT_WIDTH/2;
+ rt.right = child->split_pos+SPLIT_WIDTH/2+1;
+ lastBrush = SelectBrush(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
+ Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
+ SelectObject(ps.hdc, lastBrush);
+#ifdef _NO_EXTENSIONS
+ rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
+ FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
+#endif
+ EndPaint(hwnd, &ps);
+ break;}
+
+ case WM_SETCURSOR:
+ if (LOWORD(lparam) == HTCLIENT) {
+ POINT pt;
+ GetCursorPos(&pt);
+ ScreenToClient(hwnd, &pt);
+
+ if (pt.x>=child->split_pos-SPLIT_WIDTH/2 && pt.x<child->split_pos+SPLIT_WIDTH/2+1) {
+ SetCursor(LoadCursor(0, IDC_SIZEWE));
+ return TRUE;
+ }
+ }
+ goto def;
+
+ case WM_LBUTTONDOWN: {
+ RECT rt;
+ int x = GET_X_LPARAM(lparam);
+
+ GetClientRect(hwnd, &rt);
+
+ if (x>=child->split_pos-SPLIT_WIDTH/2 && x<child->split_pos+SPLIT_WIDTH/2+1) {
+ last_split = child->split_pos;
+#ifdef _NO_EXTENSIONS
+ draw_splitbar(hwnd, last_split);
+#endif
+ SetCapture(hwnd);
+ }
+
+ break;}
+
+ case WM_LBUTTONUP:
+ if (GetCapture() == hwnd) {
+#ifdef _NO_EXTENSIONS
+ RECT rt;
+ int x = LOWORD(lparam);
+ draw_splitbar(hwnd, last_split);
+ last_split = -1;
+ GetClientRect(hwnd, &rt);
+ child->split_pos = x;
+ resize_tree(child, rt.right, rt.bottom);
+#endif
+ ReleaseCapture();
+ }
+ break;
+
+#ifdef _NO_EXTENSIONS
+ case WM_CAPTURECHANGED:
+ if (GetCapture()==hwnd && last_split>=0)
+ draw_splitbar(hwnd, last_split);
+ break;
+#endif
+
+ case WM_KEYDOWN:
+ if (wparam == VK_ESCAPE)
+ if (GetCapture() == hwnd) {
+ RECT rt;
+#ifdef _NO_EXTENSIONS
+ draw_splitbar(hwnd, last_split);
+#else
+ child->split_pos = last_split;
+#endif
+ GetClientRect(hwnd, &rt);
+ resize_tree(child, rt.right, rt.bottom);
+ last_split = -1;
+ ReleaseCapture();
+ SetCursor(LoadCursor(0, IDC_ARROW));
+ }
+ break;
+
+ case WM_MOUSEMOVE:
+ if (GetCapture() == hwnd) {
+ RECT rt;
+ int x = LOWORD(lparam);
+
+#ifdef _NO_EXTENSIONS
+ HDC hdc = GetDC(hwnd);
+ GetClientRect(hwnd, &rt);
+
+ rt.left = last_split-SPLIT_WIDTH/2;
+ rt.right = last_split+SPLIT_WIDTH/2+1;
+ InvertRect(hdc, &rt);
+
+ last_split = x;
+ rt.left = x-SPLIT_WIDTH/2;
+ rt.right = x+SPLIT_WIDTH/2+1;
+ InvertRect(hdc, &rt);
+
+ ReleaseDC(hwnd, hdc);
+#else
+ GetClientRect(hwnd, &rt);
+
+ if (x>=0 && x<rt.right) {
+ child->split_pos = x;
+ resize_tree(child, rt.right, rt.bottom);
+ rt.left = x-SPLIT_WIDTH/2;
+ rt.right = x+SPLIT_WIDTH/2+1;
+ InvalidateRect(hwnd, &rt, FALSE);
+ UpdateWindow(child->left.hwnd);
+ UpdateWindow(hwnd);
+ UpdateWindow(child->right.hwnd);
+ }
+#endif
+ }
+ break;
+
+#ifndef _NO_EXTENSIONS
+ case WM_GETMINMAXINFO:
+ DefMDIChildProc(hwnd, nmsg, wparam, lparam);
+
+ {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;}
+#endif /* _NO_EXTENSIONS */
+
+ case WM_SETFOCUS:
+ if (SetCurrentDirectory(child->path))
+ set_space_status();
+ SetFocus(child->focus_pane? child->right.hwnd: child->left.hwnd);
+ break;
+
+ case WM_DISPATCH_COMMAND: {
+ Pane* pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
+
+ switch(LOWORD(wparam)) {
+ case ID_WINDOW_NEW: {
+ ChildWnd* new_child = alloc_child_window(child->path, NULL, hwnd);
+
+ if (!create_child_window(new_child))
+ free(new_child);
+
+ break;}
+
+ case ID_REFRESH:
+ refresh_drives();
+ refresh_child(child);
+ break;
+
+ case ID_ACTIVATE:
+ activate_entry(child, pane, hwnd);
+ break;
+
+ case ID_FILE_MOVE: {
+ TCHAR source[BUFFER_LEN], target[BUFFER_LEN];
+
+ if (prompt_target(pane, source, target)) {
+ SHFILEOPSTRUCT shfo = {hwnd, FO_MOVE, source, target};
+
+ source[lstrlen(source)+1] = '\0';
+ target[lstrlen(target)+1] = '\0';
+
+ if (!SHFileOperation(&shfo))
+ refresh_child(child);
+ }
+ break;}
+
+ case ID_FILE_COPY: {
+ TCHAR source[BUFFER_LEN], target[BUFFER_LEN];
+
+ if (prompt_target(pane, source, target)) {
+ SHFILEOPSTRUCT shfo = {hwnd, FO_COPY, source, target};
+
+ source[lstrlen(source)+1] = '\0';
+ target[lstrlen(target)+1] = '\0';
+
+ if (!SHFileOperation(&shfo))
+ refresh_child(child);
+ }
+ break;}
+
+ case ID_FILE_DELETE: {
+ TCHAR path[BUFFER_LEN];
+ SHFILEOPSTRUCT shfo = {hwnd, FO_DELETE, path};
+
+ get_path(pane->cur, path);
+
+ path[lstrlen(path)+1] = '\0';
+
+ if (!SHFileOperation(&shfo))
+ refresh_child(child);
+ break;}
+
+ case ID_VIEW_SORT_NAME:
+ set_sort_order(child, SORT_NAME);
+ break;
+
+ case ID_VIEW_SORT_TYPE:
+ set_sort_order(child, SORT_EXT);
+ break;
+
+ case ID_VIEW_SORT_SIZE:
+ set_sort_order(child, SORT_SIZE);
+ break;
+
+ case ID_VIEW_SORT_DATE:
+ set_sort_order(child, SORT_DATE);
+ break;
+
+ case ID_VIEW_FILTER: {
+ struct FilterDialog dlg;
+
+ memset(&dlg, 0, sizeof(struct FilterDialog));
+ lstrcpy(dlg.pattern, child->filter_pattern);
+ dlg.flags = child->filter_flags;
+
+ if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_VIEW_TYPE), hwnd, FilterDialogDlgProc, (LPARAM)&dlg) == IDOK) {
+ lstrcpy(child->filter_pattern, dlg.pattern);
+ child->filter_flags = dlg.flags;
+ refresh_right_pane(child);
+ }
+ break;}
+
+ case ID_VIEW_SPLIT: {
+ last_split = child->split_pos;
+#ifdef _NO_EXTENSIONS
+ draw_splitbar(hwnd, last_split);
+#endif
+ SetCapture(hwnd);
+ break;}
+
+ case ID_EDIT_PROPERTIES:
+ show_properties_dlg(pane->cur, child->hwnd);
+ break;
+
+ default:
+ return pane_command(pane, LOWORD(wparam));
+ }
+
+ return TRUE;}
+
+ case WM_COMMAND: {
+ Pane* pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
+
+ switch(HIWORD(wparam)) {
+ case LBN_SELCHANGE: {
+ int idx = ListBox_GetCurSel(pane->hwnd);
+ Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, idx);
+
+ if (pane == &child->left)
+ set_curdir(child, entry, idx, hwnd);
+ else
+ pane->cur = entry;
+ break;}
+
+ case LBN_DBLCLK:
+ activate_entry(child, pane, hwnd);
+ break;
+ }
+ break;}
+
+#ifndef _NO_EXTENSIONS
+ case WM_NOTIFY: {
+ NMHDR* pnmh = (NMHDR*) lparam;
+ return pane_notify(pnmh->idFrom==IDW_HEADER_LEFT? &child->left: &child->right, pnmh);}
+#endif
+
+#ifdef _SHELL_FOLDERS
+ case WM_CONTEXTMENU: {
+ POINT pt, pt_clnt;
+ Pane* pane;
+ int idx;
+
+ /* first select the current item in the listbox */
+ HWND hpanel = (HWND) wparam;
+ pt_clnt.x = pt.x = (short)LOWORD(lparam);
+ pt_clnt.y = pt.y = (short)HIWORD(lparam);
+ ScreenToClient(hpanel, &pt_clnt);
+ SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
+ SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
+
+ /* now create the popup menu using shell namespace and IContextMenu */
+ pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
+ idx = ListBox_GetCurSel(pane->hwnd);
+
+ if (idx != -1) {
+ Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, idx);
+
+ LPITEMIDLIST pidl_abs = get_to_absolute_pidl(entry, hwnd);
+
+ if (pidl_abs) {
+ IShellFolder* parentFolder;
+ LPCITEMIDLIST pidlLast;
+
+ /* get and use the parent folder to display correct context menu in all cases */
+ if (SUCCEEDED(SHBindToParent(pidl_abs, &IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) {
+ if (ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pt.x, pt.y) == S_OK)
+ refresh_child(child);
+
+ IShellFolder_Release(parentFolder);
+ }
+
+ IMalloc_Free(Globals.iMalloc, pidl_abs);
+ }
+ }
+ break;}
+#endif
+
+ case WM_MEASUREITEM:
+ draw_menu_item:
+ if (!wparam) /* Is the message menu-related? */
+ if (CtxMenu_HandleMenuMsg(nmsg, wparam, lparam))
+ return TRUE;
+
+ break;
+
+ case WM_INITMENUPOPUP:
+ if (CtxMenu_HandleMenuMsg(nmsg, wparam, lparam))
+ return 0;
+
+ update_view_menu(child);
+ break;
+
+#ifndef __MINGW32__ /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
+ case WM_MENUCHAR: /* only supported by IContextMenu3 */
+ if (s_pctxmenu3) {
+ LRESULT lResult = 0;
+
+ (*s_pctxmenu3->lpVtbl->HandleMenuMsg2)(s_pctxmenu3, nmsg, wparam, lparam, &lResult);
+
+ return lResult;
+ }
+
+ break;
+#endif
+
+ case WM_SIZE:
+ if (wparam != SIZE_MINIMIZED)
+ resize_tree(child, LOWORD(lparam), HIWORD(lparam));
+ /* fall through */
+
+ default: def:
+ return DefMDIChildProc(hwnd, nmsg, wparam, lparam);
+ }
+
+ return 0;
+}
+
+
+static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
+{
+ ChildWnd* child = (ChildWnd*) GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
+ Pane* pane = (Pane*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ ASSERT(child);
+
+ switch(nmsg) {
+#ifndef _NO_EXTENSIONS
+ case WM_HSCROLL:
+ set_header(pane);
+ break;
+#endif
+
+ case WM_SETFOCUS:
+ child->focus_pane = pane==&child->right? 1: 0;
+ ListBox_SetSel(hwnd, TRUE, 1);
+ /*TODO: check menu items */
+ break;
+
+ case WM_KEYDOWN:
+ if (wparam == VK_TAB) {
+ /*TODO: SetFocus(Globals.hdrivebar) */
+ SetFocus(child->focus_pane? child->left.hwnd: child->right.hwnd);
+ }
+ }
+
+ return CallWindowProc(g_orgTreeWndProc, hwnd, nmsg, wparam, lparam);
+}
+
+
+static void InitInstance(HINSTANCE hinstance)
+{
+ const static TCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
+
+ WNDCLASSEX wcFrame;
+ WNDCLASS wcChild;
+ ATOM hChildClass;
+ int col;
+
+ INITCOMMONCONTROLSEX icc = {
+ sizeof(INITCOMMONCONTROLSEX),
+ ICC_BAR_CLASSES
+ };
+
+ HDC hdc = GetDC(0);
+
+ setlocale(LC_COLLATE, ""); /* set collating rules to local settings for compareName */
+
+ InitCommonControlsEx(&icc);
+
+
+ /* register frame window class */
+
+ wcFrame.cbSize = sizeof(WNDCLASSEX);
+ wcFrame.style = 0;
+ wcFrame.lpfnWndProc = FrameWndProc;
+ wcFrame.cbClsExtra = 0;
+ wcFrame.cbWndExtra = 0;
+ wcFrame.hInstance = hinstance;
+ wcFrame.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_WINEFILE));
+ wcFrame.hCursor = LoadCursor(0, IDC_ARROW);
+ wcFrame.hbrBackground = 0;
+ wcFrame.lpszMenuName = 0;
+ wcFrame.lpszClassName = sWINEFILEFRAME;
+ wcFrame.hIconSm = (HICON)LoadImage(hinstance,
+ MAKEINTRESOURCE(IDI_WINEFILE),
+ IMAGE_ICON,
+ GetSystemMetrics(SM_CXSMICON),
+ GetSystemMetrics(SM_CYSMICON),
+ LR_SHARED);
+
+ Globals.hframeClass = RegisterClassEx(&wcFrame);
+
+
+ /* register tree windows class */
+
+ wcChild.style = CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW;
+ wcChild.lpfnWndProc = ChildWndProc;
+ wcChild.cbClsExtra = 0;
+ wcChild.cbWndExtra = 0;
+ wcChild.hInstance = hinstance;
+ wcChild.hIcon = 0;
+ wcChild.hCursor = LoadCursor(0, IDC_ARROW);
+ wcChild.hbrBackground = 0;
+ wcChild.lpszMenuName = 0;
+ wcChild.lpszClassName = sWINEFILETREE;
+
+ hChildClass = RegisterClass(&wcChild);
+
+
+ Globals.haccel = LoadAccelerators(hinstance, MAKEINTRESOURCE(IDA_WINEFILE));
+
+ Globals.hfont = CreateFont(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sFont);
+
+ ReleaseDC(0, hdc);
+
+ Globals.hInstance = hinstance;
+
+#ifdef _SHELL_FOLDERS
+ CoInitialize(NULL);
+ CoGetMalloc(MEMCTX_TASK, &Globals.iMalloc);
+ SHGetDesktopFolder(&Globals.iDesktop);
+#ifdef __WINE__
+ Globals.cfStrFName = RegisterClipboardFormatA(CFSTR_FILENAME);
+#else
+ Globals.cfStrFName = RegisterClipboardFormat(CFSTR_FILENAME);
+#endif
+#endif
+
+ /* load column strings */
+ col = 1;
+
+ load_string(g_pos_names[col++], IDS_COL_NAME);
+ load_string(g_pos_names[col++], IDS_COL_SIZE);
+ load_string(g_pos_names[col++], IDS_COL_CDATE);
+#ifndef _NO_EXTENSIONS
+ load_string(g_pos_names[col++], IDS_COL_ADATE);
+ load_string(g_pos_names[col++], IDS_COL_MDATE);
+ load_string(g_pos_names[col++], IDS_COL_IDX);
+ load_string(g_pos_names[col++], IDS_COL_LINKS);
+#endif
+ load_string(g_pos_names[col++], IDS_COL_ATTR);
+#ifndef _NO_EXTENSIONS
+ load_string(g_pos_names[col++], IDS_COL_SEC);
+#endif
+}
+
+
+static void show_frame(HWND hwndParent, int cmdshow, LPCTSTR path)
+{
+ const static TCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'};
+
+ TCHAR buffer[MAX_PATH], b1[BUFFER_LEN];
+ ChildWnd* child;
+ HMENU hMenuFrame, hMenuWindow;
+
+ CLIENTCREATESTRUCT ccs;
+
+ if (Globals.hMainWnd)
+ return;
+
+ hMenuFrame = LoadMenu(Globals.hInstance, MAKEINTRESOURCE(IDM_WINEFILE));
+ hMenuWindow = GetSubMenu(hMenuFrame, GetMenuItemCount(hMenuFrame)-2);
+
+ Globals.hMenuFrame = hMenuFrame;
+ Globals.hMenuView = GetSubMenu(hMenuFrame, 3);
+ Globals.hMenuOptions = GetSubMenu(hMenuFrame, 4);
+
+ ccs.hWindowMenu = hMenuWindow;
+ ccs.idFirstChild = IDW_FIRST_CHILD;
+
+
+ /* create main window */
+ Globals.hMainWnd = CreateWindowEx(0, (LPCTSTR)(int)Globals.hframeClass, RS(b1,IDS_WINE_FILE), WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+ hwndParent, Globals.hMenuFrame, Globals.hInstance, 0/*lpParam*/);
+
+
+ Globals.hmdiclient = CreateWindowEx(0, sMDICLIENT, NULL,
+ WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
+ 0, 0, 0, 0,
+ Globals.hMainWnd, 0, Globals.hInstance, &ccs);
+
+
+ CheckMenuItem(Globals.hMenuOptions, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
+
+ create_drive_bar();
+
+ {
+ TBBUTTON toolbarBtns[] = {
+ {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
+ {0, ID_WINDOW_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+ {1, ID_WINDOW_CASCADE, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+ {2, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+ {3, ID_WINDOW_TILE_VERT, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+/*TODO
+ {4, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+ {5, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+*/ };
+
+ Globals.htoolbar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE,
+ IDW_TOOLBAR, 2, Globals.hInstance, IDB_TOOLBAR, toolbarBtns,
+ sizeof(toolbarBtns)/sizeof(TBBUTTON), 16, 15, 16, 15, sizeof(TBBUTTON));
+ CheckMenuItem(Globals.hMenuOptions, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED);
+ }
+
+ Globals.hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, Globals.hMainWnd, IDW_STATUSBAR);
+ CheckMenuItem(Globals.hMenuOptions, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
+
+/* CreateStatusWindow does not accept WS_BORDER
+ Globals.hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0,
+ WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0,
+ Globals.hMainWnd, (HMENU)IDW_STATUSBAR, hinstance, 0);*/
+
+ /*TODO: read paths and window placements from registry */
+
+ if (!path || !*path) {
+ GetCurrentDirectory(MAX_PATH, buffer);
+ path = buffer;
+ }
+
+ ShowWindow(Globals.hMainWnd, cmdshow);
+
+//#if defined(_SHELL_FOLDERS) && !defined(__WINE__)
+// // Shell Namespace as default:
+// child = alloc_child_window(path, get_path_pidl(path,Globals.hMainWnd), Globals.hMainWnd);
+//#else
+ child = alloc_child_window(path, NULL, Globals.hMainWnd);
+//#endif
+
+ child->pos.showCmd = SW_SHOWMAXIMIZED;
+ child->pos.rcNormalPosition.left = 0;
+ child->pos.rcNormalPosition.top = 0;
+ child->pos.rcNormalPosition.right = 320;
+ child->pos.rcNormalPosition.bottom = 280;
+
+ if (!create_child_window(child))
+ free(child);
+
+ SetWindowPlacement(child->hwnd, &child->pos);
+
+ Globals.himl = ImageList_LoadBitmap(Globals.hInstance, MAKEINTRESOURCE(IDB_IMAGES), 16, 0, RGB(0,255,0));
+
+ Globals.prescan_node = FALSE;
+
+ UpdateWindow(Globals.hMainWnd);
+}
+
+static void ExitInstance(void)
+{
+#ifdef _SHELL_FOLDERS
+ IShellFolder_Release(Globals.iDesktop);
+ IMalloc_Release(Globals.iMalloc);
+ CoUninitialize();
+#endif
+
+ DeleteObject(Globals.hfont);
+ ImageList_Destroy(Globals.himl);
+}
+
+#ifdef _NO_EXTENSIONS
+
+/* search for already running win[e]files */
+
+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 */
+static int find_window_class(LPCTSTR classname)
+{
+ EnumWindows(EnumWndProc, (LPARAM)classname);
+
+ if (g_foundPrevInstance)
+ return 1;
+
+ return 0;
+}
+
+#endif
+
+static int winefile_main(HINSTANCE hinstance, int cmdshow, LPCTSTR path)
+{
+ MSG msg;
+
+ InitInstance(hinstance);
+
+ if (cmdshow == SW_SHOWNORMAL)
+ /*TODO: read window placement from registry */
+ cmdshow = SW_MAXIMIZE;
+
+ show_frame(0, cmdshow, path);
+
+ while(GetMessage(&msg, 0, 0, 0)) {
+ if (Globals.hmdiclient && TranslateMDISysAccel(Globals.hmdiclient, &msg))
+ continue;
+
+ if (Globals.hMainWnd && TranslateAccelerator(Globals.hMainWnd, Globals.haccel, &msg))
+ continue;
+
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ ExitInstance();
+
+ return msg.wParam;
+}
+
+
+#if defined(UNICODE) && defined(_MSC_VER)
+int APIENTRY wWinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPWSTR cmdline, int cmdshow)
+#else
+int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPSTR cmdline, int cmdshow)
+#endif
+{
+#ifdef _NO_EXTENSIONS
+ if (find_window_class(sWINEFILEFRAME))
+ return 1;
+#endif
+
+#if defined(UNICODE) && !defined(_MSC_VER)
+ { /* convert ANSI cmdline into WCS path string */
+ TCHAR buffer[MAX_PATH];
+ MultiByteToWideChar(CP_ACP, 0, cmdline, -1, buffer, MAX_PATH);
+ winefile_main(hinstance, cmdshow, buffer);
+ }
+#else
+ winefile_main(hinstance, cmdshow, cmdline);
+#endif
+
+ return 0;
+}
--- /dev/null
+# Microsoft Developer Studio Project File - Name="winefile" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Application" 0x0101\r
+\r
+CFG=winefile - Win32 Unicode Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "winefile.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "winefile.mak" CFG="winefile - Win32 Unicode Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "winefile - Win32 Debug" (based on "Win32 (x86) Application")\r
+!MESSAGE "winefile - Win32 Unicode Debug" (based on "Win32 (x86) Application")\r
+!MESSAGE "winefile - Win32 UNICODE Release" (based on "Win32 (x86) Application")\r
+!MESSAGE "winefile - Win32 Release" (based on "Win32 (x86) Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+MTL=midl.exe\r
+RSC=rc.exe\r
+\r
+!IF "$(CFG)" == "winefile - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "winefileDebug"\r
+# PROP Intermediate_Dir "winefileDebug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D _WIN32_WINNT=0x0501 /FR /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x407 /d "_DEBUG"\r
+# ADD RSC /l 0x407 /i ".." /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:windows /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib ole32.lib version.lib mpr.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\r
+\r
+!ELSEIF "$(CFG)" == "winefile - Win32 Unicode Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Unicode Debug"\r
+# PROP BASE Intermediate_Dir "Unicode Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "winefileUDebug"\r
+# PROP Intermediate_Dir "winefileUDebug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D _WIN32_WINNT=0x0501 /FR /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x407 /d "_DEBUG"\r
+# ADD RSC /l 0x407 /i ".." /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:windows /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib ole32.lib version.lib mpr.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\r
+\r
+!ELSEIF "$(CFG)" == "winefile - Win32 UNICODE Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "winefile___Win32_UNICODE_Release"\r
+# PROP BASE Intermediate_Dir "winefile___Win32_UNICODE_Release"\r
+# PROP BASE Ignore_Export_Lib 0\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "winefileURelease"\r
+# PROP Intermediate_Dir "winefileURelease"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "UNICODE" /D _WIN32_WINNT=0x0501 /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x407 /d "NDEBUG"\r
+# ADD RSC /l 0x407 /i ".." /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib /nologo /subsystem:windows /machine:I386\r
+# ADD LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib ole32.lib version.lib mpr.lib /nologo /subsystem:windows /machine:I386\r
+\r
+!ELSEIF "$(CFG)" == "winefile - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "winefile___Win32_Release"\r
+# PROP BASE Intermediate_Dir "winefile___Win32_Release"\r
+# PROP BASE Ignore_Export_Lib 0\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "winefileRelease"\r
+# PROP Intermediate_Dir "winefileRelease"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "UNICODE" /D WINE_UNUSED= /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D _WIN32_WINNT=0x0501 /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x407 /d "NDEBUG"\r
+# ADD RSC /l 0x407 /i ".." /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib /nologo /subsystem:windows /machine:I386\r
+# ADD LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib ole32.lib version.lib mpr.lib /nologo /subsystem:windows /machine:I386 /out:"winefileRelease/winefile-ansi.exe"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "winefile - Win32 Debug"\r
+# Name "winefile - Win32 Unicode Debug"\r
+# Name "winefile - Win32 UNICODE Release"\r
+# Name "winefile - Win32 Release"\r
+# Begin Group "Resources"\r
+\r
+# PROP Default_Filter ""\r
+# Begin Source File\r
+\r
+SOURCE=.\cs.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\de.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\drivebar.bmp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\en.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\es.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\fr.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\hu.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\images.bmp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\it.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\nl.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\pl.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\pt.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\resource.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\ru.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\si.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\Sv.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\toolbar.bmp\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\winefile.ico\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\winefile.rc\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\zh.rc\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# End Group\r
+# Begin Source File\r
+\r
+SOURCE=.\license.c\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\resource.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\splitpath.c\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\winefile.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\winefile.h\r
+# End Source File\r
+# End Target\r
+# End Project\r
--- /dev/null
+Microsoft Developer Studio Workspace File, Format Version 6.00\r
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
+\r
+###############################################################################\r
+\r
+Project: "make_explorer"=.\make_winefile.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "winefile"=.\winefile.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Global:\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<3>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
--- /dev/null
+/*
+ * Copyright 2000, 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
+ */
+
+#define WIN32_LEAN_AND_MEAN
+#define WIN32_EXTRA_LEAN
+#define NOSERVICE
+#define NOMCX
+#define NOIME
+#define NOCOMM
+#define NOKANJI
+#define NORPC
+#define NOPROXYSTUB
+#define NOIMAGE
+#define NOTAPE
+
+#define NONAMELESSUNION
+#include <windows.h>
+#include <windowsx.h>
+#include <commctrl.h>
+#include <commdlg.h>
+
+#ifdef UNICODE
+#define _UNICODE
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <locale.h>
+#include <time.h>
+
+#ifndef __WINE__
+#include <malloc.h> /* for alloca() */
+
+ // ugly hack to use alloca() while keeping Wine's developers happy
+#define HeapAlloc(h,f,s) alloca(s)
+#define HeapFree(h,f,p)
+#endif
+
+#include <shellapi.h> /* for ShellExecute() */
+#include <shlobj.h> /* for SHFormatDrive() */
+
+#ifndef _NO_EXTENSIONS
+#define _SHELL_FOLDERS
+#endif /* _NO_EXTENSIONS */
+
+#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
+
+
+#ifdef _DEBUG
+#define ASSERT(x) {if (!(x)) DebugBreak();}
+#else
+#define ASSERT(x) /* nothing */
+#endif
+
+#define BUFFER_LEN 1024
+
+
+enum IMAGE {
+ IMG_NONE=-1, IMG_FILE=0, IMG_DOCUMENT, IMG_EXECUTABLE,
+ IMG_FOLDER, IMG_OPEN_FOLDER, IMG_FOLDER_PLUS,IMG_OPEN_PLUS, IMG_OPEN_MINUS,
+ IMG_FOLDER_UP, IMG_FOLDER_CUR
+};
+
+#define IMAGE_WIDTH 16
+#define IMAGE_HEIGHT 13
+#define SPLIT_WIDTH 5
+#define TREE_LINE_DX 3
+
+#define IDW_STATUSBAR 0x100
+#define IDW_TOOLBAR 0x101
+#define IDW_DRIVEBAR 0x102
+#define IDW_FIRST_CHILD 0xC000 /*0x200*/
+
+#define IDW_TREE_LEFT 3
+#define IDW_TREE_RIGHT 6
+#define IDW_HEADER_LEFT 2
+#define IDW_HEADER_RIGHT 5
+
+#define WM_DISPATCH_COMMAND 0xBF80
+
+#define COLOR_COMPRESSED RGB(0,0,255)
+#define COLOR_SELECTION RGB(0,0,128)
+#define COLOR_SELECTION_TXT RGB(255,255,255)
+
+#ifdef _NO_EXTENSIONS
+#define COLOR_SPLITBAR WHITE_BRUSH
+#else
+#define COLOR_SPLITBAR LTGRAY_BRUSH
+#endif
+
+#define FRM_CALC_CLIENT 0xBF83
+#define Frame_CalcFrameClient(hwnd, prt) ((BOOL)SNDMSG(hwnd, FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))
+
+
+typedef struct
+{
+ HANDLE hInstance;
+ HACCEL haccel;
+ ATOM hframeClass;
+
+ HWND hMainWnd;
+ HMENU hMenuFrame;
+ HMENU hWindowsMenu;
+ HMENU hLanguageMenu;
+ HMENU hMenuView;
+ HMENU hMenuOptions;
+ HWND hmdiclient;
+ HWND hstatusbar;
+ HWND htoolbar;
+ HWND hdrivebar;
+ HFONT hfont;
+
+ TCHAR num_sep;
+ SIZE spaceSize;
+ HIMAGELIST himl;
+
+ TCHAR drives[BUFFER_LEN];
+ BOOL prescan_node; /*TODO*/
+
+#ifdef _SHELL_FOLDERS
+ IShellFolder* iDesktop;
+ IMalloc* iMalloc;
+ UINT cfStrFName;
+#endif
+} WINEFILE_GLOBALS;
+
+extern WINEFILE_GLOBALS Globals;
+
+#ifdef __WINE__
+
+extern void WineLicense(HWND hwnd);
+extern void WineWarranty(HWND hwnd);
+
+
+#ifdef UNICODE
+extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
+#define _tsplitpath _wsplitpath
+#define _stprintf msvcrt_swprintf
+#else
+extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext);
+#define _tsplitpath _splitpath
+#define _stprintf sprintf
+#endif
+
+#else
+
+#include <tchar.h> /* for _tsplitpath() */
+
+#endif
--- /dev/null
+/*
+ * Copyright 2000 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
+ */
+
+#include "windows.h"
+#include "resource.h"
+
+/* define language neutral resources */
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#include "resource.rc"
+
+/* include localised resources */
+
+#include "en.rc"
+#include "cs.rc"
+#include "de.rc"
+#include "es.rc"
+#include "fr.rc"
+#include "hu.rc"
+#include "it.rc"
+#include "nl.rc"
+#include "pl.rc"
+#include "pt.rc"
+#include "ru.rc"
+#include "si.rc"
+#include "zh.rc"
+#include "Sv.rc"
+
--- /dev/null
+<module name="winefile" type="win32gui" installbase="system32" installname="winefile.exe" allowwarnings="true">
+ <include base="winefile">.</include>
+ <define name="UNICODE" />
+ <define name="__USE_W32API" />
+ <define name="_WIN32_IE">0x0501</define>
+ <define name="_WIN32_WINNT">0x0501</define>
+ <library>uuid</library>
+ <library>kernel32</library>
+ <library>gdi32</library>
+ <library>user32</library>
+ <library>comctl32</library>
+ <library>comdlg32</library>
+ <library>shell32</library>
+ <library>ole32</library>
+ <library>version</library>
+ <library>mpr</library>
+ <file>winefile.c</file>
+ <file>winefile.rc</file>
+</module>
--- /dev/null
+/*
+ * WineFile
+ * Simplified Chinese Language Support
+ *
+ * Copyright 2002 liuspider <liuspider@yahoo.com>
+ *
+ * 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
+}