Winefile: File Index

Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Search for

Winefile File List

Here is a list of all files with brief descriptions:
license.c [code]
resource.h [code]
splitpath.c [code]
winefile.c [code]
winefile.h [code]
Winefile Source Code Documentation
generated on 02.10.2005 by doxygen

Winefile Homepage


Winefile: license.c File Reference

license.c File Reference

#include "winefile.h"

Include dependency graph for license.c:

Go to the source code of this file.


Winefile: resource.h File Reference

resource.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define | IDB_TOOLBAR 100
#define | IDB_DRIVEBAR 101
#define | IDB_IMAGES 102
#define | IDI_WINEFILE 100
#define | IDA_WINEFILE 101
#define | IDM_WINEFILE 102
#define | IDD_EXECUTE 103
#define | IDD_SELECT_DESTINATION 104
#define | IDD_DIALOG_VIEW_TYPE 105
#define | IDD_DIALOG_PROPERTIES 106
#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
#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
#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
#define | ID_DRIVE_SHELL_NS 0x9001
#define | ID_DRIVE_FIRST 0x9002

Define Documentation

#define ID_ABOUT 1803

Definition at line 67 of file resource.h.

Referenced by FrameWndProc().

#define ID_ABOUT_WINE 0x8000

Definition at line 103 of file resource.h.

Referenced by FrameWndProc().

#define ID_ACTIVATE 101

Definition at line 44 of file resource.h.

Referenced by ChildWndProc().

#define ID_CONNECT_NETWORK_DRIVE 252

Definition at line 51 of file resource.h.

Referenced by FrameWndProc().

#define ID_DISCONNECT_NETWORK_DRIVE 253

Definition at line 52 of file resource.h.

Referenced by FrameWndProc().

#define ID_DRIVE_FIRST 0x9002

Definition at line 146 of file resource.h.

Referenced by create_drive_bar(), and FrameWndProc().

#define ID_DRIVE_SHELL_NS 0x9001

Definition at line 144 of file resource.h.

Referenced by create_drive_bar(), and FrameWndProc().

#define ID_EDIT_PROPERTIES 57656

Definition at line 69 of file resource.h.

Referenced by ChildWndProc().

#define ID_EXECUTE 105

Definition at line 45 of file resource.h.

Referenced by FrameWndProc().

#define ID_FILE_COPY 107

Definition at line 47 of file resource.h.

Referenced by ChildWndProc().

#define ID_FILE_DELETE 108

Definition at line 48 of file resource.h.

Referenced by ChildWndProc().

#define ID_FILE_EXIT 115

Definition at line 49 of file resource.h.

Referenced by FrameWndProc().

#define ID_FILE_MOVE 106

Definition at line 46 of file resource.h.

Referenced by ChildWndProc().

#define ID_FORMAT_DISK 203

Definition at line 50 of file resource.h.

Referenced by FrameWndProc().

#define ID_HELP 0xE146

Definition at line 77 of file resource.h.

Referenced by FrameWndProc().

#define ID_HELP_USING 0xE144

Definition at line 76 of file resource.h.

#define ID_LICENSE 0x8001

Definition at line 104 of file resource.h.

Referenced by FrameWndProc().

#define ID_NO_WARRANTY 0x8002

Definition at line 105 of file resource.h.

Referenced by FrameWndProc().

#define ID_PREFERRED_SIZES 0x8005

Definition at line 108 of file resource.h.

Referenced by pane_command().

#define ID_REFRESH 1704

Definition at line 68 of file resource.h.

Referenced by ChildWndProc(), and FrameWndProc().

#define ID_SELECT_FONT 510

Definition at line 62 of file resource.h.

Referenced by FrameWndProc().

#define ID_VIEW_ALL_ATTRIBUTES 402

Definition at line 54 of file resource.h.

Referenced by pane_command().

#define ID_VIEW_DRIVE_BAR 507

Definition at line 64 of file resource.h.

Referenced by FrameWndProc(), and show_frame().

#define ID_VIEW_FILTER 409

Definition at line 60 of file resource.h.

Referenced by ChildWndProc().

#define ID_VIEW_FULLSCREEN 0x8004

Definition at line 107 of file resource.h.

Referenced by FrameWndProc().

#define ID_VIEW_NAME 401

Definition at line 53 of file resource.h.

Referenced by pane_command().

#define ID_VIEW_SELECTED_ATTRIBUTES 403

Definition at line 55 of file resource.h.

Referenced by pane_command().

#define ID_VIEW_SORT_DATE 407

Definition at line 59 of file resource.h.

Referenced by ChildWndProc(), and update_view_menu().

#define ID_VIEW_SORT_NAME 404

Definition at line 56 of file resource.h.

Referenced by ChildWndProc(), and update_view_menu().

#define ID_VIEW_SORT_SIZE 406

Definition at line 58 of file resource.h.

Referenced by ChildWndProc(), and update_view_menu().

#define ID_VIEW_SORT_TYPE 405

Definition at line 57 of file resource.h.

Referenced by ChildWndProc(), and update_view_menu().

#define ID_VIEW_SPLIT 414

Definition at line 61 of file resource.h.

Referenced by ChildWndProc().

#define ID_VIEW_STATUSBAR 503

Definition at line 65 of file resource.h.

Referenced by FrameWndProc(), and show_frame().

#define ID_VIEW_TOOL_BAR 508

Definition at line 63 of file resource.h.

Referenced by FrameWndProc(), and show_frame().

#define ID_WINDOW_ARRANGE 0xE131

Definition at line 71 of file resource.h.

Referenced by FrameWndProc().

#define ID_WINDOW_AUTOSORT 0x8003

Definition at line 106 of file resource.h.

#define ID_WINDOW_CASCADE 0xE132

Definition at line 72 of file resource.h.

Referenced by FrameWndProc(), and show_frame().

#define ID_WINDOW_NEW 0xE130

Definition at line 70 of file resource.h.

Referenced by ChildWndProc(), FrameWndProc(), and show_frame().

#define ID_WINDOW_SPLIT 0xE135

Definition at line 75 of file resource.h.

#define ID_WINDOW_TILE_HORZ 0xE133

Definition at line 73 of file resource.h.

Referenced by FrameWndProc(), and show_frame().

#define ID_WINDOW_TILE_VERT 0xE134

Definition at line 74 of file resource.h.

Referenced by FrameWndProc(), and show_frame().

#define IDA_WINEFILE 101

Definition at line 30 of file resource.h.

Referenced by InitInstance().

#define IDB_DRIVEBAR 101

Definition at line 23 of file resource.h.

Referenced by create_drive_bar().

#define IDB_IMAGES 102

Definition at line 24 of file resource.h.

Referenced by show_frame().

#define IDB_TOOLBAR 100

Definition at line 22 of file resource.h.

Referenced by show_frame().

#define IDC_CHECK_ARCHIVE 1013

Definition at line 93 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_CHECK_COMPRESSED 1014

Definition at line 94 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_CHECK_HIDDEN 1015

Definition at line 95 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_CHECK_READONLY 1012

Definition at line 92 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_CHECK_SYSTEM 1016

Definition at line 96 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_LIST_PROP_VERSION_TYPES 1017

Definition at line 97 of file resource.h.

Referenced by CheckForFileInfo(), and PropertiesDialogDlgProc().

#define IDC_LIST_PROP_VERSION_VALUES 1018

Definition at line 98 of file resource.h.

Referenced by CheckForFileInfo(), and PropertiesDialogDlgProc().

#define IDC_STATIC_PROP_COPYRIGHT 1010

Definition at line 90 of file resource.h.

#define IDC_STATIC_PROP_FILENAME 1006

Definition at line 86 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_STATIC_PROP_LASTCHANGE 1008

Definition at line 88 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_STATIC_PROP_PATH 1007

Definition at line 87 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_STATIC_PROP_SIZE 1011

Definition at line 91 of file resource.h.

Referenced by PropertiesDialogDlgProc().

#define IDC_STATIC_PROP_VERSION 1009

Definition at line 89 of file resource.h.

Referenced by CheckForFileInfo().

#define IDC_VIEW_PATTERN 1000

Definition at line 79 of file resource.h.

Referenced by FilterDialogDlgProc().

#define IDC_VIEW_TYPE_DIRECTORIES 1001

Definition at line 80 of file resource.h.

Referenced by FilterDialogDlgProc().

#define IDC_VIEW_TYPE_DOCUMENTS 1003

Definition at line 82 of file resource.h.

Referenced by FilterDialogDlgProc().

#define IDC_VIEW_TYPE_HIDDEN 1005

Definition at line 84 of file resource.h.

Referenced by FilterDialogDlgProc().

#define IDC_VIEW_TYPE_OTHERS 1004

Definition at line 83 of file resource.h.

Referenced by FilterDialogDlgProc().

#define IDC_VIEW_TYPE_PROGRAMS 1002

Definition at line 81 of file resource.h.

Referenced by FilterDialogDlgProc().

#define IDD_DIALOG_PROPERTIES 106

Definition at line 39 of file resource.h.

Referenced by show_properties_dlg().

#define IDD_DIALOG_VIEW_TYPE 105

Definition at line 38 of file resource.h.

Referenced by ChildWndProc().

#define IDD_EXECUTE 103

Definition at line 36 of file resource.h.

Referenced by FrameWndProc().

#define IDD_SELECT_DESTINATION 104

Definition at line 37 of file resource.h.

Referenced by prompt_target().

#define IDI_WINEFILE 100

Definition at line 25 of file resource.h.

Referenced by InitInstance().

#define IDM_WINEFILE 102

Definition at line 31 of file resource.h.

Referenced by show_frame().

#define IDS_COL_ADATE 1213

Definition at line 130 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_ATTR 1217

Definition at line 134 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_CDATE 1212

Definition at line 129 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_IDX 1215

Definition at line 132 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_LINKS 1216

Definition at line 133 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_MDATE 1214

Definition at line 131 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_NAME 1210

Definition at line 127 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_SEC 1218

Definition at line 135 of file resource.h.

Referenced by InitInstance().

#define IDS_COL_SIZE 1211

Definition at line 128 of file resource.h.

Referenced by InitInstance().

#define IDS_DESKTOP 1204

Definition at line 120 of file resource.h.

Referenced by alloc_child_window(), and read_tree().

#define IDS_ERROR 1201

Definition at line 117 of file resource.h.

Referenced by display_error().

#define IDS_FONT_SEL_DLG_NAME 1101

Definition at line 113 of file resource.h.

Referenced by FrameWndProc().

#define IDS_FONT_SEL_ERROR 1103

Definition at line 114 of file resource.h.

Referenced by FrameWndProc().

#define IDS_FREE_SPACE_FMT 1219

Definition at line 136 of file resource.h.

Referenced by set_space_status().

#define IDS_NO_IMPL 1207

Definition at line 123 of file resource.h.

Referenced by DestinationDlgProc(), and FrameWndProc().

#define IDS_ROOT_FS 1202

Definition at line 118 of file resource.h.

Referenced by read_tree().

#define IDS_SHELL 1205

Definition at line 121 of file resource.h.

Referenced by create_drive_bar(), FrameWndProc(), and read_tree().

#define IDS_TITLEFMT 1206

Definition at line 122 of file resource.h.

Referenced by alloc_child_window().

#define IDS_UNIXFS 1203

Definition at line 119 of file resource.h.

Referenced by FrameWndProc(), and read_tree().

#define IDS_WINE 1208

Definition at line 124 of file resource.h.

Referenced by FrameWndProc().

#define IDS_WINE_FILE 1209

Definition at line 125 of file resource.h.

Referenced by show_frame().

#define IDS_WINEFILE 1200

Definition at line 116 of file resource.h.

Referenced by DestinationDlgProc(), display_error(), display_network_error(), and FrameWndProc().


Winefile: splitpath.c File Reference

splitpath.c File Reference

#include "winefile.h"

Include dependency graph for splitpath.c:

Go to the source code of this file.


Winefile: winefile.c File Reference

winefile.c File Reference

#include "winefile.h"
#include "resource.h"

Include dependency graph for winefile.c:

Go to the source code of this file.

Data Structures

struct | _Entry
struct | Root
struct | Pane
struct | ChildWnd
struct | ExecuteDialog
struct | FilterDialog
struct | PropertiesDialog
struct | LANGANDCODEPAGE
struct | FullScreenParameters

Defines

#define | COBJMACROS
#define | _MAX_DRIVE 3
#define | _MAX_FNAME 256
#define | _MAX_DIR _MAX_FNAME
#define | _MAX_EXT _MAX_FNAME
#define | _MAX_PATH 260
#define | UNION_MEMBER(x) DUMMYUNIONNAME.x
#define | DEFAULT_SPLIT_POS 300
#define | COLUMNS 10
#define | RS(b, i) load_string(b, i)
#define | get_strret get_strretA
#define | path_from_pidl path_from_pidlA
#define | FETCH_ITEM_COUNT 32
#define | infoStr pInfoString

Typedefs

typedef _Entry | Entry

Enumerations

enum | ENTRY_TYPE { ET_WINDOWS, ET_UNIX, ET_SHELL }
enum COLUMN_FLAGS {
COL_SIZE = 0x01, COL_DATE = 0x02, COL_TIME = 0x04, COL_ATTRIBUTES = 0x08,
COL_DOSNAMES = 0x10, COL_INDEX = 0x20, COL_LINKS = 0x40, COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS
}
enum | SORT_ORDER { SORT_NAME, SORT_EXT, SORT_SIZE, SORT_DATE }
enum TYPE_ORDER {
TO_DIR = 0, TO_DOT = 1, TO_DOTDOT = 2, TO_OTHER_DIR = 3,
TO_FILE = 4
}
enum TYPE_FILTER {
TF_DIRECTORIES = 0x01, TF_PROGRAMS = 0x02, TF_DOCUMENTS = 0x04, TF_OTHERS = 0x08,
TF_HIDDEN = 0x10, TF_ALL = 0x1F
}
enum | FILE_TYPE { FT_OTHER = 0, FT_EXECUTABLE = 1, FT_DOCUMENT = 2 }

Functions

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)
static LPTSTR | load_string (LPTSTR buffer, UINT id)
static void | display_error (HWND hwnd, DWORD error)
static void | display_network_error (HWND hwnd)
static Entry * | alloc_entry (void)
static void | free_entry (Entry *entry)
static void | free_entries (Entry *dir)
static void | read_directory_win (Entry *dir, LPCTSTR path)
static Entry * | find_entry_win (Entry *dir, LPCTSTR name)
static Entry * | read_tree_win (Root *root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
static void | free_strret (STRRET *str)
static LPSTR | strcpyn (LPSTR dest, LPCSTR source, size_t count)
static void | get_strretA (STRRET *str, const SHITEMID *shiid, LPSTR buffer, int len)
static HRESULT | path_from_pidlA (IShellFolder *folder, LPITEMIDLIST pidl, LPSTR buffer, int len)
static LPWSTR | wcscpyn (LPWSTR dest, LPCWSTR source, size_t count)
static void | get_strretW (STRRET *str, const SHITEMID *shiid, LPWSTR buffer, int len)
static HRESULT | name_from_pidl (IShellFolder *folder, LPITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags)
static HRESULT | path_from_pidlW (IShellFolder *folder, LPITEMIDLIST pidl, LPWSTR buffer, int len)
static LPITEMIDLIST | get_path_pidl (LPTSTR path, HWND hwnd)
static LPITEMIDLIST | get_to_absolute_pidl (Entry *entry, HWND hwnd)
static HICON | extract_icon (IShellFolder *folder, LPCITEMIDLIST pidl)
static Entry * | find_entry_shell (Entry *dir, LPCITEMIDLIST pidl)
static Entry * | read_tree_shell (Root *root, LPITEMIDLIST pidl, SORT_ORDER sortOrder, HWND hwnd)
static void | fill_w32fdata_shell (IShellFolder *folder, LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA *w32fdata)
static void | read_directory_shell (Entry *dir, HWND hwnd)
static int | TypeOrderFromDirname (LPCTSTR name)
static int | compareType (const WIN32_FIND_DATA *fd1, const WIN32_FIND_DATA *fd2)
static int | compareName (const void *arg1, const void *arg2)
static int | compareExt (const void *arg1, const void *arg2)
static int | compareSize (const void *arg1, const void *arg2)
static int | compareDate (const void *arg1, const void *arg2)
static void | SortDirectory (Entry *dir, SORT_ORDER sortOrder)
static Entry * | read_tree (Root *root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, SORT_ORDER sortOrder, HWND hwnd)
static ChildWnd * | alloc_child_window (LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd)
static void | free_child_window (ChildWnd *child)
static void | resize_frame_rect (HWND hwnd, PRECT prect)
static void | resize_frame (HWND hwnd, int cx, int cy)
static void | resize_frame_client (HWND hwnd)
static LRESULT CALLBACK | CBTProc (int code, WPARAM wparam, LPARAM lparam)
static HWND | create_child_window (ChildWnd *child)
static INT_PTR CALLBACK | ExecuteDialogDlgProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
static INT_PTR CALLBACK | DestinationDlgProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
static INT_PTR CALLBACK | FilterDialogDlgProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
static void | PropDlg_DisplayValue (HWND hlbox, HWND hedit)
static void | CheckForFileInfo (struct PropertiesDialog *dlg, HWND hwnd, LPCTSTR strFilename)
static INT_PTR CALLBACK | PropertiesDialogDlgProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
static void | show_properties_dlg (Entry *entry, HWND hwnd)
static void | frame_get_clientspace (HWND hwnd, PRECT prect)
static BOOL | toggle_fullscreen (HWND hwnd)
static void | fullscreen_move (HWND hwnd)
static void | toggle_child (HWND hwnd, UINT cmd, HWND hchild)
static BOOL | activate_drive_window (LPCTSTR path)
static BOOL | activate_fs_window (LPCTSTR filesys)
static void | resize_tree (ChildWnd *child, int cx, int cy)
static HWND | create_header (HWND parent, Pane *pane, int id)
static void | init_output (HWND hwnd)
static void | draw_item (Pane *pane, LPDRAWITEMSTRUCT dis, Entry *entry, int calcWidthCol)
static BOOL | calc_widths (Pane *pane, BOOL anyway)
static void | calc_single_width (Pane *pane, int col)
static BOOL | pattern_match (LPCTSTR str, LPCTSTR pattern)
static BOOL | pattern_imatch (LPCTSTR str, LPCTSTR pattern)
static enum FILE_TYPE | get_file_type (LPCTSTR filename)
static int | insert_entries (Pane *pane, Entry *dir, LPCTSTR pattern, int filter_flags, int idx)
static void | format_bytes (LPTSTR buffer, LONGLONG bytes)
static void | set_space_status (void)
static void | create_tree_window (HWND parent, Pane *pane, int id, int id_header, LPCTSTR pattern, int filter_flags)
static void | InitChildWindow (ChildWnd *child)
static void | calc_width (Pane *pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
static void | calc_tabbed_width (Pane *pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
static void | output_text (Pane *pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str, DWORD flags)
static void | output_tabbed_text (Pane *pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
static void | output_number (Pane *pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
static BOOL | is_exe_file (LPCTSTR ext)
static BOOL | is_registered_type (LPCTSTR ext)
static void | set_header (Pane *pane)
static LRESULT | pane_notify (Pane *pane, NMHDR *pnmh)
static void | scan_entry (ChildWnd *child, Entry *entry, int idx, HWND hwnd)
static BOOL | expand_entry (ChildWnd *child, Entry *dir)
static void | collapse_entry (Pane *pane, Entry *dir)
static void | refresh_right_pane (ChildWnd *child)
static void | create_drive_bar (void)
static BOOL | launch_file (HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
static BOOL | launch_entry (Entry *entry, HWND hwnd, UINT nCmdShow)
static void | activate_entry (ChildWnd *child, Pane *pane, HWND hwnd)
static BOOL | pane_command (Pane *pane, UINT cmd)
static void | set_sort_order (ChildWnd *child, SORT_ORDER sortOrder)
static void | update_view_menu (ChildWnd *child)
static BOOL | is_directory (LPCTSTR target)
static BOOL | prompt_target (Pane *pane, LPTSTR source, LPTSTR target)
static void | CtxMenu_reset (void)
static IContextMenu * | CtxMenu_query_interfaces (IContextMenu *pcm1)
static BOOL | CtxMenu_HandleMenuMsg (UINT nmsg, WPARAM wparam, LPARAM lparam)
static HRESULT | ShellFolderContextMenu (IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *apidl, int x, int y)
static void | InitInstance (HINSTANCE hinstance)
static void | show_frame (HWND hwndParent, int cmdshow)
static void | ExitInstance (void)
static int | winefile_main (HINSTANCE hinstance, HWND hwndParent, int cmdshow)
int APIENTRY | WinMain (HINSTANCE hinstance, HINSTANCE previnstance, LPSTR cmdline, int cmdshow)

Variables

WINEFILE_GLOBALS Globals
static int | last_split
static const TCHAR | sEmpty [] = {'\0'}
static const TCHAR | sSpace [] = {' ', '\0'}
static const TCHAR | sNumFmt [] = {'%','d','\0'}
static const TCHAR | sQMarks [] = {'?','?','?','\0'}
static const TCHAR | sWINEFILEFRAME [] = {'W','F','S','_','F','r','a','m','e','\0'}
static const TCHAR | sWINEFILETREE [] = {'W','F','S','_','T','r','e','e','\0'}
static const TCHAR | sLongHexFmt [] = {'%','L','X','\0'}
static const TCHAR | sLongNumFmt [] = {'%','L','d','\0'}
static int(* | sortFunctions [])(const void *arg1, const void *arg2)
static HHOOK | hcbthook
static ChildWnd * | newchild = NULL
LANGANDCODEPAGE * lpTranslate
static LPCSTR | InfoStrings []
static struct FullScreenParameters | g_fullscreen
static TCHAR | g_pos_names [COLUMNS][20]
static const int | g_pos_align []
static WNDPROC | g_orgTreeWndProc
static IContextMenu2 * | s_pctxmenu2 = NULL
static IContextMenu3 * | s_pctxmenu3 = NULL

Define Documentation

#define _MAX_DIR _MAX_FNAME

Definition at line 45 of file winefile.c.

Referenced by alloc_child_window(), and read_tree().

#define _MAX_DRIVE 3

Definition at line 43 of file winefile.c.

Referenced by activate_drive_window(), alloc_child_window(), FrameWndProc(), and refresh_child().

#define _MAX_EXT _MAX_FNAME

Definition at line 46 of file winefile.c.

Referenced by alloc_child_window(), is_exe_file(), and prompt_target().

#define _MAX_FNAME 256

Definition at line 44 of file winefile.c.

Referenced by alloc_child_window(), prompt_target(), and read_tree().

#define _MAX_PATH 260

Definition at line 47 of file winefile.c.

Referenced by extract_icon().

#define COBJMACROS

Definition at line 31 of file winefile.c.

#define COLUMNS 10

Definition at line 133 of file winefile.c.

Referenced by calc_single_width(), calc_widths(), create_header(), draw_item(), pane_notify(), and set_header().

#define DEFAULT_SPLIT_POS 300

Definition at line 58 of file winefile.c.

Referenced by alloc_child_window().

#define FETCH_ITEM_COUNT 32

Referenced by read_directory_shell().

#define get_strret get_strretA

Definition at line 661 of file winefile.c.

Referenced by name_from_pidl().

#define infoStr pInfoString

Referenced by CheckForFileInfo().

#define path_from_pidl path_from_pidlA

Definition at line 662 of file winefile.c.

Referenced by get_path().

#define RS | ( | b,
 |  | i | ) | load_string(b, i)

Definition at line 212 of file winefile.c.

Referenced by alloc_child_window(), DestinationDlgProc(), display_error(), display_network_error(), FrameWndProc(), set_space_status(), and show_frame().

#define UNION_MEMBER ( x ) DUMMYUNIONNAME.x

Definition at line 51 of file winefile.c.

Typedef Documentation

typedef struct _Entry Entry

Enumeration Type Documentation

enum COLUMN_FLAGS

Enumerator:
COL_SIZE
COL_DATE
COL_TIME
COL_ATTRIBUTES
COL_DOSNAMES
COL_INDEX
COL_LINKS
COL_ALL

Definition at line 104 of file winefile.c.

00104                   {
00105         COL_SIZE                = 0x01,
00106         COL_DATE                = 0x02,
00107         COL_TIME                = 0x04,
00108         COL_ATTRIBUTES  = 0x08,
00109         COL_DOSNAMES    = 0x10,
00110 #ifdef _NO_EXTENSIONS
00111         COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES
00112 #else
00113         COL_INDEX               = 0x20,
00114         COL_LINKS               = 0x40,
00115         COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS
00116 #endif
00117 };

enum ENTRY_TYPE

Enumerator:
ET_WINDOWS
ET_UNIX
ET_SHELL

Definition at line 64 of file winefile.c.

00064                 {
00065         ET_WINDOWS,
00066         ET_UNIX,
00067 #ifdef _SHELL_FOLDERS
00068         ET_SHELL
00069 #endif
00070 };

enum FILE_TYPE

Enumerator:
FT_OTHER
FT_EXECUTABLE
FT_DOCUMENT

Definition at line 2744 of file winefile.c.

02744                {
02745         FT_OTHER                = 0,
02746         FT_EXECUTABLE   = 1,
02747         FT_DOCUMENT             = 2
02748 };

enum SORT_ORDER

Enumerator:
SORT_NAME
SORT_EXT
SORT_SIZE
SORT_DATE

Definition at line 119 of file winefile.c.

00119              {
00120         SORT_NAME,
00121         SORT_EXT,
00122         SORT_SIZE,
00123         SORT_DATE
00124 } SORT_ORDER;

enum TYPE_FILTER

Enumerator:
TF_DIRECTORIES
TF_PROGRAMS
TF_DOCUMENTS
TF_OTHERS
TF_HIDDEN
TF_ALL

Definition at line 1393 of file winefile.c.

01393                  {
01394         TF_DIRECTORIES  = 0x01,
01395         TF_PROGRAMS             = 0x02,
01396         TF_DOCUMENTS    = 0x04,
01397         TF_OTHERS               = 0x08,
01398         TF_HIDDEN               = 0x10,
01399         TF_ALL                  = 0x1F
01400 };

enum TYPE_ORDER

Enumerator:
TO_DIR
TO_DOT
TO_DOTDOT
TO_OTHER_DIR
TO_FILE

Definition at line 1105 of file winefile.c.

01105                 {
01106         TO_DIR = 0,
01107         TO_DOT = 1,
01108         TO_DOTDOT = 2,
01109         TO_OTHER_DIR = 3,
01110         TO_FILE = 4
01111 };

Function Documentation

static BOOL activate_drive_window ( LPCTSTR path ) [static]

Definition at line 2080 of file winefile.c.

References _MAX_DRIVE, WINEFILE_GLOBALS::hmdiclient, Root::path, and ChildWnd::root.

Referenced by FrameWndProc().

02081 {
02082         TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE];
02083         HWND child_wnd;
02084
02085         _tsplitpath(path, drv1, 0, 0, 0);
02086
02087         /* search for a already open window for the same drive */
02088         for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) {
02089                 ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA);
02090
02091                 if (child) {
02092                         _tsplitpath(child->root.path, drv2, 0, 0, 0);
02093
02094                         if (!lstrcmpi(drv2, drv1)) {
02095                                 SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
02096
02097                                 if (IsMinimized(child_wnd))
02098                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
02099
02100                                 return TRUE;
02101                         }
02102                 }
02103         }
02104
02105         return FALSE;
02106 }

static void activate_entry | ( | ChildWnd * | child,
 |  | Pane * | pane,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 3899 of file winefile.c.

References calc_widths(), collapse_entry(), Pane::cur, _Entry::data, expand_entry(), _Entry::expanded, ChildWnd::hwnd, launch_entry(), scan_entry(), _Entry::scanned, set_curdir(), set_header(), show_properties_dlg(), Pane::treePane, and _Entry::up.

Referenced by ChildWndProc().

03900 {
03901         Entry* entry = pane->cur;
03902
03903         if (!entry)
03904                 return;
03905
03906         if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
03907                 int scanned_old = entry->scanned;
03908
03909                 if (!scanned_old)
03910                         scan_entry(child, entry, ListBox_GetCurSel(child->left.hwnd), hwnd);
03911
03912 #ifndef _NO_EXTENSIONS
03913                 if (entry->data.cFileName[0]=='.' && entry->data.cFileName[1]=='\0')
03914                         return;
03915 #endif
03916
03917                 if (entry->data.cFileName[0]=='.' && entry->data.cFileName[1]=='.' && entry->data.cFileName[2]=='\0') {
03918                         entry = child->left.cur->up;
03919                         collapse_entry(&child->left, entry);
03920                         goto focus_entry;
03921                 } else if (entry->expanded)
03922                         collapse_entry(pane, child->left.cur);
03923                 else {
03924                         expand_entry(child, child->left.cur);
03925
03926                         if (!pane->treePane) focus_entry: {
03927                                 int idx = ListBox_FindItemData(child->left.hwnd, ListBox_GetCurSel(child->left.hwnd), entry);
03928                                 ListBox_SetCurSel(child->left.hwnd, idx);
03929                                 set_curdir(child, entry, idx, hwnd);
03930                         }
03931                 }
03932
03933                 if (!scanned_old) {
03934                         calc_widths(pane, FALSE);
03935
03936 #ifndef _NO_EXTENSIONS
03937                         set_header(pane);
03938 #endif
03939                 }
03940         } else {
03941                 if (GetKeyState(VK_MENU) < 0)
03942                         show_properties_dlg(entry, child->hwnd);
03943                 else
03944                         launch_entry(entry, child->hwnd, SW_SHOWNORMAL);
03945         }
03946 }

Here is the call graph for this function:

static BOOL activate_fs_window ( LPCTSTR filesys ) [static]

Definition at line 2108 of file winefile.c.

References Root::fs, WINEFILE_GLOBALS::hmdiclient, and ChildWnd::root.

Referenced by FrameWndProc().

02109 {
02110         HWND child_wnd;
02111
02112         /* search for a already open window of the given file system name */
02113         for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) {
02114                 ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA);
02115
02116                 if (child) {
02117                         if (!lstrcmpi(child->root.fs, filesys)) {
02118                                 SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
02119
02120                                 if (IsMinimized(child_wnd))
02121                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
02122
02123                                 return TRUE;
02124                         }
02125                 }
02126         }
02127
02128         return FALSE;
02129 }

static ChildWnd* alloc_child_window | ( | LPCTSTR | path,
 |  | LPITEMIDLIST | pidl,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 1403 of file winefile.c.

References _MAX_DIR, _MAX_DRIVE, _MAX_EXT, _MAX_FNAME, BUFFER_LEN, COL_ATTRIBUTES, COL_DATE, COL_INDEX, COL_LINKS, COL_SIZE, COL_TIME, _Entry::data, DEFAULT_SPLIT_POS, Root::entry, ET_SHELL, _Entry::etype, ChildWnd::filter_flags, ChildWnd::filter_pattern, ChildWnd::focus_pane, Root::fs, ChildWnd::header_wdths_ok, IDS_DESKTOP, IDS_TITLEFMT, ChildWnd::left, _Entry::level, load_string(), ChildWnd::path, ChildWnd::pos, read_tree(), ChildWnd::right, Pane::root, ChildWnd::root, RS, set_curdir(), SORT_NAME, ChildWnd::sortOrder, ChildWnd::split_pos, TF_ALL, Pane::treePane, and Pane::visible_cols.

Referenced by ChildWndProc(), FrameWndProc(), and show_frame().

01404 {
01405         TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
01406         TCHAR b1[BUFFER_LEN];
01407         const static TCHAR sAsterics[] = {'*', '\0'};
01408
01409         ChildWnd* child = (ChildWnd*) malloc(sizeof(ChildWnd));
01410         Root* root = &child->root;
01411         Entry* entry;
01412
01413         memset(child, 0, sizeof(ChildWnd));
01414
01415         child->left.treePane = TRUE;
01416         child->left.visible_cols = 0;
01417
01418         child->right.treePane = FALSE;
01419 #ifndef _NO_EXTENSIONS
01420         child->right.visible_cols = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS;
01421 #else
01422         child->right.visible_cols = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES;
01423 #endif
01424
01425         child->pos.length = sizeof(WINDOWPLACEMENT);
01426         child->pos.flags = 0;
01427         child->pos.showCmd = SW_SHOWNORMAL;
01428         child->pos.rcNormalPosition.left = CW_USEDEFAULT;
01429         child->pos.rcNormalPosition.top = CW_USEDEFAULT;
01430         child->pos.rcNormalPosition.right = CW_USEDEFAULT;
01431         child->pos.rcNormalPosition.bottom = CW_USEDEFAULT;
01432
01433         child->focus_pane = 0;
01434         child->split_pos = DEFAULT_SPLIT_POS;
01435         child->sortOrder = SORT_NAME;
01436         child->header_wdths_ok = FALSE;
01437
01438         if (path)
01439         {
01440                 lstrcpy(child->path, path);
01441
01442                 _tsplitpath(path, drv, dir, name, ext);
01443         }
01444
01445         lstrcpy(child->filter_pattern, sAsterics);
01446         child->filter_flags = TF_ALL;
01447
01448         root->entry.level = 0;
01449
01450         entry = read_tree(root, path, pidl, drv, child->sortOrder, hwnd);
01451
01452 #ifdef _SHELL_FOLDERS
01453         if (root->entry.etype == ET_SHELL)
01454                 load_string(root->entry.data.cFileName, IDS_DESKTOP);
01455         else
01456 #endif
01457                 wsprintf(root->entry.data.cFileName, RS(b1,IDS_TITLEFMT), drv, root->fs);
01458
01459         root->entry.data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
01460
01461         child->left.root = &root->entry;
01462         child->right.root = NULL;
01463
01464         set_curdir(child, entry, 0, hwnd);
01465
01466         return child;
01467 }

Here is the call graph for this function:

static Entry* alloc_entry ( void ) [static]

Definition at line 290 of file winefile.c.

References _Entry::folder, _Entry::hicon, and _Entry::pidl.

Referenced by read_directory_shell(), and read_directory_win().

00291 {
00292         Entry* entry = (Entry*) malloc(sizeof(Entry));
00293
00294 #ifdef _SHELL_FOLDERS
00295         entry->pidl = NULL;
00296         entry->folder = NULL;
00297         entry->hicon = 0;
00298 #endif
00299
00300         return entry;
00301 }

static void calc_single_width | ( | Pane * | pane,
 |  | int | col
 | ) | [static]

Definition at line 2646 of file winefile.c.

References COLUMNS, draw_item(), WINEFILE_GLOBALS::hfont, Pane::hwnd, IMAGE_WIDTH, Pane::positions, WINEFILE_GLOBALS::spaceSize, and Pane::widths.

Referenced by pane_notify().

02647 {
02648         HFONT hfontOld;
02649         int x, cx;
02650         int entries = ListBox_GetCount(pane->hwnd);
02651         int cnt;
02652         HDC hdc;
02653
02654         pane->widths[col] = 0;
02655
02656         hdc = GetDC(pane->hwnd);
02657         hfontOld = SelectFont(hdc, Globals.hfont);
02658
02659         for(cnt=0; cnt<entries; cnt++) {
02660                 Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt);
02661                 DRAWITEMSTRUCT dis;
02662
02663                 dis.CtlType               = 0;
02664                 dis.CtlID                 = 0;
02665                 dis.itemID                = 0;
02666                 dis.itemAction    = 0;
02667                 dis.itemState     = 0;
02668                 dis.hwndItem      = pane->hwnd;
02669                 dis.hDC                   = hdc;
02670                 dis.rcItem.left   = 0;
02671                 dis.rcItem.top    = 0;
02672                 dis.rcItem.right  = 0;
02673                 dis.rcItem.bottom = 0;
02674                 /*dis.itemData    = 0; */
02675
02676                 draw_item(pane, &dis, entry, col);
02677         }
02678
02679         SelectObject(hdc, hfontOld);
02680         ReleaseDC(pane->hwnd, hdc);
02681
02682         cx = pane->widths[col];
02683
02684         if (cx) {
02685                 cx += 3*Globals.spaceSize.cx;
02686
02687                 if (cx < IMAGE_WIDTH)
02688                         cx = IMAGE_WIDTH;
02689         }
02690
02691         pane->widths[col] = cx;
02692
02693         x = pane->positions[col] + cx;
02694
02695         for(; col<COLUMNS; ) {
02696                 pane->positions[++col] = x;
02697                 x += pane->widths[col];
02698         }
02699
02700         ListBox_SetHorizontalExtent(pane->hwnd, x);
02701 }

Here is the call graph for this function:

static void calc_tabbed_width | ( | Pane * | pane,
 |  | LPDRAWITEMSTRUCT | dis,
 |  | int | col,
 |  | LPCTSTR | str
 | ) | [static]

Definition at line 2949 of file winefile.c.

References Pane::widths.

Referenced by draw_item().

02950 {
02951         RECT rt = {0, 0, 0, 0};
02952
02953 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
02954         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
02955
02956         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
02957         /*FIXME rt (0,0) ??? */
02958
02959         if (rt.right > pane->widths[col])
02960                 pane->widths[col] = rt.right;
02961 }

static void calc_width | ( | Pane * | pane,
 |  | LPDRAWITEMSTRUCT | dis,
 |  | int | col,
 |  | LPCTSTR | str
 | ) | [static]

Definition at line 2939 of file winefile.c.

References Pane::widths.

Referenced by draw_item().

02940 {
02941         RECT rt = {0, 0, 0, 0};
02942
02943         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
02944
02945         if (rt.right > pane->widths[col])
02946                 pane->widths[col] = rt.right;
02947 }

static BOOL calc_widths | ( | Pane * | pane,
 |  | BOOL | anyway
 | ) | [static]

Definition at line 2559 of file winefile.c.

References COLUMNS, draw_item(), WINEFILE_GLOBALS::hfont, Pane::hwnd, IMAGE_WIDTH, Pane::positions, WINEFILE_GLOBALS::spaceSize, and Pane::widths.

Referenced by activate_entry(), create_tree_window(), expand_entry(), pane_command(), refresh_right_pane(), and scan_entry().

02560 {
02561         int col, x, cx, spc=3*Globals.spaceSize.cx;
02562         int entries = ListBox_GetCount(pane->hwnd);
02563         int orgWidths[COLUMNS];
02564         int orgPositions[COLUMNS+1];
02565         HFONT hfontOld;
02566         HDC hdc;
02567         int cnt;
02568
02569         if (!anyway) {
02570                 memcpy(orgWidths, pane->widths, sizeof(orgWidths));
02571                 memcpy(orgPositions, pane->positions, sizeof(orgPositions));
02572         }
02573
02574         for(col=0; col<COLUMNS; col++)
02575                 pane->widths[col] = 0;
02576
02577         hdc = GetDC(pane->hwnd);
02578         hfontOld = SelectFont(hdc, Globals.hfont);
02579
02580         for(cnt=0; cnt<entries; cnt++) {
02581                 Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt);
02582
02583                 DRAWITEMSTRUCT dis;
02584
02585                 dis.CtlType               = 0;
02586                 dis.CtlID                 = 0;
02587                 dis.itemID                = 0;
02588                 dis.itemAction    = 0;
02589                 dis.itemState     = 0;
02590                 dis.hwndItem      = pane->hwnd;
02591                 dis.hDC                   = hdc;
02592                 dis.rcItem.left   = 0;
02593                 dis.rcItem.top    = 0;
02594                 dis.rcItem.right  = 0;
02595                 dis.rcItem.bottom = 0;
02596                 /*dis.itemData    = 0; */
02597
02598                 draw_item(pane, &dis, entry, COLUMNS);
02599         }
02600
02601         SelectObject(hdc, hfontOld);
02602         ReleaseDC(pane->hwnd, hdc);
02603
02604         x = 0;
02605         for(col=0; col<COLUMNS; col++) {
02606                 pane->positions[col] = x;
02607                 cx = pane->widths[col];
02608
02609                 if (cx) {
02610                         cx += spc;
02611
02612                         if (cx < IMAGE_WIDTH)
02613                                 cx = IMAGE_WIDTH;
02614
02615                         pane->widths[col] = cx;
02616                 }
02617
02618                 x += cx;
02619         }
02620
02621         pane->positions[COLUMNS] = x;
02622
02623         ListBox_SetHorizontalExtent(pane->hwnd, x);
02624
02625         /* no change? */
02626         if (!memcmp(orgWidths, pane->widths, sizeof(orgWidths)))
02627                 return FALSE;
02628
02629         /* don't move, if only collapsing an entry */
02630         if (!anyway && pane->widths[0]<orgWidths[0] &&
02631                 !memcmp(orgWidths+1, pane->widths+1, sizeof(orgWidths)-sizeof(int))) {
02632                 pane->widths[0] = orgWidths[0];
02633                 memcpy(pane->positions, orgPositions, sizeof(orgPositions));
02634
02635                 return FALSE;
02636         }
02637
02638         InvalidateRect(pane->hwnd, 0, TRUE);
02639
02640         return TRUE;
02641 }

Here is the call graph for this function:

static LRESULT CALLBACK CBTProc | ( | int | code,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 1615 of file winefile.c.

References ChildWnd::hwnd.

Referenced by create_child_window().

01616 {
01617         if (code==HCBT_CREATEWND && newchild) {
01618                 ChildWnd* child = newchild;
01619                 newchild = NULL;
01620
01621                 child->hwnd = (HWND) wparam;
01622                 SetWindowLongPtr(child->hwnd, GWLP_USERDATA, (LPARAM)child);
01623         }
01624
01625         return CallNextHookEx(hcbthook, code, wparam, lparam);
01626 }

static void CheckForFileInfo | ( | struct PropertiesDialog * | dlg,
 |  | HWND | hwnd,
 |  | LPCTSTR | strFilename
 | ) | [static]

Definition at line 1820 of file winefile.c.

References BUFFER_LEN, IDC_LIST_PROP_VERSION_TYPES, IDC_LIST_PROP_VERSION_VALUES, IDC_STATIC_PROP_VERSION, infoStr, PropDlg_DisplayValue(), PropertiesDialog::pVersionData, LANGANDCODEPAGE::wCodePage, and LANGANDCODEPAGE::wLanguage.

Referenced by PropertiesDialogDlgProc().

01821 {
01822         static TCHAR sBackSlash[] = {'\\','\0'};
01823         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'};
01824         static TCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
01825                                                                                 '%','0','4','x','%','0','4','x','\\','%','s','\0'};
01826         DWORD dwVersionDataLen = GetFileVersionInfoSize((LPTSTR)strFilename, NULL);     /* VC6 and MinGW headers use LPTSTR instead of LPCTSTR */
01827
01828         if (dwVersionDataLen) {
01829                 dlg->pVersionData = malloc(dwVersionDataLen);
01830
01831                 if (GetFileVersionInfo((LPTSTR)strFilename, 0, dwVersionDataLen, dlg->pVersionData)) {  /* VC6 and MinGW headers use LPTSTR instead of LPCTSTR */
01832                         LPVOID pVal;
01833                         UINT nValLen;
01834
01835                         if (VerQueryValue(dlg->pVersionData, sBackSlash, &pVal, &nValLen)) {
01836                                 if (nValLen == sizeof(VS_FIXEDFILEINFO)) {
01837                                         VS_FIXEDFILEINFO* pFixedFileInfo = (VS_FIXEDFILEINFO*)pVal;
01838                                         char buffer[BUFFER_LEN];
01839
01840                                         sprintf(buffer, "%d.%d.%d.%d",
01841                                                 HIWORD(pFixedFileInfo->dwFileVersionMS), LOWORD(pFixedFileInfo->dwFileVersionMS),
01842                                                 HIWORD(pFixedFileInfo->dwFileVersionLS), LOWORD(pFixedFileInfo->dwFileVersionLS));
01843
01844                                         SetDlgItemTextA(hwnd, IDC_STATIC_PROP_VERSION, buffer);
01845                                 }
01846                         }
01847
01848                         /* Read the list of languages and code pages. */
01849                         if (VerQueryValue(dlg->pVersionData, sTranslation, &pVal, &nValLen)) {
01850                                 struct LANGANDCODEPAGE* pTranslate = (struct LANGANDCODEPAGE*)pVal;
01851                                 struct LANGANDCODEPAGE* pEnd = (struct LANGANDCODEPAGE*)((LPBYTE)pVal+nValLen);
01852
01853                                 HWND hlbox = GetDlgItem(hwnd, IDC_LIST_PROP_VERSION_TYPES);
01854
01855                                 /* Read the file description for each language and code page. */
01856                                 for(; pTranslate<pEnd; ++pTranslate) {
01857                                         LPCSTR* p;
01858
01859                                         for(p=InfoStrings; *p; ++p) {
01860                                                 TCHAR subblock[200];
01861 #ifdef UNICODE
01862                                                 TCHAR infoStr[100];
01863 #endif
01864                                                 LPCTSTR pTxt;
01865                                                 UINT nValLen;
01866
01867                                                 LPCSTR pInfoString = *p;
01868 #ifdef UNICODE
01869                                                 MultiByteToWideChar(CP_ACP, 0, pInfoString, -1, infoStr, 100);
01870 #else
01871 #define infoStr pInfoString
01872 #endif
01873                                                 wsprintf(subblock, sStringFileInfo, pTranslate->wLanguage, pTranslate->wCodePage, infoStr);
01874
01875                                                 /* Retrieve file description for language and code page */
01876                                                 if (VerQueryValue(dlg->pVersionData, subblock, (PVOID)&pTxt, &nValLen)) {
01877                                                         int idx = ListBox_AddString(hlbox, infoStr);
01878                                                         ListBox_SetItemData(hlbox, idx, pTxt);
01879                                                 }
01880                                         }
01881                                 }
01882
01883                                 ListBox_SetCurSel(hlbox, 0);
01884
01885                                 PropDlg_DisplayValue(hlbox, GetDlgItem(hwnd,IDC_LIST_PROP_VERSION_VALUES));
01886                         }
01887                 }
01888         }
01889 }

Here is the call graph for this function:

static LRESULT CALLBACK ChildWndProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 4165 of file winefile.c.

References activate_entry(), alloc_child_window(), ASSERT, BUFFER_LEN, COLOR_SPLITBAR, create_child_window(), CtxMenu_HandleMenuMsg(), Pane::cur, draw_item(), ChildWnd::filter_flags, ChildWnd::filter_pattern, FilterDialogDlgProc(), FilterDialog::flags, ChildWnd::focus_pane, free_child_window(), get_path(), get_to_absolute_pidl(), WINEFILE_GLOBALS::hInstance, ChildWnd::hwnd, Pane::hwnd, ID_ACTIVATE, ID_EDIT_PROPERTIES, ID_FILE_COPY, ID_FILE_DELETE, ID_FILE_MOVE, ID_REFRESH, ID_VIEW_FILTER, ID_VIEW_SORT_DATE, ID_VIEW_SORT_NAME, ID_VIEW_SORT_SIZE, ID_VIEW_SORT_TYPE, ID_VIEW_SPLIT, ID_WINDOW_NEW, IDD_DIALOG_VIEW_TYPE, IDW_HEADER_LEFT, IDW_TREE_LEFT, IDW_TREE_RIGHT, WINEFILE_GLOBALS::iMalloc, InitChildWindow(), last_split, ChildWnd::left, pane_command(), pane_notify(), ChildWnd::path, FilterDialog::pattern, prompt_target(), refresh_child(), refresh_drives(), refresh_right_pane(), resize_tree(), ChildWnd::right, set_curdir(), set_sort_order(), set_space_status(), ShellFolderContextMenu(), show_properties_dlg(), SORT_DATE, SORT_EXT, SORT_NAME, SORT_SIZE, ChildWnd::split_pos, SPLIT_WIDTH, update_view_menu(), and WM_DISPATCH_COMMAND.

Referenced by InitInstance().

04166 {
04167         ChildWnd* child = (ChildWnd*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
04168         ASSERT(child);
04169
04170         switch(nmsg) {
04171                 case WM_DRAWITEM: {
04172                         LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lparam;
04173                         Entry* entry = (Entry*) dis->itemData;
04174
04175                         if (dis->CtlID == IDW_TREE_LEFT)
04176                                 draw_item(&child->left, dis, entry, -1);
04177                         else if (dis->CtlID == IDW_TREE_RIGHT)
04178                                 draw_item(&child->right, dis, entry, -1);
04179                         else
04180                                 goto draw_menu_item;
04181
04182                         return TRUE;}
04183
04184                 case WM_CREATE:
04185                         InitChildWindow(child);
04186                         break;
04187
04188                 case WM_NCDESTROY:
04189                         free_child_window(child);
04190                         SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
04191                         break;
04192
04193                 case WM_PAINT: {
04194                         PAINTSTRUCT ps;
04195                         HBRUSH lastBrush;
04196                         RECT rt;
04197                         GetClientRect(hwnd, &rt);
04198                         BeginPaint(hwnd, &ps);
04199                         rt.left = child->split_pos-SPLIT_WIDTH/2;
04200                         rt.right = child->split_pos+SPLIT_WIDTH/2+1;
04201                         lastBrush = SelectBrush(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
04202                         Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
04203                         SelectObject(ps.hdc, lastBrush);
04204 #ifdef _NO_EXTENSIONS
04205                         rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
04206                         FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
04207 #endif
04208                         EndPaint(hwnd, &ps);
04209                         break;}
04210
04211                 case WM_SETCURSOR:
04212                         if (LOWORD(lparam) == HTCLIENT) {
04213                                 POINT pt;
04214                                 GetCursorPos(&pt);
04215                                 ScreenToClient(hwnd, &pt);
04216
04217                                 if (pt.x>=child->split_pos-SPLIT_WIDTH/2 && pt.x<child->split_pos+SPLIT_WIDTH/2+1) {
04218                                         SetCursor(LoadCursor(0, IDC_SIZEWE));
04219                                         return TRUE;
04220                                 }
04221                         }
04222                         goto def;
04223
04224                 case WM_LBUTTONDOWN: {
04225                         RECT rt;
04226                         int x = GET_X_LPARAM(lparam);
04227
04228                         GetClientRect(hwnd, &rt);
04229
04230                         if (x>=child->split_pos-SPLIT_WIDTH/2 && x<child->split_pos+SPLIT_WIDTH/2+1) {
04231                                 last_split = child->split_pos;
04232 #ifdef _NO_EXTENSIONS
04233                                 draw_splitbar(hwnd, last_split);
04234 #endif
04235                                 SetCapture(hwnd);
04236                         }
04237
04238                         break;}
04239
04240                 case WM_LBUTTONUP:
04241                         if (GetCapture() == hwnd) {
04242 #ifdef _NO_EXTENSIONS
04243                                 RECT rt;
04244                                 int x = LOWORD(lparam);
04245                                 draw_splitbar(hwnd, last_split);
04246                                 last_split = -1;
04247                                 GetClientRect(hwnd, &rt);
04248                                 child->split_pos = x;
04249                                 resize_tree(child, rt.right, rt.bottom);
04250 #endif
04251                                 ReleaseCapture();
04252                         }
04253                         break;
04254
04255 #ifdef _NO_EXTENSIONS
04256                 case WM_CAPTURECHANGED:
04257                         if (GetCapture()==hwnd && last_split>=0)
04258                                 draw_splitbar(hwnd, last_split);
04259                         break;
04260 #endif
04261
04262                 case WM_KEYDOWN:
04263                         if (wparam == VK_ESCAPE)
04264                                 if (GetCapture() == hwnd) {
04265                                         RECT rt;
04266 #ifdef _NO_EXTENSIONS
04267                                         draw_splitbar(hwnd, last_split);
04268 #else
04269                                         child->split_pos = last_split;
04270 #endif
04271                                         GetClientRect(hwnd, &rt);
04272                                         resize_tree(child, rt.right, rt.bottom);
04273                                         last_split = -1;
04274                                         ReleaseCapture();
04275                                         SetCursor(LoadCursor(0, IDC_ARROW));
04276                                 }
04277                         break;
04278
04279                 case WM_MOUSEMOVE:
04280                         if (GetCapture() == hwnd) {
04281                                 RECT rt;
04282                                 int x = LOWORD(lparam);
04283
04284 #ifdef _NO_EXTENSIONS
04285                                 HDC hdc = GetDC(hwnd);
04286                                 GetClientRect(hwnd, &rt);
04287
04288                                 rt.left = last_split-SPLIT_WIDTH/2;
04289                                 rt.right = last_split+SPLIT_WIDTH/2+1;
04290                                 InvertRect(hdc, &rt);
04291
04292                                 last_split = x;
04293                                 rt.left = x-SPLIT_WIDTH/2;
04294                                 rt.right = x+SPLIT_WIDTH/2+1;
04295                                 InvertRect(hdc, &rt);
04296
04297                                 ReleaseDC(hwnd, hdc);
04298 #else
04299                                 GetClientRect(hwnd, &rt);
04300
04301                                 if (x>=0 && x<rt.right) {
04302                                         child->split_pos = x;
04303                                         resize_tree(child, rt.right, rt.bottom);
04304                                         rt.left = x-SPLIT_WIDTH/2;
04305                                         rt.right = x+SPLIT_WIDTH/2+1;
04306                                         InvalidateRect(hwnd, &rt, FALSE);
04307                                         UpdateWindow(child->left.hwnd);
04308                                         UpdateWindow(hwnd);
04309                                         UpdateWindow(child->right.hwnd);
04310                                 }
04311 #endif
04312                         }
04313                         break;
04314
04315 #ifndef _NO_EXTENSIONS
04316                 case WM_GETMINMAXINFO:
04317                         DefMDIChildProc(hwnd, nmsg, wparam, lparam);
04318
04319                         {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
04320
04321                         lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */
04322                         lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */
04323                         break;}
04324 #endif /* _NO_EXTENSIONS */
04325
04326                 case WM_SETFOCUS:
04327                         if (SetCurrentDirectory(child->path))
04328                                 set_space_status();
04329                         SetFocus(child->focus_pane? child->right.hwnd: child->left.hwnd);
04330                         break;
04331
04332                 case WM_DISPATCH_COMMAND: {
04333                         Pane* pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
04334
04335                         switch(LOWORD(wparam)) {
04336                                 case ID_WINDOW_NEW: {
04337                                         ChildWnd* new_child = alloc_child_window(child->path, NULL, hwnd);
04338
04339                                         if (!create_child_window(new_child))
04340                                                 free(new_child);
04341
04342                                         break;}
04343
04344                                 case ID_REFRESH:
04345                                         refresh_drives();
04346                                         refresh_child(child);
04347                                         break;
04348
04349                                 case ID_ACTIVATE:
04350                                         activate_entry(child, pane, hwnd);
04351                                         break;
04352
04353                                 case ID_FILE_MOVE: {
04354                                         TCHAR source[BUFFER_LEN], target[BUFFER_LEN];
04355
04356                                         if (prompt_target(pane, source, target)) {
04357                                                 SHFILEOPSTRUCT shfo = {hwnd, FO_MOVE, source, target};
04358
04359                                                 source[lstrlen(source)+1] = '\0';
04360                                                 target[lstrlen(target)+1] = '\0';
04361
04362                                                 if (!SHFileOperation(&shfo))
04363                                                         refresh_child(child);
04364                                         }
04365                                         break;}
04366
04367                                 case ID_FILE_COPY: {
04368                                         TCHAR source[BUFFER_LEN], target[BUFFER_LEN];
04369
04370                                         if (prompt_target(pane, source, target)) {
04371                                                 SHFILEOPSTRUCT shfo = {hwnd, FO_COPY, source, target};
04372
04373                                                 source[lstrlen(source)+1] = '\0';
04374                                                 target[lstrlen(target)+1] = '\0';
04375
04376                                                 if (!SHFileOperation(&shfo))
04377                                                         refresh_child(child);
04378                                         }
04379                                         break;}
04380
04381                                 case ID_FILE_DELETE: {
04382                                         TCHAR path[BUFFER_LEN];
04383                                         SHFILEOPSTRUCT shfo = {hwnd, FO_DELETE, path};
04384
04385                                         get_path(pane->cur, path);
04386
04387                                         path[lstrlen(path)+1] = '\0';
04388
04389                                         if (!SHFileOperation(&shfo))
04390                                                 refresh_child(child);
04391                                         break;}
04392
04393                                 case ID_VIEW_SORT_NAME:
04394                                         set_sort_order(child, SORT_NAME);
04395                                         break;
04396
04397                                 case ID_VIEW_SORT_TYPE:
04398                                         set_sort_order(child, SORT_EXT);
04399                                         break;
04400
04401                                 case ID_VIEW_SORT_SIZE:
04402                                         set_sort_order(child, SORT_SIZE);
04403                                         break;
04404
04405                                 case ID_VIEW_SORT_DATE:
04406                                         set_sort_order(child, SORT_DATE);
04407                                         break;
04408
04409                                 case ID_VIEW_FILTER: {
04410                                         struct FilterDialog dlg;
04411
04412                                         memset(&dlg, 0, sizeof(struct FilterDialog));
04413                                         lstrcpy(dlg.pattern, child->filter_pattern);
04414                                         dlg.flags = child->filter_flags;
04415
04416                                         if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_VIEW_TYPE), hwnd, FilterDialogDlgProc, (LPARAM)&dlg) == IDOK) {
04417                                                 lstrcpy(child->filter_pattern, dlg.pattern);
04418                                                 child->filter_flags = dlg.flags;
04419                                                 refresh_right_pane(child);
04420                                         }
04421                                         break;}
04422
04423                                 case ID_VIEW_SPLIT: {
04424                                         last_split = child->split_pos;
04425 #ifdef _NO_EXTENSIONS
04426                                         draw_splitbar(hwnd, last_split);
04427 #endif
04428                                         SetCapture(hwnd);
04429                                         break;}
04430
04431                                 case ID_EDIT_PROPERTIES:
04432                                         show_properties_dlg(pane->cur, child->hwnd);
04433                                         break;
04434
04435                                 default:
04436                                         return pane_command(pane, LOWORD(wparam));
04437                         }
04438
04439                         return TRUE;}
04440
04441                 case WM_COMMAND: {
04442                         Pane* pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
04443
04444                         switch(HIWORD(wparam)) {
04445                                 case LBN_SELCHANGE: {
04446                                         int idx = ListBox_GetCurSel(pane->hwnd);
04447                                         Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, idx);
04448
04449                                         if (pane == &child->left)
04450                                                 set_curdir(child, entry, idx, hwnd);
04451                                         else
04452                                                 pane->cur = entry;
04453                                         break;}
04454
04455                                 case LBN_DBLCLK:
04456                                         activate_entry(child, pane, hwnd);
04457                                         break;
04458                         }
04459                         break;}
04460
04461 #ifndef _NO_EXTENSIONS
04462                 case WM_NOTIFY: {
04463                         NMHDR* pnmh = (NMHDR*) lparam;
04464                         return pane_notify(pnmh->idFrom==IDW_HEADER_LEFT? &child->left: &child->right, pnmh);}
04465 #endif
04466
04467 #ifdef _SHELL_FOLDERS
04468                 case WM_CONTEXTMENU: {
04469                         POINT pt, pt_clnt;
04470                         Pane* pane;
04471                         int idx;
04472
04473                          /* first select the current item in the listbox */
04474                         HWND hpanel = (HWND) wparam;
04475                         pt_clnt.x = pt.x = (short)LOWORD(lparam);
04476                         pt_clnt.y = pt.y = (short)HIWORD(lparam);
04477                         ScreenToClient(hpanel, &pt_clnt);
04478                         SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
04479                         SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
04480
04481                          /* now create the popup menu using shell namespace and IContextMenu */
04482                         pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
04483                         idx = ListBox_GetCurSel(pane->hwnd);
04484
04485                         if (idx != -1) {
04486                                 Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, idx);
04487
04488                                 LPITEMIDLIST pidl_abs = get_to_absolute_pidl(entry, hwnd);
04489
04490                                 if (pidl_abs) {
04491                                         IShellFolder* parentFolder;
04492                                         LPCITEMIDLIST pidlLast;
04493
04494                                          /* get and use the parent folder to display correct context menu in all cases */
04495                                         if (SUCCEEDED(SHBindToParent(pidl_abs, &IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) {
04496                                                 if (ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pt.x, pt.y) == S_OK)
04497                                                         refresh_child(child);
04498
04499                                                 IShellFolder_Release(parentFolder);
04500                                         }
04501
04502                                         IMalloc_Free(Globals.iMalloc, pidl_abs);
04503                                 }
04504                         }
04505                         break;}
04506 #endif
04507
04508                   case WM_MEASUREITEM:
04509                   draw_menu_item:
04510                         if (!wparam)    /* Is the message menu-related? */
04511                                 if (CtxMenu_HandleMenuMsg(nmsg, wparam, lparam))
04512                                         return TRUE;
04513
04514                         break;
04515
04516                   case WM_INITMENUPOPUP:
04517                         if (CtxMenu_HandleMenuMsg(nmsg, wparam, lparam))
04518                                 return 0;
04519
04520                         update_view_menu(child);
04521                         break;
04522
04523 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04524                   case WM_MENUCHAR:     /* only supported by IContextMenu3 */
04525                    if (s_pctxmenu3) {
04526                            LRESULT lResult = 0;
04527
04528                            (*s_pctxmenu3->lpVtbl->HandleMenuMsg2)(s_pctxmenu3, nmsg, wparam, lparam, &lResult);
04529
04530                            return lResult;
04531                    }
04532
04533                    break;
04534 #endif
04535
04536                 case WM_SIZE:
04537                         if (wparam != SIZE_MINIMIZED)
04538                                 resize_tree(child, LOWORD(lparam), HIWORD(lparam));
04539                         /* fall through */
04540
04541                 default: def:
04542                         return DefMDIChildProc(hwnd, nmsg, wparam, lparam);
04543         }
04544
04545         return 0;
04546 }

Here is the call graph for this function:

static void collapse_entry | ( | Pane * | pane,
 |  | Entry * | dir
 | ) | [static]

Definition at line 3667 of file winefile.c.

References _Entry::expanded, Pane::hwnd, and _Entry::level.

Referenced by activate_entry().

03668 {
03669         int idx = ListBox_FindItemData(pane->hwnd, 0, dir);
03670
03671         ShowWindow(pane->hwnd, SW_HIDE);
03672
03673         /* hide sub entries */
03674         for(;;) {
03675                 LRESULT res = ListBox_GetItemData(pane->hwnd, idx+1);
03676                 Entry* sub = (Entry*) res;
03677
03678                 if (res==LB_ERR || !sub || sub->level<=dir->level)
03679                         break;
03680
03681                 ListBox_DeleteString(pane->hwnd, idx+1);
03682         }
03683
03684         dir->expanded = FALSE;
03685
03686         ShowWindow(pane->hwnd, SW_SHOW);
03687 }

static int compareDate | ( | const void * | arg1,
 |  | const void * | arg2
 | ) | [static]

Definition at line 1209 of file winefile.c.

References compareType().

01210 {
01211         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01212         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01213
01214         int cmp = compareType(fd1, fd2);
01215         if (cmp)
01216                 return cmp;
01217
01218         return CompareFileTime(&fd2->ftLastWriteTime, &fd1->ftLastWriteTime);
01219 }

Here is the call graph for this function:

static int compareExt | ( | const void * | arg1,
 |  | const void * | arg2
 | ) | [static]

Definition at line 1155 of file winefile.c.

References compareType(), and sEmpty.

01156 {
01157         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01158         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01159         const TCHAR *name1, *name2, *ext1, *ext2;
01160
01161         int cmp = compareType(fd1, fd2);
01162         if (cmp)
01163                 return cmp;
01164
01165         name1 = fd1->cFileName;
01166         name2 = fd2->cFileName;
01167
01168         ext1 = _tcsrchr(name1, TEXT('.'));
01169         ext2 = _tcsrchr(name2, TEXT('.'));
01170
01171         if (ext1)
01172                 ext1++;
01173         else
01174                 ext1 = sEmpty;
01175
01176         if (ext2)
01177                 ext2++;
01178         else
01179                 ext2 = sEmpty;
01180
01181         cmp = lstrcmpi(ext1, ext2);
01182         if (cmp)
01183                 return cmp;
01184
01185         return lstrcmpi(name1, name2);
01186 }

Here is the call graph for this function:

static int compareName | ( | const void * | arg1,
 |  | const void * | arg2
 | ) | [static]

Definition at line 1143 of file winefile.c.

References compareType().

01144 {
01145         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01146         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01147
01148         int cmp = compareType(fd1, fd2);
01149         if (cmp)
01150                 return cmp;
01151
01152         return lstrcmpi(fd1->cFileName, fd2->cFileName);
01153 }

Here is the call graph for this function:

static int compareSize | ( | const void * | arg1,
 |  | const void * | arg2
 | ) | [static]

Definition at line 1188 of file winefile.c.

References compareType().

01189 {
01190         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01191         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01192
01193         int cmp = compareType(fd1, fd2);
01194         if (cmp)
01195                 return cmp;
01196
01197         cmp = fd2->nFileSizeHigh - fd1->nFileSizeHigh;
01198
01199         if (cmp < 0)
01200                 return -1;
01201         else if (cmp > 0)
01202                 return 1;
01203
01204         cmp = fd2->nFileSizeLow - fd1->nFileSizeLow;
01205
01206         return cmp<0? -1: cmp>0? 1: 0;
01207 }

Here is the call graph for this function:

static int compareType | ( | const WIN32_FIND_DATA * | fd1,
 |  | const WIN32_FIND_DATA * | fd2
 | ) | [static]

Definition at line 1128 of file winefile.c.

References TO_DIR, TO_FILE, and TypeOrderFromDirname().

Referenced by compareDate(), compareExt(), compareName(), and compareSize().

01129 {
01130         int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
01131         int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
01132
01133         /* Handle "." and ".." as special case and move them at the very first beginning. */
01134         if (order1==TO_DIR && order2==TO_DIR) {
01135                 order1 = TypeOrderFromDirname(fd1->cFileName);
01136                 order2 = TypeOrderFromDirname(fd2->cFileName);
01137         }
01138
01139         return order2==order1? 0: order1<order2? -1: 1;
01140 }

Here is the call graph for this function:

static HWND create_child_window ( ChildWnd * child ) [static]

Definition at line 1628 of file winefile.c.

References CBTProc(), Pane::cur, WINEFILE_GLOBALS::hInstance, WINEFILE_GLOBALS::hmdiclient, Pane::hwnd, ChildWnd::hwnd, IMAGE_HEIGHT, ChildWnd::left, ChildWnd::path, ChildWnd::pos, ChildWnd::right, WINEFILE_GLOBALS::spaceSize, and sWINEFILETREE.

Referenced by ChildWndProc(), FrameWndProc(), and show_frame().

01629 {
01630         MDICREATESTRUCT mcs;
01631         int idx;
01632
01633         mcs.szClass = sWINEFILETREE;
01634         mcs.szTitle = (LPTSTR)child->path;
01635         mcs.hOwner  = Globals.hInstance;
01636         mcs.x       = child->pos.rcNormalPosition.left;
01637         mcs.y       = child->pos.rcNormalPosition.top;
01638         mcs.cx      = child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left;
01639         mcs.cy      = child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top;
01640         mcs.style   = 0;
01641         mcs.lParam  = 0;
01642
01643         hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId());
01644
01645         newchild = child;
01646         child->hwnd = (HWND) SendMessage(Globals.hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs);
01647         if (!child->hwnd) {
01648                 UnhookWindowsHookEx(hcbthook);
01649                 return 0;
01650         }
01651
01652         UnhookWindowsHookEx(hcbthook);
01653
01654         ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
01655         ListBox_SetItemHeight(child->right.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
01656
01657         idx = ListBox_FindItemData(child->left.hwnd, 0, child->left.cur);
01658         ListBox_SetCurSel(child->left.hwnd, idx);
01659
01660         return child->hwnd;
01661 }

Here is the call graph for this function:

static void create_drive_bar ( void ) [static]

Definition at line 3764 of file winefile.c.

References BUFFER_LEN, WINEFILE_GLOBALS::drives, WINEFILE_GLOBALS::hdrivebar, WINEFILE_GLOBALS::hInstance, WINEFILE_GLOBALS::hMainWnd, ID_DRIVE_FIRST, ID_DRIVE_SHELL_NS, IDB_DRIVEBAR, IDS_SHELL, IDW_DRIVEBAR, and load_string().

Referenced by refresh_drives(), and show_frame().

03765 {
03766         TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0};
03767 #ifndef _NO_EXTENSIONS
03768         TCHAR b1[BUFFER_LEN];
03769 #endif
03770         int btn = 1;
03771         PTSTR p;
03772
03773         GetLogicalDriveStrings(BUFFER_LEN, Globals.drives);
03774
03775         Globals.hdrivebar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
03776                                 IDW_DRIVEBAR, 2, Globals.hInstance, IDB_DRIVEBAR, &drivebarBtn,
03777                                 0, 16, 13, 16, 13, sizeof(TBBUTTON));
03778
03779 #ifndef _NO_EXTENSIONS
03780 #ifdef __WINE__
03781         /* insert unix file system button */
03782         b1[0] = '/';
03783         b1[1] = '\0';
03784         b1[2] = '\0';
03785         SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
03786
03787         drivebarBtn.idCommand = ID_DRIVE_UNIX_FS;
03788         SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
03789         drivebarBtn.iString++;
03790 #endif
03791 #ifdef _SHELL_FOLDERS
03792         /* insert shell namespace button */
03793         load_string(b1, IDS_SHELL);
03794         b1[lstrlen(b1)+1] = '\0';
03795         SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
03796
03797         drivebarBtn.idCommand = ID_DRIVE_SHELL_NS;
03798         SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
03799         drivebarBtn.iString++;
03800 #endif
03801
03802         /* register windows drive root strings */
03803         SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)Globals.drives);
03804 #endif
03805
03806         drivebarBtn.idCommand = ID_DRIVE_FIRST;
03807
03808         for(p=Globals.drives; *p; ) {
03809 #ifdef _NO_EXTENSIONS
03810                 /* insert drive letter */
03811                 TCHAR b[3] = {tolower(*p)};
03812                 SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b);
03813 #endif
03814                 switch(GetDriveType(p)) {
03815                         case DRIVE_REMOVABLE:   drivebarBtn.iBitmap = 1;        break;
03816                         case DRIVE_CDROM:               drivebarBtn.iBitmap = 3;        break;
03817                         case DRIVE_REMOTE:              drivebarBtn.iBitmap = 4;        break;
03818                         case DRIVE_RAMDISK:             drivebarBtn.iBitmap = 5;        break;
03819                         default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
03820                 }
03821
03822                 SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
03823                 drivebarBtn.idCommand++;
03824                 drivebarBtn.iString++;
03825
03826                 while(*p++);
03827         }
03828 }

Here is the call graph for this function:

static HWND create_header | ( | HWND | parent,
 |  | Pane * | pane,
 |  | int | id
 | ) | [static]

Definition at line 2508 of file winefile.c.

References COLUMNS, WINEFILE_GLOBALS::hInstance, and Pane::widths.

Referenced by create_tree_window().

02509 {
02510         HD_ITEM hdi;
02511         int idx;
02512
02513         HWND hwnd = CreateWindow(WC_HEADER, 0, WS_CHILD|WS_VISIBLE|HDS_HORZ/*TODO: |HDS_BUTTONS + sort orders*/,
02514                                                                 0, 0, 0, 0, parent, (HMENU)id, Globals.hInstance, 0);
02515         if (!hwnd)
02516                 return 0;
02517
02518         SetWindowFont(hwnd, GetStockObject(DEFAULT_GUI_FONT), FALSE);
02519
02520         hdi.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT;
02521
02522         for(idx=0; idx<COLUMNS; idx++) {
02523                 hdi.pszText = g_pos_names[idx];
02524                 hdi.fmt = HDF_STRING | g_pos_align[idx];
02525                 hdi.cxy = pane->widths[idx];
02526                 Header_InsertItem(hwnd, idx, &hdi);
02527         }
02528
02529         return hwnd;
02530 }

static void create_tree_window | ( | HWND | parent,
 |  | Pane * | pane,
 |  | int | id,
 |  | int | id_header,
 |  | LPCTSTR | pattern,
 |  | int | filter_flags
 | ) | [static]

Definition at line 2863 of file winefile.c.

References calc_widths(), create_header(), WINEFILE_GLOBALS::hfont, WINEFILE_GLOBALS::hInstance, Pane::hwnd, init_output(), insert_entries(), Pane::root, sEmpty, and TreeWndProc().

Referenced by InitChildWindow().

02864 {
02865         const static TCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'};
02866
02867         static int s_init = 0;
02868         Entry* entry = pane->root;
02869
02870         pane->hwnd = CreateWindow(sListBox, sEmpty, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|
02871                                                                 LBS_DISABLENOSCROLL|LBS_NOINTEGRALHEIGHT|LBS_OWNERDRAWFIXED|LBS_NOTIFY,
02872                                                                 0, 0, 0, 0, parent, (HMENU)id, Globals.hInstance, 0);
02873
02874         SetWindowLongPtr(pane->hwnd, GWLP_USERDATA, (LPARAM)pane);
02875         g_orgTreeWndProc = SubclassWindow(pane->hwnd, TreeWndProc);
02876
02877         SetWindowFont(pane->hwnd, Globals.hfont, FALSE);
02878
02879         /* insert entries into listbox */
02880         if (entry)
02881                 insert_entries(pane, entry, pattern, filter_flags, -1);
02882
02883         /* calculate column widths */
02884         if (!s_init) {
02885                 s_init = 1;
02886                 init_output(pane->hwnd);
02887         }
02888
02889         calc_widths(pane, TRUE);
02890
02891 #ifndef _NO_EXTENSIONS
02892         pane->hwndHeader = create_header(parent, pane, id_header);
02893 #endif
02894 }

Here is the call graph for this function:

static BOOL CtxMenu_HandleMenuMsg | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 4100 of file winefile.c.

Referenced by ChildWndProc().

04101 {
04102 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04103         if (s_pctxmenu3) {
04104                 if (SUCCEEDED((*s_pctxmenu3->lpVtbl->HandleMenuMsg)(s_pctxmenu3, nmsg, wparam, lparam)))
04105                         return TRUE;
04106         }
04107 #endif
04108
04109         if (s_pctxmenu2)
04110                 if (SUCCEEDED((*s_pctxmenu2->lpVtbl->HandleMenuMsg)(s_pctxmenu2, nmsg, wparam, lparam)))
04111                         return TRUE;
04112
04113         return FALSE;
04114 }

static IContextMenu* CtxMenu_query_interfaces ( IContextMenu * pcm1 ) [static]

Definition at line 4079 of file winefile.c.

References CtxMenu_reset().

Referenced by ShellFolderContextMenu().

04080 {
04081         IContextMenu* pcm = NULL;
04082
04083         CtxMenu_reset();
04084
04085 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04086         if (IUnknown_QueryInterface(pcm1, &IID_IContextMenu3, (void**)&pcm) == NOERROR)
04087                 s_pctxmenu3 = (LPCONTEXTMENU3)pcm;
04088         else
04089 #endif
04090         if (IUnknown_QueryInterface(pcm1, &IID_IContextMenu2, (void**)&pcm) == NOERROR)
04091                 s_pctxmenu2 = (LPCONTEXTMENU2)pcm;
04092
04093         if (pcm) {
04094                 IUnknown_Release(pcm1);
04095                 return pcm;
04096         } else
04097                 return pcm1;
04098 }

Here is the call graph for this function:

static void CtxMenu_reset ( void ) [static]

Definition at line 4070 of file winefile.c.

Referenced by CtxMenu_query_interfaces(), and ShellFolderContextMenu().

04071 {
04072         s_pctxmenu2 = NULL;
04073
04074 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04075         s_pctxmenu3 = NULL;
04076 #endif
04077 }

static INT_PTR CALLBACK DestinationDlgProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 1696 of file winefile.c.

References BUFFER_LEN, IDS_NO_IMPL, IDS_WINEFILE, and RS.

Referenced by prompt_target().

01697 {
01698         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
01699
01700         switch(nmsg) {
01701                 case WM_INITDIALOG:
01702                         SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
01703                         SetWindowText(GetDlgItem(hwnd, 201), (LPCTSTR)lparam);
01704                         return 1;
01705
01706                 case WM_COMMAND: {
01707                         int id = (int)wparam;
01708
01709                         switch(id) {
01710                           case IDOK: {
01711                                 LPTSTR dest = (LPTSTR) GetWindowLongPtr(hwnd, GWLP_USERDATA);
01712                                 GetWindowText(GetDlgItem(hwnd, 201), dest, MAX_PATH);
01713                                 EndDialog(hwnd, id);
01714                                 break;}
01715
01716                           case IDCANCEL:
01717                                 EndDialog(hwnd, id);
01718                                 break;
01719
01720                           case 254:
01721                                 MessageBox(hwnd, RS(b1,IDS_NO_IMPL), RS(b2,IDS_WINEFILE), MB_OK);
01722                                 break;
01723                         }
01724
01725                         return 1;
01726                 }
01727         }
01728
01729         return 0;
01730 }

static void display_error | ( | HWND | hwnd,
 |  | DWORD | error
 | ) | [static]

Definition at line 216 of file winefile.c.

References BUFFER_LEN, IDS_ERROR, IDS_WINEFILE, and RS.

Referenced by FrameWndProc(), launch_entry(), and launch_file().

00217 {
00218         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
00219         PTSTR msg;
00220
00221         if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00222                 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL))
00223                 MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
00224         else
00225                 MessageBox(hwnd, RS(b1,IDS_ERROR), RS(b2,IDS_WINEFILE), MB_OK);
00226
00227         LocalFree(msg);
00228 }

static void display_network_error ( HWND hwnd ) [static]

Definition at line 232 of file winefile.c.

References BUFFER_LEN, IDS_WINEFILE, and RS.

Referenced by FrameWndProc().

00233 {
00234         TCHAR msg[BUFFER_LEN], provider[BUFFER_LEN], b2[BUFFER_LEN];
00235         DWORD error;
00236
00237         if (WNetGetLastError(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR)
00238                 MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
00239 }

static void draw_item | ( | Pane * | pane,
 |  | LPDRAWITEMSTRUCT | dis,
 |  | Entry * | entry,
 |  | int | calcWidthCol
 | ) | [static]

Definition at line 3079 of file winefile.c.

References _Entry::bhfi, _Entry::bhfi_valid, BUFFER_LEN, calc_tabbed_width(), calc_width(), COL_ATTRIBUTES, COL_DATE, COL_INDEX, COL_LINKS, COL_SIZE, COL_TIME, COLOR_COMPRESSED, COLOR_SELECTION, COLUMNS, _Entry::data, _Entry::expanded, FILE_ATTRIBUTE_ENCRYPTED, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED, FILE_ATTRIBUTE_REPARSE_POINT, FILE_ATTRIBUTE_SPARSE_FILE, format_date(), FT_DOCUMENT, FT_EXECUTABLE, get_file_type(), _Entry::hicon, WINEFILE_GLOBALS::himl, IMAGE_HEIGHT, IMAGE_WIDTH, IMG_DOCUMENT, IMG_EXECUTABLE, IMG_FILE, IMG_FOLDER, IMG_FOLDER_CUR, IMG_FOLDER_UP, IMG_NONE, IMG_OPEN_FOLDER, _Entry::level, _Entry::next, output_number(), output_tabbed_text(), output_text(), Pane::positions, sLongHexFmt, sLongNumFmt, sNumFmt, TREE_LINE_DX, Pane::treePane, _Entry::up, Pane::visible_cols, and Pane::widths.

Referenced by calc_single_width(), calc_widths(), and ChildWndProc().

03080 {
03081         TCHAR buffer[BUFFER_LEN];
03082         DWORD attrs;
03083         int visible_cols = pane->visible_cols;
03084         COLORREF bkcolor, textcolor;
03085         RECT focusRect = dis->rcItem;
03086         HBRUSH hbrush;
03087         enum IMAGE img;
03088         int img_pos, cx;
03089         int col = 0;
03090
03091         if (entry) {
03092                 attrs = entry->data.dwFileAttributes;
03093
03094                 if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
03095                         if (entry->data.cFileName[0]==TEXT('.') && entry->data.cFileName[1]==TEXT('.')
03096                                         && entry->data.cFileName[2]==TEXT('\0'))
03097                                 img = IMG_FOLDER_UP;
03098 #ifndef _NO_EXTENSIONS
03099                         else if (entry->data.cFileName[0]==TEXT('.') && entry->data.cFileName[1]==TEXT('\0'))
03100                                 img = IMG_FOLDER_CUR;
03101 #endif
03102                         else if (
03103 #ifdef _NO_EXTENSIONS
03104                                          entry->expanded ||
03105 #endif
03106                                          (pane->treePane && (dis->itemState&ODS_FOCUS)))
03107                                 img = IMG_OPEN_FOLDER;
03108                         else
03109                                 img = IMG_FOLDER;
03110                 } else {
03111                         switch(get_file_type(entry->data.cFileName)) {
03112                           case FT_EXECUTABLE:   img = IMG_EXECUTABLE;   break;
03113                           case FT_DOCUMENT:             img = IMG_DOCUMENT;             break;
03114                           default:                              img = IMG_FILE;
03115                         }
03116                 }
03117         } else {
03118                 attrs = 0;
03119                 img = IMG_NONE;
03120         }
03121
03122         if (pane->treePane) {
03123                 if (entry) {
03124                         img_pos = dis->rcItem.left + entry->level*(IMAGE_WIDTH+TREE_LINE_DX);
03125
03126                         if (calcWidthCol == -1) {
03127                                 int x;
03128                                 int y = dis->rcItem.top + IMAGE_HEIGHT/2;
03129                                 Entry* up;
03130                                 RECT rt_clip;
03131                                 HRGN hrgn_org = CreateRectRgn(0, 0, 0, 0);
03132                                 HRGN hrgn;
03133
03134                                 rt_clip.left   = dis->rcItem.left;
03135                                 rt_clip.top    = dis->rcItem.top;
03136                                 rt_clip.right  = dis->rcItem.left+pane->widths[col];
03137                                 rt_clip.bottom = dis->rcItem.bottom;
03138
03139                                 hrgn = CreateRectRgnIndirect(&rt_clip);
03140
03141                                 if (!GetClipRgn(dis->hDC, hrgn_org)) {
03142                                         DeleteObject(hrgn_org);
03143                                         hrgn_org = 0;
03144                                 }
03145
03146                                 /* HGDIOBJ holdPen = SelectObject(dis->hDC, GetStockObject(BLACK_PEN)); */
03147                                 ExtSelectClipRgn(dis->hDC, hrgn, RGN_AND);
03148                                 DeleteObject(hrgn);
03149
03150                                 if ((up=entry->up) != NULL) {
03151                                         MoveToEx(dis->hDC, img_pos-IMAGE_WIDTH/2, y, 0);
03152                                         LineTo(dis->hDC, img_pos-2, y);
03153
03154                                         x = img_pos - IMAGE_WIDTH/2;
03155
03156                                         do {
03157                                                 x -= IMAGE_WIDTH+TREE_LINE_DX;
03158
03159                                                 if (up->next
03160 #ifndef _LEFT_FILES
03161                                                         && (up->next->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
03162 #endif
03163                                                         ) {
03164                                                         MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
03165                                                         LineTo(dis->hDC, x, dis->rcItem.bottom);
03166                                                 }
03167                                         } while((up=up->up) != NULL);
03168                                 }
03169
03170                                 x = img_pos - IMAGE_WIDTH/2;
03171
03172                                 MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
03173                                 LineTo(dis->hDC, x, y);
03174
03175                                 if (entry->next
03176 #ifndef _LEFT_FILES
03177                                         && (entry->next->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
03178 #endif
03179                                         )
03180                                         LineTo(dis->hDC, x, dis->rcItem.bottom);
03181
03182                                 SelectClipRgn(dis->hDC, hrgn_org);
03183                                 if (hrgn_org) DeleteObject(hrgn_org);
03184                                 /* SelectObject(dis->hDC, holdPen); */
03185                         } else if (calcWidthCol==col || calcWidthCol==COLUMNS) {
03186                                 int right = img_pos + IMAGE_WIDTH - TREE_LINE_DX;
03187
03188                                 if (right > pane->widths[col])
03189                                         pane->widths[col] = right;
03190                         }
03191                 } else  {
03192                         img_pos = dis->rcItem.left;
03193                 }
03194         } else {
03195                 img_pos = dis->rcItem.left;
03196
03197                 if (calcWidthCol==col || calcWidthCol==COLUMNS)
03198                         pane->widths[col] = IMAGE_WIDTH;
03199         }
03200
03201         if (calcWidthCol == -1) {
03202                 focusRect.left = img_pos - 2;
03203
03204 #ifdef _NO_EXTENSIONS
03205                 if (pane->treePane && entry) {
03206                         RECT rt = {0};
03207
03208                         DrawText(dis->hDC, entry->data.cFileName, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
03209
03210                         focusRect.right = dis->rcItem.left+pane->positions[col+1]+TREE_LINE_DX + rt.right +2;
03211                 }
03212 #else
03213
03214                 if (attrs & FILE_ATTRIBUTE_COMPRESSED)
03215                         textcolor = COLOR_COMPRESSED;
03216                 else
03217 #endif /* _NO_EXTENSIONS */
03218                         textcolor = RGB(0,0,0);
03219
03220                 if (dis->itemState & ODS_FOCUS) {
03221                         textcolor = RGB(255,255,255);
03222                         bkcolor = COLOR_SELECTION;
03223                 } else {
03224                         bkcolor = RGB(255,255,255);
03225                 }
03226
03227                 hbrush = CreateSolidBrush(bkcolor);
03228                 FillRect(dis->hDC, &focusRect, hbrush);
03229                 DeleteObject(hbrush);
03230
03231                 SetBkMode(dis->hDC, TRANSPARENT);
03232                 SetTextColor(dis->hDC, textcolor);
03233
03234                 cx = pane->widths[col];
03235
03236                 if (cx && img!=IMG_NONE) {
03237                         if (cx > IMAGE_WIDTH)
03238                                 cx = IMAGE_WIDTH;
03239
03240 #ifdef _SHELL_FOLDERS
03241                         if (entry->hicon && entry->hicon!=(HICON)-1)
03242                                 DrawIconEx(dis->hDC, img_pos, dis->rcItem.top, entry->hicon, cx, GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL);
03243                         else
03244 #endif
03245                                 ImageList_DrawEx(Globals.himl, img, dis->hDC,
03246                                                                  img_pos, dis->rcItem.top, cx,
03247                                                                  IMAGE_HEIGHT, bkcolor, CLR_DEFAULT, ILD_NORMAL);
03248                 }
03249         }
03250
03251         if (!entry)
03252                 return;
03253
03254 #ifdef _NO_EXTENSIONS
03255         if (img >= IMG_FOLDER_UP)
03256                 return;
03257 #endif
03258
03259         col++;
03260
03261         /* ouput file name */
03262         if (calcWidthCol == -1)
03263                 output_text(pane, dis, col, entry->data.cFileName, 0);
03264         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03265                 calc_width(pane, dis, col, entry->data.cFileName);
03266
03267         col++;
03268
03269 #ifdef _NO_EXTENSIONS
03270   if (!pane->treePane) {
03271 #endif
03272
03273         /* display file size */
03274         if (visible_cols & COL_SIZE) {
03275 #ifdef _NO_EXTENSIONS
03276                 if (!(attrs&FILE_ATTRIBUTE_DIRECTORY))
03277 #endif
03278                 {
03279                         ULONGLONG size;
03280
03281                         size = ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow;
03282
03283                         _stprintf(buffer, sLongNumFmt, size);
03284
03285                         if (calcWidthCol == -1)
03286                                 output_number(pane, dis, col, buffer);
03287                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03288                                 calc_width(pane, dis, col, buffer);/*TODO: not in every case time enough */
03289                 }
03290
03291                 col++;
03292         }
03293
03294         /* display file date */
03295         if (visible_cols & (COL_DATE|COL_TIME)) {
03296 #ifndef _NO_EXTENSIONS
03297                 format_date(&entry->data.ftCreationTime, buffer, visible_cols);
03298                 if (calcWidthCol == -1)
03299                         output_text(pane, dis, col, buffer, 0);
03300                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03301                         calc_width(pane, dis, col, buffer);
03302                 col++;
03303
03304                 format_date(&entry->data.ftLastAccessTime, buffer, visible_cols);
03305                 if (calcWidthCol == -1)
03306                         output_text(pane, dis, col, buffer, 0);
03307                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03308                         calc_width(pane, dis, col, buffer);
03309                 col++;
03310 #endif /* _NO_EXTENSIONS */
03311
03312                 format_date(&entry->data.ftLastWriteTime, buffer, visible_cols);
03313                 if (calcWidthCol == -1)
03314                         output_text(pane, dis, col, buffer, 0);
03315                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03316                         calc_width(pane, dis, col, buffer);
03317                 col++;
03318         }
03319
03320 #ifndef _NO_EXTENSIONS
03321         if (entry->bhfi_valid) {
03322             ULONGLONG index = ((ULONGLONG)entry->bhfi.nFileIndexHigh << 32) | entry->bhfi.nFileIndexLow;
03323
03324                 if (visible_cols & COL_INDEX) {
03325                         _stprintf(buffer, sLongHexFmt, index);
03326
03327                         if (calcWidthCol == -1)
03328                                 output_text(pane, dis, col, buffer, DT_RIGHT);
03329                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03330                                 calc_width(pane, dis, col, buffer);
03331
03332                         col++;
03333                 }
03334
03335                 if (visible_cols & COL_LINKS) {
03336                         wsprintf(buffer, sNumFmt, entry->bhfi.nNumberOfLinks);
03337
03338                         if (calcWidthCol == -1)
03339                                 output_text(pane, dis, col, buffer, DT_CENTER);
03340                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03341                                 calc_width(pane, dis, col, buffer);
03342
03343                         col++;
03344                 }
03345         } else
03346                 col += 2;
03347 #endif /* _NO_EXTENSIONS */
03348
03349         /* show file attributes */
03350         if (visible_cols & COL_ATTRIBUTES) {
03351 #ifdef _NO_EXTENSIONS
03352                 const static TCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
03353                 lstrcpy(buffer, s4Tabs);
03354 #else
03355                 const static TCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
03356                 lstrcpy(buffer, s11Tabs);
03357 #endif
03358
03359                 if (attrs & FILE_ATTRIBUTE_NORMAL)                                      buffer[ 0] = 'N';
03360                 else {
03361                         if (attrs & FILE_ATTRIBUTE_READONLY)                    buffer[ 2] = 'R';
03362                         if (attrs & FILE_ATTRIBUTE_HIDDEN)                              buffer[ 4] = 'H';
03363                         if (attrs & FILE_ATTRIBUTE_SYSTEM)                              buffer[ 6] = 'S';
03364                         if (attrs & FILE_ATTRIBUTE_ARCHIVE)                             buffer[ 8] = 'A';
03365                         if (attrs & FILE_ATTRIBUTE_COMPRESSED)                  buffer[10] = 'C';
03366 #ifndef _NO_EXTENSIONS
03367                         if (attrs & FILE_ATTRIBUTE_DIRECTORY)                   buffer[12] = 'D';
03368                         if (attrs & FILE_ATTRIBUTE_ENCRYPTED)                   buffer[14] = 'E';
03369                         if (attrs & FILE_ATTRIBUTE_TEMPORARY)                   buffer[16] = 'T';
03370                         if (attrs & FILE_ATTRIBUTE_SPARSE_FILE)                 buffer[18] = 'P';
03371                         if (attrs & FILE_ATTRIBUTE_REPARSE_POINT)               buffer[20] = 'Q';
03372                         if (attrs & FILE_ATTRIBUTE_OFFLINE)                             buffer[22] = 'O';
03373                         if (attrs & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) buffer[24] = 'X';
03374 #endif /* _NO_EXTENSIONS */
03375                 }
03376
03377                 if (calcWidthCol == -1)
03378                         output_tabbed_text(pane, dis, col, buffer);
03379                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03380                         calc_tabbed_width(pane, dis, col, buffer);
03381
03382                 col++;
03383         }
03384
03385 /*TODO
03386         if (flags.security) {
03387                 const static TCHAR sSecTabs[] = {
03388                         ' ','\t',' ','\t',' ','\t',' ',
03389                         ' ','\t',' ',
03390                         ' ','\t',' ','\t',' ','\t',' ',
03391                         ' ','\t',' ',
03392                         ' ','\t',' ','\t',' ','\t',' ',
03393                         '\0'
03394                 };
03395
03396                 DWORD rights = get_access_mask();
03397
03398                 lstrcpy(buffer, sSecTabs);
03399
03400                 if (rights & FILE_READ_DATA)                    buffer[ 0] = 'R';
03401                 if (rights & FILE_WRITE_DATA)                   buffer[ 2] = 'W';
03402                 if (rights & FILE_APPEND_DATA)                  buffer[ 4] = 'A';
03403                 if (rights & FILE_READ_EA)                              {buffer[6] = 'entry'; buffer[ 7] = 'R';}
03404                 if (rights & FILE_WRITE_EA)                             {buffer[9] = 'entry'; buffer[10] = 'W';}
03405                 if (rights & FILE_EXECUTE)                              buffer[12] = 'X';
03406                 if (rights & FILE_DELETE_CHILD)                 buffer[14] = 'D';
03407                 if (rights & FILE_READ_ATTRIBUTES)              {buffer[16] = 'a'; buffer[17] = 'R';}
03408                 if (rights & FILE_WRITE_ATTRIBUTES)             {buffer[19] = 'a'; buffer[20] = 'W';}
03409                 if (rights & WRITE_DAC)                                 buffer[22] = 'C';
03410                 if (rights & WRITE_OWNER)                               buffer[24] = 'O';
03411                 if (rights & SYNCHRONIZE)                               buffer[26] = 'S';
03412
03413                 output_text(dis, col++, buffer, DT_LEFT, 3, psize);
03414         }
03415
03416         if (flags.description) {
03417                 get_description(buffer);
03418                 output_text(dis, col++, buffer, 0, psize);
03419         }
03420 */
03421
03422 #ifdef _NO_EXTENSIONS
03423   }
03424
03425         /* draw focus frame */
03426         if ((dis->itemState&ODS_FOCUS) && calcWidthCol==-1) {
03427                 /* Currently [04/2000] Wine neither behaves exactly the same */
03428                 /* way as WIN 95 nor like Windows NT... */
03429                 HGDIOBJ lastBrush;
03430                 HPEN lastPen;
03431                 HPEN hpen;
03432
03433                 if (!(GetVersion() & 0x80000000)) {     /* Windows NT? */
03434                         LOGBRUSH lb = {PS_SOLID, RGB(255,255,255)};
03435                         hpen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, 0);
03436                 } else
03437                         hpen = CreatePen(PS_DOT, 0, RGB(255,255,255));
03438
03439                 lastPen = SelectPen(dis->hDC, hpen);
03440                 lastBrush = SelectObject(dis->hDC, GetStockObject(HOLLOW_BRUSH));
03441                 SetROP2(dis->hDC, R2_XORPEN);
03442                 Rectangle(dis->hDC, focusRect.left, focusRect.top, focusRect.right, focusRect.bottom);
03443                 SelectObject(dis->hDC, lastBrush);
03444                 SelectObject(dis->hDC, lastPen);
03445                 DeleteObject(hpen);
03446         }
03447 #endif /* _NO_EXTENSIONS */
03448 }

Here is the call graph for this function:

static INT_PTR CALLBACK ExecuteDialogDlgProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 1669 of file winefile.c.

References ExecuteDialog::cmd, and ExecuteDialog::cmdshow.

Referenced by FrameWndProc().

01670 {
01671         static struct ExecuteDialog* dlg;
01672
01673         switch(nmsg) {
01674                 case WM_INITDIALOG:
01675                         dlg = (struct ExecuteDialog*) lparam;
01676                         return 1;
01677
01678                 case WM_COMMAND: {
01679                         int id = (int)wparam;
01680
01681                         if (id == IDOK) {
01682                                 GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH);
01683                                 dlg->cmdshow = Button_GetState(GetDlgItem(hwnd,214))&BST_CHECKED?
01684                                                                                                 SW_SHOWMINIMIZED: SW_SHOWNORMAL;
01685                                 EndDialog(hwnd, id);
01686                         } else if (id == IDCANCEL)
01687                                 EndDialog(hwnd, id);
01688
01689                         return 1;}
01690         }
01691
01692         return 0;
01693 }

static void ExitInstance ( void ) [static]

Definition at line 4775 of file winefile.c.

References WINEFILE_GLOBALS::hfont, WINEFILE_GLOBALS::himl, WINEFILE_GLOBALS::iDesktop, and WINEFILE_GLOBALS::iMalloc.

Referenced by winefile_main().

04776 {
04777 #ifdef _SHELL_FOLDERS
04778         IShellFolder_Release(Globals.iDesktop);
04779         IMalloc_Release(Globals.iMalloc);
04780         CoUninitialize();
04781 #endif
04782
04783         DeleteObject(Globals.hfont);
04784         ImageList_Destroy(Globals.himl);
04785 }

static BOOL expand_entry | ( | ChildWnd * | child,
 |  | Entry * | dir
 | ) | [static]

Definition at line 3624 of file winefile.c.

References calc_widths(), _Entry::data, _Entry::down, _Entry::expanded, ChildWnd::header_wdths_ok, Pane::hwnd, insert_entries(), ChildWnd::left, _Entry::next, set_header(), and TF_ALL.

Referenced by activate_entry().

03625 {
03626         int idx;
03627         Entry* p;
03628
03629         if (!dir || dir->expanded || !dir->down)
03630                 return FALSE;
03631
03632         p = dir->down;
03633
03634         if (p->data.cFileName[0]=='.' && p->data.cFileName[1]=='\0' && p->next) {
03635                 p = p->next;
03636
03637                 if (p->data.cFileName[0]=='.' && p->data.cFileName[1]=='.' &&
03638                                 p->data.cFileName[2]=='\0' && p->next)
03639                         p = p->next;
03640         }
03641
03642         /* no subdirectories ? */
03643         if (!(p->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
03644                 return FALSE;
03645
03646         idx = ListBox_FindItemData(child->left.hwnd, 0, dir);
03647
03648         dir->expanded = TRUE;
03649
03650         /* insert entries in left pane */
03651         insert_entries(&child->left, p, NULL, TF_ALL, idx);
03652
03653         if (!child->header_wdths_ok) {
03654                 if (calc_widths(&child->left, FALSE)) {
03655 #ifndef _NO_EXTENSIONS
03656                         set_header(&child->left);
03657 #endif
03658
03659                         child->header_wdths_ok = TRUE;
03660                 }
03661         }
03662
03663         return TRUE;
03664 }

Here is the call graph for this function:

static HICON extract_icon | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl
 | ) | [static]

Definition at line 836 of file winefile.c.

References _MAX_PATH.

Referenced by read_directory_shell().

00837 {
00838         IExtractIcon* pExtract;
00839
00840         if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) {
00841                 TCHAR path[_MAX_PATH];
00842                 unsigned flags;
00843                 HICON hicon;
00844                 int idx;
00845
00846                 if (SUCCEEDED((*pExtract->lpVtbl->GetIconLocation)(pExtract, GIL_FORSHELL, path, _MAX_PATH, &idx, &flags))) {
00847                         if (!(flags & GIL_NOTFILENAME)) {
00848                                 if (idx == -1)
00849                                         idx = 0;        /* special case for some control panel applications */
00850
00851                                 if ((int)ExtractIconEx(path, idx, 0, &hicon, 1) > 0)
00852                                         flags &= ~GIL_DONTCACHE;
00853                         } else {
00854                                 HICON hIconLarge = 0;
00855
00856                                 HRESULT hr = (*pExtract->lpVtbl->Extract)(pExtract, path, idx, &hIconLarge, &hicon, MAKELONG(0/*GetSystemMetrics(SM_CXICON)*/,GetSystemMetrics(SM_CXSMICON)));
00857
00858                                 if (SUCCEEDED(hr))
00859                                         DestroyIcon(hIconLarge);
00860                         }
00861
00862                         return hicon;
00863                 }
00864         }
00865
00866         return 0;
00867 }

static void fill_w32fdata_shell | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl,
 |  | SFGAOF | attribs,
 |  | WIN32_FIND_DATA * | w32fdata
 | ) | [static]

Definition at line 938 of file winefile.c.

References WINEFILE_GLOBALS::cfStrFName.

Referenced by read_directory_shell().

00939 {
00940         if (!(attribs & SFGAO_FILESYSTEM) ||
00941                   FAILED(SHGetDataFromIDList(folder, pidl, SHGDFIL_FINDDATA, w32fdata, sizeof(WIN32_FIND_DATA)))) {
00942                 WIN32_FILE_ATTRIBUTE_DATA fad;
00943                 IDataObject* pDataObj;
00944
00945                 STGMEDIUM medium = {0, {0}, 0};
00946                 FORMATETC fmt = {Globals.cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00947
00948                 HRESULT hr = IShellFolder_GetUIObjectOf(folder, 0, 1, &pidl, &IID_IDataObject, 0, (LPVOID*)&pDataObj);
00949
00950                 if (SUCCEEDED(hr)) {
00951                         hr = IDataObject_GetData(pDataObj, &fmt, &medium);
00952
00953                         IDataObject_Release(pDataObj);
00954
00955                         if (SUCCEEDED(hr)) {
00956                                 LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal));
00957                                 UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS);
00958
00959                                 if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) {
00960                                         w32fdata->dwFileAttributes = fad.dwFileAttributes;
00961                                         w32fdata->ftCreationTime = fad.ftCreationTime;
00962                                         w32fdata->ftLastAccessTime = fad.ftLastAccessTime;
00963                                         w32fdata->ftLastWriteTime = fad.ftLastWriteTime;
00964
00965                                         if (!(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
00966                                                 w32fdata->nFileSizeLow = fad.nFileSizeLow;
00967                                                 w32fdata->nFileSizeHigh = fad.nFileSizeHigh;
00968                                         }
00969                                 }
00970
00971                                 SetErrorMode(sem_org);
00972
00973                                 GlobalUnlock(medium.UNION_MEMBER(hGlobal));
00974                                 GlobalFree(medium.UNION_MEMBER(hGlobal));
00975                         }
00976                 }
00977         }
00978
00979         if (attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
00980                 w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00981
00982         if (attribs & SFGAO_READONLY)
00983                 w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
00984
00985         if (attribs & SFGAO_COMPRESSED)
00986                 w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED;
00987 }

static INT_PTR CALLBACK FilterDialogDlgProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 1738 of file winefile.c.

References FilterDialog::flags, IDC_VIEW_PATTERN, IDC_VIEW_TYPE_DIRECTORIES, IDC_VIEW_TYPE_DOCUMENTS, IDC_VIEW_TYPE_HIDDEN, IDC_VIEW_TYPE_OTHERS, IDC_VIEW_TYPE_PROGRAMS, FilterDialog::pattern, TF_DIRECTORIES, TF_DOCUMENTS, TF_HIDDEN, TF_OTHERS, and TF_PROGRAMS.

Referenced by ChildWndProc().

01739 {
01740         static struct FilterDialog* dlg;
01741
01742         switch(nmsg) {
01743                 case WM_INITDIALOG:
01744                         dlg = (struct FilterDialog*) lparam;
01745                         SetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern);
01746                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DIRECTORIES), (dlg->flags&TF_DIRECTORIES? BST_CHECKED: BST_UNCHECKED));
01747                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_PROGRAMS), dlg->flags&TF_PROGRAMS? BST_CHECKED: BST_UNCHECKED);
01748                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DOCUMENTS), dlg->flags&TF_DOCUMENTS? BST_CHECKED: BST_UNCHECKED);
01749                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_OTHERS), dlg->flags&TF_OTHERS? BST_CHECKED: BST_UNCHECKED);
01750                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_HIDDEN), dlg->flags&TF_HIDDEN? BST_CHECKED: BST_UNCHECKED);
01751                         return 1;
01752
01753                 case WM_COMMAND: {
01754                         int id = (int)wparam;
01755
01756                         if (id == IDOK) {
01757                                 int flags = 0;
01758
01759                                 GetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern, MAX_PATH);
01760
01761                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DIRECTORIES))&BST_CHECKED? TF_DIRECTORIES: 0;
01762                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_PROGRAMS))&BST_CHECKED? TF_PROGRAMS: 0;
01763                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DOCUMENTS))&BST_CHECKED? TF_DOCUMENTS: 0;
01764                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_OTHERS))&BST_CHECKED? TF_OTHERS: 0;
01765                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_HIDDEN))&BST_CHECKED? TF_HIDDEN: 0;
01766
01767                                 dlg->flags = flags;
01768
01769                                 EndDialog(hwnd, id);
01770                         } else if (id == IDCANCEL)
01771                                 EndDialog(hwnd, id);
01772
01773                         return 1;}
01774         }
01775
01776         return 0;
01777 }

static Entry* find_entry_shell | ( | Entry * | dir,
 |  | LPCITEMIDLIST | pidl
 | ) | [static]

Definition at line 870 of file winefile.c.

References _Entry::down, _Entry::next, and _Entry::pidl.

Referenced by read_tree_shell().

00871 {
00872         Entry* entry;
00873
00874         for(entry=dir->down; entry; entry=entry->next) {
00875                 if (entry->pidl->mkid.cb == pidl->mkid.cb &&
00876                         !memcmp(entry->pidl, pidl, entry->pidl->mkid.cb))
00877                         return entry;
00878         }
00879
00880         return 0;
00881 }

static Entry* find_entry_win | ( | Entry * | dir,
 |  | LPCTSTR | name
 | ) | [static]

Definition at line 419 of file winefile.c.

References _Entry::data, _Entry::down, and _Entry::next.

Referenced by read_tree_win().

00420 {
00421         Entry* entry;
00422
00423         for(entry=dir->down; entry; entry=entry->next) {
00424                 LPCTSTR p = name;
00425                 LPCTSTR q = entry->data.cFileName;
00426
00427                 do {
00428                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00429                                 return entry;
00430                 } while(tolower(*p++) == tolower(*q++));
00431
00432                 p = name;
00433                 q = entry->data.cAlternateFileName;
00434
00435                 do {
00436                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00437                                 return entry;
00438                 } while(tolower(*p++) == tolower(*q++));
00439         }
00440
00441         return 0;
00442 }

static void format_bytes | ( | LPTSTR | buffer,
 |  | LONGLONG | bytes
 | ) | [static]

Definition at line 2827 of file winefile.c.

References sLongNumFmt.

Referenced by set_space_status().

02828 {
02829         const static TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'};
02830         const static TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'};
02831         const static TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'};
02832
02833         float fBytes = (float)bytes;
02834
02835         if (bytes >= 1073741824)        /* 1 GB */
02836                 wsprintf(buffer, sFmtGB, fBytes/1073741824.f+.5f);
02837         else if (bytes >= 1048576)      /* 1 MB */
02838                 wsprintf(buffer, sFmtMB, fBytes/1048576.f+.5f);
02839         else if (bytes >= 1024)         /* 1 kB */
02840                 wsprintf(buffer, sFmtkB, fBytes/1024.f+.5f);
02841         else
02842                 _stprintf(buffer, sLongNumFmt, bytes);
02843 }

static void format_date | ( | const FILETIME * | ft,
 |  | TCHAR * | buffer,
 |  | int | visible_cols
 | ) | [static]

Definition at line 2904 of file winefile.c.

References BUFFER_LEN, COL_DATE, COL_TIME, and sQMarks.

Referenced by draw_item(), and PropertiesDialogDlgProc().

02905 {
02906         SYSTEMTIME systime;
02907         FILETIME lft;
02908         int len = 0;
02909
02910         *buffer = TEXT('\0');
02911
02912         if (!ft->dwLowDateTime && !ft->dwHighDateTime)
02913                 return;
02914
02915         if (!FileTimeToLocalFileTime(ft, &lft))
02916                 {err: lstrcpy(buffer,sQMarks); return;}
02917
02918         if (!FileTimeToSystemTime(&lft, &systime))
02919                 goto err;
02920
02921         if (visible_cols & COL_DATE) {
02922                 len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer, BUFFER_LEN);
02923                 if (!len)
02924                         goto err;
02925         }
02926
02927         if (visible_cols & COL_TIME) {
02928                 if (len)
02929                         buffer[len-1] = ' ';
02930
02931                 buffer[len++] = ' ';
02932
02933                 if (!GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer+len, BUFFER_LEN-len))
02934                         buffer[len] = TEXT('\0');
02935         }
02936 }

static void frame_get_clientspace | ( | HWND | hwnd,
 |  | PRECT | prect
 | ) | [static]

Definition at line 1979 of file winefile.c.

References WINEFILE_GLOBALS::hdrivebar, WINEFILE_GLOBALS::hstatusbar, and WINEFILE_GLOBALS::htoolbar.

Referenced by FrameWndProc().

01980 {
01981         RECT rt;
01982
01983         if (!IsIconic(hwnd))
01984                 GetClientRect(hwnd, prect);
01985         else {
01986                 WINDOWPLACEMENT wp;
01987
01988                 GetWindowPlacement(hwnd, &wp);
01989
01990                 prect->left = prect->top = 0;
01991                 prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left-
01992                                                 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE));
01993                 prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
01994                                                 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
01995                                                 GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
01996         }
01997
01998         if (IsWindowVisible(Globals.htoolbar)) {
01999                 GetClientRect(Globals.htoolbar, &rt);
02000                 prect->top += rt.bottom+2;
02001         }
02002
02003         if (IsWindowVisible(Globals.hdrivebar)) {
02004                 GetClientRect(Globals.hdrivebar, &rt);
02005                 prect->top += rt.bottom+2;
02006         }
02007
02008         if (IsWindowVisible(Globals.hstatusbar)) {
02009                 GetClientRect(Globals.hstatusbar, &rt);
02010                 prect->bottom -= rt.bottom;
02011         }
02012 }

static LRESULT CALLBACK FrameWndProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 2131 of file winefile.c.

References _MAX_DRIVE, activate_drive_window(), activate_fs_window(), alloc_child_window(), BUFFER_LEN, create_child_window(), display_error(), display_network_error(), WINEFILE_GLOBALS::drives, ExecuteDialogDlgProc(), frame_get_clientspace(), FRM_CALC_CLIENT, get_path_pidl(), WINEFILE_GLOBALS::hdrivebar, WINEFILE_GLOBALS::hfont, WINEFILE_GLOBALS::hInstance, WINEFILE_GLOBALS::hMainWnd, WINEFILE_GLOBALS::hmdiclient, WINEFILE_GLOBALS::hMenuFrame, WINEFILE_GLOBALS::hMenuOptions, WINEFILE_GLOBALS::hMenuView, WINEFILE_GLOBALS::hstatusbar, WINEFILE_GLOBALS::htoolbar, Pane::hwnd, WINEFILE_GLOBALS::hwndParent, ID_ABOUT, ID_ABOUT_WINE, ID_CONNECT_NETWORK_DRIVE, ID_DISCONNECT_NETWORK_DRIVE, ID_DRIVE_FIRST, ID_DRIVE_SHELL_NS, ID_EXECUTE, ID_FILE_EXIT, ID_FORMAT_DISK, ID_HELP, ID_LICENSE, ID_NO_WARRANTY, ID_REFRESH, ID_SELECT_FONT, ID_VIEW_DRIVE_BAR, ID_VIEW_FULLSCREEN, ID_VIEW_STATUSBAR, ID_VIEW_TOOL_BAR, ID_WINDOW_ARRANGE, ID_WINDOW_CASCADE, ID_WINDOW_NEW, ID_WINDOW_TILE_HORZ, ID_WINDOW_TILE_VERT, IDD_EXECUTE, IDS_FONT_SEL_DLG_NAME, IDS_FONT_SEL_ERROR, IDS_NO_IMPL, IDS_SHELL, IDS_UNIXFS, IDS_WINE, IDS_WINEFILE, IDW_FIRST_CHILD, IMAGE_HEIGHT, ChildWnd::left, refresh_drives(), resize_frame(), ChildWnd::right, RS, WINEFILE_GLOBALS::spaceSize, sSpace, toggle_child(), toggle_fullscreen(), and WM_DISPATCH_COMMAND.

Referenced by InitInstance().

02132 {
02133         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
02134
02135         switch(nmsg) {
02136                 case WM_CLOSE:
02137                         DestroyWindow(hwnd);
02138
02139                          /* clear handle variables */
02140                         Globals.hMenuFrame = 0;
02141                         Globals.hMenuView = 0;
02142                         Globals.hMenuOptions = 0;
02143                         Globals.hMainWnd = 0;
02144                         Globals.hmdiclient = 0;
02145                         Globals.hdrivebar = 0;
02146                         break;
02147
02148                 case WM_DESTROY:
02149                          /* don't exit desktop when closing file manager window */
02150                         if (!Globals.hwndParent)
02151                                 PostQuitMessage(0);
02152                         break;
02153
02154                 case WM_INITMENUPOPUP: {
02155                         HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0);
02156
02157                         if (!SendMessage(hwndClient, WM_INITMENUPOPUP, wparam, lparam))
02158                                 return 0;
02159                         break;}
02160
02161                 case WM_COMMAND: {
02162                         UINT cmd = LOWORD(wparam);
02163                         HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0);
02164
02165                         if (SendMessage(hwndClient, WM_DISPATCH_COMMAND, wparam, lparam))
02166                                 break;
02167
02168                         if (cmd>=ID_DRIVE_FIRST && cmd<=ID_DRIVE_FIRST+0xFF) {
02169                                 TCHAR drv[_MAX_DRIVE], path[MAX_PATH];
02170                                 ChildWnd* child;
02171                                 LPCTSTR root = Globals.drives;
02172                                 int i;
02173
02174                                 for(i=cmd-ID_DRIVE_FIRST; i--; root++)
02175                                         while(*root)
02176                                                 root++;
02177
02178                                 if (activate_drive_window(root))
02179                                         return 0;
02180
02181                                 _tsplitpath(root, drv, 0, 0, 0);
02182
02183                                 if (!SetCurrentDirectory(drv)) {
02184                                         display_error(hwnd, GetLastError());
02185                                         return 0;
02186                                 }
02187
02188                                 GetCurrentDirectory(MAX_PATH, path); /*TODO: store last directory per drive */
02189                                 child = alloc_child_window(path, NULL, hwnd);
02190
02191                                 if (!create_child_window(child))
02192                                         free(child);
02193                         } else switch(cmd) {
02194                                 case ID_FILE_EXIT:
02195                                         SendMessage(hwnd, WM_CLOSE, 0, 0);
02196                                         break;
02197
02198                                 case ID_WINDOW_NEW: {
02199                                         TCHAR path[MAX_PATH];
02200                                         ChildWnd* child;
02201
02202                                         GetCurrentDirectory(MAX_PATH, path);
02203                                         child = alloc_child_window(path, NULL, hwnd);
02204
02205                                         if (!create_child_window(child))
02206                                                 free(child);
02207                                         break;}
02208
02209                                 case ID_REFRESH:
02210                                         refresh_drives();
02211                                         break;
02212
02213                                 case ID_WINDOW_CASCADE:
02214                                         SendMessage(Globals.hmdiclient, WM_MDICASCADE, 0, 0);
02215                                         break;
02216
02217                                 case ID_WINDOW_TILE_HORZ:
02218                                         SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_HORIZONTAL, 0);
02219                                         break;
02220
02221                                 case ID_WINDOW_TILE_VERT:
02222                                         SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_VERTICAL, 0);
02223                                         break;
02224
02225                                 case ID_WINDOW_ARRANGE:
02226                                         SendMessage(Globals.hmdiclient, WM_MDIICONARRANGE, 0, 0);
02227                                         break;
02228
02229                                 case ID_SELECT_FONT: {
02230                                         TCHAR dlg_name[BUFFER_LEN], dlg_info[BUFFER_LEN];
02231                                         CHOOSEFONT chFont;
02232                                         LOGFONT lFont;
02233
02234                                         HDC hdc = GetDC(hwnd);
02235                                         chFont.lStructSize = sizeof(CHOOSEFONT);
02236                                         chFont.hwndOwner = hwnd;
02237                                         chFont.hDC = NULL;
02238                                         chFont.lpLogFont = &lFont;
02239                                         chFont.Flags = CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_LIMITSIZE | CF_NOSCRIPTSEL;
02240                                         chFont.rgbColors = RGB(0,0,0);
02241                                         chFont.lCustData = 0;
02242                                         chFont.lpfnHook = NULL;
02243                                         chFont.lpTemplateName = NULL;
02244                                         chFont.hInstance = Globals.hInstance;
02245                                         chFont.lpszStyle = NULL;
02246                                         chFont.nFontType = SIMULATED_FONTTYPE;
02247                                         chFont.nSizeMin = 0;
02248                                         chFont.nSizeMax = 24;
02249
02250                                         if (ChooseFont(&chFont)) {
02251                                                 HWND childWnd;
02252                                                 HFONT hFontOld;
02253
02254                                                 DeleteObject(Globals.hfont);
02255                                                 Globals.hfont = CreateFontIndirect(&lFont);
02256                                                 hFontOld = SelectFont(hdc, Globals.hfont);
02257                                                 GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
02258
02259                                                 /* change font in all open child windows */
02260                                                 for(childWnd=GetWindow(Globals.hmdiclient,GW_CHILD); childWnd; childWnd=GetNextWindow(childWnd,GW_HWNDNEXT)) {
02261                                                         ChildWnd* child = (ChildWnd*) GetWindowLongPtr(childWnd, GWLP_USERDATA);
02262                                                         SetWindowFont(child->left.hwnd, Globals.hfont, TRUE);
02263                                                         SetWindowFont(child->right.hwnd, Globals.hfont, TRUE);
02264                                                         ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
02265                                                         ListBox_SetItemHeight(child->right.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
02266                                                         InvalidateRect(child->left.hwnd, NULL, TRUE);
02267                                                         InvalidateRect(child->right.hwnd, NULL, TRUE);
02268                                                 }
02269
02270                                                 SelectFont(hdc, hFontOld);
02271                                         }
02272                                         else if (CommDlgExtendedError()) {
02273                                                 LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
02274                                                 LoadString(Globals.hInstance, IDS_FONT_SEL_ERROR, dlg_info, BUFFER_LEN);
02275                                                 MessageBox(hwnd, dlg_info, dlg_name, MB_OK);
02276                                         }
02277
02278                                         ReleaseDC(hwnd, hdc);
02279                                         break;
02280                                 }
02281
02282                                 case ID_VIEW_TOOL_BAR:
02283                                         toggle_child(hwnd, cmd, Globals.htoolbar);
02284                                         break;
02285
02286                                 case ID_VIEW_DRIVE_BAR:
02287                                         toggle_child(hwnd, cmd, Globals.hdrivebar);
02288                                         break;
02289
02290                                 case ID_VIEW_STATUSBAR:
02291                                         toggle_child(hwnd, cmd, Globals.hstatusbar);
02292                                         break;
02293
02294                                 case ID_EXECUTE: {
02295                                         struct ExecuteDialog dlg;
02296
02297                                         memset(&dlg, 0, sizeof(struct ExecuteDialog));
02298
02299                                         if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_EXECUTE), hwnd, ExecuteDialogDlgProc, (LPARAM)&dlg) == IDOK) {
02300                                                 HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
02301
02302                                                 if ((int)hinst <= 32)
02303                                                         display_error(hwnd, GetLastError());
02304                                         }
02305                                         break;}
02306
02307                                 case ID_CONNECT_NETWORK_DRIVE: {
02308                                         DWORD ret = WNetConnectionDialog(hwnd, RESOURCETYPE_DISK);
02309                                         if (ret == NO_ERROR)
02310                                                 refresh_drives();
02311                                         else if (ret != (DWORD)-1) {
02312                                                 if (ret == ERROR_EXTENDED_ERROR)
02313                                                         display_network_error(hwnd);
02314                                                 else
02315                                                         display_error(hwnd, ret);
02316                                         }
02317                                         break;}
02318
02319                                 case ID_DISCONNECT_NETWORK_DRIVE: {
02320                                         DWORD ret = WNetDisconnectDialog(hwnd, RESOURCETYPE_DISK);
02321                                         if (ret == NO_ERROR)
02322                                                 refresh_drives();
02323                                         else if (ret != (DWORD)-1) {
02324                                                 if (ret == ERROR_EXTENDED_ERROR)
02325                                                         display_network_error(hwnd);
02326                                                 else
02327                                                         display_error(hwnd, ret);
02328                                         }
02329                                         break;}
02330
02331 #ifndef __MINGW32__     /* SHFormatDrive missing in MinGW (as of 13.5.2005) */
02332                                 case ID_FORMAT_DISK: {
02333                                         UINT sem_org = SetErrorMode(0); /* Get the current Error Mode settings. */
02334                                         SetErrorMode(sem_org & ~SEM_FAILCRITICALERRORS); /* Force O/S to handle */
02335                                         SHFormatDrive(hwnd, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
02336                                         SetErrorMode(sem_org); /* Put it back the way it was. */
02337                                         break;}
02338 #endif
02339
02340                                 case ID_HELP:
02341                                         WinHelp(hwnd, RS(b1,IDS_WINEFILE), HELP_INDEX, 0);
02342                                         break;
02343
02344 #ifndef _NO_EXTENSIONS
02345                                 case ID_VIEW_FULLSCREEN:
02346                                         CheckMenuItem(Globals.hMenuOptions, cmd, toggle_fullscreen(hwnd)?MF_CHECKED:0);
02347                                         break;
02348
02349 #ifdef __WINE__
02350                                 case ID_DRIVE_UNIX_FS: {
02351                                         TCHAR path[MAX_PATH];
02352 #ifdef UNICODE
02353                                         char cpath[MAX_PATH];
02354 #endif
02355                                         ChildWnd* child;
02356
02357                                         if (activate_fs_window(RS(b1,IDS_UNIXFS)))
02358                                                 break;
02359
02360
02361 #ifdef UNICODE
02362                                         getcwd(cpath, MAX_PATH);
02363                                         MultiByteToWideChar(CP_UNIXCP, 0, cpath, -1, path, MAX_PATH);
02364 #else
02365                                         getcwd(path, MAX_PATH);
02366 #endif
02367                                         child = alloc_child_window(path, NULL, hwnd);
02368
02369                                         if (!create_child_window(child))
02370                                                 free(child);
02371                                         break;}
02372 #endif
02373
02374 #ifdef _SHELL_FOLDERS
02375                                 case ID_DRIVE_SHELL_NS: {
02376                                         TCHAR path[MAX_PATH];
02377                                         ChildWnd* child;
02378
02379                                         if (activate_fs_window(RS(b1,IDS_SHELL)))
02380                                                 break;
02381
02382                                         GetCurrentDirectory(MAX_PATH, path);
02383                                         child = alloc_child_window(path, get_path_pidl(path,hwnd), hwnd);
02384
02385                                         if (!create_child_window(child))
02386                                                 free(child);
02387                                         break;}
02388 #endif
02389 #endif
02390
02391                                 /*TODO: There are even more menu items! */
02392
02393 #ifndef _NO_EXTENSIONS
02394 #ifdef __WINE__
02395                                 case ID_LICENSE:
02396                                         WineLicense(Globals.hMainWnd);
02397                                         break;
02398
02399                                 case ID_NO_WARRANTY:
02400                                         WineWarranty(Globals.hMainWnd);
02401                                         break;
02402
02403                                 case ID_ABOUT_WINE:
02404                                         ShellAbout(hwnd, RS(b2,IDS_WINE), RS(b1,IDS_WINEFILE), 0);
02405                                         break;
02406 #endif
02407
02408                                 case ID_ABOUT:
02409                                         ShellAbout(hwnd, RS(b1,IDS_WINEFILE), NULL, 0);
02410                                         break;
02411 #endif  /* _NO_EXTENSIONS */
02412
02413                                 default:
02414                                         /*TODO: if (wParam >= PM_FIRST_LANGUAGE && wParam <= PM_LAST_LANGUAGE)
02415                                                 STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE);
02416                                         else */if ((cmd<IDW_FIRST_CHILD || cmd>=IDW_FIRST_CHILD+0x100) &&
02417                                                 (cmd<SC_SIZE || cmd>SC_RESTORE))
02418                                                 MessageBox(hwnd, RS(b2,IDS_NO_IMPL), RS(b1,IDS_WINEFILE), MB_OK);
02419
02420                                         return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam);
02421                         }
02422                         break;}
02423
02424                 case WM_SIZE:
02425                         resize_frame(hwnd, LOWORD(lparam), HIWORD(lparam));
02426                         break;  /* do not pass message to DefFrameProc */
02427
02428 #ifndef _NO_EXTENSIONS
02429                 case WM_GETMINMAXINFO: {
02430                         LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
02431
02432                         lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */
02433                         lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */
02434                         break;}
02435
02436                 case FRM_CALC_CLIENT:
02437                         frame_get_clientspace(hwnd, (PRECT)lparam);
02438                         return TRUE;
02439 #endif /* _NO_EXTENSIONS */
02440
02441                 default:
02442                         return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam);
02443         }
02444
02445         return 0;
02446 }

Here is the call graph for this function:

static void free_child_window ( ChildWnd * child ) [static]

Definition at line 1471 of file winefile.c.

References Root::entry, free_entries(), and ChildWnd::root.

Referenced by ChildWndProc().

01472 {
01473         free_entries(&child->root.entry);
01474         free(child);
01475 }

Here is the call graph for this function:

static void free_entries ( Entry * dir ) [static]

Definition at line 321 of file winefile.c.

References _Entry::down, free_entry(), and _Entry::next.

Referenced by free_child_window(), and scan_entry().

00322 {
00323         Entry *entry, *next=dir->down;
00324
00325         if (next) {
00326                 dir->down = 0;
00327
00328                 do {
00329                         entry = next;
00330                         next = entry->next;
00331
00332                         free_entries(entry);
00333                         free_entry(entry);
00334                 } while(next);
00335         }
00336 }

Here is the call graph for this function:

static void free_entry ( Entry * entry ) [static]

Definition at line 304 of file winefile.c.

References _Entry::folder, _Entry::hicon, WINEFILE_GLOBALS::iDesktop, WINEFILE_GLOBALS::iMalloc, and _Entry::pidl.

Referenced by free_entries().

00305 {
00306 #ifdef _SHELL_FOLDERS
00307         if (entry->hicon && entry->hicon!=(HICON)-1)
00308                 DestroyIcon(entry->hicon);
00309
00310         if (entry->folder && entry->folder!=Globals.iDesktop)
00311                 IShellFolder_Release(entry->folder);
00312
00313         if (entry->pidl)
00314                 IMalloc_Free(Globals.iMalloc, entry->pidl);
00315 #endif
00316
00317         free(entry);
00318 }

static void free_strret ( STRRET * str ) [static]

Definition at line 666 of file winefile.c.

References WINEFILE_GLOBALS::iMalloc.

Referenced by name_from_pidl(), path_from_pidlA(), and path_from_pidlW().

00667 {
00668         if (str->uType == STRRET_WSTR)
00669                 IMalloc_Free(Globals.iMalloc, str->UNION_MEMBER(pOleStr));
00670 }

static void fullscreen_move ( HWND hwnd ) [static]

Definition at line 2044 of file winefile.c.

References Frame_CalcFrameClient.

Referenced by toggle_child().

02045 {
02046         RECT rt, pos;
02047         GetWindowRect(hwnd, &pos);
02048
02049         Frame_CalcFrameClient(hwnd, &rt);
02050         ClientToScreen(hwnd, (LPPOINT)&rt.left);
02051         ClientToScreen(hwnd, (LPPOINT)&rt.right);
02052
02053         rt.left = pos.left-rt.left;
02054         rt.top = pos.top-rt.top;
02055         rt.right = GetSystemMetrics(SM_CXSCREEN)+pos.right-rt.right;
02056         rt.bottom = GetSystemMetrics(SM_CYSCREEN)+pos.bottom-rt.bottom;
02057
02058         MoveWindow(hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
02059 }

static enum FILE_TYPE get_file_type ( LPCTSTR filename ) [static]

Definition at line 3064 of file winefile.c.

References FT_DOCUMENT, FT_EXECUTABLE, FT_OTHER, is_exe_file(), is_registered_type(), and sEmpty.

Referenced by draw_item(), and insert_entries().

03065 {
03066         LPCTSTR ext = _tcsrchr(filename, '.');
03067         if (!ext)
03068                 ext = sEmpty;
03069
03070         if (is_exe_file(ext))
03071                 return FT_EXECUTABLE;
03072         else if (is_registered_type(ext))
03073                 return FT_DOCUMENT;
03074         else
03075                 return FT_OTHER;
03076 }

Here is the call graph for this function:

static void get_path | ( | Entry * | dir,
 |  | PTSTR | path
 | ) | [static]

Definition at line 1479 of file winefile.c.

References _Entry::data, ET_SHELL, ET_UNIX, _Entry::etype, _Entry::folder, WINEFILE_GLOBALS::iDesktop, path_from_pidl, _Entry::pidl, and _Entry::up.

Referenced by ChildWndProc(), get_to_absolute_pidl(), launch_entry(), prompt_target(), refresh_child(), scan_entry(), set_curdir(), and show_properties_dlg().

01480 {
01481         Entry* entry;
01482         int len = 0;
01483         int level = 0;
01484
01485 #ifdef _SHELL_FOLDERS
01486         if (dir->etype == ET_SHELL)
01487         {
01488                 SFGAOF attribs;
01489                 HRESULT hr = S_OK;
01490
01491                 path[0] = TEXT('\0');
01492
01493                 attribs = 0;
01494
01495                 if (dir->folder)
01496                         hr = IShellFolder_GetAttributesOf(dir->folder, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs);
01497
01498                 if (SUCCEEDED(hr) && (attribs&SFGAO_FILESYSTEM)) {
01499                         IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop;
01500
01501                         hr = path_from_pidl(parent, dir->pidl, path, MAX_PATH);
01502                 }
01503         }
01504         else
01505 #endif
01506         {
01507                 for(entry=dir; entry; level++) {
01508                         LPCTSTR name;
01509                         int l;
01510
01511                         {
01512                                 LPCTSTR s;
01513                                 name = entry->data.cFileName;
01514                                 s = name;
01515
01516                                 for(l=0; *s && *s!=TEXT('/') && *s!=TEXT('\\'); s++)
01517                                         l++;
01518                         }
01519
01520                         if (entry->up) {
01521                                 if (l > 0) {
01522                                         memmove(path+l+1, path, len*sizeof(TCHAR));
01523                                         memcpy(path+1, name, l*sizeof(TCHAR));
01524                                         len += l+1;
01525
01526 #ifndef _NO_EXTENSIONS
01527                                         if (entry->etype == ET_UNIX)
01528                                                 path[0] = TEXT('/');
01529                                         else
01530 #endif
01531                                         path[0] = TEXT('\\');
01532                                 }
01533
01534                                 entry = entry->up;
01535                         } else {
01536                                 memmove(path+l, path, len*sizeof(TCHAR));
01537                                 memcpy(path, name, l*sizeof(TCHAR));
01538                                 len += l;
01539                                 break;
01540                         }
01541                 }
01542
01543                 if (!level) {
01544 #ifndef _NO_EXTENSIONS
01545                         if (entry->etype == ET_UNIX)
01546                                 path[len++] = TEXT('/');
01547                         else
01548 #endif
01549                                 path[len++] = TEXT('\\');
01550                 }
01551
01552                 path[len] = TEXT('\0');
01553         }
01554 }

static LPITEMIDLIST get_path_pidl | ( | LPTSTR | path,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 783 of file winefile.c.

References WINEFILE_GLOBALS::iDesktop.

Referenced by FrameWndProc(), get_to_absolute_pidl(), and refresh_child().

00784 {
00785         LPITEMIDLIST pidl;
00786         HRESULT hr;
00787         ULONG len;
00788
00789 #ifdef UNICODE
00790         LPWSTR buffer = path;
00791 #else
00792         WCHAR buffer[MAX_PATH];
00793         MultiByteToWideChar(CP_ACP, 0, path, -1, buffer, MAX_PATH);
00794 #endif
00795
00796         hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
00797         if (FAILED(hr))
00798                 return NULL;
00799
00800         return pidl;
00801 }

static void get_strretA | ( | STRRET * | str,
 |  | const SHITEMID * | shiid,
 |  | LPSTR | buffer,
 |  | int | len
 | ) | [static]

Definition at line 686 of file winefile.c.

References strcpyn().

Referenced by path_from_pidlA().

00687 {
00688  switch(str->uType) {
00689   case STRRET_WSTR:
00690         WideCharToMultiByte(CP_ACP, 0, str->UNION_MEMBER(pOleStr), -1, buffer, len, NULL, NULL);
00691         break;
00692
00693   case STRRET_OFFSET:
00694         strcpyn(buffer, (LPCSTR)shiid+str->UNION_MEMBER(uOffset), len);
00695         break;
00696
00697   case STRRET_CSTR:
00698         strcpyn(buffer, str->UNION_MEMBER(cStr), len);
00699  }
00700 }

Here is the call graph for this function:

static void get_strretW | ( | STRRET * | str,
 |  | const SHITEMID * | shiid,
 |  | LPWSTR | buffer,
 |  | int | len
 | ) | [static]

Definition at line 731 of file winefile.c.

References wcscpyn().

Referenced by path_from_pidlW().

00732 {
00733  switch(str->uType) {
00734   case STRRET_WSTR:
00735         wcscpyn(buffer, str->UNION_MEMBER(pOleStr), len);
00736         break;
00737
00738   case STRRET_OFFSET:
00739         MultiByteToWideChar(CP_ACP, 0, (LPCSTR)shiid+str->UNION_MEMBER(uOffset), -1, buffer, len);
00740         break;
00741
00742   case STRRET_CSTR:
00743         MultiByteToWideChar(CP_ACP, 0, str->UNION_MEMBER(cStr), -1, buffer, len);
00744  }
00745 }

Here is the call graph for this function:

static LPITEMIDLIST get_to_absolute_pidl | ( | Entry * | entry,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 806 of file winefile.c.

References ET_SHELL, ET_WINDOWS, _Entry::etype, _Entry::folder, get_path(), get_path_pidl(), WINEFILE_GLOBALS::iDesktop, path_from_pidlW(), _Entry::pidl, and _Entry::up.

Referenced by ChildWndProc(), and launch_entry().

00807 {
00808         if (entry->up && entry->up->etype==ET_SHELL) {
00809                 IShellFolder* folder = entry->up->folder;
00810                 WCHAR buffer[MAX_PATH];
00811
00812                 HRESULT hr = path_from_pidlW(folder, entry->pidl, buffer, MAX_PATH);
00813
00814                 if (SUCCEEDED(hr)) {
00815                         LPITEMIDLIST pidl;
00816                         ULONG len;
00817
00818                         hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
00819
00820                         if (SUCCEEDED(hr))
00821                                 return pidl;
00822                 }
00823         } else if (entry->etype == ET_WINDOWS) {
00824                 TCHAR path[MAX_PATH];
00825
00826                 get_path(entry, path);
00827
00828                 return get_path_pidl(path, hwnd);
00829         } else if (entry->pidl)
00830                 return ILClone(entry->pidl);
00831
00832         return NULL;
00833 }

Here is the call graph for this function:

static void init_output ( HWND hwnd ) [static]

Definition at line 2535 of file winefile.c.

References WINEFILE_GLOBALS::hfont, WINEFILE_GLOBALS::num_sep, WINEFILE_GLOBALS::spaceSize, and sSpace.

Referenced by create_tree_window().

02536 {
02537         const static TCHAR s1000[] = {'1','0','0','0','\0'};
02538
02539         TCHAR b[16];
02540         HFONT old_font;
02541         HDC hdc = GetDC(hwnd);
02542
02543         if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, s1000, 0, b, 16) > 4)
02544                 Globals.num_sep = b[1];
02545         else
02546                 Globals.num_sep = TEXT('.');
02547
02548         old_font = SelectFont(hdc, Globals.hfont);
02549         GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
02550         SelectFont(hdc, old_font);
02551         ReleaseDC(hwnd, hdc);
02552 }

static void InitChildWindow ( ChildWnd * child ) [static]

Definition at line 2897 of file winefile.c.

References create_tree_window(), ChildWnd::filter_flags, ChildWnd::filter_pattern, ChildWnd::hwnd, IDW_HEADER_LEFT, IDW_HEADER_RIGHT, IDW_TREE_LEFT, IDW_TREE_RIGHT, ChildWnd::left, ChildWnd::right, and TF_ALL.

Referenced by ChildWndProc().

02898 {
02899         create_tree_window(child->hwnd, &child->left, IDW_TREE_LEFT, IDW_HEADER_LEFT, NULL, TF_ALL);
02900         create_tree_window(child->hwnd, &child->right, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, child->filter_pattern, child->filter_flags);
02901 }

Here is the call graph for this function:

static void InitInstance ( HINSTANCE hinstance ) [static]

Definition at line 4579 of file winefile.c.

References WINEFILE_GLOBALS::cfStrFName, ChildWndProc(), FrameWndProc(), WINEFILE_GLOBALS::haccel, WINEFILE_GLOBALS::hfont, WINEFILE_GLOBALS::hframeClass, WINEFILE_GLOBALS::hInstance, IDA_WINEFILE, WINEFILE_GLOBALS::iDesktop, IDI_WINEFILE, IDS_COL_ADATE, IDS_COL_ATTR, IDS_COL_CDATE, IDS_COL_IDX, IDS_COL_LINKS, IDS_COL_MDATE, IDS_COL_NAME, IDS_COL_SEC, IDS_COL_SIZE, WINEFILE_GLOBALS::iMalloc, load_string(), sWINEFILEFRAME, and sWINEFILETREE.

Referenced by winefile_main().

04580 {
04581         const static TCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
04582
04583         WNDCLASSEX wcFrame;
04584         WNDCLASS wcChild;
04585         ATOM hChildClass;
04586         int col;
04587
04588         INITCOMMONCONTROLSEX icc = {
04589                 sizeof(INITCOMMONCONTROLSEX),
04590                 ICC_BAR_CLASSES
04591         };
04592
04593         HDC hdc = GetDC(0);
04594
04595         setlocale(LC_COLLATE, "");      /* set collating rules to local settings for compareName */
04596
04597         InitCommonControlsEx(&icc);
04598
04599
04600         /* register frame window class */
04601
04602         wcFrame.cbSize        = sizeof(WNDCLASSEX);
04603         wcFrame.style         = 0;
04604         wcFrame.lpfnWndProc   = FrameWndProc;
04605         wcFrame.cbClsExtra    = 0;
04606         wcFrame.cbWndExtra    = 0;
04607         wcFrame.hInstance     = hinstance;
04608         wcFrame.hIcon         = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_WINEFILE));
04609         wcFrame.hCursor       = LoadCursor(0, IDC_ARROW);
04610         wcFrame.hbrBackground = 0;
04611         wcFrame.lpszMenuName  = 0;
04612         wcFrame.lpszClassName = sWINEFILEFRAME;
04613         wcFrame.hIconSm       = (HICON)LoadImage(hinstance,
04614                                                                                          MAKEINTRESOURCE(IDI_WINEFILE),
04615                                                                                          IMAGE_ICON,
04616                                                                                          GetSystemMetrics(SM_CXSMICON),
04617                                                                                          GetSystemMetrics(SM_CYSMICON),
04618                                                                                          LR_SHARED);
04619
04620         Globals.hframeClass = RegisterClassEx(&wcFrame);
04621
04622
04623         /* register tree windows class */
04624
04625         wcChild.style         = CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW;
04626         wcChild.lpfnWndProc   = ChildWndProc;
04627         wcChild.cbClsExtra    = 0;
04628         wcChild.cbWndExtra    = 0;
04629         wcChild.hInstance     = hinstance;
04630         wcChild.hIcon         = 0;
04631         wcChild.hCursor       = LoadCursor(0, IDC_ARROW);
04632         wcChild.hbrBackground = 0;
04633         wcChild.lpszMenuName  = 0;
04634         wcChild.lpszClassName = sWINEFILETREE;
04635
04636         hChildClass = RegisterClass(&wcChild);
04637
04638
04639         Globals.haccel = LoadAccelerators(hinstance, MAKEINTRESOURCE(IDA_WINEFILE));
04640
04641         Globals.hfont = CreateFont(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sFont);
04642
04643         ReleaseDC(0, hdc);
04644
04645         Globals.hInstance = hinstance;
04646
04647 #ifdef _SHELL_FOLDERS
04648         CoInitialize(NULL);
04649         CoGetMalloc(MEMCTX_TASK, &Globals.iMalloc);
04650         SHGetDesktopFolder(&Globals.iDesktop);
04651 #ifdef __WINE__
04652         Globals.cfStrFName = RegisterClipboardFormatA(CFSTR_FILENAME);
04653 #else
04654         Globals.cfStrFName = RegisterClipboardFormat(CFSTR_FILENAME);
04655 #endif
04656 #endif
04657
04658         /* load column strings */
04659         col = 1;
04660
04661         load_string(g_pos_names[col++], IDS_COL_NAME);
04662         load_string(g_pos_names[col++], IDS_COL_SIZE);
04663         load_string(g_pos_names[col++], IDS_COL_CDATE);
04664 #ifndef _NO_EXTENSIONS
04665         load_string(g_pos_names[col++], IDS_COL_ADATE);
04666         load_string(g_pos_names[col++], IDS_COL_MDATE);
04667         load_string(g_pos_names[col++], IDS_COL_IDX);
04668         load_string(g_pos_names[col++], IDS_COL_LINKS);
04669 #endif
04670         load_string(g_pos_names[col++], IDS_COL_ATTR);
04671 #ifndef _NO_EXTENSIONS
04672         load_string(g_pos_names[col++], IDS_COL_SEC);
04673 #endif
04674 }

Here is the call graph for this function:

static int insert_entries | ( | Pane * | pane,
 |  | Entry * | dir,
 |  | LPCTSTR | pattern,
 |  | int | filter_flags,
 |  | int | idx
 | ) | [static]

Definition at line 2755 of file winefile.c.

References _Entry::data, _Entry::down, _Entry::expanded, FT_DOCUMENT, FT_EXECUTABLE, get_file_type(), Pane::hwnd, _Entry::next, pattern_imatch(), TF_DIRECTORIES, TF_DOCUMENTS, TF_HIDDEN, TF_OTHERS, TF_PROGRAMS, and Pane::treePane.

Referenced by create_tree_window(), expand_entry(), refresh_child(), refresh_right_pane(), and scan_entry().

02756 {
02757         Entry* entry = dir;
02758
02759         if (!entry)
02760                 return idx;
02761
02762         ShowWindow(pane->hwnd, SW_HIDE);
02763
02764         for(; entry; entry=entry->next) {
02765 #ifndef _LEFT_FILES
02766                 if (pane->treePane && !(entry->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
02767                         continue;
02768 #endif
02769
02770                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
02771                         /* don't display entries "." and ".." in the left pane */
02772                         if (pane->treePane && entry->data.cFileName[0]==TEXT('.'))
02773                                 if (
02774         #ifndef _NO_EXTENSIONS
02775                                         entry->data.cFileName[1]==TEXT('\0') ||
02776         #endif
02777                                         (entry->data.cFileName[1]==TEXT('.') && entry->data.cFileName[2]==TEXT('\0')))
02778                                         continue;
02779
02780                         /* filter directories in right pane */
02781                         if (!pane->treePane && !(filter_flags&TF_DIRECTORIES))
02782                                 continue;
02783                 }
02784
02785                 /* filter using the file name pattern */
02786                 if (pattern)
02787                         if (!pattern_imatch(entry->data.cFileName, pattern))
02788                                 continue;
02789
02790                 /* filter system and hidden files */
02791                 if (!(filter_flags&TF_HIDDEN) && (entry->data.dwFileAttributes&(FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM)))
02792                         continue;
02793
02794                 /* filter looking at the file type */
02795                 if ((filter_flags&(TF_PROGRAMS|TF_DOCUMENTS|TF_OTHERS)) != (TF_PROGRAMS|TF_DOCUMENTS|TF_OTHERS))
02796                         switch(get_file_type(entry->data.cFileName)) {
02797                           case FT_EXECUTABLE:
02798                                 if (!(filter_flags & TF_PROGRAMS))
02799                                         continue;
02800                                 break;
02801
02802                           case FT_DOCUMENT:
02803                                 if (!(filter_flags & TF_DOCUMENTS))
02804                                         continue;
02805                                 break;
02806
02807                           default: /* TF_OTHERS */
02808                                 if (!(filter_flags & TF_OTHERS))
02809                                         continue;
02810                         }
02811
02812                 if (idx != -1)
02813                         idx++;
02814
02815                 ListBox_InsertItemData(pane->hwnd, idx, entry);
02816
02817                 if (pane->treePane && entry->expanded)
02818                         idx = insert_entries(pane, entry->down, pattern, filter_flags, idx);
02819         }
02820
02821         ShowWindow(pane->hwnd, SW_SHOW);
02822
02823         return idx;
02824 }

Here is the call graph for this function:

static BOOL is_directory ( LPCTSTR target ) [static]

Definition at line 4015 of file winefile.c.

Referenced by prompt_target().

04016 {
04017         /*TODO correctly handle UNIX paths */
04018         DWORD target_attr = GetFileAttributes(target);
04019
04020         if (target_attr == INVALID_FILE_ATTRIBUTES)
04021                 return FALSE;
04022
04023         return target_attr&FILE_ATTRIBUTE_DIRECTORY? TRUE: FALSE;
04024 }

static BOOL is_exe_file ( LPCTSTR ext ) [static]

Definition at line 3025 of file winefile.c.

References _MAX_EXT.

Referenced by get_file_type().

03026 {
03027         static const TCHAR executable_extensions[][4] = {
03028                 {'C','O','M','\0'},
03029                 {'E','X','E','\0'},
03030                 {'B','A','T','\0'},
03031                 {'C','M','D','\0'},
03032 #ifndef _NO_EXTENSIONS
03033                 {'C','M','M','\0'},
03034                 {'B','T','M','\0'},
03035                 {'A','W','K','\0'},
03036 #endif /* _NO_EXTENSIONS */
03037                 {'\0'}
03038         };
03039
03040         TCHAR ext_buffer[_MAX_EXT];
03041         const TCHAR (*p)[4];
03042         LPCTSTR s;
03043         LPTSTR d;
03044
03045         for(s=ext+1,d=ext_buffer; (*d=tolower(*s)); s++)
03046                 d++;
03047
03048         for(p=executable_extensions; (*p)[0]; p++)
03049                 if (!lstrcmpi(ext_buffer, *p))
03050                         return TRUE;
03051
03052         return FALSE;
03053 }

static BOOL is_registered_type ( LPCTSTR ext ) [static]

Definition at line 3055 of file winefile.c.

Referenced by get_file_type().

03056 {
03057         /* check if there exists a classname for this file extension in the registry */
03058         if (!RegQueryValue(HKEY_CLASSES_ROOT, ext, NULL, NULL))
03059                 return TRUE;
03060
03061         return FALSE;
03062 }

static BOOL launch_entry | ( | Entry * | entry,
 |  | HWND | hwnd,
 |  | UINT | nCmdShow
 | ) | [static]

Definition at line 3860 of file winefile.c.

References ExecuteDialog::cmd, display_error(), ET_SHELL, _Entry::etype, get_path(), get_to_absolute_pidl(), WINEFILE_GLOBALS::iMalloc, launch_file(), and _Entry::pidl.

Referenced by activate_entry().

03861 {
03862         TCHAR cmd[MAX_PATH];
03863
03864 #ifdef _SHELL_FOLDERS
03865         if (entry->etype == ET_SHELL) {
03866                 BOOL ret = TRUE;
03867
03868                 SHELLEXECUTEINFO shexinfo;
03869
03870                 shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
03871                 shexinfo.fMask = SEE_MASK_IDLIST;
03872                 shexinfo.hwnd = hwnd;
03873                 shexinfo.lpVerb = NULL;
03874                 shexinfo.lpFile = NULL;
03875                 shexinfo.lpParameters = NULL;
03876                 shexinfo.lpDirectory = NULL;
03877                 shexinfo.nShow = nCmdShow;
03878                 shexinfo.lpIDList = get_to_absolute_pidl(entry, hwnd);
03879
03880                 if (!ShellExecuteEx(&shexinfo)) {
03881                         display_error(hwnd, GetLastError());
03882                         ret = FALSE;
03883                 }
03884
03885                 if (shexinfo.lpIDList != entry->pidl)
03886                         IMalloc_Free(Globals.iMalloc, shexinfo.lpIDList);
03887
03888                 return ret;
03889         }
03890 #endif
03891
03892         get_path(entry, cmd);
03893
03894          /* start program, open document... */
03895         return launch_file(hwnd, cmd, nCmdShow);
03896 }

Here is the call graph for this function:

static BOOL launch_file | ( | HWND | hwnd,
 |  | LPCTSTR | cmd,
 |  | UINT | nCmdShow
 | ) | [static]

Definition at line 3847 of file winefile.c.

References display_error().

Referenced by launch_entry().

03848 {
03849         HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow);
03850
03851         if ((int)hinst <= 32) {
03852                 display_error(hwnd, GetLastError());
03853                 return FALSE;
03854         }
03855
03856         return TRUE;
03857 }

Here is the call graph for this function:

static LPTSTR load_string | ( | LPTSTR | buffer,
 |  | UINT | id
 | ) | [static]

Definition at line 205 of file winefile.c.

References BUFFER_LEN, and WINEFILE_GLOBALS::hInstance.

Referenced by alloc_child_window(), create_drive_bar(), InitInstance(), and read_tree().

00206 {
00207         LoadString(Globals.hInstance, id, buffer, BUFFER_LEN);
00208
00209         return buffer;
00210 }

static HRESULT name_from_pidl | ( | IShellFolder * | folder,
 |  | LPITEMIDLIST | pidl,
 |  | LPTSTR | buffer,
 |  | int | len,
 |  | SHGDNF | flags
 | ) | [static]

Definition at line 748 of file winefile.c.

References free_strret(), and get_strret.

Referenced by read_directory_shell().

00749 {
00750         STRRET str;
00751
00752         HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, flags, &str);
00753
00754         if (SUCCEEDED(hr)) {
00755                 get_strret(&str, &pidl->mkid, buffer, len);
00756                 free_strret(&str);
00757         } else
00758                 buffer[0] = '\0';
00759
00760         return hr;
00761 }

Here is the call graph for this function:

static void output_number | ( | Pane * | pane,
 |  | LPDRAWITEMSTRUCT | dis,
 |  | int | col,
 |  | LPCTSTR | str
 | ) | [static]

Definition at line 2993 of file winefile.c.

References WINEFILE_GLOBALS::num_sep, Pane::positions, and WINEFILE_GLOBALS::spaceSize.

Referenced by draw_item().

02994 {
02995         int x = dis->rcItem.left;
02996         RECT rt;
02997         LPCTSTR s = str;
02998         TCHAR b[128];
02999         LPTSTR d = b;
03000         int pos;
03001
03002         rt.left   = x+pane->positions[col]+Globals.spaceSize.cx;
03003         rt.top    = dis->rcItem.top;
03004         rt.right  = x+pane->positions[col+1]-Globals.spaceSize.cx;
03005         rt.bottom = dis->rcItem.bottom;
03006
03007         if (*s)
03008                 *d++ = *s++;
03009
03010         /* insert number separator characters */
03011         pos = lstrlen(s) % 3;
03012
03013         while(*s)
03014                 if (pos--)
03015                         *d++ = *s++;
03016                 else {
03017                         *d++ = Globals.num_sep;
03018                         pos = 3;
03019                 }
03020
03021         DrawText(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS);
03022 }

static void output_tabbed_text | ( | Pane * | pane,
 |  | LPDRAWITEMSTRUCT | dis,
 |  | int | col,
 |  | LPCTSTR | str
 | ) | [static]

Definition at line 2977 of file winefile.c.

References Pane::positions, and WINEFILE_GLOBALS::spaceSize.

Referenced by draw_item().

02978 {
02979         int x = dis->rcItem.left;
02980         RECT rt;
02981
02982         rt.left   = x+pane->positions[col]+Globals.spaceSize.cx;
02983         rt.top    = dis->rcItem.top;
02984         rt.right  = x+pane->positions[col+1]-Globals.spaceSize.cx;
02985         rt.bottom = dis->rcItem.bottom;
02986
02987 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
02988         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
02989
02990         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
02991 }

static void output_text | ( | Pane * | pane,
 |  | LPDRAWITEMSTRUCT | dis,
 |  | int | col,
 |  | LPCTSTR | str,
 |  | DWORD | flags
 | ) | [static]

Definition at line 2964 of file winefile.c.

References Pane::positions, and WINEFILE_GLOBALS::spaceSize.

Referenced by draw_item().

02965 {
02966         int x = dis->rcItem.left;
02967         RECT rt;
02968
02969         rt.left   = x+pane->positions[col]+Globals.spaceSize.cx;
02970         rt.top    = dis->rcItem.top;
02971         rt.right  = x+pane->positions[col+1]-Globals.spaceSize.cx;
02972         rt.bottom = dis->rcItem.bottom;
02973
02974         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags);
02975 }

static BOOL pane_command | ( | Pane * | pane,
 |  | UINT | cmd
 | ) | [static]

Definition at line 3949 of file winefile.c.

References calc_widths(), COL_ALL, WINEFILE_GLOBALS::hMenuView, Pane::hwnd, ID_PREFERRED_SIZES, ID_VIEW_ALL_ATTRIBUTES, ID_VIEW_NAME, ID_VIEW_SELECTED_ATTRIBUTES, set_header(), and Pane::visible_cols.

Referenced by ChildWndProc().

03950 {
03951         switch(cmd) {
03952                 case ID_VIEW_NAME:
03953                         if (pane->visible_cols) {
03954                                 pane->visible_cols = 0;
03955                                 calc_widths(pane, TRUE);
03956 #ifndef _NO_EXTENSIONS
03957                                 set_header(pane);
03958 #endif
03959                                 InvalidateRect(pane->hwnd, 0, TRUE);
03960                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND|MF_CHECKED);
03961                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND);
03962                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
03963                         }
03964                         break;
03965
03966                 case ID_VIEW_ALL_ATTRIBUTES:
03967                         if (pane->visible_cols != COL_ALL) {
03968                                 pane->visible_cols = COL_ALL;
03969                                 calc_widths(pane, TRUE);
03970 #ifndef _NO_EXTENSIONS
03971                                 set_header(pane);
03972 #endif
03973                                 InvalidateRect(pane->hwnd, 0, TRUE);
03974                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND);
03975                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND|MF_CHECKED);
03976                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
03977                         }
03978                         break;
03979
03980 #ifndef _NO_EXTENSIONS
03981                 case ID_PREFERRED_SIZES: {
03982                         calc_widths(pane, TRUE);
03983                         set_header(pane);
03984                         InvalidateRect(pane->hwnd, 0, TRUE);
03985                         break;}
03986 #endif
03987
03988                         /* TODO: more command ids... */
03989
03990                 default:
03991                         return FALSE;
03992         }
03993
03994         return TRUE;
03995 }

Here is the call graph for this function:

static LRESULT pane_notify | ( | Pane * | pane,
 |  | NMHDR * | pnmh
 | ) | [static]

Definition at line 3500 of file winefile.c.

References calc_single_width(), COLUMNS, Pane::hwnd, Pane::hwndHeader, Pane::positions, set_header(), and Pane::widths.

Referenced by ChildWndProc().

03501 {
03502         switch(pnmh->code) {
03503                 case HDN_TRACK:
03504                 case HDN_ENDTRACK: {
03505                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
03506                         int idx = phdn->iItem;
03507                         int dx = phdn->pitem->cxy - pane->widths[idx];
03508                         int i;
03509
03510                         RECT clnt;
03511                         GetClientRect(pane->hwnd, &clnt);
03512
03513                         /* move immediate to simulate HDS_FULLDRAG (for now [04/2000] not really needed with WINELIB) */
03514                         Header_SetItem(pane->hwndHeader, idx, phdn->pitem);
03515
03516                         pane->widths[idx] += dx;
03517
03518                         for(i=idx; ++i<=COLUMNS; )
03519                                 pane->positions[i] += dx;
03520
03521                         {
03522                                 int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ);
03523                                 RECT rt_scr;
03524                                 RECT rt_clip;
03525
03526                                 rt_scr.left   = pane->positions[idx+1]-scroll_pos;
03527                                 rt_scr.top    = 0;
03528                                 rt_scr.right  = clnt.right;
03529                                 rt_scr.bottom = clnt.bottom;
03530
03531                                 rt_clip.left   = pane->positions[idx]-scroll_pos;
03532                                 rt_clip.top    = 0;
03533                                 rt_clip.right  = clnt.right;
03534                                 rt_clip.bottom = clnt.bottom;
03535
03536                                 if (rt_scr.left < 0) rt_scr.left = 0;
03537                                 if (rt_clip.left < 0) rt_clip.left = 0;
03538
03539                                 ScrollWindowEx(pane->hwnd, dx, 0, &rt_scr, &rt_clip, 0, 0, SW_INVALIDATE);
03540
03541                                 rt_clip.right = pane->positions[idx+1];
03542                                 RedrawWindow(pane->hwnd, &rt_clip, 0, RDW_INVALIDATE|RDW_UPDATENOW);
03543
03544                                 if (pnmh->code == HDN_ENDTRACK) {
03545                                         ListBox_SetHorizontalExtent(pane->hwnd, pane->positions[COLUMNS]);
03546
03547                                         if (GetScrollPos(pane->hwnd, SB_HORZ) != scroll_pos)
03548                                                 set_header(pane);
03549                                 }
03550                         }
03551
03552                         return FALSE;
03553                 }
03554
03555                 case HDN_DIVIDERDBLCLICK: {
03556                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
03557                         HD_ITEM item;
03558
03559                         calc_single_width(pane, phdn->iItem);
03560                         item.mask = HDI_WIDTH;
03561                         item.cxy = pane->widths[phdn->iItem];
03562
03563                         Header_SetItem(pane->hwndHeader, phdn->iItem, &item);
03564                         InvalidateRect(pane->hwnd, 0, TRUE);
03565                         break;}
03566         }
03567
03568         return 0;
03569 }

Here is the call graph for this function:

static HRESULT path_from_pidlA | ( | IShellFolder * | folder,
 |  | LPITEMIDLIST | pidl,
 |  | LPSTR | buffer,
 |  | int | len
 | ) | [static]

Definition at line 702 of file winefile.c.

References free_strret(), and get_strretA().

00703 {
00704         STRRET str;
00705
00706          /* SHGDN_FORPARSING: get full path of id list */
00707         HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
00708
00709         if (SUCCEEDED(hr)) {
00710                 get_strretA(&str, &pidl->mkid, buffer, len);
00711                 free_strret(&str);
00712         } else
00713                 buffer[0] = '\0';
00714
00715         return hr;
00716 }

Here is the call graph for this function:

static HRESULT path_from_pidlW | ( | IShellFolder * | folder,
 |  | LPITEMIDLIST | pidl,
 |  | LPWSTR | buffer,
 |  | int | len
 | ) | [static]

Definition at line 764 of file winefile.c.

References free_strret(), and get_strretW().

Referenced by get_to_absolute_pidl().

00765 {
00766         STRRET str;
00767
00768          /* SHGDN_FORPARSING: get full path of id list */
00769         HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
00770
00771         if (SUCCEEDED(hr)) {
00772                 get_strretW(&str, &pidl->mkid, buffer, len);
00773                 free_strret(&str);
00774         } else
00775                 buffer[0] = '\0';
00776
00777         return hr;
00778 }

Here is the call graph for this function:

static BOOL pattern_imatch | ( | LPCTSTR | str,
 |  | LPCTSTR | pattern
 | ) | [static]

Definition at line 2731 of file winefile.c.

References BUFFER_LEN, and pattern_match().

Referenced by insert_entries().

02732 {
02733         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
02734
02735         lstrcpy(b1, str);
02736         lstrcpy(b2, pattern);
02737         CharUpper(b1);
02738         CharUpper(b2);
02739
02740         return pattern_match(b1, b2);
02741 }

Here is the call graph for this function:

static BOOL pattern_match | ( | LPCTSTR | str,
 |  | LPCTSTR | pattern
 | ) | [static]

Definition at line 2704 of file winefile.c.

Referenced by pattern_imatch().

02705 {
02706         for( ; *str&&*pattern; str++,pattern++) {
02707                 if (*pattern == '*') {
02708                         do pattern++;
02709                         while(*pattern == '*');
02710
02711                         if (!*pattern)
02712                                 return TRUE;
02713
02714                         for(; *str; str++)
02715                                 if (*str==*pattern && pattern_match(str, pattern))
02716                                         return TRUE;
02717
02718                         return FALSE;
02719                 }
02720                 else if (*str!=*pattern && *pattern!='?')
02721                         return FALSE;
02722         }
02723
02724         if (*str || *pattern)
02725                 if (*pattern!='*' || pattern[1]!='\0')
02726                         return FALSE;
02727
02728         return TRUE;
02729 }

static BOOL prompt_target | ( | Pane * | pane,
 |  | LPTSTR | source,
 |  | LPTSTR | target
 | ) | [static]

Definition at line 4026 of file winefile.c.

References _MAX_EXT, _MAX_FNAME, Pane::cur, DestinationDlgProc(), get_path(), WINEFILE_GLOBALS::hInstance, Pane::hwnd, IDD_SELECT_DESTINATION, is_directory(), and _Entry::up.

Referenced by ChildWndProc().

04027 {
04028         TCHAR path[MAX_PATH];
04029         int len;
04030
04031         get_path(pane->cur, path);
04032
04033         if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_SELECT_DESTINATION), pane->hwnd, DestinationDlgProc, (LPARAM)path) != IDOK)
04034                 return FALSE;
04035
04036         get_path(pane->cur, source);
04037
04038         /* convert relative targets to absolute paths */
04039         if (path[0]!='/' && path[1]!=':') {
04040                 get_path(pane->cur->up, target);
04041                 len = lstrlen(target);
04042
04043                 if (target[len-1]!='\\' && target[len-1]!='/')
04044                         target[len++] = '/';
04045
04046                 lstrcpy(target+len, path);
04047         } else
04048                 lstrcpy(target, path);
04049
04050         /* If the target already exists as directory, create a new target below this. */
04051         if (is_directory(path)) {
04052                 TCHAR fname[_MAX_FNAME], ext[_MAX_EXT];
04053                 const static TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'};
04054
04055                 _tsplitpath(source, NULL, NULL, fname, ext);
04056
04057                 wsprintf(target, sAppend, path, fname, ext);
04058         }
04059
04060         return TRUE;
04061 }

Here is the call graph for this function:

static void PropDlg_DisplayValue | ( | HWND | hlbox,
 |  | HWND | hedit
 | ) | [static]

Definition at line 1808 of file winefile.c.

Referenced by CheckForFileInfo(), and PropertiesDialogDlgProc().

01809 {
01810         int idx = ListBox_GetCurSel(hlbox);
01811
01812         if (idx != LB_ERR) {
01813                 LPCTSTR pValue = (LPCTSTR) ListBox_GetItemData(hlbox, idx);
01814
01815                 if (pValue)
01816                         SetWindowText(hedit, pValue);
01817         }
01818 }

static INT_PTR CALLBACK PropertiesDialogDlgProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 1891 of file winefile.c.

References BUFFER_LEN, CheckForFileInfo(), COL_DATE, COL_TIME, _Entry::data, PropertiesDialog::entry, format_date(), IDC_CHECK_ARCHIVE, IDC_CHECK_COMPRESSED, IDC_CHECK_HIDDEN, IDC_CHECK_READONLY, IDC_CHECK_SYSTEM, IDC_LIST_PROP_VERSION_TYPES, IDC_LIST_PROP_VERSION_VALUES, IDC_STATIC_PROP_FILENAME, IDC_STATIC_PROP_LASTCHANGE, IDC_STATIC_PROP_PATH, IDC_STATIC_PROP_SIZE, PropertiesDialog::path, PropDlg_DisplayValue(), PropertiesDialog::pVersionData, and sLongNumFmt.

Referenced by show_properties_dlg().

01892 {
01893         static struct PropertiesDialog* dlg;
01894
01895         switch(nmsg) {
01896                 case WM_INITDIALOG: {
01897                         const static TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'};
01898                         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
01899                         LPWIN32_FIND_DATA pWFD;
01900                         ULONGLONG size;
01901
01902                         dlg = (struct PropertiesDialog*) lparam;
01903                         pWFD = (LPWIN32_FIND_DATA) &dlg->entry.data;
01904
01905                         GetWindowText(hwnd, b1, MAX_PATH);
01906                         wsprintf(b2, b1, pWFD->cFileName);
01907                         SetWindowText(hwnd, b2);
01908
01909                         format_date(&pWFD->ftLastWriteTime, b1, COL_DATE|COL_TIME);
01910                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_LASTCHANGE), b1);
01911
01912                         size = ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow;
01913                         _stprintf(b1, sLongNumFmt, size);
01914                         wsprintf(b2, sByteFmt, b1);
01915                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_SIZE), b2);
01916
01917                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_FILENAME), pWFD->cFileName);
01918                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_PATH), dlg->path);
01919
01920                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_READONLY), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_READONLY? BST_CHECKED: BST_UNCHECKED));
01921                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_ARCHIVE), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_ARCHIVE? BST_CHECKED: BST_UNCHECKED));
01922                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_COMPRESSED), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_COMPRESSED? BST_CHECKED: BST_UNCHECKED));
01923                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_HIDDEN), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_HIDDEN? BST_CHECKED: BST_UNCHECKED));
01924                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_SYSTEM), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_SYSTEM? BST_CHECKED: BST_UNCHECKED));
01925
01926                         CheckForFileInfo(dlg, hwnd, dlg->path);
01927                         return 1;}
01928
01929                 case WM_COMMAND: {
01930                         int id = (int)wparam;
01931
01932                         switch(HIWORD(wparam)) {
01933                           case LBN_SELCHANGE: {
01934                                 HWND hlbox = GetDlgItem(hwnd, IDC_LIST_PROP_VERSION_TYPES);
01935                                 PropDlg_DisplayValue(hlbox, GetDlgItem(hwnd,IDC_LIST_PROP_VERSION_VALUES));
01936                                 break;
01937                           }
01938
01939                           case BN_CLICKED:
01940                                 if (id==IDOK || id==IDCANCEL)
01941                                         EndDialog(hwnd, id);
01942                         }
01943
01944                         return 1;}
01945
01946                 case WM_NCDESTROY:
01947                         free(dlg->pVersionData);
01948                         dlg->pVersionData = NULL;
01949                         break;
01950         }
01951
01952         return 0;
01953 }

Here is the call graph for this function:

static void read_directory | ( | Entry * | dir,
 |  | LPCTSTR | path,
 |  | SORT_ORDER | sortOrder,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 1262 of file winefile.c.

References _Entry::data, _Entry::down, ET_SHELL, ET_UNIX, _Entry::etype, _Entry::next, WINEFILE_GLOBALS::prescan_node, read_directory_shell(), read_directory_win(), and SortDirectory().

Referenced by read_tree_shell(), read_tree_win(), and scan_entry().

01263 {
01264         TCHAR buffer[MAX_PATH];
01265         Entry* entry;
01266         LPCTSTR s;
01267         PTSTR d;
01268
01269 #ifdef _SHELL_FOLDERS
01270         if (dir->etype == ET_SHELL)
01271         {
01272                 read_directory_shell(dir, hwnd);
01273
01274                 if (Globals.prescan_node) {
01275                         s = path;
01276                         d = buffer;
01277
01278                         while(*s)
01279                                 *d++ = *s++;
01280
01281                         *d++ = TEXT('\\');
01282
01283                         for(entry=dir->down; entry; entry=entry->next)
01284                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01285                                         read_directory_shell(entry, hwnd);
01286                                         SortDirectory(entry, sortOrder);
01287                                 }
01288                 }
01289         }
01290         else
01291 #endif
01292 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
01293         if (dir->etype == ET_UNIX)
01294         {
01295                 read_directory_unix(dir, path);
01296
01297                 if (Globals.prescan_node) {
01298                         s = path;
01299                         d = buffer;
01300
01301                         while(*s)
01302                                 *d++ = *s++;
01303
01304                         *d++ = TEXT('/');
01305
01306                         for(entry=dir->down; entry; entry=entry->next)
01307                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01308                                         lstrcpy(d, entry->data.cFileName);
01309                                         read_directory_unix(entry, buffer);
01310                                         SortDirectory(entry, sortOrder);
01311                                 }
01312                 }
01313         }
01314         else
01315 #endif
01316         {
01317                 read_directory_win(dir, path);
01318
01319                 if (Globals.prescan_node) {
01320                         s = path;
01321                         d = buffer;
01322
01323                         while(*s)
01324                                 *d++ = *s++;
01325
01326                         *d++ = TEXT('\\');
01327
01328                         for(entry=dir->down; entry; entry=entry->next)
01329                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01330                                         lstrcpy(d, entry->data.cFileName);
01331                                         read_directory_win(entry, buffer);
01332                                         SortDirectory(entry, sortOrder);
01333                                 }
01334                 }
01335         }
01336
01337         SortDirectory(dir, sortOrder);
01338 }

Here is the call graph for this function:

static void read_directory_shell | ( | Entry * | dir,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 990 of file winefile.c.

References alloc_entry(), _Entry::bhfi_valid, _Entry::data, _Entry::down, ET_SHELL, _Entry::etype, _Entry::expanded, extract_icon(), FETCH_ITEM_COUNT, fill_w32fdata_shell(), _Entry::folder, _Entry::hicon, _Entry::level, name_from_pidl(), _Entry::next, _Entry::pidl, _Entry::scanned, and _Entry::up.

Referenced by read_directory().

00991 {
00992         IShellFolder* folder = dir->folder;
00993         int level = dir->level + 1;
00994         HRESULT hr;
00995
00996         IShellFolder* child;
00997         IEnumIDList* idlist;
00998
00999         Entry* first_entry = NULL;
01000         Entry* last = NULL;
01001         Entry* entry;
01002
01003         if (!folder)
01004                 return;
01005
01006         hr = IShellFolder_EnumObjects(folder, hwnd, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE, &idlist);
01007
01008         if (SUCCEEDED(hr)) {
01009                 for(;;) {
01010 #define FETCH_ITEM_COUNT        32
01011                         LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
01012                         SFGAOF attribs;
01013                         ULONG cnt = 0;
01014                         ULONG n;
01015
01016                         memset(pidls, 0, sizeof(pidls));
01017
01018                         hr = IEnumIDList_Next(idlist, FETCH_ITEM_COUNT, pidls, &cnt);
01019                         if (!SUCCEEDED(hr))
01020                                 break;
01021
01022                         if (hr == S_FALSE)
01023                                 break;
01024
01025                         for(n=0; n<cnt; ++n) {
01026                                 entry = alloc_entry();
01027
01028                                 if (!first_entry)
01029                                         first_entry = entry;
01030
01031                                 if (last)
01032                                         last->next = entry;
01033
01034                                 memset(&entry->data, 0, sizeof(WIN32_FIND_DATA));
01035                                 entry->bhfi_valid = FALSE;
01036
01037                                 attribs = ~SFGAO_FILESYSTEM;    /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daß "My Documents" anstatt von "Martin's Documents" angezeigt wird */
01038
01039                                 hr = IShellFolder_GetAttributesOf(folder, 1, (LPCITEMIDLIST*)&pidls[n], &attribs);
01040
01041                                 if (SUCCEEDED(hr)) {
01042                                         if (attribs != (SFGAOF)~SFGAO_FILESYSTEM) {
01043                                                 fill_w32fdata_shell(folder, pidls[n], attribs, &entry->data);
01044
01045                                                 entry->bhfi_valid = TRUE;
01046                                         } else
01047                                                 attribs = 0;
01048                                 } else
01049                                         attribs = 0;
01050
01051                                 entry->pidl = pidls[n];
01052
01053                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01054                                         hr = IShellFolder_BindToObject(folder, pidls[n], 0, &IID_IShellFolder, (void**)&child);
01055
01056                                         if (SUCCEEDED(hr))
01057                                                 entry->folder = child;
01058                                         else
01059                                                 entry->folder = NULL;
01060                                 }
01061                                 else
01062                                         entry->folder = NULL;
01063
01064                                 if (!entry->data.cFileName[0])
01065                                         /*hr = */name_from_pidl(folder, pidls[n], entry->data.cFileName, MAX_PATH, /*SHGDN_INFOLDER*/0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/);
01066
01067                                  /* get display icons for files and virtual objects */
01068                                 if (!(entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
01069                                         !(attribs & SFGAO_FILESYSTEM)) {
01070                                         entry->hicon = extract_icon(folder, pidls[n]);
01071
01072                                         if (!entry->hicon)
01073                                                 entry->hicon = (HICON)-1;       /* don't try again later */
01074                                 }
01075
01076                                 entry->down = NULL;
01077                                 entry->up = dir;
01078                                 entry->expanded = FALSE;
01079                                 entry->scanned = FALSE;
01080                                 entry->level = level;
01081
01082 #ifndef _NO_EXTENSIONS
01083                                 entry->etype = ET_SHELL;
01084                                 entry->bhfi_valid = FALSE;
01085 #endif
01086
01087                                 last = entry;
01088                         }
01089                 }
01090
01091                 IEnumIDList_Release(idlist);
01092         }
01093
01094         if (last)
01095                 last->next = NULL;
01096
01097         dir->down = first_entry;
01098         dir->scanned = TRUE;
01099 }

Here is the call graph for this function:

static void read_directory_win | ( | Entry * | dir,
 |  | LPCTSTR | path
 | ) | [static]

Definition at line 339 of file winefile.c.

References alloc_entry(), _Entry::bhfi, _Entry::bhfi_valid, _Entry::data, _Entry::down, ET_WINDOWS, _Entry::etype, _Entry::expanded, _Entry::level, _Entry::next, _Entry::scanned, and _Entry::up.

Referenced by read_directory().

00340 {
00341         Entry* first_entry = NULL;
00342         Entry* last = NULL;
00343         Entry* entry;
00344
00345         int level = dir->level + 1;
00346         WIN32_FIND_DATA w32fd;
00347         HANDLE hFind;
00348 #ifndef _NO_EXTENSIONS
00349         HANDLE hFile;
00350 #endif
00351
00352         TCHAR buffer[MAX_PATH], *p;
00353         for(p=buffer; *path; )
00354                 *p++ = *path++;
00355
00356         *p++ = '\\';
00357         p[0] = '*';
00358         p[1] = '\0';
00359
00360         hFind = FindFirstFile(buffer, &w32fd);
00361
00362         if (hFind != INVALID_HANDLE_VALUE) {
00363                 do {
00364 #ifdef _NO_EXTENSIONS
00365                         /* hide directory entry "." */
00366                         if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00367                                 LPCTSTR name = w32fd.cFileName;
00368
00369                                 if (name[0]=='.' && name[1]=='\0')
00370                                         continue;
00371                         }
00372 #endif
00373                         entry = alloc_entry();
00374
00375                         if (!first_entry)
00376                                 first_entry = entry;
00377
00378                         if (last)
00379                                 last->next = entry;
00380
00381                         memcpy(&entry->data, &w32fd, sizeof(WIN32_FIND_DATA));
00382                         entry->down = NULL;
00383                         entry->up = dir;
00384                         entry->expanded = FALSE;
00385                         entry->scanned = FALSE;
00386                         entry->level = level;
00387
00388 #ifndef _NO_EXTENSIONS
00389                         entry->etype = ET_WINDOWS;
00390                         entry->bhfi_valid = FALSE;
00391
00392                         lstrcpy(p, entry->data.cFileName);
00393
00394                         hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00395                                                                 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00396
00397                         if (hFile != INVALID_HANDLE_VALUE) {
00398                                 if (GetFileInformationByHandle(hFile, &entry->bhfi))
00399                                         entry->bhfi_valid = TRUE;
00400
00401                                 CloseHandle(hFile);
00402                         }
00403 #endif
00404
00405                         last = entry;
00406                 } while(FindNextFile(hFind, &w32fd));
00407
00408                 if (last)
00409                         last->next = NULL;
00410
00411                 FindClose(hFind);
00412         }
00413
00414         dir->down = first_entry;
00415         dir->scanned = TRUE;
00416 }

Here is the call graph for this function:

static Entry* read_tree | ( | Root * | root,
 |  | LPCTSTR | path,
 |  | LPITEMIDLIST | pidl,
 |  | LPTSTR | drv,
 |  | SORT_ORDER | sortOrder,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 1341 of file winefile.c.

References _MAX_DIR, _MAX_FNAME, Root::drive_type, Root::fs, Root::fs_flags, IDS_DESKTOP, IDS_ROOT_FS, IDS_SHELL, IDS_UNIXFS, load_string(), Root::path, read_tree_shell(), read_tree_win(), and Root::volname.

Referenced by alloc_child_window(), and refresh_child().

01342 {
01343 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
01344         const static TCHAR sSlash[] = {'/', '\0'};
01345 #endif
01346         const static TCHAR sBackslash[] = {'\\', '\0'};
01347
01348 #ifdef _SHELL_FOLDERS
01349         if (pidl)
01350         {
01351                  /* read shell namespace tree */
01352                 root->drive_type = DRIVE_UNKNOWN;
01353                 drv[0] = '\\';
01354                 drv[1] = '\0';
01355                 load_string(root->volname, IDS_DESKTOP);
01356                 root->fs_flags = 0;
01357                 load_string(root->fs, IDS_SHELL);
01358
01359                 return read_tree_shell(root, pidl, sortOrder, hwnd);
01360         }
01361         else
01362 #endif
01363 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
01364         if (*path == '/')
01365         {
01366                  /* read unix file system tree */
01367                 root->drive_type = GetDriveType(path);
01368
01369                 lstrcat(drv, sSlash);
01370                 load_string(root->volname, IDS_ROOT_FS);
01371                 root->fs_flags = 0;
01372                 load_string(root->fs, IDS_UNIXFS);
01373
01374                 lstrcpy(root->path, sSlash);
01375
01376                 return read_tree_unix(root, path, sortOrder, hwnd);
01377         }
01378 #endif
01379
01380          /* read WIN32 file system tree */
01381         root->drive_type = GetDriveType(path);
01382
01383         lstrcat(drv, sBackslash);
01384         GetVolumeInformation(drv, root->volname, _MAX_FNAME, 0, 0, &root->fs_flags, root->fs, _MAX_DIR);
01385
01386         lstrcpy(root->path, drv);
01387
01388         return read_tree_win(root, path, sortOrder, hwnd);
01389 }

Here is the call graph for this function:

static Entry* read_tree_shell | ( | Root * | root,
 |  | LPITEMIDLIST | pidl,
 |  | SORT_ORDER | sortOrder,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 883 of file winefile.c.

References _Entry::down, Root::entry, ET_SHELL, _Entry::etype, _Entry::expanded, find_entry_shell(), _Entry::folder, WINEFILE_GLOBALS::iDesktop, WINEFILE_GLOBALS::iMalloc, _Entry::pidl, and read_directory().

Referenced by read_tree().

00884 {
00885         Entry* entry = &root->entry;
00886         Entry* next;
00887         LPITEMIDLIST next_pidl = pidl;
00888         IShellFolder* folder;
00889         IShellFolder* child = NULL;
00890         HRESULT hr;
00891
00892         HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00893
00894 #ifndef _NO_EXTENSIONS
00895         entry->etype = ET_SHELL;
00896 #endif
00897
00898         folder = Globals.iDesktop;
00899
00900         while(entry) {
00901                 entry->pidl = next_pidl;
00902                 entry->folder = folder;
00903
00904                 if (!pidl->mkid.cb)
00905                         break;
00906
00907                  /* copy first element of item idlist */
00908                 next_pidl = IMalloc_Alloc(Globals.iMalloc, pidl->mkid.cb+sizeof(USHORT));
00909                 memcpy(next_pidl, pidl, pidl->mkid.cb);
00910                 ((LPITEMIDLIST)((LPBYTE)next_pidl+pidl->mkid.cb))->mkid.cb = 0;
00911
00912                 hr = IShellFolder_BindToObject(folder, next_pidl, 0, &IID_IShellFolder, (void**)&child);
00913                 if (!SUCCEEDED(hr))
00914                         break;
00915
00916                 read_directory(entry, NULL, sortOrder, hwnd);
00917
00918                 if (entry->down)
00919                         entry->expanded = TRUE;
00920
00921                 next = find_entry_shell(entry, next_pidl);
00922                 if (!next)
00923                         break;
00924
00925                 folder = child;
00926                 entry = next;
00927
00928                  /* go to next element */
00929                 pidl = (LPITEMIDLIST) ((LPBYTE)pidl+pidl->mkid.cb);
00930         }
00931
00932         SetCursor(old_cursor);
00933
00934         return entry;
00935 }

Here is the call graph for this function:

static Entry* read_tree_win | ( | Root * | root,
 |  | LPCTSTR | path,
 |  | SORT_ORDER | sortOrder,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 445 of file winefile.c.

References _Entry::down, Root::entry, ET_WINDOWS, _Entry::etype, _Entry::expanded, find_entry_win(), and read_directory().

Referenced by read_tree().

00446 {
00447         TCHAR buffer[MAX_PATH];
00448         Entry* entry = &root->entry;
00449         LPCTSTR s = path;
00450         PTSTR d = buffer;
00451
00452         HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00453
00454 #ifndef _NO_EXTENSIONS
00455         entry->etype = ET_WINDOWS;
00456 #endif
00457
00458         while(entry) {
00459                 while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
00460                         *d++ = *s++;
00461
00462                 while(*s==TEXT('\\') || *s==TEXT('/'))
00463                         s++;
00464
00465                 *d++ = TEXT('\\');
00466                 *d = TEXT('\0');
00467
00468                 read_directory(entry, buffer, sortOrder, hwnd);
00469
00470                 if (entry->down)
00471                         entry->expanded = TRUE;
00472
00473                 if (!*s)
00474                         break;
00475
00476                 entry = find_entry_win(entry, s);
00477         }
00478
00479         SetCursor(old_cursor);
00480
00481         return entry;
00482 }

Here is the call graph for this function:

static void refresh_child ( ChildWnd * child ) [static]

Definition at line 3732 of file winefile.c.

References _MAX_DRIVE, Pane::cur, _Entry::down, Root::entry, ET_SHELL, _Entry::etype, get_path(), get_path_pidl(), Pane::hwnd, ChildWnd::hwnd, insert_entries(), ChildWnd::left, read_tree(), ChildWnd::right, ChildWnd::root, Pane::root, scan_entry(), set_curdir(), ChildWnd::sortOrder, and TF_ALL.

Referenced by ChildWndProc(), and set_sort_order().

03733 {
03734         TCHAR path[MAX_PATH], drv[_MAX_DRIVE+1];
03735         Entry* entry;
03736         int idx;
03737
03738         get_path(child->left.cur, path);
03739         _tsplitpath(path, drv, NULL, NULL, NULL);
03740
03741         child->right.root = NULL;
03742
03743         scan_entry(child, &child->root.entry, 0, child->hwnd);
03744
03745 #ifdef _SHELL_FOLDERS
03746         if (child->root.entry.etype == ET_SHELL)
03747                 entry = read_tree(&child->root, NULL, get_path_pidl(path,child->hwnd), drv, child->sortOrder, child->hwnd);
03748         else
03749 #endif
03750                 entry = read_tree(&child->root, path, NULL, drv, child->sortOrder, child->hwnd);
03751
03752         if (!entry)
03753                 entry = &child->root.entry;
03754
03755         insert_entries(&child->left, child->root.entry.down, NULL, TF_ALL, 0);
03756
03757         set_curdir(child, entry, 0, child->hwnd);
03758
03759         idx = ListBox_FindItemData(child->left.hwnd, 0, child->left.cur);
03760         ListBox_SetCurSel(child->left.hwnd, idx);
03761 }

Here is the call graph for this function:

static void refresh_drives ( void ) [static]

Definition at line 3830 of file winefile.c.

References create_drive_bar(), WINEFILE_GLOBALS::hdrivebar, and WINEFILE_GLOBALS::hMainWnd.

Referenced by ChildWndProc(), and FrameWndProc().

03831 {
03832         RECT rect;
03833
03834         /* destroy drive bar */
03835         DestroyWindow(Globals.hdrivebar);
03836         Globals.hdrivebar = 0;
03837
03838         /* re-create drive bar */
03839         create_drive_bar();
03840
03841         /* update window layout */
03842         GetClientRect(Globals.hMainWnd, &rect);
03843         SendMessage(Globals.hMainWnd, WM_SIZE, 0, MAKELONG(rect.right, rect.bottom));
03844 }

Here is the call graph for this function:

static void refresh_right_pane ( ChildWnd * child ) [static]

Definition at line 3690 of file winefile.c.

References calc_widths(), ChildWnd::filter_flags, ChildWnd::filter_pattern, Pane::hwnd, insert_entries(), ChildWnd::right, Pane::root, and set_header().

Referenced by ChildWndProc(), and set_curdir().

03691 {
03692         ListBox_ResetContent(child->right.hwnd);
03693         insert_entries(&child->right, child->right.root, child->filter_pattern, child->filter_flags, -1);
03694         calc_widths(&child->right, FALSE);
03695
03696 #ifndef _NO_EXTENSIONS
03697         set_header(&child->right);
03698 #endif
03699 }

Here is the call graph for this function:

static void resize_frame | ( | HWND | hwnd,
 |  | int | cx,
 |  | int | cy
 | ) | [static]

Definition at line 1590 of file winefile.c.

References resize_frame_rect().

Referenced by FrameWndProc().

01591 {
01592         RECT rect;
01593
01594         rect.left   = 0;
01595         rect.top    = 0;
01596         rect.right  = cx;
01597         rect.bottom = cy;
01598
01599         resize_frame_rect(hwnd, &rect);
01600 }

Here is the call graph for this function:

static void resize_frame_client ( HWND hwnd ) [static]

Definition at line 1602 of file winefile.c.

References resize_frame_rect().

Referenced by toggle_child().

01603 {
01604         RECT rect;
01605
01606         GetClientRect(hwnd, &rect);
01607
01608         resize_frame_rect(hwnd, &rect);
01609 }

Here is the call graph for this function:

static void resize_frame_rect | ( | HWND | hwnd,
 |  | PRECT | prect
 | ) | [static]

Definition at line 1557 of file winefile.c.

References WINEFILE_GLOBALS::hdrivebar, WINEFILE_GLOBALS::hmdiclient, WINEFILE_GLOBALS::hstatusbar, and WINEFILE_GLOBALS::htoolbar.

Referenced by resize_frame(), and resize_frame_client().

01558 {
01559         int new_top;
01560         RECT rt;
01561
01562         if (IsWindowVisible(Globals.htoolbar)) {
01563                 SendMessage(Globals.htoolbar, WM_SIZE, 0, 0);
01564                 GetClientRect(Globals.htoolbar, &rt);
01565                 prect->top = rt.bottom+3;
01566                 prect->bottom -= rt.bottom+3;
01567         }
01568
01569         if (IsWindowVisible(Globals.hdrivebar)) {
01570                 SendMessage(Globals.hdrivebar, WM_SIZE, 0, 0);
01571                 GetClientRect(Globals.hdrivebar, &rt);
01572                 new_top = --prect->top + rt.bottom+3;
01573                 MoveWindow(Globals.hdrivebar, 0, prect->top, rt.right, new_top, TRUE);
01574                 prect->top = new_top;
01575                 prect->bottom -= rt.bottom+2;
01576         }
01577
01578         if (IsWindowVisible(Globals.hstatusbar)) {
01579                 int parts[] = {300, 500};
01580
01581                 SendMessage(Globals.hstatusbar, WM_SIZE, 0, 0);
01582                 SendMessage(Globals.hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
01583                 GetClientRect(Globals.hstatusbar, &rt);
01584                 prect->bottom -= rt.bottom;
01585         }
01586
01587         MoveWindow(Globals.hmdiclient, prect->left-1,prect->top-1,prect->right+2,prect->bottom+1, TRUE);
01588 }

static void resize_tree | ( | ChildWnd * | child,
 |  | int | cx,
 |  | int | cy
 | ) | [static]

Definition at line 2470 of file winefile.c.

References Pane::hwnd, Pane::hwndHeader, ChildWnd::left, ChildWnd::right, ChildWnd::split_pos, and SPLIT_WIDTH.

Referenced by ChildWndProc().

02471 {
02472         HDWP hdwp = BeginDeferWindowPos(4);
02473         RECT rt;
02474
02475         rt.left   = 0;
02476         rt.top    = 0;
02477         rt.right  = cx;
02478         rt.bottom = cy;
02479
02480         cx = child->split_pos + SPLIT_WIDTH/2;
02481
02482 #ifndef _NO_EXTENSIONS
02483         {
02484                 WINDOWPOS wp;
02485                 HD_LAYOUT hdl;
02486
02487                 hdl.prc   = &rt;
02488                 hdl.pwpos = &wp;
02489
02490                 Header_Layout(child->left.hwndHeader, &hdl);
02491
02492                 DeferWindowPos(hdwp, child->left.hwndHeader, wp.hwndInsertAfter,
02493                                                 wp.x-1, wp.y, child->split_pos-SPLIT_WIDTH/2+1, wp.cy, wp.flags);
02494                 DeferWindowPos(hdwp, child->right.hwndHeader, wp.hwndInsertAfter,
02495                                                 rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
02496         }
02497 #endif /* _NO_EXTENSIONS */
02498
02499         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);
02500         DeferWindowPos(hdwp, child->right.hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
02501
02502         EndDeferWindowPos(hdwp);
02503 }

static void scan_entry | ( | ChildWnd * | child,
 |  | Entry * | entry,
 |  | int | idx,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 3574 of file winefile.c.

References calc_widths(), _Entry::down, ET_SHELL, _Entry::etype, ChildWnd::filter_flags, ChildWnd::filter_pattern, free_entries(), get_path(), ChildWnd::header_wdths_ok, Pane::hwnd, insert_entries(), ChildWnd::left, _Entry::level, read_directory(), ChildWnd::right, set_header(), and ChildWnd::sortOrder.

Referenced by activate_entry(), refresh_child(), and set_curdir().

03575 {
03576         TCHAR path[MAX_PATH];
03577         HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
03578
03579         /* delete sub entries in left pane */
03580         for(;;) {
03581                 LRESULT res = ListBox_GetItemData(child->left.hwnd, idx+1);
03582                 Entry* sub = (Entry*) res;
03583
03584                 if (res==LB_ERR || !sub || sub->level<=entry->level)
03585                         break;
03586
03587                 ListBox_DeleteString(child->left.hwnd, idx+1);
03588         }
03589
03590         /* empty right pane */
03591         ListBox_ResetContent(child->right.hwnd);
03592
03593         /* release memory */
03594         free_entries(entry);
03595
03596         /* read contents from disk */
03597 #ifdef _SHELL_FOLDERS
03598         if (entry->etype == ET_SHELL)
03599         {
03600                 read_directory(entry, NULL, child->sortOrder, hwnd);
03601         }
03602         else
03603 #endif
03604         {
03605                 get_path(entry, path);
03606                 read_directory(entry, path, child->sortOrder, hwnd);
03607         }
03608
03609         /* insert found entries in right pane */
03610         insert_entries(&child->right, entry->down, child->filter_pattern, child->filter_flags, -1);
03611         calc_widths(&child->right, FALSE);
03612 #ifndef _NO_EXTENSIONS
03613         set_header(&child->right);
03614 #endif
03615
03616         child->header_wdths_ok = FALSE;
03617
03618         SetCursor(old_cursor);
03619 }

Here is the call graph for this function:

static void set_curdir | ( | ChildWnd * | child,
 |  | Entry * | entry,
 |  | int | idx,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 3701 of file winefile.c.

References Pane::cur, _Entry::down, get_path(), ChildWnd::hwnd, ChildWnd::left, ChildWnd::path, refresh_right_pane(), ChildWnd::right, Pane::root, scan_entry(), _Entry::scanned, and set_space_status().

Referenced by activate_entry(), alloc_child_window(), ChildWndProc(), and refresh_child().

03702 {
03703         TCHAR path[MAX_PATH];
03704
03705         if (!entry)
03706                 return;
03707
03708         path[0] = '\0';
03709
03710         child->left.cur = entry;
03711
03712         child->right.root = entry->down? entry->down: entry;
03713         child->right.cur = entry;
03714
03715         if (!entry->scanned)
03716                 scan_entry(child, entry, idx, hwnd);
03717         else
03718                 refresh_right_pane(child);
03719
03720         get_path(entry, path);
03721         lstrcpy(child->path, path);
03722
03723         if (child->hwnd)        /* only change window title, if the window already exists */
03724                 SetWindowText(child->hwnd, path);
03725
03726         if (path[0])
03727                 if (SetCurrentDirectory(path))
03728                         set_space_status();
03729 }

Here is the call graph for this function:

static void set_header ( Pane * pane ) [static]

Definition at line 3473 of file winefile.c.

References COLUMNS, Pane::hwnd, Pane::hwndHeader, and Pane::widths.

Referenced by activate_entry(), expand_entry(), pane_command(), pane_notify(), refresh_right_pane(), scan_entry(), and TreeWndProc().

03474 {
03475         HD_ITEM item;
03476         int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ);
03477         int i=0, x=0;
03478
03479         item.mask = HDI_WIDTH;
03480         item.cxy = 0;
03481
03482         for(; x+pane->widths[i]<scroll_pos && i<COLUMNS; i++) {
03483                 x += pane->widths[i];
03484                 Header_SetItem(pane->hwndHeader, i, &item);
03485         }
03486
03487         if (i < COLUMNS) {
03488                 x += pane->widths[i];
03489                 item.cxy = x - scroll_pos;
03490                 Header_SetItem(pane->hwndHeader, i++, &item);
03491
03492                 for(; i<COLUMNS; i++) {
03493                         item.cxy = pane->widths[i];
03494                         x += pane->widths[i];
03495                         Header_SetItem(pane->hwndHeader, i, &item);
03496                 }
03497         }
03498 }

static void set_sort_order | ( | ChildWnd * | child,
 |  | SORT_ORDER | sortOrder
 | ) | [static]

Definition at line 3998 of file winefile.c.

References refresh_child(), and ChildWnd::sortOrder.

Referenced by ChildWndProc().

03999 {
04000         if (child->sortOrder != sortOrder) {
04001                 child->sortOrder = sortOrder;
04002                 refresh_child(child);
04003         }
04004 }

Here is the call graph for this function:

static void set_space_status ( void ) [static]

Definition at line 2845 of file winefile.c.

References BUFFER_LEN, format_bytes(), WINEFILE_GLOBALS::hstatusbar, IDS_FREE_SPACE_FMT, RS, and sQMarks.

Referenced by ChildWndProc(), and set_curdir().

02846 {
02847         ULARGE_INTEGER ulFreeBytesToCaller, ulTotalBytes, ulFreeBytes;
02848         TCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN];
02849
02850         if (GetDiskFreeSpaceEx(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) {
02851                 format_bytes(b1, ulFreeBytesToCaller.QuadPart);
02852                 format_bytes(b2, ulTotalBytes.QuadPart);
02853                 wsprintf(buffer, RS(fmt,IDS_FREE_SPACE_FMT), b1, b2);
02854         } else
02855                 lstrcpy(buffer, sQMarks);
02856
02857         SendMessage(Globals.hstatusbar, SB_SETTEXT, 0, (LPARAM)buffer);
02858 }

Here is the call graph for this function:

static HRESULT ShellFolderContextMenu | ( | IShellFolder * | shell_folder,
 |  | HWND | hwndParent,
 |  | int | cidl,
 |  | LPCITEMIDLIST * | apidl,
 |  | int | x,
 |  | int | y
 | ) | [static]

Definition at line 4117 of file winefile.c.

References CtxMenu_query_interfaces(), and CtxMenu_reset().

Referenced by ChildWndProc().

04118 {
04119         IContextMenu* pcm;
04120         BOOL executed = FALSE;
04121
04122         HRESULT hr = IShellFolder_GetUIObjectOf(shell_folder, hwndParent, cidl, apidl, &IID_IContextMenu, NULL, (LPVOID*)&pcm);
04123 /*      HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm); */
04124
04125         if (SUCCEEDED(hr)) {
04126                 HMENU hmenu = CreatePopupMenu();
04127
04128                 pcm = CtxMenu_query_interfaces(pcm);
04129
04130                 if (hmenu) {
04131                         hr = (*pcm->lpVtbl->QueryContextMenu)(pcm, hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
04132
04133                         if (SUCCEEDED(hr)) {
04134                                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
04135
04136                                 CtxMenu_reset();
04137
04138                                 if (idCmd) {
04139                                         CMINVOKECOMMANDINFO cmi;
04140
04141                                         cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
04142                                         cmi.fMask = 0;
04143                                         cmi.hwnd = hwndParent;
04144                                         cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
04145                                         cmi.lpParameters = NULL;
04146                                         cmi.lpDirectory = NULL;
04147                                         cmi.nShow = SW_SHOWNORMAL;
04148                                         cmi.dwHotKey = 0;
04149                                         cmi.hIcon = 0;
04150
04151                                         hr = (*pcm->lpVtbl->InvokeCommand)(pcm, &cmi);
04152                                         executed = TRUE;
04153                                 }
04154                         } else
04155                                 CtxMenu_reset();
04156                 }
04157
04158                 IUnknown_Release(pcm);
04159         }
04160
04161         return FAILED(hr)? hr: executed? S_OK: S_FALSE;
04162 }

Here is the call graph for this function:

static void show_frame | ( | HWND | hwndParent,
 |  | int | cmdshow
 | ) | [static]

Definition at line 4677 of file winefile.c.

References alloc_child_window(), BUFFER_LEN, create_child_window(), create_drive_bar(), WINEFILE_GLOBALS::hframeClass, WINEFILE_GLOBALS::himl, WINEFILE_GLOBALS::hInstance, WINEFILE_GLOBALS::hMainWnd, WINEFILE_GLOBALS::hmdiclient, WINEFILE_GLOBALS::hMenuFrame, WINEFILE_GLOBALS::hMenuOptions, WINEFILE_GLOBALS::hMenuView, WINEFILE_GLOBALS::hstatusbar, WINEFILE_GLOBALS::htoolbar, WINEFILE_GLOBALS::hwndParent, ID_VIEW_DRIVE_BAR, ID_VIEW_STATUSBAR, ID_VIEW_TOOL_BAR, ID_WINDOW_CASCADE, ID_WINDOW_NEW, ID_WINDOW_TILE_HORZ, ID_WINDOW_TILE_VERT, IDB_IMAGES, IDB_TOOLBAR, IDM_WINEFILE, IDS_WINE_FILE, IDW_FIRST_CHILD, IDW_STATUSBAR, IDW_TOOLBAR, ChildWnd::pos, WINEFILE_GLOBALS::prescan_node, and RS.

Referenced by winefile_main().

04678 {
04679         const static TCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'};
04680
04681         TCHAR path[MAX_PATH], b1[BUFFER_LEN];
04682         ChildWnd* child;
04683         HMENU hMenuFrame, hMenuWindow;
04684
04685         CLIENTCREATESTRUCT ccs;
04686
04687         if (Globals.hMainWnd)
04688                 return;
04689
04690         Globals.hwndParent = hwndParent;
04691
04692         hMenuFrame = LoadMenu(Globals.hInstance, MAKEINTRESOURCE(IDM_WINEFILE));
04693         hMenuWindow = GetSubMenu(hMenuFrame, GetMenuItemCount(hMenuFrame)-2);
04694
04695         Globals.hMenuFrame = hMenuFrame;
04696         Globals.hMenuView = GetSubMenu(hMenuFrame, 3);
04697         Globals.hMenuOptions = GetSubMenu(hMenuFrame, 4);
04698
04699         ccs.hWindowMenu  = hMenuWindow;
04700         ccs.idFirstChild = IDW_FIRST_CHILD;
04701
04702
04703         /* create main window */
04704         Globals.hMainWnd = CreateWindowEx(0, (LPCTSTR)(int)Globals.hframeClass, RS(b1,IDS_WINE_FILE), WS_OVERLAPPEDWINDOW,
04705                                         CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
04706                                         hwndParent, Globals.hMenuFrame, Globals.hInstance, 0/*lpParam*/);
04707
04708
04709         Globals.hmdiclient = CreateWindowEx(0, sMDICLIENT, NULL,
04710                                         WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
04711                                         0, 0, 0, 0,
04712                                         Globals.hMainWnd, 0, Globals.hInstance, &ccs);
04713
04714
04715         CheckMenuItem(Globals.hMenuOptions, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
04716
04717         create_drive_bar();
04718
04719         {
04720                 TBBUTTON toolbarBtns[] = {
04721                         {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
04722                         {0, ID_WINDOW_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04723                         {1, ID_WINDOW_CASCADE, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04724                         {2, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04725                         {3, ID_WINDOW_TILE_VERT, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04726 /*TODO
04727                         {4, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04728                         {5, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04729 */              };
04730
04731                 Globals.htoolbar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE,
04732                         IDW_TOOLBAR, 2, Globals.hInstance, IDB_TOOLBAR, toolbarBtns,
04733                         sizeof(toolbarBtns)/sizeof(TBBUTTON), 16, 15, 16, 15, sizeof(TBBUTTON));
04734                 CheckMenuItem(Globals.hMenuOptions, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED);
04735         }
04736
04737         Globals.hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, Globals.hMainWnd, IDW_STATUSBAR);
04738         CheckMenuItem(Globals.hMenuOptions, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
04739
04740 /* CreateStatusWindow does not accept WS_BORDER
04741         Globals.hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0,
04742                                         WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0,
04743                                         Globals.hMainWnd, (HMENU)IDW_STATUSBAR, hinstance, 0);*/
04744
04745         /*TODO: read paths and window placements from registry */
04746         GetCurrentDirectory(MAX_PATH, path);
04747
04748         ShowWindow(Globals.hMainWnd, cmdshow);
04749
04750 //#if defined(_SHELL_FOLDERS) && !defined(__WINE__)
04751 //       // Shell Namespace as default:
04752 //      child = alloc_child_window(path, get_path_pidl(path,Globals.hMainWnd), Globals.hMainWnd);
04753 //#else
04754         child = alloc_child_window(path, NULL, Globals.hMainWnd);
04755 //#endif
04756
04757         child->pos.showCmd = SW_SHOWMAXIMIZED;
04758         child->pos.rcNormalPosition.left = 0;
04759         child->pos.rcNormalPosition.top = 0;
04760         child->pos.rcNormalPosition.right = 320;
04761         child->pos.rcNormalPosition.bottom = 280;
04762
04763         if (!create_child_window(child))
04764                 free(child);
04765
04766         SetWindowPlacement(child->hwnd, &child->pos);
04767
04768         Globals.himl = ImageList_LoadBitmap(Globals.hInstance, MAKEINTRESOURCE(IDB_IMAGES), 16, 0, RGB(0,255,0));
04769
04770         Globals.prescan_node = FALSE;
04771
04772         UpdateWindow(Globals.hMainWnd);
04773 }

Here is the call graph for this function:

static void show_properties_dlg | ( | Entry * | entry,
 |  | HWND | hwnd
 | ) | [static]

Definition at line 1955 of file winefile.c.

References PropertiesDialog::entry, get_path(), WINEFILE_GLOBALS::hInstance, IDD_DIALOG_PROPERTIES, PropertiesDialog::path, and PropertiesDialogDlgProc().

Referenced by activate_entry(), and ChildWndProc().

01956 {
01957         struct PropertiesDialog dlg;
01958
01959         memset(&dlg, 0, sizeof(struct PropertiesDialog));
01960         get_path(entry, dlg.path);
01961         memcpy(&dlg.entry, entry, sizeof(Entry));
01962
01963         DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_PROPERTIES), hwnd, PropertiesDialogDlgProc, (LPARAM)&dlg);
01964 }

Here is the call graph for this function:

static void SortDirectory | ( | Entry * | dir,
 |  | SORT_ORDER | sortOrder
 | ) | [static]

Definition at line 1230 of file winefile.c.

References _Entry::down, HeapAlloc, HeapFree, _Entry::next, and sortFunctions.

Referenced by read_directory().

01231 {
01232         Entry* entry = dir->down;
01233         Entry** array, **p;
01234         int len;
01235
01236         len = 0;
01237         for(entry=dir->down; entry; entry=entry->next)
01238                 len++;
01239
01240         if (len) {
01241                 array = HeapAlloc(GetProcessHeap(), 0, len*sizeof(Entry*));
01242
01243                 p = array;
01244                 for(entry=dir->down; entry; entry=entry->next)
01245                         *p++ = entry;
01246
01247                 /* call qsort with the appropriate compare function */
01248                 qsort(array, len, sizeof(array[0]), sortFunctions[sortOrder]);
01249
01250                 dir->down = array[0];
01251
01252                 for(p=array; --len; p++)
01253                         p[0]->next = p[1];
01254
01255                 (*p)->next = 0;
01256
01257                 HeapFree(GetProcessHeap(), 0, array);
01258         }
01259 }

static LPSTR strcpyn | ( | LPSTR | dest,
 |  | LPCSTR | source,
 |  | size_t | count
 | ) | [static]

Definition at line 675 of file winefile.c.

Referenced by get_strretA().

00676 {
00677  LPCSTR s;
00678  LPSTR d = dest;
00679
00680  for(s=source; count&&(*d++=*s++); )
00681   count--;
00682
00683  return dest;
00684 }

static void toggle_child | ( | HWND | hwnd,
 |  | UINT | cmd,
 |  | HWND | hchild
 | ) | [static]

Definition at line 2064 of file winefile.c.

References fullscreen_move(), g_fullscreen, WINEFILE_GLOBALS::hMenuOptions, FullScreenParameters::mode, and resize_frame_client().

Referenced by FrameWndProc().

02065 {
02066         BOOL vis = IsWindowVisible(hchild);
02067
02068         CheckMenuItem(Globals.hMenuOptions, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
02069
02070         ShowWindow(hchild, vis?SW_HIDE:SW_SHOW);
02071
02072 #ifndef _NO_EXTENSIONS
02073         if (g_fullscreen.mode)
02074                 fullscreen_move(hwnd);
02075 #endif
02076
02077         resize_frame_client(hwnd);
02078 }

Here is the call graph for this function:

static BOOL toggle_fullscreen ( HWND hwnd ) [static]

Definition at line 2014 of file winefile.c.

References Frame_CalcFrameClient, g_fullscreen, FullScreenParameters::mode, FullScreenParameters::orgPos, and FullScreenParameters::wasZoomed.

Referenced by FrameWndProc().

02015 {
02016         RECT rt;
02017
02018         if ((g_fullscreen.mode=!g_fullscreen.mode)) {
02019                 GetWindowRect(hwnd, &g_fullscreen.orgPos);
02020                 g_fullscreen.wasZoomed = IsZoomed(hwnd);
02021
02022                 Frame_CalcFrameClient(hwnd, &rt);
02023                 ClientToScreen(hwnd, (LPPOINT)&rt.left);
02024                 ClientToScreen(hwnd, (LPPOINT)&rt.right);
02025
02026                 rt.left = g_fullscreen.orgPos.left-rt.left;
02027                 rt.top = g_fullscreen.orgPos.top-rt.top;
02028                 rt.right = GetSystemMetrics(SM_CXSCREEN)+g_fullscreen.orgPos.right-rt.right;
02029                 rt.bottom = GetSystemMetrics(SM_CYSCREEN)+g_fullscreen.orgPos.bottom-rt.bottom;
02030
02031                 MoveWindow(hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
02032         } else {
02033                 MoveWindow(hwnd, g_fullscreen.orgPos.left, g_fullscreen.orgPos.top,
02034                                                         g_fullscreen.orgPos.right-g_fullscreen.orgPos.left,
02035                                                         g_fullscreen.orgPos.bottom-g_fullscreen.orgPos.top, TRUE);
02036
02037                 if (g_fullscreen.wasZoomed)
02038                         ShowWindow(hwnd, WS_MAXIMIZE);
02039         }
02040
02041         return g_fullscreen.mode;
02042 }

static LRESULT CALLBACK TreeWndProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 4549 of file winefile.c.

References ASSERT, ChildWnd::focus_pane, Pane::hwnd, ChildWnd::left, ChildWnd::right, and set_header().

Referenced by create_tree_window().

04550 {
04551         ChildWnd* child = (ChildWnd*) GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
04552         Pane* pane = (Pane*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
04553         ASSERT(child);
04554
04555         switch(nmsg) {
04556 #ifndef _NO_EXTENSIONS
04557                 case WM_HSCROLL:
04558                         set_header(pane);
04559                         break;
04560 #endif
04561
04562                 case WM_SETFOCUS:
04563                         child->focus_pane = pane==&child->right? 1: 0;
04564                         ListBox_SetSel(hwnd, TRUE, 1);
04565                         /*TODO: check menu items */
04566                         break;
04567
04568                 case WM_KEYDOWN:
04569                         if (wparam == VK_TAB) {
04570                                 /*TODO: SetFocus(Globals.hdrivebar) */
04571                                 SetFocus(child->focus_pane? child->left.hwnd: child->right.hwnd);
04572                         }
04573         }
04574
04575         return CallWindowProc(g_orgTreeWndProc, hwnd, nmsg, wparam, lparam);
04576 }

Here is the call graph for this function:

static int TypeOrderFromDirname ( LPCTSTR name ) [static]

Definition at line 1114 of file winefile.c.

References TO_DOT, TO_DOTDOT, and TO_OTHER_DIR.

Referenced by compareType().

01115 {
01116         if (name[0] == '.') {
01117                 if (name[1] == '\0')
01118                         return TO_DOT;  /* "." */
01119
01120                 if (name[1]=='.' && name[2]=='\0')
01121                         return TO_DOTDOT;       /* ".." */
01122         }
01123
01124         return TO_OTHER_DIR;    /* anything else */
01125 }

static void update_view_menu ( ChildWnd * child ) [static]

Definition at line 4006 of file winefile.c.

References WINEFILE_GLOBALS::hMenuView, ID_VIEW_SORT_DATE, ID_VIEW_SORT_NAME, ID_VIEW_SORT_SIZE, ID_VIEW_SORT_TYPE, SORT_DATE, SORT_EXT, SORT_NAME, SORT_SIZE, and ChildWnd::sortOrder.

Referenced by ChildWndProc().

04007 {
04008         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_NAME, child->sortOrder==SORT_NAME? MF_CHECKED: MF_UNCHECKED);
04009         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_TYPE, child->sortOrder==SORT_EXT? MF_CHECKED: MF_UNCHECKED);
04010         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_SIZE, child->sortOrder==SORT_SIZE? MF_CHECKED: MF_UNCHECKED);
04011         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_DATE, child->sortOrder==SORT_DATE? MF_CHECKED: MF_UNCHECKED);
04012 }

static LPWSTR wcscpyn | ( | LPWSTR | dest,
 |  | LPCWSTR | source,
 |  | size_t | count
 | ) | [static]

Definition at line 720 of file winefile.c.

Referenced by get_strretW().

00721 {
00722  LPCWSTR s;
00723  LPWSTR d = dest;
00724
00725  for(s=source; count&&(*d++=*s++); )
00726   count--;
00727
00728  return dest;
00729 }

static int winefile_main | ( | HINSTANCE | hinstance,
 |  | HWND | hwndParent,
 |  | int | cmdshow
 | ) | [static]

Definition at line 4820 of file winefile.c.

References ExitInstance(), WINEFILE_GLOBALS::haccel, WINEFILE_GLOBALS::hMainWnd, WINEFILE_GLOBALS::hmdiclient, InitInstance(), and show_frame().

Referenced by WinMain().

04821 {
04822         MSG msg;
04823
04824         InitInstance(hinstance);
04825
04826         if (cmdshow == SW_SHOWNORMAL)
04827                 /*TODO: read window placement from registry */
04828                 cmdshow = SW_MAXIMIZE;
04829
04830         show_frame(hwndParent, cmdshow);
04831
04832         while(GetMessage(&msg, 0, 0, 0)) {
04833                 if (Globals.hmdiclient && TranslateMDISysAccel(Globals.hmdiclient, &msg))
04834                         continue;
04835
04836                 if (Globals.hMainWnd && TranslateAccelerator(Globals.hMainWnd, Globals.haccel, &msg))
04837                         continue;
04838
04839                 TranslateMessage(&msg);
04840                 DispatchMessage(&msg);
04841         }
04842
04843         ExitInstance();
04844
04845         return msg.wParam;
04846 }

Here is the call graph for this function:

int APIENTRY WinMain | ( | HINSTANCE | hinstance,
 |  | HINSTANCE | previnstance,
 |  | LPSTR | cmdline,
 |  | int | cmdshow
 | ) |

Definition at line 4849 of file winefile.c.

References sWINEFILEFRAME, and winefile_main().

04853 {
04854 #ifdef _NO_EXTENSIONS
04855         if (find_window_class(sWINEFILEFRAME))
04856                 return 1;
04857 #endif
04858
04859         winefile_main(hinstance, 0, cmdshow);
04860
04861         return 0;
04862 }

Here is the call graph for this function:

Variable Documentation

struct FullScreenParameters g_fullscreen [static]

Referenced by toggle_child(), and toggle_fullscreen().

WNDPROC g_orgTreeWndProc [static]

Definition at line 2861 of file winefile.c.

const int g_pos_align[] [static]

Initial value:

 {
        0,
        HDF_LEFT,
        HDF_RIGHT,
        HDF_LEFT,

        HDF_LEFT,
        HDF_LEFT,
        HDF_LEFT,
        HDF_CENTER,

        HDF_CENTER,

        HDF_LEFT

}

Definition at line 2453 of file winefile.c.

TCHAR g_pos_names[COLUMNS][20] [static]

Initial value:

 {
        {'\0'}
}

Definition at line 2449 of file winefile.c.

WINEFILE_GLOBALS Globals

Definition at line 178 of file winefile.c.

HHOOK hcbthook [static]

Definition at line 1612 of file winefile.c.

LPCSTR InfoStrings[] [static]

Initial value:

 {
        "Comments",
        "CompanyName",
        "FileDescription",
        "FileVersion",
        "InternalName",
        "LegalCopyright",
        "LegalTrademarks",
        "OriginalFilename",
        "PrivateBuild",
        "ProductName",
        "ProductVersion",
        "SpecialBuild",
        NULL
}

Definition at line 1792 of file winefile.c.

int last_split [static]

Definition at line 180 of file winefile.c.

Referenced by ChildWndProc().

struct LANGANDCODEPAGE * lpTranslate

ChildWnd* newchild = NULL [static]

Definition at line 1613 of file winefile.c.

IContextMenu2* s_pctxmenu2 = NULL [static]

Definition at line 4064 of file winefile.c.

IContextMenu3* s_pctxmenu3 = NULL [static]

Definition at line 4067 of file winefile.c.

const TCHAR sEmpty[] = {'\0'} [static]

Definition at line 184 of file winefile.c.

Referenced by compareExt(), create_tree_window(), and get_file_type().

const TCHAR sLongHexFmt[] = {'%','L','X','\0'} [static]

Definition at line 199 of file winefile.c.

Referenced by draw_item().

const TCHAR sLongNumFmt[] = {'%','L','d','\0'} [static]

Definition at line 200 of file winefile.c.

Referenced by draw_item(), format_bytes(), and PropertiesDialogDlgProc().

const TCHAR sNumFmt[] = {'%','d','\0'} [static]

Definition at line 186 of file winefile.c.

Referenced by draw_item().

int(* sortFunctions[])(const void *arg1, const void *arg2) [static]

Initial value:

 {
        compareName,
        compareExt,
        compareSize,
        compareDate
}

Definition at line 1222 of file winefile.c.

Referenced by SortDirectory().

const TCHAR sQMarks[] = {'?','?','?','\0'} [static]

Definition at line 187 of file winefile.c.

Referenced by format_date(), and set_space_status().

const TCHAR sSpace[] = {' ', '\0'} [static]

Definition at line 185 of file winefile.c.

Referenced by FrameWndProc(), and init_output().

const TCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'} [static]

Definition at line 190 of file winefile.c.

Referenced by InitInstance(), and WinMain().

const TCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'} [static]

Definition at line 191 of file winefile.c.

Referenced by create_child_window(), and InitInstance().


Winefile: winefile.h File Reference

winefile.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <commdlg.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <locale.h>
#include <time.h>
#include <malloc.h>
#include <shellapi.h>
#include <shlobj.h>
#include <tchar.h>

Include dependency graph for winefile.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct | WINEFILE_GLOBALS

Defines

#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
#define | HeapAlloc(h, f, s) alloca(s)
#define | HeapFree(h, f, p)
#define | _SHELL_FOLDERS
#define | FILE_ATTRIBUTE_ENCRYPTED 0x00000040
#define | FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
#define | FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
#define | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
#define | ASSERT(x)
#define | BUFFER_LEN 1024
#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
#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_SPLITBAR LTGRAY_BRUSH
#define | FRM_CALC_CLIENT 0xBF83
#define | Frame_CalcFrameClient(hwnd, prt) ((BOOL)SNDMSG(hwnd, FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))

Enumerations

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
}

Variables

WINEFILE_GLOBALS Globals

Define Documentation

#define _SHELL_FOLDERS

Definition at line 59 of file winefile.h.

#define ASSERT ( x )

Definition at line 73 of file winefile.h.

Referenced by ChildWndProc(), and TreeWndProc().

#define BUFFER_LEN 1024

Definition at line 76 of file winefile.h.

Referenced by alloc_child_window(), CheckForFileInfo(), ChildWndProc(), create_drive_bar(), DestinationDlgProc(), display_error(), display_network_error(), draw_item(), format_date(), FrameWndProc(), load_string(), pattern_imatch(), PropertiesDialogDlgProc(), set_space_status(), and show_frame().

#define COLOR_COMPRESSED RGB(0,0,255)

Definition at line 102 of file winefile.h.

Referenced by draw_item().

#define COLOR_SELECTION RGB(0,0,128)

Definition at line 103 of file winefile.h.

Referenced by draw_item().

#define COLOR_SPLITBAR LTGRAY_BRUSH

Definition at line 108 of file winefile.h.

Referenced by ChildWndProc().

#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040

Definition at line 63 of file winefile.h.

Referenced by draw_item().

#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000

Definition at line 66 of file winefile.h.

Referenced by draw_item().

#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400

Definition at line 65 of file winefile.h.

Referenced by draw_item().

#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200

Definition at line 64 of file winefile.h.

Referenced by draw_item().

#define Frame_CalcFrameClient | ( | hwnd,
 |  | prt | ) | ((BOOL)SNDMSG(hwnd, FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))

Definition at line 112 of file winefile.h.

Referenced by fullscreen_move(), and toggle_fullscreen().

#define FRM_CALC_CLIENT 0xBF83

Definition at line 111 of file winefile.h.

Referenced by FrameWndProc().

#define HeapAlloc | ( | h,
 |  | f,
 |  | s | ) | alloca(s)

Definition at line 51 of file winefile.h.

Referenced by SortDirectory().

#define HeapFree | ( | h,
 |  | f,
 |  | p | )

Definition at line 52 of file winefile.h.

Referenced by SortDirectory().

#define IDW_DRIVEBAR 0x102

Definition at line 92 of file winefile.h.

Referenced by create_drive_bar().

#define IDW_FIRST_CHILD 0xC000

Definition at line 93 of file winefile.h.

Referenced by FrameWndProc(), and show_frame().

#define IDW_HEADER_LEFT 2

Definition at line 97 of file winefile.h.

Referenced by ChildWndProc(), and InitChildWindow().

#define IDW_HEADER_RIGHT 5

Definition at line 98 of file winefile.h.

Referenced by InitChildWindow().

#define IDW_STATUSBAR 0x100

Definition at line 90 of file winefile.h.

Referenced by show_frame().

#define IDW_TOOLBAR 0x101

Definition at line 91 of file winefile.h.

Referenced by show_frame().

#define IDW_TREE_LEFT 3

Definition at line 95 of file winefile.h.

Referenced by ChildWndProc(), and InitChildWindow().

#define IDW_TREE_RIGHT 6

Definition at line 96 of file winefile.h.

Referenced by ChildWndProc(), and InitChildWindow().

#define IMAGE_HEIGHT 13

Definition at line 86 of file winefile.h.

Referenced by create_child_window(), draw_item(), and FrameWndProc().

#define IMAGE_WIDTH 16

Definition at line 85 of file winefile.h.

Referenced by calc_single_width(), calc_widths(), and draw_item().

#define NOCOMM

Definition at line 24 of file winefile.h.

#define NOIMAGE

Definition at line 28 of file winefile.h.

#define NOIME

Definition at line 23 of file winefile.h.

#define NOKANJI

Definition at line 25 of file winefile.h.

#define NOMCX

Definition at line 22 of file winefile.h.

#define NONAMELESSUNION

Definition at line 31 of file winefile.h.

#define NOPROXYSTUB

Definition at line 27 of file winefile.h.

#define NORPC

Definition at line 26 of file winefile.h.

#define NOSERVICE

Definition at line 21 of file winefile.h.

#define NOTAPE

Definition at line 29 of file winefile.h.

#define SPLIT_WIDTH 5

Definition at line 87 of file winefile.h.

Referenced by ChildWndProc(), and resize_tree().

#define TREE_LINE_DX 3

Definition at line 88 of file winefile.h.

Referenced by draw_item().

#define WIN32_EXTRA_LEAN

Definition at line 20 of file winefile.h.

#define WIN32_LEAN_AND_MEAN

Definition at line 19 of file winefile.h.

#define WM_DISPATCH_COMMAND 0xBF80

Definition at line 100 of file winefile.h.

Referenced by ChildWndProc(), and FrameWndProc().

Enumeration Type Documentation

enum IMAGE

Enumerator:
IMG_NONE
IMG_FILE
IMG_DOCUMENT
IMG_EXECUTABLE
IMG_FOLDER
IMG_OPEN_FOLDER
IMG_FOLDER_PLUS
IMG_OPEN_PLUS
IMG_OPEN_MINUS
IMG_FOLDER_UP
IMG_FOLDER_CUR

Definition at line 79 of file winefile.h.

00079            {
00080     IMG_NONE=-1,    IMG_FILE=0,         IMG_DOCUMENT,   IMG_EXECUTABLE,
00081     IMG_FOLDER,     IMG_OPEN_FOLDER,    IMG_FOLDER_PLUS,IMG_OPEN_PLUS,  IMG_OPEN_MINUS,
00082     IMG_FOLDER_UP,  IMG_FOLDER_CUR
00083 };

Variable Documentation

WINEFILE_GLOBALS Globals

Definition at line 178 of file winefile.c.


Winefile: Data Structures

Winefile Data Structures

Here are the data structures with brief descriptions:
_Entry
ChildWnd
ExecuteDialog
FilterDialog
FullScreenParameters
LANGANDCODEPAGE
Pane
PropertiesDialog
Root
WINEFILE_GLOBALS


Winefile: _Entry Struct Reference

_Entry Struct Reference

Collaboration diagram for _Entry:

[legend]

Data Fields

_Entry * next
_Entry * down
_Entry * up
BOOL | expanded
BOOL | scanned
int | level
WIN32_FIND_DATA | data
BY_HANDLE_FILE_INFORMATION | bhfi
BOOL | bhfi_valid
enum ENTRY_TYPE | etype
LPITEMIDLIST | pidl
IShellFolder * | folder
HICON | hicon

Detailed Description

Definition at line 72 of file winefile.c.

Field Documentation

BY_HANDLE_FILE_INFORMATION _Entry::bhfi

Definition at line 84 of file winefile.c.

Referenced by draw_item(), and read_directory_win().

BOOL _Entry::bhfi_valid

Definition at line 85 of file winefile.c.

Referenced by draw_item(), read_directory_shell(), and read_directory_win().

WIN32_FIND_DATA _Entry::data

Definition at line 81 of file winefile.c.

Referenced by activate_entry(), alloc_child_window(), draw_item(), expand_entry(), find_entry_win(), get_path(), insert_entries(), PropertiesDialogDlgProc(), read_directory(), read_directory_shell(), and read_directory_win().

struct _Entry* _Entry::down

Definition at line 74 of file winefile.c.

Referenced by expand_entry(), find_entry_shell(), find_entry_win(), free_entries(), insert_entries(), read_directory(), read_directory_shell(), read_directory_win(), read_tree_shell(), read_tree_win(), refresh_child(), scan_entry(), set_curdir(), and SortDirectory().

enum ENTRY_TYPE _Entry::etype

Definition at line 86 of file winefile.c.

Referenced by alloc_child_window(), get_path(), get_to_absolute_pidl(), launch_entry(), read_directory(), read_directory_shell(), read_directory_win(), read_tree_shell(), read_tree_win(), refresh_child(), and scan_entry().

BOOL _Entry::expanded

Definition at line 77 of file winefile.c.

Referenced by activate_entry(), collapse_entry(), draw_item(), expand_entry(), insert_entries(), read_directory_shell(), read_directory_win(), read_tree_shell(), and read_tree_win().

IShellFolder* _Entry::folder

Definition at line 90 of file winefile.c.

Referenced by alloc_entry(), free_entry(), get_path(), get_to_absolute_pidl(), read_directory_shell(), and read_tree_shell().

HICON _Entry::hicon

Definition at line 91 of file winefile.c.

Referenced by alloc_entry(), draw_item(), free_entry(), and read_directory_shell().

int _Entry::level

Definition at line 79 of file winefile.c.

Referenced by alloc_child_window(), collapse_entry(), draw_item(), read_directory_shell(), read_directory_win(), and scan_entry().

struct _Entry* _Entry::next

Definition at line 73 of file winefile.c.

Referenced by draw_item(), expand_entry(), find_entry_shell(), find_entry_win(), free_entries(), insert_entries(), read_directory(), read_directory_shell(), read_directory_win(), and SortDirectory().

LPITEMIDLIST _Entry::pidl

Definition at line 89 of file winefile.c.

Referenced by alloc_entry(), find_entry_shell(), free_entry(), get_path(), get_to_absolute_pidl(), launch_entry(), read_directory_shell(), and read_tree_shell().

BOOL _Entry::scanned

Definition at line 78 of file winefile.c.

Referenced by activate_entry(), read_directory_shell(), read_directory_win(), and set_curdir().

struct _Entry* _Entry::up

Definition at line 75 of file winefile.c.

Referenced by activate_entry(), draw_item(), get_path(), get_to_absolute_pidl(), prompt_target(), read_directory_shell(), and read_directory_win().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: ChildWnd Struct Reference

ChildWnd Struct Reference

Collaboration diagram for ChildWnd:

[legend]

Data Fields

HWND | hwnd
Pane left
Pane right
int | focus_pane
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

Detailed Description

Definition at line 146 of file winefile.c.

Field Documentation

int ChildWnd::filter_flags

Definition at line 157 of file winefile.c.

Referenced by alloc_child_window(), ChildWndProc(), InitChildWindow(), refresh_right_pane(), and scan_entry().

TCHAR ChildWnd::filter_pattern[MAX_PATH]

Definition at line 156 of file winefile.c.

Referenced by alloc_child_window(), ChildWndProc(), InitChildWindow(), refresh_right_pane(), and scan_entry().

int ChildWnd::focus_pane

Definition at line 150 of file winefile.c.

Referenced by alloc_child_window(), ChildWndProc(), and TreeWndProc().

BOOL ChildWnd::header_wdths_ok

Definition at line 153 of file winefile.c.

Referenced by alloc_child_window(), expand_entry(), and scan_entry().

HWND ChildWnd::hwnd

Definition at line 147 of file winefile.c.

Referenced by activate_entry(), CBTProc(), ChildWndProc(), create_child_window(), InitChildWindow(), refresh_child(), and set_curdir().

Pane ChildWnd::left

Definition at line 148 of file winefile.c.

Referenced by alloc_child_window(), ChildWndProc(), create_child_window(), expand_entry(), FrameWndProc(), InitChildWindow(), refresh_child(), resize_tree(), scan_entry(), set_curdir(), and TreeWndProc().

TCHAR ChildWnd::path[MAX_PATH]

Definition at line 155 of file winefile.c.

Referenced by alloc_child_window(), ChildWndProc(), create_child_window(), and set_curdir().

WINDOWPLACEMENT ChildWnd::pos

Definition at line 151 of file winefile.c.

Referenced by alloc_child_window(), create_child_window(), and show_frame().

Pane ChildWnd::right

Definition at line 149 of file winefile.c.

Referenced by alloc_child_window(), ChildWndProc(), create_child_window(), FrameWndProc(), InitChildWindow(), refresh_child(), refresh_right_pane(), resize_tree(), scan_entry(), set_curdir(), and TreeWndProc().

Root ChildWnd::root

Definition at line 158 of file winefile.c.

Referenced by activate_drive_window(), activate_fs_window(), alloc_child_window(), free_child_window(), and refresh_child().

SORT_ORDER ChildWnd::sortOrder

Definition at line 160 of file winefile.c.

Referenced by alloc_child_window(), refresh_child(), scan_entry(), set_sort_order(), and update_view_menu().

int ChildWnd::split_pos

Definition at line 152 of file winefile.c.

Referenced by alloc_child_window(), ChildWndProc(), and resize_tree().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: ExecuteDialog Struct Reference

ExecuteDialog Struct Reference

Collaboration diagram for ExecuteDialog:

[legend]

Data Fields

TCHAR | cmd [MAX_PATH]
int | cmdshow

Detailed Description

Definition at line 1664 of file winefile.c.

Field Documentation

TCHAR ExecuteDialog::cmd[MAX_PATH]

Definition at line 1665 of file winefile.c.

Referenced by ExecuteDialogDlgProc(), and launch_entry().

int ExecuteDialog::cmdshow

Definition at line 1666 of file winefile.c.

Referenced by ExecuteDialogDlgProc().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: FilterDialog Struct Reference

FilterDialog Struct Reference

Collaboration diagram for FilterDialog:

[legend]

Data Fields

TCHAR | pattern [MAX_PATH]
int | flags

Detailed Description

Definition at line 1733 of file winefile.c.

Field Documentation

int FilterDialog::flags

Definition at line 1735 of file winefile.c.

Referenced by ChildWndProc(), and FilterDialogDlgProc().

TCHAR FilterDialog::pattern[MAX_PATH]

Definition at line 1734 of file winefile.c.

Referenced by ChildWndProc(), and FilterDialogDlgProc().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: FullScreenParameters Struct Reference

FullScreenParameters Struct Reference

Collaboration diagram for FullScreenParameters:

[legend]

Data Fields

BOOL | mode
RECT | orgPos
BOOL | wasZoomed

Detailed Description

Definition at line 1969 of file winefile.c.

Field Documentation

BOOL FullScreenParameters::mode

Definition at line 1970 of file winefile.c.

Referenced by toggle_child(), and toggle_fullscreen().

RECT FullScreenParameters::orgPos

Definition at line 1971 of file winefile.c.

Referenced by toggle_fullscreen().

BOOL FullScreenParameters::wasZoomed

Definition at line 1972 of file winefile.c.

Referenced by toggle_fullscreen().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: LANGANDCODEPAGE Struct Reference

LANGANDCODEPAGE Struct Reference

Collaboration diagram for LANGANDCODEPAGE:

[legend]

Data Fields

WORD | wLanguage
WORD | wCodePage

Detailed Description

Definition at line 1787 of file winefile.c.

Field Documentation

WORD LANGANDCODEPAGE::wCodePage

Definition at line 1789 of file winefile.c.

Referenced by CheckForFileInfo().

WORD LANGANDCODEPAGE::wLanguage

Definition at line 1788 of file winefile.c.

Referenced by CheckForFileInfo().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: Pane Struct Reference

Pane Struct Reference

Collaboration diagram for Pane:

[legend]

Data Fields

HWND | hwnd
HWND | hwndHeader
int | widths [COLUMNS]
int | positions [COLUMNS+1]
BOOL | treePane
int | visible_cols
Entry * root
Entry * cur

Detailed Description

Definition at line 126 of file winefile.c.

Field Documentation

Entry* Pane::cur

Definition at line 143 of file winefile.c.

Referenced by activate_entry(), ChildWndProc(), create_child_window(), prompt_target(), refresh_child(), and set_curdir().

HWND Pane::hwnd

Definition at line 127 of file winefile.c.

Referenced by calc_single_width(), calc_widths(), ChildWndProc(), collapse_entry(), create_child_window(), create_tree_window(), expand_entry(), FrameWndProc(), insert_entries(), pane_command(), pane_notify(), prompt_target(), refresh_child(), refresh_right_pane(), resize_tree(), scan_entry(), set_header(), and TreeWndProc().

HWND Pane::hwndHeader

Definition at line 129 of file winefile.c.

Referenced by pane_notify(), resize_tree(), and set_header().

int Pane::positions[COLUMNS+1]

Definition at line 138 of file winefile.c.

Referenced by calc_single_width(), calc_widths(), draw_item(), output_number(), output_tabbed_text(), output_text(), and pane_notify().

Entry* Pane::root

Definition at line 142 of file winefile.c.

Referenced by alloc_child_window(), create_tree_window(), refresh_child(), refresh_right_pane(), and set_curdir().

BOOL Pane::treePane

Definition at line 140 of file winefile.c.

Referenced by activate_entry(), alloc_child_window(), draw_item(), and insert_entries().

int Pane::visible_cols

Definition at line 141 of file winefile.c.

Referenced by alloc_child_window(), draw_item(), and pane_command().

int Pane::widths[COLUMNS]

Definition at line 137 of file winefile.c.

Referenced by calc_single_width(), calc_tabbed_width(), calc_width(), calc_widths(), create_header(), draw_item(), pane_notify(), and set_header().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: PropertiesDialog Struct Reference

PropertiesDialog Struct Reference

Collaboration diagram for PropertiesDialog:

[legend]

Data Fields

TCHAR | path [MAX_PATH]
Entry entry
void * | pVersionData

Detailed Description

Definition at line 1780 of file winefile.c.

Field Documentation

Entry PropertiesDialog::entry

Definition at line 1782 of file winefile.c.

Referenced by PropertiesDialogDlgProc(), and show_properties_dlg().

TCHAR PropertiesDialog::path[MAX_PATH]

Definition at line 1781 of file winefile.c.

Referenced by PropertiesDialogDlgProc(), and show_properties_dlg().

void* PropertiesDialog::pVersionData

Definition at line 1783 of file winefile.c.

Referenced by CheckForFileInfo(), and PropertiesDialogDlgProc().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: Root Struct Reference

Root Struct Reference

Collaboration diagram for Root:

[legend]

Data Fields

Entry entry
TCHAR | path [MAX_PATH]
TCHAR | volname [_MAX_FNAME]
TCHAR | fs [_MAX_DIR]
DWORD | drive_type
DWORD | fs_flags

Detailed Description

Definition at line 95 of file winefile.c.

Field Documentation

DWORD Root::drive_type

Definition at line 100 of file winefile.c.

Referenced by read_tree().

Entry Root::entry

Definition at line 96 of file winefile.c.

Referenced by alloc_child_window(), free_child_window(), read_tree_shell(), read_tree_win(), and refresh_child().

TCHAR Root::fs[_MAX_DIR]

Definition at line 99 of file winefile.c.

Referenced by activate_fs_window(), alloc_child_window(), and read_tree().

DWORD Root::fs_flags

Definition at line 101 of file winefile.c.

Referenced by read_tree().

TCHAR Root::path[MAX_PATH]

Definition at line 97 of file winefile.c.

Referenced by activate_drive_window(), and read_tree().

TCHAR Root::volname[_MAX_FNAME]

Definition at line 98 of file winefile.c.

Referenced by read_tree().

The documentation for this struct was generated from the following file:
  • winefile.c


Winefile: WINEFILE_GLOBALS Struct Reference

WINEFILE_GLOBALS Struct Reference

#include <winefile.h>

Collaboration diagram for WINEFILE_GLOBALS:

[legend]

Data Fields

HANDLE | hInstance
HACCEL | haccel
ATOM | hframeClass
HWND | hwndParent
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
IShellFolder * | iDesktop
IMalloc * | iMalloc
UINT | cfStrFName

Detailed Description

Definition at line 115 of file winefile.h.

Field Documentation

UINT WINEFILE_GLOBALS::cfStrFName

Definition at line 144 of file winefile.h.

Referenced by fill_w32fdata_shell(), and InitInstance().

TCHAR WINEFILE_GLOBALS::drives[BUFFER_LEN]

Definition at line 138 of file winefile.h.

Referenced by create_drive_bar(), and FrameWndProc().

HACCEL WINEFILE_GLOBALS::haccel

Definition at line 118 of file winefile.h.

Referenced by InitInstance(), and winefile_main().

HWND WINEFILE_GLOBALS::hdrivebar

Definition at line 131 of file winefile.h.

Referenced by create_drive_bar(), frame_get_clientspace(), FrameWndProc(), refresh_drives(), and resize_frame_rect().

HFONT WINEFILE_GLOBALS::hfont

Definition at line 132 of file winefile.h.

Referenced by calc_single_width(), calc_widths(), create_tree_window(), ExitInstance(), FrameWndProc(), init_output(), and InitInstance().

ATOM WINEFILE_GLOBALS::hframeClass

Definition at line 119 of file winefile.h.

Referenced by InitInstance(), and show_frame().

HIMAGELIST WINEFILE_GLOBALS::himl

Definition at line 136 of file winefile.h.

Referenced by draw_item(), ExitInstance(), and show_frame().

HANDLE WINEFILE_GLOBALS::hInstance

Definition at line 117 of file winefile.h.

Referenced by ChildWndProc(), create_child_window(), create_drive_bar(), create_header(), create_tree_window(), FrameWndProc(), InitInstance(), load_string(), prompt_target(), show_frame(), and show_properties_dlg().

HMENU WINEFILE_GLOBALS::hLanguageMenu

Definition at line 125 of file winefile.h.

HWND WINEFILE_GLOBALS::hMainWnd

Definition at line 122 of file winefile.h.

Referenced by create_drive_bar(), FrameWndProc(), refresh_drives(), show_frame(), and winefile_main().

HWND WINEFILE_GLOBALS::hmdiclient

Definition at line 128 of file winefile.h.

Referenced by activate_drive_window(), activate_fs_window(), create_child_window(), FrameWndProc(), resize_frame_rect(), show_frame(), and winefile_main().

HMENU WINEFILE_GLOBALS::hMenuFrame

Definition at line 123 of file winefile.h.

Referenced by FrameWndProc(), and show_frame().

HMENU WINEFILE_GLOBALS::hMenuOptions

Definition at line 127 of file winefile.h.

Referenced by FrameWndProc(), show_frame(), and toggle_child().

HMENU WINEFILE_GLOBALS::hMenuView

Definition at line 126 of file winefile.h.

Referenced by FrameWndProc(), pane_command(), show_frame(), and update_view_menu().

HWND WINEFILE_GLOBALS::hstatusbar

Definition at line 129 of file winefile.h.

Referenced by frame_get_clientspace(), FrameWndProc(), resize_frame_rect(), set_space_status(), and show_frame().

HWND WINEFILE_GLOBALS::htoolbar

Definition at line 130 of file winefile.h.

Referenced by frame_get_clientspace(), FrameWndProc(), resize_frame_rect(), and show_frame().

HMENU WINEFILE_GLOBALS::hWindowsMenu

Definition at line 124 of file winefile.h.

HWND WINEFILE_GLOBALS::hwndParent

Definition at line 120 of file winefile.h.

Referenced by FrameWndProc(), and show_frame().

IShellFolder* WINEFILE_GLOBALS::iDesktop

Definition at line 142 of file winefile.h.

Referenced by ExitInstance(), free_entry(), get_path(), get_path_pidl(), get_to_absolute_pidl(), InitInstance(), and read_tree_shell().

IMalloc* WINEFILE_GLOBALS::iMalloc

Definition at line 143 of file winefile.h.

Referenced by ChildWndProc(), ExitInstance(), free_entry(), free_strret(), InitInstance(), launch_entry(), and read_tree_shell().

TCHAR WINEFILE_GLOBALS::num_sep

Definition at line 134 of file winefile.h.

Referenced by init_output(), and output_number().

BOOL WINEFILE_GLOBALS::prescan_node

Definition at line 139 of file winefile.h.

Referenced by read_directory(), and show_frame().

SIZE WINEFILE_GLOBALS::spaceSize

Definition at line 135 of file winefile.h.

Referenced by calc_single_width(), calc_widths(), create_child_window(), FrameWndProc(), init_output(), output_number(), output_tabbed_text(), and output_text().

The documentation for this struct was generated from the following file:
  • winefile.h


Winefile: Data Fields

All | Variables
b | c | d | e | f | h | i | l | m | n | o | p | r | s | t | u | v | w

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- b -

  • bhfi : _Entry
  • bhfi_valid : _Entry

- c -

  • cfStrFName : WINEFILE_GLOBALS
  • cmd : ExecuteDialog
  • cmdshow : ExecuteDialog
  • cur : Pane

- d -

  • data : _Entry
  • down : _Entry
  • drive_type : Root
  • drives : WINEFILE_GLOBALS

- e -

  • entry : PropertiesDialog, Root
  • etype : _Entry
  • expanded : _Entry

- f -

  • filter_flags : ChildWnd
  • filter_pattern : ChildWnd
  • flags : FilterDialog
  • focus_pane : ChildWnd
  • folder : _Entry
  • fs : Root
  • fs_flags : Root

- h -

  • haccel : WINEFILE_GLOBALS
  • hdrivebar : WINEFILE_GLOBALS
  • header_wdths_ok : ChildWnd
  • hfont : WINEFILE_GLOBALS
  • hframeClass : WINEFILE_GLOBALS
  • hicon : _Entry
  • himl : WINEFILE_GLOBALS
  • hInstance : WINEFILE_GLOBALS
  • hLanguageMenu : WINEFILE_GLOBALS
  • hMainWnd : WINEFILE_GLOBALS
  • hmdiclient : WINEFILE_GLOBALS
  • hMenuFrame : WINEFILE_GLOBALS
  • hMenuOptions : WINEFILE_GLOBALS
  • hMenuView : WINEFILE_GLOBALS
  • hstatusbar : WINEFILE_GLOBALS
  • htoolbar : WINEFILE_GLOBALS
  • hWindowsMenu : WINEFILE_GLOBALS
  • hwnd : ChildWnd, Pane
  • hwndHeader : Pane
  • hwndParent : WINEFILE_GLOBALS

- i -

  • iDesktop : WINEFILE_GLOBALS
  • iMalloc : WINEFILE_GLOBALS

- l -

  • left : ChildWnd
  • level : _Entry

- m -

  • mode : FullScreenParameters

- n -

  • next : _Entry
  • num_sep : WINEFILE_GLOBALS

- o -

  • orgPos : FullScreenParameters

- p -

  • path : PropertiesDialog, ChildWnd, Root
  • pattern : FilterDialog
  • pidl : _Entry
  • pos : ChildWnd
  • positions : Pane
  • prescan_node : WINEFILE_GLOBALS
  • pVersionData : PropertiesDialog

- r -

  • right : ChildWnd
  • root : ChildWnd, Pane

- s -

  • scanned : _Entry
  • sortOrder : ChildWnd
  • spaceSize : WINEFILE_GLOBALS
  • split_pos : ChildWnd

- t -

  • treePane : Pane

- u -

  • up : _Entry

- v -

  • visible_cols : Pane
  • volname : Root

- w -

  • wasZoomed : FullScreenParameters
  • wCodePage : LANGANDCODEPAGE
  • widths : Pane
  • wLanguage : LANGANDCODEPAGE


All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- _ -

  • _MAX_DIR : winefile.c
  • _MAX_DRIVE : winefile.c
  • _MAX_EXT : winefile.c
  • _MAX_FNAME : winefile.c
  • _MAX_PATH : winefile.c
  • _SHELL_FOLDERS : winefile.h


Winefile: Alphabetical List

Winefile Data Structure Index

_ | C | E | F | L | P | R | W

_
E
FullScreenParameters Pane Root
_Entry ExecuteDialog
L
PropertiesDialog
W
C
F
LANGANDCODEPAGE
R
WINEFILE_GLOBALS
ChildWnd FilterDialog
P

_ | C | E | F | L | P | R | W


Winefile: Data Fields - Variables

All | Variables
b | c | d | e | f | h | i | l | m | n | o | p | r | s | t | u | v | w

- b -

  • bhfi : _Entry
  • bhfi_valid : _Entry

- c -

  • cfStrFName : WINEFILE_GLOBALS
  • cmd : ExecuteDialog
  • cmdshow : ExecuteDialog
  • cur : Pane

- d -

  • data : _Entry
  • down : _Entry
  • drive_type : Root
  • drives : WINEFILE_GLOBALS

- e -

  • entry : PropertiesDialog, Root
  • etype : _Entry
  • expanded : _Entry

- f -

  • filter_flags : ChildWnd
  • filter_pattern : ChildWnd
  • flags : FilterDialog
  • focus_pane : ChildWnd
  • folder : _Entry
  • fs : Root
  • fs_flags : Root

- h -

  • haccel : WINEFILE_GLOBALS
  • hdrivebar : WINEFILE_GLOBALS
  • header_wdths_ok : ChildWnd
  • hfont : WINEFILE_GLOBALS
  • hframeClass : WINEFILE_GLOBALS
  • hicon : _Entry
  • himl : WINEFILE_GLOBALS
  • hInstance : WINEFILE_GLOBALS
  • hLanguageMenu : WINEFILE_GLOBALS
  • hMainWnd : WINEFILE_GLOBALS
  • hmdiclient : WINEFILE_GLOBALS
  • hMenuFrame : WINEFILE_GLOBALS
  • hMenuOptions : WINEFILE_GLOBALS
  • hMenuView : WINEFILE_GLOBALS
  • hstatusbar : WINEFILE_GLOBALS
  • htoolbar : WINEFILE_GLOBALS
  • hWindowsMenu : WINEFILE_GLOBALS
  • hwnd : ChildWnd, Pane
  • hwndHeader : Pane
  • hwndParent : WINEFILE_GLOBALS

- i -

  • iDesktop : WINEFILE_GLOBALS
  • iMalloc : WINEFILE_GLOBALS

- l -

  • left : ChildWnd
  • level : _Entry

- m -

  • mode : FullScreenParameters

- n -

  • next : _Entry
  • num_sep : WINEFILE_GLOBALS

- o -

  • orgPos : FullScreenParameters

- p -

  • path : PropertiesDialog, ChildWnd, Root
  • pattern : FilterDialog
  • pidl : _Entry
  • pos : ChildWnd
  • positions : Pane
  • prescan_node : WINEFILE_GLOBALS
  • pVersionData : PropertiesDialog

- r -

  • right : ChildWnd
  • root : ChildWnd, Pane

- s -

  • scanned : _Entry
  • sortOrder : ChildWnd
  • spaceSize : WINEFILE_GLOBALS
  • split_pos : ChildWnd

- t -

  • treePane : Pane

- u -

  • up : _Entry

- v -

  • visible_cols : Pane
  • volname : Root

- w -

  • wasZoomed : FullScreenParameters
  • wCodePage : LANGANDCODEPAGE
  • widths : Pane
  • wLanguage : LANGANDCODEPAGE


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- l -

  • last_split : winefile.c
  • launch_entry() : winefile.c
  • launch_file() : winefile.c
  • load_string() : winefile.c
  • lpTranslate : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- n -

  • name_from_pidl() : winefile.c
  • newchild : winefile.c
  • NOCOMM : winefile.h
  • NOIMAGE : winefile.h
  • NOIME : winefile.h
  • NOKANJI : winefile.h
  • NOMCX : winefile.h
  • NONAMELESSUNION : winefile.h
  • NOPROXYSTUB : winefile.h
  • NORPC : winefile.h
  • NOSERVICE : winefile.h
  • NOTAPE : winefile.h


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- o -

  • output_number() : winefile.c
  • output_tabbed_text() : winefile.c
  • output_text() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- a -

  • activate_drive_window() : winefile.c
  • activate_entry() : winefile.c
  • activate_fs_window() : winefile.c
  • alloc_child_window() : winefile.c
  • alloc_entry() : winefile.c
  • ASSERT : winefile.h


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- b -

  • BUFFER_LEN : winefile.h


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- c -

  • calc_single_width() : winefile.c
  • calc_tabbed_width() : winefile.c
  • calc_width() : winefile.c
  • calc_widths() : winefile.c
  • CBTProc() : winefile.c
  • CheckForFileInfo() : winefile.c
  • ChildWndProc() : winefile.c
  • COBJMACROS : winefile.c
  • COL_ALL : winefile.c
  • COL_ATTRIBUTES : winefile.c
  • COL_DATE : winefile.c
  • COL_DOSNAMES : winefile.c
  • COL_INDEX : winefile.c
  • COL_LINKS : winefile.c
  • COL_SIZE : winefile.c
  • COL_TIME : winefile.c
  • collapse_entry() : winefile.c
  • COLOR_COMPRESSED : winefile.h
  • COLOR_SELECTION : winefile.h
  • COLOR_SPLITBAR : winefile.h
  • COLUMN_FLAGS : winefile.c
  • COLUMNS : winefile.c
  • compareDate() : winefile.c
  • compareExt() : winefile.c
  • compareName() : winefile.c
  • compareSize() : winefile.c
  • compareType() : winefile.c
  • create_child_window() : winefile.c
  • create_drive_bar() : winefile.c
  • create_header() : winefile.c
  • create_tree_window() : winefile.c
  • CtxMenu_HandleMenuMsg() : winefile.c
  • CtxMenu_query_interfaces() : winefile.c
  • CtxMenu_reset() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- d -

  • DEFAULT_SPLIT_POS : winefile.c
  • DestinationDlgProc() : winefile.c
  • display_error() : winefile.c
  • display_network_error() : winefile.c
  • draw_item() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- e -

  • Entry : winefile.c
  • ENTRY_TYPE : winefile.c
  • ET_SHELL : winefile.c
  • ET_UNIX : winefile.c
  • ET_WINDOWS : winefile.c
  • ExecuteDialogDlgProc() : winefile.c
  • ExitInstance() : winefile.c
  • expand_entry() : winefile.c
  • extract_icon() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- f -

  • FETCH_ITEM_COUNT : winefile.c
  • FILE_ATTRIBUTE_ENCRYPTED : winefile.h
  • FILE_ATTRIBUTE_NOT_CONTENT_INDEXED : winefile.h
  • FILE_ATTRIBUTE_REPARSE_POINT : winefile.h
  • FILE_ATTRIBUTE_SPARSE_FILE : winefile.h
  • FILE_TYPE : winefile.c
  • fill_w32fdata_shell() : winefile.c
  • FilterDialogDlgProc() : winefile.c
  • find_entry_shell() : winefile.c
  • find_entry_win() : winefile.c
  • format_bytes() : winefile.c
  • format_date() : winefile.c
  • Frame_CalcFrameClient : winefile.h
  • frame_get_clientspace() : winefile.c
  • FrameWndProc() : winefile.c
  • free_child_window() : winefile.c
  • free_entries() : winefile.c
  • free_entry() : winefile.c
  • free_strret() : winefile.c
  • FRM_CALC_CLIENT : winefile.h
  • FT_DOCUMENT : winefile.c
  • FT_EXECUTABLE : winefile.c
  • FT_OTHER : winefile.c
  • fullscreen_move() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- g -

  • g_fullscreen : winefile.c
  • g_orgTreeWndProc : winefile.c
  • g_pos_align : winefile.c
  • g_pos_names : winefile.c
  • get_file_type() : winefile.c
  • get_path() : winefile.c
  • get_path_pidl() : winefile.c
  • get_strret : winefile.c
  • get_strretA() : winefile.c
  • get_strretW() : winefile.c
  • get_to_absolute_pidl() : winefile.c
  • Globals : winefile.h, winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- h -

  • hcbthook : winefile.c
  • HeapAlloc : winefile.h
  • HeapFree : winefile.h


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- i -

  • ID_ABOUT : resource.h
  • ID_ABOUT_WINE : resource.h
  • ID_ACTIVATE : resource.h
  • ID_CONNECT_NETWORK_DRIVE : resource.h
  • ID_DISCONNECT_NETWORK_DRIVE : resource.h
  • ID_DRIVE_FIRST : resource.h
  • ID_DRIVE_SHELL_NS : resource.h
  • ID_EDIT_PROPERTIES : resource.h
  • ID_EXECUTE : resource.h
  • ID_FILE_COPY : resource.h
  • ID_FILE_DELETE : resource.h
  • ID_FILE_EXIT : resource.h
  • ID_FILE_MOVE : resource.h
  • ID_FORMAT_DISK : resource.h
  • ID_HELP : resource.h
  • ID_HELP_USING : resource.h
  • ID_LICENSE : resource.h
  • ID_NO_WARRANTY : resource.h
  • ID_PREFERRED_SIZES : resource.h
  • ID_REFRESH : resource.h
  • ID_SELECT_FONT : resource.h
  • ID_VIEW_ALL_ATTRIBUTES : resource.h
  • ID_VIEW_DRIVE_BAR : resource.h
  • ID_VIEW_FILTER : resource.h
  • ID_VIEW_FULLSCREEN : resource.h
  • ID_VIEW_NAME : resource.h
  • ID_VIEW_SELECTED_ATTRIBUTES : resource.h
  • ID_VIEW_SORT_DATE : resource.h
  • ID_VIEW_SORT_NAME : resource.h
  • ID_VIEW_SORT_SIZE : resource.h
  • ID_VIEW_SORT_TYPE : resource.h
  • ID_VIEW_SPLIT : resource.h
  • ID_VIEW_STATUSBAR : resource.h
  • ID_VIEW_TOOL_BAR : resource.h
  • ID_WINDOW_ARRANGE : resource.h
  • ID_WINDOW_AUTOSORT : resource.h
  • ID_WINDOW_CASCADE : resource.h
  • ID_WINDOW_NEW : resource.h
  • ID_WINDOW_SPLIT : resource.h
  • ID_WINDOW_TILE_HORZ : resource.h
  • ID_WINDOW_TILE_VERT : resource.h
  • IDA_WINEFILE : resource.h
  • IDB_DRIVEBAR : resource.h
  • IDB_IMAGES : resource.h
  • IDB_TOOLBAR : resource.h
  • IDC_CHECK_ARCHIVE : resource.h
  • IDC_CHECK_COMPRESSED : resource.h
  • IDC_CHECK_HIDDEN : resource.h
  • IDC_CHECK_READONLY : resource.h
  • IDC_CHECK_SYSTEM : resource.h
  • IDC_LIST_PROP_VERSION_TYPES : resource.h
  • IDC_LIST_PROP_VERSION_VALUES : resource.h
  • IDC_STATIC_PROP_COPYRIGHT : resource.h
  • IDC_STATIC_PROP_FILENAME : resource.h
  • IDC_STATIC_PROP_LASTCHANGE : resource.h
  • IDC_STATIC_PROP_PATH : resource.h
  • IDC_STATIC_PROP_SIZE : resource.h
  • IDC_STATIC_PROP_VERSION : resource.h
  • IDC_VIEW_PATTERN : resource.h
  • IDC_VIEW_TYPE_DIRECTORIES : resource.h
  • IDC_VIEW_TYPE_DOCUMENTS : resource.h
  • IDC_VIEW_TYPE_HIDDEN : resource.h
  • IDC_VIEW_TYPE_OTHERS : resource.h
  • IDC_VIEW_TYPE_PROGRAMS : resource.h
  • IDD_DIALOG_PROPERTIES : resource.h
  • IDD_DIALOG_VIEW_TYPE : resource.h
  • IDD_EXECUTE : resource.h
  • IDD_SELECT_DESTINATION : resource.h
  • IDI_WINEFILE : resource.h
  • IDM_WINEFILE : resource.h
  • IDS_COL_ADATE : resource.h
  • IDS_COL_ATTR : resource.h
  • IDS_COL_CDATE : resource.h
  • IDS_COL_IDX : resource.h
  • IDS_COL_LINKS : resource.h
  • IDS_COL_MDATE : resource.h
  • IDS_COL_NAME : resource.h
  • IDS_COL_SEC : resource.h
  • IDS_COL_SIZE : resource.h
  • IDS_DESKTOP : resource.h
  • IDS_ERROR : resource.h
  • IDS_FONT_SEL_DLG_NAME : resource.h
  • IDS_FONT_SEL_ERROR : resource.h
  • IDS_FREE_SPACE_FMT : resource.h
  • IDS_NO_IMPL : resource.h
  • IDS_ROOT_FS : resource.h
  • IDS_SHELL : resource.h
  • IDS_TITLEFMT : resource.h
  • IDS_UNIXFS : resource.h
  • IDS_WINE : resource.h
  • IDS_WINE_FILE : resource.h
  • IDS_WINEFILE : resource.h
  • IDW_DRIVEBAR : winefile.h
  • IDW_FIRST_CHILD : winefile.h
  • IDW_HEADER_LEFT : winefile.h
  • IDW_HEADER_RIGHT : winefile.h
  • IDW_STATUSBAR : winefile.h
  • IDW_TOOLBAR : winefile.h
  • IDW_TREE_LEFT : winefile.h
  • IDW_TREE_RIGHT : winefile.h
  • IMAGE : winefile.h
  • IMAGE_HEIGHT : winefile.h
  • IMAGE_WIDTH : winefile.h
  • IMG_DOCUMENT : winefile.h
  • IMG_EXECUTABLE : winefile.h
  • IMG_FILE : winefile.h
  • IMG_FOLDER : winefile.h
  • IMG_FOLDER_CUR : winefile.h
  • IMG_FOLDER_PLUS : winefile.h
  • IMG_FOLDER_UP : winefile.h
  • IMG_NONE : winefile.h
  • IMG_OPEN_FOLDER : winefile.h
  • IMG_OPEN_MINUS : winefile.h
  • IMG_OPEN_PLUS : winefile.h
  • infoStr : winefile.c
  • InfoStrings : winefile.c
  • init_output() : winefile.c
  • InitChildWindow() : winefile.c
  • InitInstance() : winefile.c
  • insert_entries() : winefile.c
  • is_directory() : winefile.c
  • is_exe_file() : winefile.c
  • is_registered_type() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- p -

  • pane_command() : winefile.c
  • pane_notify() : winefile.c
  • path_from_pidl : winefile.c
  • path_from_pidlA() : winefile.c
  • path_from_pidlW() : winefile.c
  • pattern_imatch() : winefile.c
  • pattern_match() : winefile.c
  • prompt_target() : winefile.c
  • PropDlg_DisplayValue() : winefile.c
  • PropertiesDialogDlgProc() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- r -

  • read_directory() : winefile.c
  • read_directory_shell() : winefile.c
  • read_directory_win() : winefile.c
  • read_tree() : winefile.c
  • read_tree_shell() : winefile.c
  • read_tree_win() : winefile.c
  • refresh_child() : winefile.c
  • refresh_drives() : winefile.c
  • refresh_right_pane() : winefile.c
  • resize_frame() : winefile.c
  • resize_frame_client() : winefile.c
  • resize_frame_rect() : winefile.c
  • resize_tree() : winefile.c
  • RS : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- s -

  • s_pctxmenu2 : winefile.c
  • s_pctxmenu3 : winefile.c
  • scan_entry() : winefile.c
  • sEmpty : winefile.c
  • set_curdir() : winefile.c
  • set_header() : winefile.c
  • set_sort_order() : winefile.c
  • set_space_status() : winefile.c
  • ShellFolderContextMenu() : winefile.c
  • show_frame() : winefile.c
  • show_properties_dlg() : winefile.c
  • sLongHexFmt : winefile.c
  • sLongNumFmt : winefile.c
  • sNumFmt : winefile.c
  • SORT_DATE : winefile.c
  • SORT_EXT : winefile.c
  • SORT_NAME : winefile.c
  • SORT_ORDER : winefile.c
  • SORT_SIZE : winefile.c
  • SortDirectory() : winefile.c
  • sortFunctions : winefile.c
  • SPLIT_WIDTH : winefile.h
  • sQMarks : winefile.c
  • sSpace : winefile.c
  • strcpyn() : winefile.c
  • sWINEFILEFRAME : winefile.c
  • sWINEFILETREE : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- t -

  • TF_ALL : winefile.c
  • TF_DIRECTORIES : winefile.c
  • TF_DOCUMENTS : winefile.c
  • TF_HIDDEN : winefile.c
  • TF_OTHERS : winefile.c
  • TF_PROGRAMS : winefile.c
  • TO_DIR : winefile.c
  • TO_DOT : winefile.c
  • TO_DOTDOT : winefile.c
  • TO_FILE : winefile.c
  • TO_OTHER_DIR : winefile.c
  • toggle_child() : winefile.c
  • toggle_fullscreen() : winefile.c
  • TREE_LINE_DX : winefile.h
  • TreeWndProc() : winefile.c
  • TYPE_FILTER : winefile.c
  • TYPE_ORDER : winefile.c
  • TypeOrderFromDirname() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- u -

  • UNION_MEMBER : winefile.c
  • update_view_menu() : winefile.c


| All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | e | f | g | h | i | l | n | o | p | r | s | t | u | w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- w -

  • wcscpyn() : winefile.c
  • WIN32_EXTRA_LEAN : winefile.h
  • WIN32_LEAN_AND_MEAN : winefile.h
  • winefile_main() : winefile.c
  • WinMain() : winefile.c
  • WM_DISPATCH_COMMAND : winefile.h


All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
_ | a | b | c | d | f | g | h | i | n | p | r | s | t | u | w

- _ -

  • _MAX_DIR : winefile.c
  • _MAX_DRIVE : winefile.c
  • _MAX_EXT : winefile.c
  • _MAX_FNAME : winefile.c
  • _MAX_PATH : winefile.c
  • _SHELL_FOLDERS : winefile.h

- a -

  • ASSERT : winefile.h

- b -

  • BUFFER_LEN : winefile.h

- c -

  • COBJMACROS : winefile.c
  • COLOR_COMPRESSED : winefile.h
  • COLOR_SELECTION : winefile.h
  • COLOR_SPLITBAR : winefile.h
  • COLUMNS : winefile.c

- d -

  • DEFAULT_SPLIT_POS : winefile.c

- f -

  • FETCH_ITEM_COUNT : winefile.c
  • FILE_ATTRIBUTE_ENCRYPTED : winefile.h
  • FILE_ATTRIBUTE_NOT_CONTENT_INDEXED : winefile.h
  • FILE_ATTRIBUTE_REPARSE_POINT : winefile.h
  • FILE_ATTRIBUTE_SPARSE_FILE : winefile.h
  • Frame_CalcFrameClient : winefile.h
  • FRM_CALC_CLIENT : winefile.h

- g -

  • get_strret : winefile.c

- h -

  • HeapAlloc : winefile.h
  • HeapFree : winefile.h

- i -

  • ID_ABOUT : resource.h
  • ID_ABOUT_WINE : resource.h
  • ID_ACTIVATE : resource.h
  • ID_CONNECT_NETWORK_DRIVE : resource.h
  • ID_DISCONNECT_NETWORK_DRIVE : resource.h
  • ID_DRIVE_FIRST : resource.h
  • ID_DRIVE_SHELL_NS : resource.h
  • ID_EDIT_PROPERTIES : resource.h
  • ID_EXECUTE : resource.h
  • ID_FILE_COPY : resource.h
  • ID_FILE_DELETE : resource.h
  • ID_FILE_EXIT : resource.h
  • ID_FILE_MOVE : resource.h
  • ID_FORMAT_DISK : resource.h
  • ID_HELP : resource.h
  • ID_HELP_USING : resource.h
  • ID_LICENSE : resource.h
  • ID_NO_WARRANTY : resource.h
  • ID_PREFERRED_SIZES : resource.h
  • ID_REFRESH : resource.h
  • ID_SELECT_FONT : resource.h
  • ID_VIEW_ALL_ATTRIBUTES : resource.h
  • ID_VIEW_DRIVE_BAR : resource.h
  • ID_VIEW_FILTER : resource.h
  • ID_VIEW_FULLSCREEN : resource.h
  • ID_VIEW_NAME : resource.h
  • ID_VIEW_SELECTED_ATTRIBUTES : resource.h
  • ID_VIEW_SORT_DATE : resource.h
  • ID_VIEW_SORT_NAME : resource.h
  • ID_VIEW_SORT_SIZE : resource.h
  • ID_VIEW_SORT_TYPE : resource.h
  • ID_VIEW_SPLIT : resource.h
  • ID_VIEW_STATUSBAR : resource.h
  • ID_VIEW_TOOL_BAR : resource.h
  • ID_WINDOW_ARRANGE : resource.h
  • ID_WINDOW_AUTOSORT : resource.h
  • ID_WINDOW_CASCADE : resource.h
  • ID_WINDOW_NEW : resource.h
  • ID_WINDOW_SPLIT : resource.h
  • ID_WINDOW_TILE_HORZ : resource.h
  • ID_WINDOW_TILE_VERT : resource.h
  • IDA_WINEFILE : resource.h
  • IDB_DRIVEBAR : resource.h
  • IDB_IMAGES : resource.h
  • IDB_TOOLBAR : resource.h
  • IDC_CHECK_ARCHIVE : resource.h
  • IDC_CHECK_COMPRESSED : resource.h
  • IDC_CHECK_HIDDEN : resource.h
  • IDC_CHECK_READONLY : resource.h
  • IDC_CHECK_SYSTEM : resource.h
  • IDC_LIST_PROP_VERSION_TYPES : resource.h
  • IDC_LIST_PROP_VERSION_VALUES : resource.h
  • IDC_STATIC_PROP_COPYRIGHT : resource.h
  • IDC_STATIC_PROP_FILENAME : resource.h
  • IDC_STATIC_PROP_LASTCHANGE : resource.h
  • IDC_STATIC_PROP_PATH : resource.h
  • IDC_STATIC_PROP_SIZE : resource.h
  • IDC_STATIC_PROP_VERSION : resource.h
  • IDC_VIEW_PATTERN : resource.h
  • IDC_VIEW_TYPE_DIRECTORIES : resource.h
  • IDC_VIEW_TYPE_DOCUMENTS : resource.h
  • IDC_VIEW_TYPE_HIDDEN : resource.h
  • IDC_VIEW_TYPE_OTHERS : resource.h
  • IDC_VIEW_TYPE_PROGRAMS : resource.h
  • IDD_DIALOG_PROPERTIES : resource.h
  • IDD_DIALOG_VIEW_TYPE : resource.h
  • IDD_EXECUTE : resource.h
  • IDD_SELECT_DESTINATION : resource.h
  • IDI_WINEFILE : resource.h
  • IDM_WINEFILE : resource.h
  • IDS_COL_ADATE : resource.h
  • IDS_COL_ATTR : resource.h
  • IDS_COL_CDATE : resource.h
  • IDS_COL_IDX : resource.h
  • IDS_COL_LINKS : resource.h
  • IDS_COL_MDATE : resource.h
  • IDS_COL_NAME : resource.h
  • IDS_COL_SEC : resource.h
  • IDS_COL_SIZE : resource.h
  • IDS_DESKTOP : resource.h
  • IDS_ERROR : resource.h
  • IDS_FONT_SEL_DLG_NAME : resource.h
  • IDS_FONT_SEL_ERROR : resource.h
  • IDS_FREE_SPACE_FMT : resource.h
  • IDS_NO_IMPL : resource.h
  • IDS_ROOT_FS : resource.h
  • IDS_SHELL : resource.h
  • IDS_TITLEFMT : resource.h
  • IDS_UNIXFS : resource.h
  • IDS_WINE : resource.h
  • IDS_WINE_FILE : resource.h
  • IDS_WINEFILE : resource.h
  • IDW_DRIVEBAR : winefile.h
  • IDW_FIRST_CHILD : winefile.h
  • IDW_HEADER_LEFT : winefile.h
  • IDW_HEADER_RIGHT : winefile.h
  • IDW_STATUSBAR : winefile.h
  • IDW_TOOLBAR : winefile.h
  • IDW_TREE_LEFT : winefile.h
  • IDW_TREE_RIGHT : winefile.h
  • IMAGE_HEIGHT : winefile.h
  • IMAGE_WIDTH : winefile.h
  • infoStr : winefile.c

- n -

  • NOCOMM : winefile.h
  • NOIMAGE : winefile.h
  • NOIME : winefile.h
  • NOKANJI : winefile.h
  • NOMCX : winefile.h
  • NONAMELESSUNION : winefile.h
  • NOPROXYSTUB : winefile.h
  • NORPC : winefile.h
  • NOSERVICE : winefile.h
  • NOTAPE : winefile.h

- p -

  • path_from_pidl : winefile.c

- r -

  • RS : winefile.c

- s -

  • SPLIT_WIDTH : winefile.h

- t -

  • TREE_LINE_DX : winefile.h

- u -

  • UNION_MEMBER : winefile.c

- w -

  • WIN32_EXTRA_LEAN : winefile.h
  • WIN32_LEAN_AND_MEAN : winefile.h
  • WM_DISPATCH_COMMAND : winefile.h


All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines

  • COLUMN_FLAGS : winefile.c
  • ENTRY_TYPE : winefile.c
  • FILE_TYPE : winefile.c
  • IMAGE : winefile.h
  • SORT_ORDER : winefile.c
  • TYPE_FILTER : winefile.c
  • TYPE_ORDER : winefile.c


All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
c | e | f | i | s | t

- c -

  • COL_ALL : winefile.c
  • COL_ATTRIBUTES : winefile.c
  • COL_DATE : winefile.c
  • COL_DOSNAMES : winefile.c
  • COL_INDEX : winefile.c
  • COL_LINKS : winefile.c
  • COL_SIZE : winefile.c
  • COL_TIME : winefile.c

- e -

  • ET_SHELL : winefile.c
  • ET_UNIX : winefile.c
  • ET_WINDOWS : winefile.c

- f -

  • FT_DOCUMENT : winefile.c
  • FT_EXECUTABLE : winefile.c
  • FT_OTHER : winefile.c

- i -

  • IMG_DOCUMENT : winefile.h
  • IMG_EXECUTABLE : winefile.h
  • IMG_FILE : winefile.h
  • IMG_FOLDER : winefile.h
  • IMG_FOLDER_CUR : winefile.h
  • IMG_FOLDER_PLUS : winefile.h
  • IMG_FOLDER_UP : winefile.h
  • IMG_NONE : winefile.h
  • IMG_OPEN_FOLDER : winefile.h
  • IMG_OPEN_MINUS : winefile.h
  • IMG_OPEN_PLUS : winefile.h

- s -

  • SORT_DATE : winefile.c
  • SORT_EXT : winefile.c
  • SORT_NAME : winefile.c
  • SORT_SIZE : winefile.c

- t -

  • TF_ALL : winefile.c
  • TF_DIRECTORIES : winefile.c
  • TF_DOCUMENTS : winefile.c
  • TF_HIDDEN : winefile.c
  • TF_OTHERS : winefile.c
  • TF_PROGRAMS : winefile.c
  • TO_DIR : winefile.c
  • TO_DOT : winefile.c
  • TO_DOTDOT : winefile.c
  • TO_FILE : winefile.c
  • TO_OTHER_DIR : winefile.c


All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines
a | c | d | e | f | g | i | l | n | o | p | r | s | t | u | w

- a -

  • activate_drive_window() : winefile.c
  • activate_entry() : winefile.c
  • activate_fs_window() : winefile.c
  • alloc_child_window() : winefile.c
  • alloc_entry() : winefile.c

- c -

  • calc_single_width() : winefile.c
  • calc_tabbed_width() : winefile.c
  • calc_width() : winefile.c
  • calc_widths() : winefile.c
  • CBTProc() : winefile.c
  • CheckForFileInfo() : winefile.c
  • ChildWndProc() : winefile.c
  • collapse_entry() : winefile.c
  • compareDate() : winefile.c
  • compareExt() : winefile.c
  • compareName() : winefile.c
  • compareSize() : winefile.c
  • compareType() : winefile.c
  • create_child_window() : winefile.c
  • create_drive_bar() : winefile.c
  • create_header() : winefile.c
  • create_tree_window() : winefile.c
  • CtxMenu_HandleMenuMsg() : winefile.c
  • CtxMenu_query_interfaces() : winefile.c
  • CtxMenu_reset() : winefile.c

- d -

  • DestinationDlgProc() : winefile.c
  • display_error() : winefile.c
  • display_network_error() : winefile.c
  • draw_item() : winefile.c

- e -

  • ExecuteDialogDlgProc() : winefile.c
  • ExitInstance() : winefile.c
  • expand_entry() : winefile.c
  • extract_icon() : winefile.c

- f -

  • fill_w32fdata_shell() : winefile.c
  • FilterDialogDlgProc() : winefile.c
  • find_entry_shell() : winefile.c
  • find_entry_win() : winefile.c
  • format_bytes() : winefile.c
  • format_date() : winefile.c
  • frame_get_clientspace() : winefile.c
  • FrameWndProc() : winefile.c
  • free_child_window() : winefile.c
  • free_entries() : winefile.c
  • free_entry() : winefile.c
  • free_strret() : winefile.c
  • fullscreen_move() : winefile.c

- g -

  • get_file_type() : winefile.c
  • get_path() : winefile.c
  • get_path_pidl() : winefile.c
  • get_strretA() : winefile.c
  • get_strretW() : winefile.c
  • get_to_absolute_pidl() : winefile.c

- i -

  • init_output() : winefile.c
  • InitChildWindow() : winefile.c
  • InitInstance() : winefile.c
  • insert_entries() : winefile.c
  • is_directory() : winefile.c
  • is_exe_file() : winefile.c
  • is_registered_type() : winefile.c

- l -

  • launch_entry() : winefile.c
  • launch_file() : winefile.c
  • load_string() : winefile.c

- n -

  • name_from_pidl() : winefile.c

- o -

  • output_number() : winefile.c
  • output_tabbed_text() : winefile.c
  • output_text() : winefile.c

- p -

  • pane_command() : winefile.c
  • pane_notify() : winefile.c
  • path_from_pidlA() : winefile.c
  • path_from_pidlW() : winefile.c
  • pattern_imatch() : winefile.c
  • pattern_match() : winefile.c
  • prompt_target() : winefile.c
  • PropDlg_DisplayValue() : winefile.c
  • PropertiesDialogDlgProc() : winefile.c

- r -

  • read_directory() : winefile.c
  • read_directory_shell() : winefile.c
  • read_directory_win() : winefile.c
  • read_tree() : winefile.c
  • read_tree_shell() : winefile.c
  • read_tree_win() : winefile.c
  • refresh_child() : winefile.c
  • refresh_drives() : winefile.c
  • refresh_right_pane() : winefile.c
  • resize_frame() : winefile.c
  • resize_frame_client() : winefile.c
  • resize_frame_rect() : winefile.c
  • resize_tree() : winefile.c

- s -

  • scan_entry() : winefile.c
  • set_curdir() : winefile.c
  • set_header() : winefile.c
  • set_sort_order() : winefile.c
  • set_space_status() : winefile.c
  • ShellFolderContextMenu() : winefile.c
  • show_frame() : winefile.c
  • show_properties_dlg() : winefile.c
  • SortDirectory() : winefile.c
  • strcpyn() : winefile.c

- t -

  • toggle_child() : winefile.c
  • toggle_fullscreen() : winefile.c
  • TreeWndProc() : winefile.c
  • TypeOrderFromDirname() : winefile.c

- u -

  • update_view_menu() : winefile.c

- w -

  • wcscpyn() : winefile.c
  • winefile_main() : winefile.c
  • WinMain() : winefile.c


All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines

  • Entry : winefile.c


All | Functions | Variables | Typedefs | Enumerations | Enumerator | Defines

  • g_fullscreen : winefile.c
  • g_orgTreeWndProc : winefile.c
  • g_pos_align : winefile.c
  • g_pos_names : winefile.c
  • Globals : winefile.h, winefile.c
  • hcbthook : winefile.c
  • InfoStrings : winefile.c
  • last_split : winefile.c
  • lpTranslate : winefile.c
  • newchild : winefile.c
  • s_pctxmenu2 : winefile.c
  • s_pctxmenu3 : winefile.c
  • sEmpty : winefile.c
  • sLongHexFmt : winefile.c
  • sLongNumFmt : winefile.c
  • sNumFmt : winefile.c
  • sortFunctions : winefile.c
  • sQMarks : winefile.c
  • sSpace : winefile.c
  • sWINEFILEFRAME : winefile.c
  • sWINEFILETREE : winefile.c


Winefile: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


Winefile: license.c Source File

license.c

Go to the documentation of this file.
00001 /*
00002  * Copyright 2000 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 #include "winefile.h"
00020
00021 #ifdef __WINE__
00022
00023 static const CHAR LicenseCaption[] = "LICENSE";
00024 static const CHAR License[] =
00025 "This library is free software; you can redistribute it and/or "
00026 "modify it under the terms of the GNU Lesser General Public "
00027 "License as published by the Free Software Foundation; either "
00028 "version 2.1 of the License, or (at your option) any later version.\n"
00029
00030 "This library is distributed in the hope that it will be useful, "
00031 "but WITHOUT ANY WARRANTY; without even the implied warranty of "
00032 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU "
00033 "Lesser General Public License for more details.\n"
00034
00035 "You should have received a copy of the GNU Lesser General Public "
00036 "License along with this library; if not, write to the Free Software "
00037 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA";
00038
00039 static const CHAR NoWarrantyCaption[] = "NO WARRANTY";
00040 static const CHAR NoWarranty[] =
00041 "This library is distributed in the hope that it will be useful, "
00042 "but WITHOUT ANY WARRANTY; without even the implied warranty of "
00043 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU "
00044 "Lesser General Public License for more details.";
00045
00046 VOID WineLicense(HWND hwnd)
00047 {
00048   MessageBoxA(hwnd, License, LicenseCaption, MB_ICONINFORMATION|MB_OK);
00049 }
00050
00051 VOID WineWarranty(HWND hwnd)
00052 {
00053   MessageBoxA(hwnd, NoWarranty, NoWarrantyCaption, MB_ICONEXCLAMATION|MB_OK);
00054 }
00055
00056 #endif


Winefile: Main Page

Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Search for

Winefile Documentation

Winefile Source Code Documentation
generated on 02.10.2005 by doxygen

Winefile Homepage


Winefile: resource.h Source File

resource.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2000, 2003, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020 /* images */
00021
00022 #define IDB_TOOLBAR                     100
00023 #define IDB_DRIVEBAR                    101
00024 #define IDB_IMAGES                      102
00025 #define IDI_WINEFILE                    100
00026
00027
00028 /* accellerators and menus */
00029
00030 #define IDA_WINEFILE                    101
00031 #define IDM_WINEFILE                    102
00032
00033
00034 /* dialogs */
00035
00036 #define IDD_EXECUTE                     103
00037 #define IDD_SELECT_DESTINATION          104
00038 #define IDD_DIALOG_VIEW_TYPE            105
00039 #define IDD_DIALOG_PROPERTIES           106
00040
00041
00042 /* control ids */
00043
00044 #define ID_ACTIVATE                     101
00045 #define ID_EXECUTE                      105
00046 #define ID_FILE_MOVE                    106
00047 #define ID_FILE_COPY                    107
00048 #define ID_FILE_DELETE                  108
00049 #define ID_FILE_EXIT                    115
00050 #define ID_FORMAT_DISK                  203
00051 #define ID_CONNECT_NETWORK_DRIVE        252
00052 #define ID_DISCONNECT_NETWORK_DRIVE     253
00053 #define ID_VIEW_NAME                    401
00054 #define ID_VIEW_ALL_ATTRIBUTES          402
00055 #define ID_VIEW_SELECTED_ATTRIBUTES     403
00056 #define ID_VIEW_SORT_NAME               404
00057 #define ID_VIEW_SORT_TYPE               405
00058 #define ID_VIEW_SORT_SIZE               406
00059 #define ID_VIEW_SORT_DATE               407
00060 #define ID_VIEW_FILTER                  409
00061 #define ID_VIEW_SPLIT                   414
00062 #define ID_SELECT_FONT                  510
00063 #define ID_VIEW_TOOL_BAR                508
00064 #define ID_VIEW_DRIVE_BAR               507
00065 #define ID_VIEW_STATUSBAR               503
00066
00067 #define ID_ABOUT                        1803
00068 #define ID_REFRESH                      1704
00069 #define ID_EDIT_PROPERTIES              57656
00070 #define ID_WINDOW_NEW                   0xE130
00071 #define ID_WINDOW_ARRANGE               0xE131
00072 #define ID_WINDOW_CASCADE               0xE132
00073 #define ID_WINDOW_TILE_HORZ             0xE133
00074 #define ID_WINDOW_TILE_VERT             0xE134
00075 #define ID_WINDOW_SPLIT                 0xE135
00076 #define ID_HELP_USING                   0xE144
00077 #define ID_HELP                         0xE146
00078
00079 #define IDC_VIEW_PATTERN                1000
00080 #define IDC_VIEW_TYPE_DIRECTORIES       1001
00081 #define IDC_VIEW_TYPE_PROGRAMS          1002
00082 #define IDC_VIEW_TYPE_DOCUMENTS         1003
00083 #define IDC_VIEW_TYPE_OTHERS            1004
00084 #define IDC_VIEW_TYPE_HIDDEN            1005
00085
00086 #define IDC_STATIC_PROP_FILENAME        1006
00087 #define IDC_STATIC_PROP_PATH            1007
00088 #define IDC_STATIC_PROP_LASTCHANGE      1008
00089 #define IDC_STATIC_PROP_VERSION         1009
00090 #define IDC_STATIC_PROP_COPYRIGHT       1010
00091 #define IDC_STATIC_PROP_SIZE            1011
00092 #define IDC_CHECK_READONLY              1012
00093 #define IDC_CHECK_ARCHIVE               1013
00094 #define IDC_CHECK_COMPRESSED            1014
00095 #define IDC_CHECK_HIDDEN                1015
00096 #define IDC_CHECK_SYSTEM                1016
00097 #define IDC_LIST_PROP_VERSION_TYPES     1017
00098 #define IDC_LIST_PROP_VERSION_VALUES    1018
00099
00100
00101 /* winefile extensions */
00102
00103 #define ID_ABOUT_WINE                   0x8000
00104 #define ID_LICENSE                      0x8001
00105 #define ID_NO_WARRANTY                  0x8002
00106 #define ID_WINDOW_AUTOSORT              0x8003
00107 #define ID_VIEW_FULLSCREEN              0x8004
00108 #define ID_PREFERRED_SIZES              0x8005
00109
00110
00111 /* string table */
00112
00113 #define IDS_FONT_SEL_DLG_NAME           1101
00114 #define IDS_FONT_SEL_ERROR              1103
00115
00116 #define IDS_WINEFILE                    1200
00117 #define IDS_ERROR                       1201
00118 #define IDS_ROOT_FS                     1202
00119 #define IDS_UNIXFS                      1203
00120 #define IDS_DESKTOP                     1204
00121 #define IDS_SHELL                       1205
00122 #define IDS_TITLEFMT                    1206
00123 #define IDS_NO_IMPL                     1207
00124 #define IDS_WINE                        1208
00125 #define IDS_WINE_FILE                   1209
00126
00127 #define IDS_COL_NAME                    1210
00128 #define IDS_COL_SIZE                    1211
00129 #define IDS_COL_CDATE                   1212
00130 #define IDS_COL_ADATE                   1213
00131 #define IDS_COL_MDATE                   1214
00132 #define IDS_COL_IDX                     1215
00133 #define IDS_COL_LINKS                   1216
00134 #define IDS_COL_ATTR                    1217
00135 #define IDS_COL_SEC                     1218
00136 #define IDS_FREE_SPACE_FMT              1219
00137
00138
00139 /* range for drive bar command ids: 0x9000..0x90FF */
00140
00141 #ifdef __WINE__
00142 #define ID_DRIVE_UNIX_FS                0x9000
00143 #endif
00144 #define ID_DRIVE_SHELL_NS               0x9001
00145
00146 #define ID_DRIVE_FIRST                  0x9002


Winefile: splitpath.c Source File

splitpath.c

Go to the documentation of this file.
00001 /*
00002  * Copyright 2000, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019 #include "winefile.h"
00020
00021
00022 #ifdef __WINE__
00023 #ifdef UNICODE
00024
00025 void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext)
00026 {
00027         const WCHAR* end; /* end of processed string */
00028         const WCHAR* p;   /* search pointer */
00029         const WCHAR* s;   /* copy pointer */
00030
00031         /* extract drive name */
00032         if (path[0] && path[1]==':') {
00033                 if (drv) {
00034                         *drv++ = *path++;
00035                         *drv++ = *path++;
00036                         *drv = L'\0';
00037                 }
00038         } else if (drv)
00039                 *drv = L'\0';
00040
00041         /* search for end of string or stream separator */
00042         for(end=path; *end && *end!=L':'; )
00043                 end++;
00044
00045         /* search for begin of file extension */
00046         for(p=end; p>path && *--p!=L'\\' && *p!=L'/'; )
00047                 if (*p == L'.') {
00048                         end = p;
00049                         break;
00050                 }
00051
00052         if (ext)
00053                 for(s=end; (*ext=*s++); )
00054                         ext++;
00055
00056         /* search for end of directory name */
00057         for(p=end; p>path; )
00058                 if (*--p=='\\' || *p=='/') {
00059                         p++;
00060                         break;
00061                 }
00062
00063         if (name) {
00064                 for(s=p; s<end; )
00065                         *name++ = *s++;
00066
00067                 *name = L'\0';
00068         }
00069
00070         if (dir) {
00071                 for(s=path; s<p; )
00072                         *dir++ = *s++;
00073
00074                 *dir = L'\0';
00075         }
00076 }
00077
00078 #else /* UNICODE */
00079
00080 void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext)
00081 {
00082         const CHAR* end; /* end of processed string */
00083         const CHAR* p;   /* search pointer */
00084         const CHAR* s;   /* copy pointer */
00085
00086         /* extract drive name */
00087         if (path[0] && path[1]==':') {
00088                 if (drv) {
00089                         *drv++ = *path++;
00090                         *drv++ = *path++;
00091                         *drv = '\0';
00092                 }
00093         } else if (drv)
00094                 *drv = '\0';
00095
00096         /* search for end of string or stream separator */
00097         for(end=path; *end && *end!=':'; )
00098                 end++;
00099
00100         /* search for begin of file extension */
00101         for(p=end; p>path && *--p!='\\' && *p!='/'; )
00102                 if (*p == '.') {
00103                         end = p;
00104                         break;
00105                 }
00106
00107         if (ext)
00108                 for(s=end; (*ext=*s++); )
00109                         ext++;
00110
00111         /* search for end of directory name */
00112         for(p=end; p>path; )
00113                 if (*--p=='\\' || *p=='/') {
00114                         p++;
00115                         break;
00116                 }
00117
00118         if (name) {
00119                 for(s=p; s<end; )
00120                         *name++ = *s++;
00121
00122                 *name = '\0';
00123         }
00124
00125         if (dir) {
00126                 for(s=path; s<p; )
00127                         *dir++ = *s++;
00128
00129                 *dir = '\0';
00130         }
00131 }
00132
00133 #endif /* UNICODE */
00134 #endif /* __WINE__ */
00135
00136
00137 /*
00138 void main()     // test splipath()
00139 {
00140         TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
00141
00142         _tsplitpath(L"x\\y", drv, dir, name, ext);
00143         _tsplitpath(L"x\\", drv, dir, name, ext);
00144         _tsplitpath(L"\\x", drv, dir, name, ext);
00145         _tsplitpath(L"x", drv, dir, name, ext);
00146         _tsplitpath(L"", drv, dir, name, ext);
00147         _tsplitpath(L".x", drv, dir, name, ext);
00148         _tsplitpath(L":x", drv, dir, name, ext);
00149         _tsplitpath(L"a:x", drv, dir, name, ext);
00150         _tsplitpath(L"a.b:x", drv, dir, name, ext);
00151         _tsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext);
00152         _tsplitpath(L"abc.EFGH:12345", drv, dir, name, ext);
00153         _tsplitpath(L"C:/dos/command.com", drv, dir, name, ext);
00154 }
00155 */


Winefile: winefile.c Source File

winefile.c

Go to the documentation of this file.
00001 /*
00002  * Winefile
00003  *
00004  * Copyright 2000, 2003, 2004, 2005 Martin Fuchs
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020
00021 #ifdef __WINE__
00022 #include "config.h"
00023 #include "wine/port.h"
00024
00025 /* for unix filesystem function calls */
00026 #include <sys/stat.h>
00027 #include <sys/types.h>
00028 #include <dirent.h>
00029 #endif
00030
00031 #define COBJMACROS
00032
00033 #include "winefile.h"
00034
00035 #include "resource.h"
00036
00037
00038 #ifdef _NO_EXTENSIONS
00039 #undef _LEFT_FILES
00040 #endif
00041
00042 #ifndef _MAX_PATH
00043 #define _MAX_DRIVE          3
00044 #define _MAX_FNAME          256
00045 #define _MAX_DIR            _MAX_FNAME
00046 #define _MAX_EXT            _MAX_FNAME
00047 #define _MAX_PATH           260
00048 #endif
00049
00050 #ifdef NONAMELESSUNION
00051 #define UNION_MEMBER(x) DUMMYUNIONNAME.x
00052 #else
00053 #define UNION_MEMBER(x) x
00054 #endif
00055
00056
00057 #ifdef _SHELL_FOLDERS
00058 #define DEFAULT_SPLIT_POS       300
00059 #else
00060 #define DEFAULT_SPLIT_POS       200
00061 #endif
00062
00063
00064 enum ENTRY_TYPE {
00065         ET_WINDOWS,
00066         ET_UNIX,
00067 #ifdef _SHELL_FOLDERS
00068         ET_SHELL
00069 #endif
00070 };
00071
00072 typedef struct _Entry {
00073         struct _Entry*  next;
00074         struct _Entry*  down;
00075         struct _Entry*  up;
00076
00077         BOOL                    expanded;
00078         BOOL                    scanned;
00079         int                             level;
00080
00081         WIN32_FIND_DATA data;
00082
00083 #ifndef _NO_EXTENSIONS
00084         BY_HANDLE_FILE_INFORMATION bhfi;
00085         BOOL                    bhfi_valid;
00086         enum ENTRY_TYPE etype;
00087 #endif
00088 #ifdef _SHELL_FOLDERS
00089         LPITEMIDLIST    pidl;
00090         IShellFolder*   folder;
00091         HICON                   hicon;
00092 #endif
00093 } Entry;
00094
00095 typedef struct {
00096         Entry   entry;
00097         TCHAR   path[MAX_PATH];
00098         TCHAR   volname[_MAX_FNAME];
00099         TCHAR   fs[_MAX_DIR];
00100         DWORD   drive_type;
00101         DWORD   fs_flags;
00102 } Root;
00103
00104 enum COLUMN_FLAGS {
00105         COL_SIZE                = 0x01,
00106         COL_DATE                = 0x02,
00107         COL_TIME                = 0x04,
00108         COL_ATTRIBUTES  = 0x08,
00109         COL_DOSNAMES    = 0x10,
00110 #ifdef _NO_EXTENSIONS
00111         COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES
00112 #else
00113         COL_INDEX               = 0x20,
00114         COL_LINKS               = 0x40,
00115         COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS
00116 #endif
00117 };
00118
00119 typedef enum {
00120         SORT_NAME,
00121         SORT_EXT,
00122         SORT_SIZE,
00123         SORT_DATE
00124 } SORT_ORDER;
00125
00126 typedef struct {
00127         HWND    hwnd;
00128 #ifndef _NO_EXTENSIONS
00129         HWND    hwndHeader;
00130 #endif
00131
00132 #ifndef _NO_EXTENSIONS
00133 #define COLUMNS 10
00134 #else
00135 #define COLUMNS 5
00136 #endif
00137         int             widths[COLUMNS];
00138         int             positions[COLUMNS+1];
00139
00140         BOOL    treePane;
00141         int             visible_cols;
00142         Entry*  root;
00143         Entry*  cur;
00144 } Pane;
00145
00146 typedef struct {
00147         HWND    hwnd;
00148         Pane    left;
00149         Pane    right;
00150         int             focus_pane;             /* 0: left  1: right */
00151         WINDOWPLACEMENT pos;
00152         int             split_pos;
00153         BOOL    header_wdths_ok;
00154
00155         TCHAR   path[MAX_PATH];
00156         TCHAR   filter_pattern[MAX_PATH];
00157         int             filter_flags;
00158         Root    root;
00159
00160         SORT_ORDER sortOrder;
00161 } ChildWnd;
00162
00163
00164
00165 static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd);
00166 static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd);
00167 static void refresh_child(ChildWnd* child);
00168 static void refresh_drives(void);
00169 static void get_path(Entry* dir, PTSTR path);
00170 static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols);
00171
00172 static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00173 static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00174 static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00175
00176
00177 /* globals */
00178 WINEFILE_GLOBALS Globals;
00179
00180 static int last_split;
00181
00182
00183 /* some common string constants */
00184 const static TCHAR sEmpty[] = {'\0'};
00185 const static TCHAR sSpace[] = {' ', '\0'};
00186 const static TCHAR sNumFmt[] = {'%','d','\0'};
00187 const static TCHAR sQMarks[] = {'?','?','?','\0'};
00188
00189 /* window class names */
00190 const static TCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'};
00191 const static TCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'};
00192
00193 #ifdef _MSC_VER
00194 /* #define LONGLONGARG _T("I64") */
00195 const static TCHAR sLongHexFmt[] = {'%','I','6','4','X','\0'};
00196 const static TCHAR sLongNumFmt[] = {'%','I','6','4','d','\0'};
00197 #else
00198 /* #define LONGLONGARG _T("L") */
00199 const static TCHAR sLongHexFmt[] = {'%','L','X','\0'};
00200 const static TCHAR sLongNumFmt[] = {'%','L','d','\0'};
00201 #endif
00202
00203
00204 /* load resource string */
00205 static LPTSTR load_string(LPTSTR buffer, UINT id)
00206 {
00207         LoadString(Globals.hInstance, id, buffer, BUFFER_LEN);
00208
00209         return buffer;
00210 }
00211
00212 #define RS(b, i) load_string(b, i)
00213
00214
00215 /* display error message for the specified WIN32 error code */
00216 static void display_error(HWND hwnd, DWORD error)
00217 {
00218         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
00219         PTSTR msg;
00220
00221         if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00222                 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL))
00223                 MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
00224         else
00225                 MessageBox(hwnd, RS(b1,IDS_ERROR), RS(b2,IDS_WINEFILE), MB_OK);
00226
00227         LocalFree(msg);
00228 }
00229
00230
00231 /* display network error message using WNetGetLastError() */
00232 static void display_network_error(HWND hwnd)
00233 {
00234         TCHAR msg[BUFFER_LEN], provider[BUFFER_LEN], b2[BUFFER_LEN];
00235         DWORD error;
00236
00237         if (WNetGetLastError(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR)
00238                 MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
00239 }
00240
00241
00242 #ifdef __WINE__
00243
00244 #ifdef UNICODE
00245
00246 /* call vswprintf() in msvcrt.dll */
00247 /*TODO: fix swprintf() in non-msvcrt mode, so that this dynamic linking function can be removed */
00248 static int msvcrt_swprintf(WCHAR* buffer, const WCHAR* fmt, ...)
00249 {
00250         static int (__cdecl *pvswprintf)(WCHAR*, const WCHAR*, va_list) = NULL;
00251         va_list ap;
00252         int ret;
00253
00254         if (!pvswprintf) {
00255                 HMODULE hModMsvcrt = LoadLibraryA("msvcrt");
00256                 pvswprintf = (int(__cdecl*)(WCHAR*,const WCHAR*,va_list)) GetProcAddress(hModMsvcrt, "vswprintf");
00257         }
00258
00259         va_start(ap, fmt);
00260         ret = (*pvswprintf)(buffer, fmt, ap);
00261         va_end(ap);
00262
00263         return ret;
00264 }
00265
00266 static LPCWSTR my_wcsrchr(LPCWSTR str, WCHAR c)
00267 {
00268         LPCWSTR p = str;
00269
00270         while(*p)
00271                 ++p;
00272
00273         do {
00274                 if (--p < str)
00275                         return NULL;
00276         } while(*p != c);
00277
00278         return p;
00279 }
00280
00281 #define _tcsrchr my_wcsrchr
00282 #else   /* UNICODE */
00283 #define _tcsrchr strrchr
00284 #endif  /* UNICODE */
00285
00286 #endif  /* __WINE__ */
00287
00288
00289 /* allocate and initialise a directory entry */
00290 static Entry* alloc_entry(void)
00291 {
00292         Entry* entry = (Entry*) malloc(sizeof(Entry));
00293
00294 #ifdef _SHELL_FOLDERS
00295         entry->pidl = NULL;
00296         entry->folder = NULL;
00297         entry->hicon = 0;
00298 #endif
00299
00300         return entry;
00301 }
00302
00303 /* free a directory entry */
00304 static void free_entry(Entry* entry)
00305 {
00306 #ifdef _SHELL_FOLDERS
00307         if (entry->hicon && entry->hicon!=(HICON)-1)
00308                 DestroyIcon(entry->hicon);
00309
00310         if (entry->folder && entry->folder!=Globals.iDesktop)
00311                 IShellFolder_Release(entry->folder);
00312
00313         if (entry->pidl)
00314                 IMalloc_Free(Globals.iMalloc, entry->pidl);
00315 #endif
00316
00317         free(entry);
00318 }
00319
00320 /* recursively free all child entries */
00321 static void free_entries(Entry* dir)
00322 {
00323         Entry *entry, *next=dir->down;
00324
00325         if (next) {
00326                 dir->down = 0;
00327
00328                 do {
00329                         entry = next;
00330                         next = entry->next;
00331
00332                         free_entries(entry);
00333                         free_entry(entry);
00334                 } while(next);
00335         }
00336 }
00337
00338
00339 static void read_directory_win(Entry* dir, LPCTSTR path)
00340 {
00341         Entry* first_entry = NULL;
00342         Entry* last = NULL;
00343         Entry* entry;
00344
00345         int level = dir->level + 1;
00346         WIN32_FIND_DATA w32fd;
00347         HANDLE hFind;
00348 #ifndef _NO_EXTENSIONS
00349         HANDLE hFile;
00350 #endif
00351
00352         TCHAR buffer[MAX_PATH], *p;
00353         for(p=buffer; *path; )
00354                 *p++ = *path++;
00355
00356         *p++ = '\\';
00357         p[0] = '*';
00358         p[1] = '\0';
00359
00360         hFind = FindFirstFile(buffer, &w32fd);
00361
00362         if (hFind != INVALID_HANDLE_VALUE) {
00363                 do {
00364 #ifdef _NO_EXTENSIONS
00365                         /* hide directory entry "." */
00366                         if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00367                                 LPCTSTR name = w32fd.cFileName;
00368
00369                                 if (name[0]=='.' && name[1]=='\0')
00370                                         continue;
00371                         }
00372 #endif
00373                         entry = alloc_entry();
00374
00375                         if (!first_entry)
00376                                 first_entry = entry;
00377
00378                         if (last)
00379                                 last->next = entry;
00380
00381                         memcpy(&entry->data, &w32fd, sizeof(WIN32_FIND_DATA));
00382                         entry->down = NULL;
00383                         entry->up = dir;
00384                         entry->expanded = FALSE;
00385                         entry->scanned = FALSE;
00386                         entry->level = level;
00387
00388 #ifndef _NO_EXTENSIONS
00389                         entry->etype = ET_WINDOWS;
00390                         entry->bhfi_valid = FALSE;
00391
00392                         lstrcpy(p, entry->data.cFileName);
00393
00394                         hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00395                                                                 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00396
00397                         if (hFile != INVALID_HANDLE_VALUE) {
00398                                 if (GetFileInformationByHandle(hFile, &entry->bhfi))
00399                                         entry->bhfi_valid = TRUE;
00400
00401                                 CloseHandle(hFile);
00402                         }
00403 #endif
00404
00405                         last = entry;
00406                 } while(FindNextFile(hFind, &w32fd));
00407
00408                 if (last)
00409                         last->next = NULL;
00410
00411                 FindClose(hFind);
00412         }
00413
00414         dir->down = first_entry;
00415         dir->scanned = TRUE;
00416 }
00417
00418
00419 static Entry* find_entry_win(Entry* dir, LPCTSTR name)
00420 {
00421         Entry* entry;
00422
00423         for(entry=dir->down; entry; entry=entry->next) {
00424                 LPCTSTR p = name;
00425                 LPCTSTR q = entry->data.cFileName;
00426
00427                 do {
00428                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00429                                 return entry;
00430                 } while(tolower(*p++) == tolower(*q++));
00431
00432                 p = name;
00433                 q = entry->data.cAlternateFileName;
00434
00435                 do {
00436                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00437                                 return entry;
00438                 } while(tolower(*p++) == tolower(*q++));
00439         }
00440
00441         return 0;
00442 }
00443
00444
00445 static Entry* read_tree_win(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
00446 {
00447         TCHAR buffer[MAX_PATH];
00448         Entry* entry = &root->entry;
00449         LPCTSTR s = path;
00450         PTSTR d = buffer;
00451
00452         HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00453
00454 #ifndef _NO_EXTENSIONS
00455         entry->etype = ET_WINDOWS;
00456 #endif
00457
00458         while(entry) {
00459                 while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
00460                         *d++ = *s++;
00461
00462                 while(*s==TEXT('\\') || *s==TEXT('/'))
00463                         s++;
00464
00465                 *d++ = TEXT('\\');
00466                 *d = TEXT('\0');
00467
00468                 read_directory(entry, buffer, sortOrder, hwnd);
00469
00470                 if (entry->down)
00471                         entry->expanded = TRUE;
00472
00473                 if (!*s)
00474                         break;
00475
00476                 entry = find_entry_win(entry, s);
00477         }
00478
00479         SetCursor(old_cursor);
00480
00481         return entry;
00482 }
00483
00484
00485 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
00486
00487 static BOOL time_to_filetime(const time_t* t, FILETIME* ftime)
00488 {
00489         struct tm* tm = gmtime(t);
00490         SYSTEMTIME stime;
00491
00492         if (!tm)
00493                 return FALSE;
00494
00495         stime.wYear = tm->tm_year+1900;
00496         stime.wMonth = tm->tm_mon+1;
00497         /* stime.wDayOfWeek */
00498         stime.wDay = tm->tm_mday;
00499         stime.wHour = tm->tm_hour;
00500         stime.wMinute = tm->tm_min;
00501         stime.wSecond = tm->tm_sec;
00502
00503         return SystemTimeToFileTime(&stime, ftime);
00504 }
00505
00506 static void read_directory_unix(Entry* dir, LPCTSTR path)
00507 {
00508         Entry* first_entry = NULL;
00509         Entry* last = NULL;
00510         Entry* entry;
00511         DIR* pdir;
00512
00513         int level = dir->level + 1;
00514 #ifdef UNICODE
00515         char cpath[MAX_PATH];
00516
00517         WideCharToMultiByte(CP_UNIXCP, 0, path, -1, cpath, MAX_PATH, NULL, NULL);
00518 #else
00519         const char* cpath = path;
00520 #endif
00521
00522         pdir = opendir(cpath);
00523
00524         if (pdir) {
00525                 struct stat st;
00526                 struct dirent* ent;
00527                 char buffer[MAX_PATH], *p;
00528                 const char* s;
00529
00530                 for(p=buffer,s=cpath; *s; )
00531                         *p++ = *s++;
00532
00533                 if (p==buffer || p[-1]!='/')
00534                         *p++ = '/';
00535
00536                 while((ent=readdir(pdir))) {
00537                         entry = alloc_entry();
00538
00539                         if (!first_entry)
00540                                 first_entry = entry;
00541
00542                         if (last)
00543                                 last->next = entry;
00544
00545                         entry->etype = ET_UNIX;
00546
00547                         strcpy(p, ent->d_name);
00548 #ifdef UNICODE
00549                         MultiByteToWideChar(CP_UNIXCP, 0, p, -1, entry->data.cFileName, MAX_PATH);
00550 #else
00551                         lstrcpy(entry->data.cFileName, p);
00552 #endif
00553
00554                         if (!stat(buffer, &st)) {
00555                                 entry->data.dwFileAttributes = p[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0;
00556
00557                                 if (S_ISDIR(st.st_mode))
00558                                         entry->data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00559
00560                                 entry->data.nFileSizeLow = st.st_size & 0xFFFFFFFF;
00561                                 entry->data.nFileSizeHigh = st.st_size >> 32;
00562
00563                                 memset(&entry->data.ftCreationTime, 0, sizeof(FILETIME));
00564                                 time_to_filetime(&st.st_atime, &entry->data.ftLastAccessTime);
00565                                 time_to_filetime(&st.st_mtime, &entry->data.ftLastWriteTime);
00566
00567                                 entry->bhfi.nFileIndexLow = ent->d_ino;
00568                                 entry->bhfi.nFileIndexHigh = 0;
00569
00570                                 entry->bhfi.nNumberOfLinks = st.st_nlink;
00571
00572                                 entry->bhfi_valid = TRUE;
00573                         } else {
00574                                 entry->data.nFileSizeLow = 0;
00575                                 entry->data.nFileSizeHigh = 0;
00576                                 entry->bhfi_valid = FALSE;
00577                         }
00578
00579                         entry->down = NULL;
00580                         entry->up = dir;
00581                         entry->expanded = FALSE;
00582                         entry->scanned = FALSE;
00583                         entry->level = level;
00584
00585                         last = entry;
00586                 }
00587
00588                 if (last)
00589                         last->next = NULL;
00590
00591                 closedir(pdir);
00592         }
00593
00594         dir->down = first_entry;
00595         dir->scanned = TRUE;
00596 }
00597
00598 static Entry* find_entry_unix(Entry* dir, LPCTSTR name)
00599 {
00600         Entry* entry;
00601
00602         for(entry=dir->down; entry; entry=entry->next) {
00603                 LPCTSTR p = name;
00604                 LPCTSTR q = entry->data.cFileName;
00605
00606                 do {
00607                         if (!*p || *p==TEXT('/'))
00608                                 return entry;
00609                 } while(*p++ == *q++);
00610         }
00611
00612         return 0;
00613 }
00614
00615 static Entry* read_tree_unix(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
00616 {
00617         TCHAR buffer[MAX_PATH];
00618         Entry* entry = &root->entry;
00619         LPCTSTR s = path;
00620         PTSTR d = buffer;
00621
00622         HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00623
00624         entry->etype = ET_UNIX;
00625
00626         while(entry) {
00627                 while(*s && *s!=TEXT('/'))
00628                         *d++ = *s++;
00629
00630                 while(*s == TEXT('/'))
00631                         s++;
00632
00633                 *d++ = TEXT('/');
00634                 *d = TEXT('\0');
00635
00636                 read_directory(entry, buffer, sortOrder, hwnd);
00637
00638                 if (entry->down)
00639                         entry->expanded = TRUE;
00640
00641                 if (!*s)
00642                         break;
00643
00644                 entry = find_entry_unix(entry, s);
00645         }
00646
00647         SetCursor(old_cursor);
00648
00649         return entry;
00650 }
00651
00652 #endif /* !defined(_NO_EXTENSIONS) && defined(__WINE__) */
00653
00654
00655 #ifdef _SHELL_FOLDERS
00656
00657 #ifdef UNICODE
00658 #define get_strret get_strretW
00659 #define path_from_pidl path_from_pidlW
00660 #else
00661 #define get_strret get_strretA
00662 #define path_from_pidl path_from_pidlA
00663 #endif
00664
00665
00666 static void free_strret(STRRET* str)
00667 {
00668         if (str->uType == STRRET_WSTR)
00669                 IMalloc_Free(Globals.iMalloc, str->UNION_MEMBER(pOleStr));
00670 }
00671
00672
00673 #ifndef UNICODE
00674
00675 static LPSTR strcpyn(LPSTR dest, LPCSTR source, size_t count)
00676 {
00677  LPCSTR s;
00678  LPSTR d = dest;
00679
00680  for(s=source; count&&(*d++=*s++); )
00681   count--;
00682
00683  return dest;
00684 }
00685
00686 static void get_strretA(STRRET* str, const SHITEMID* shiid, LPSTR buffer, int len)
00687 {
00688  switch(str->uType) {
00689   case STRRET_WSTR:
00690         WideCharToMultiByte(CP_ACP, 0, str->UNION_MEMBER(pOleStr), -1, buffer, len, NULL, NULL);
00691         break;
00692
00693   case STRRET_OFFSET:
00694         strcpyn(buffer, (LPCSTR)shiid+str->UNION_MEMBER(uOffset), len);
00695         break;
00696
00697   case STRRET_CSTR:
00698         strcpyn(buffer, str->UNION_MEMBER(cStr), len);
00699  }
00700 }
00701
00702 static HRESULT path_from_pidlA(IShellFolder* folder, LPITEMIDLIST pidl, LPSTR buffer, int len)
00703 {
00704         STRRET str;
00705
00706          /* SHGDN_FORPARSING: get full path of id list */
00707         HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
00708
00709         if (SUCCEEDED(hr)) {
00710                 get_strretA(&str, &pidl->mkid, buffer, len);
00711                 free_strret(&str);
00712         } else
00713                 buffer[0] = '\0';
00714
00715         return hr;
00716 }
00717
00718 #endif
00719
00720 static LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count)
00721 {
00722  LPCWSTR s;
00723  LPWSTR d = dest;
00724
00725  for(s=source; count&&(*d++=*s++); )
00726   count--;
00727
00728  return dest;
00729 }
00730
00731 static void get_strretW(STRRET* str, const SHITEMID* shiid, LPWSTR buffer, int len)
00732 {
00733  switch(str->uType) {
00734   case STRRET_WSTR:
00735         wcscpyn(buffer, str->UNION_MEMBER(pOleStr), len);
00736         break;
00737
00738   case STRRET_OFFSET:
00739         MultiByteToWideChar(CP_ACP, 0, (LPCSTR)shiid+str->UNION_MEMBER(uOffset), -1, buffer, len);
00740         break;
00741
00742   case STRRET_CSTR:
00743         MultiByteToWideChar(CP_ACP, 0, str->UNION_MEMBER(cStr), -1, buffer, len);
00744  }
00745 }
00746
00747
00748 static HRESULT name_from_pidl(IShellFolder* folder, LPITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags)
00749 {
00750         STRRET str;
00751
00752         HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, flags, &str);
00753
00754         if (SUCCEEDED(hr)) {
00755                 get_strret(&str, &pidl->mkid, buffer, len);
00756                 free_strret(&str);
00757         } else
00758                 buffer[0] = '\0';
00759
00760         return hr;
00761 }
00762
00763
00764 static HRESULT path_from_pidlW(IShellFolder* folder, LPITEMIDLIST pidl, LPWSTR buffer, int len)
00765 {
00766         STRRET str;
00767
00768          /* SHGDN_FORPARSING: get full path of id list */
00769         HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
00770
00771         if (SUCCEEDED(hr)) {
00772                 get_strretW(&str, &pidl->mkid, buffer, len);
00773                 free_strret(&str);
00774         } else
00775                 buffer[0] = '\0';
00776
00777         return hr;
00778 }
00779
00780
00781  /* create an item id list from a file system path */
00782
00783 static LPITEMIDLIST get_path_pidl(LPTSTR path, HWND hwnd)
00784 {
00785         LPITEMIDLIST pidl;
00786         HRESULT hr;
00787         ULONG len;
00788
00789 #ifdef UNICODE
00790         LPWSTR buffer = path;
00791 #else
00792         WCHAR buffer[MAX_PATH];
00793         MultiByteToWideChar(CP_ACP, 0, path, -1, buffer, MAX_PATH);
00794 #endif
00795
00796         hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
00797         if (FAILED(hr))
00798                 return NULL;
00799
00800         return pidl;
00801 }
00802
00803
00804  /* convert an item id list from relative to absolute (=relative to the desktop) format */
00805
00806 static LPITEMIDLIST get_to_absolute_pidl(Entry* entry, HWND hwnd)
00807 {
00808         if (entry->up && entry->up->etype==ET_SHELL) {
00809                 IShellFolder* folder = entry->up->folder;
00810                 WCHAR buffer[MAX_PATH];
00811
00812                 HRESULT hr = path_from_pidlW(folder, entry->pidl, buffer, MAX_PATH);
00813
00814                 if (SUCCEEDED(hr)) {
00815                         LPITEMIDLIST pidl;
00816                         ULONG len;
00817
00818                         hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
00819
00820                         if (SUCCEEDED(hr))
00821                                 return pidl;
00822                 }
00823         } else if (entry->etype == ET_WINDOWS) {
00824                 TCHAR path[MAX_PATH];
00825
00826                 get_path(entry, path);
00827
00828                 return get_path_pidl(path, hwnd);
00829         } else if (entry->pidl)
00830                 return ILClone(entry->pidl);
00831
00832         return NULL;
00833 }
00834
00835
00836 static HICON extract_icon(IShellFolder* folder, LPCITEMIDLIST pidl)
00837 {
00838         IExtractIcon* pExtract;
00839
00840         if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) {
00841                 TCHAR path[_MAX_PATH];
00842                 unsigned flags;
00843                 HICON hicon;
00844                 int idx;
00845
00846                 if (SUCCEEDED((*pExtract->lpVtbl->GetIconLocation)(pExtract, GIL_FORSHELL, path, _MAX_PATH, &idx, &flags))) {
00847                         if (!(flags & GIL_NOTFILENAME)) {
00848                                 if (idx == -1)
00849                                         idx = 0;        /* special case for some control panel applications */
00850
00851                                 if ((int)ExtractIconEx(path, idx, 0, &hicon, 1) > 0)
00852                                         flags &= ~GIL_DONTCACHE;
00853                         } else {
00854                                 HICON hIconLarge = 0;
00855
00856                                 HRESULT hr = (*pExtract->lpVtbl->Extract)(pExtract, path, idx, &hIconLarge, &hicon, MAKELONG(0/*GetSystemMetrics(SM_CXICON)*/,GetSystemMetrics(SM_CXSMICON)));
00857
00858                                 if (SUCCEEDED(hr))
00859                                         DestroyIcon(hIconLarge);
00860                         }
00861
00862                         return hicon;
00863                 }
00864         }
00865
00866         return 0;
00867 }
00868
00869
00870 static Entry* find_entry_shell(Entry* dir, LPCITEMIDLIST pidl)
00871 {
00872         Entry* entry;
00873
00874         for(entry=dir->down; entry; entry=entry->next) {
00875                 if (entry->pidl->mkid.cb == pidl->mkid.cb &&
00876                         !memcmp(entry->pidl, pidl, entry->pidl->mkid.cb))
00877                         return entry;
00878         }
00879
00880         return 0;
00881 }
00882
00883 static Entry* read_tree_shell(Root* root, LPITEMIDLIST pidl, SORT_ORDER sortOrder, HWND hwnd)
00884 {
00885         Entry* entry = &root->entry;
00886         Entry* next;
00887         LPITEMIDLIST next_pidl = pidl;
00888         IShellFolder* folder;
00889         IShellFolder* child = NULL;
00890         HRESULT hr;
00891
00892         HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00893
00894 #ifndef _NO_EXTENSIONS
00895         entry->etype = ET_SHELL;
00896 #endif
00897
00898         folder = Globals.iDesktop;
00899
00900         while(entry) {
00901                 entry->pidl = next_pidl;
00902                 entry->folder = folder;
00903
00904                 if (!pidl->mkid.cb)
00905                         break;
00906
00907                  /* copy first element of item idlist */
00908                 next_pidl = IMalloc_Alloc(Globals.iMalloc, pidl->mkid.cb+sizeof(USHORT));
00909                 memcpy(next_pidl, pidl, pidl->mkid.cb);
00910                 ((LPITEMIDLIST)((LPBYTE)next_pidl+pidl->mkid.cb))->mkid.cb = 0;
00911
00912                 hr = IShellFolder_BindToObject(folder, next_pidl, 0, &IID_IShellFolder, (void**)&child);
00913                 if (!SUCCEEDED(hr))
00914                         break;
00915
00916                 read_directory(entry, NULL, sortOrder, hwnd);
00917
00918                 if (entry->down)
00919                         entry->expanded = TRUE;
00920
00921                 next = find_entry_shell(entry, next_pidl);
00922                 if (!next)
00923                         break;
00924
00925                 folder = child;
00926                 entry = next;
00927
00928                  /* go to next element */
00929                 pidl = (LPITEMIDLIST) ((LPBYTE)pidl+pidl->mkid.cb);
00930         }
00931
00932         SetCursor(old_cursor);
00933
00934         return entry;
00935 }
00936
00937
00938 static void fill_w32fdata_shell(IShellFolder* folder, LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* w32fdata)
00939 {
00940         if (!(attribs & SFGAO_FILESYSTEM) ||
00941                   FAILED(SHGetDataFromIDList(folder, pidl, SHGDFIL_FINDDATA, w32fdata, sizeof(WIN32_FIND_DATA)))) {
00942                 WIN32_FILE_ATTRIBUTE_DATA fad;
00943                 IDataObject* pDataObj;
00944
00945                 STGMEDIUM medium = {0, {0}, 0};
00946                 FORMATETC fmt = {Globals.cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00947
00948                 HRESULT hr = IShellFolder_GetUIObjectOf(folder, 0, 1, &pidl, &IID_IDataObject, 0, (LPVOID*)&pDataObj);
00949
00950                 if (SUCCEEDED(hr)) {
00951                         hr = IDataObject_GetData(pDataObj, &fmt, &medium);
00952
00953                         IDataObject_Release(pDataObj);
00954
00955                         if (SUCCEEDED(hr)) {
00956                                 LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal));
00957                                 UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS);
00958
00959                                 if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) {
00960                                         w32fdata->dwFileAttributes = fad.dwFileAttributes;
00961                                         w32fdata->ftCreationTime = fad.ftCreationTime;
00962                                         w32fdata->ftLastAccessTime = fad.ftLastAccessTime;
00963                                         w32fdata->ftLastWriteTime = fad.ftLastWriteTime;
00964
00965                                         if (!(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
00966                                                 w32fdata->nFileSizeLow = fad.nFileSizeLow;
00967                                                 w32fdata->nFileSizeHigh = fad.nFileSizeHigh;
00968                                         }
00969                                 }
00970
00971                                 SetErrorMode(sem_org);
00972
00973                                 GlobalUnlock(medium.UNION_MEMBER(hGlobal));
00974                                 GlobalFree(medium.UNION_MEMBER(hGlobal));
00975                         }
00976                 }
00977         }
00978
00979         if (attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
00980                 w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00981
00982         if (attribs & SFGAO_READONLY)
00983                 w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
00984
00985         if (attribs & SFGAO_COMPRESSED)
00986                 w32fdata->dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED;
00987 }
00988
00989
00990 static void read_directory_shell(Entry* dir, HWND hwnd)
00991 {
00992         IShellFolder* folder = dir->folder;
00993         int level = dir->level + 1;
00994         HRESULT hr;
00995
00996         IShellFolder* child;
00997         IEnumIDList* idlist;
00998
00999         Entry* first_entry = NULL;
01000         Entry* last = NULL;
01001         Entry* entry;
01002
01003         if (!folder)
01004                 return;
01005
01006         hr = IShellFolder_EnumObjects(folder, hwnd, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE, &idlist);
01007
01008         if (SUCCEEDED(hr)) {
01009                 for(;;) {
01010 #define FETCH_ITEM_COUNT        32
01011                         LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
01012                         SFGAOF attribs;
01013                         ULONG cnt = 0;
01014                         ULONG n;
01015
01016                         memset(pidls, 0, sizeof(pidls));
01017
01018                         hr = IEnumIDList_Next(idlist, FETCH_ITEM_COUNT, pidls, &cnt);
01019                         if (!SUCCEEDED(hr))
01020                                 break;
01021
01022                         if (hr == S_FALSE)
01023                                 break;
01024
01025                         for(n=0; n<cnt; ++n) {
01026                                 entry = alloc_entry();
01027
01028                                 if (!first_entry)
01029                                         first_entry = entry;
01030
01031                                 if (last)
01032                                         last->next = entry;
01033
01034                                 memset(&entry->data, 0, sizeof(WIN32_FIND_DATA));
01035                                 entry->bhfi_valid = FALSE;
01036
01037                                 attribs = ~SFGAO_FILESYSTEM;    /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daß "My Documents" anstatt von "Martin's Documents" angezeigt wird */
01038
01039                                 hr = IShellFolder_GetAttributesOf(folder, 1, (LPCITEMIDLIST*)&pidls[n], &attribs);
01040
01041                                 if (SUCCEEDED(hr)) {
01042                                         if (attribs != (SFGAOF)~SFGAO_FILESYSTEM) {
01043                                                 fill_w32fdata_shell(folder, pidls[n], attribs, &entry->data);
01044
01045                                                 entry->bhfi_valid = TRUE;
01046                                         } else
01047                                                 attribs = 0;
01048                                 } else
01049                                         attribs = 0;
01050
01051                                 entry->pidl = pidls[n];
01052
01053                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01054                                         hr = IShellFolder_BindToObject(folder, pidls[n], 0, &IID_IShellFolder, (void**)&child);
01055
01056                                         if (SUCCEEDED(hr))
01057                                                 entry->folder = child;
01058                                         else
01059                                                 entry->folder = NULL;
01060                                 }
01061                                 else
01062                                         entry->folder = NULL;
01063
01064                                 if (!entry->data.cFileName[0])
01065                                         /*hr = */name_from_pidl(folder, pidls[n], entry->data.cFileName, MAX_PATH, /*SHGDN_INFOLDER*/0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/);
01066
01067                                  /* get display icons for files and virtual objects */
01068                                 if (!(entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
01069                                         !(attribs & SFGAO_FILESYSTEM)) {
01070                                         entry->hicon = extract_icon(folder, pidls[n]);
01071
01072                                         if (!entry->hicon)
01073                                                 entry->hicon = (HICON)-1;       /* don't try again later */
01074                                 }
01075
01076                                 entry->down = NULL;
01077                                 entry->up = dir;
01078                                 entry->expanded = FALSE;
01079                                 entry->scanned = FALSE;
01080                                 entry->level = level;
01081
01082 #ifndef _NO_EXTENSIONS
01083                                 entry->etype = ET_SHELL;
01084                                 entry->bhfi_valid = FALSE;
01085 #endif
01086
01087                                 last = entry;
01088                         }
01089                 }
01090
01091                 IEnumIDList_Release(idlist);
01092         }
01093
01094         if (last)
01095                 last->next = NULL;
01096
01097         dir->down = first_entry;
01098         dir->scanned = TRUE;
01099 }
01100
01101 #endif /* _SHELL_FOLDERS */
01102
01103
01104 /* sort order for different directory/file types */
01105 enum TYPE_ORDER {
01106         TO_DIR = 0,
01107         TO_DOT = 1,
01108         TO_DOTDOT = 2,
01109         TO_OTHER_DIR = 3,
01110         TO_FILE = 4
01111 };
01112
01113 /* distinguish between ".", ".." and any other directory names */
01114 static int TypeOrderFromDirname(LPCTSTR name)
01115 {
01116         if (name[0] == '.') {
01117                 if (name[1] == '\0')
01118                         return TO_DOT;  /* "." */
01119
01120                 if (name[1]=='.' && name[2]=='\0')
01121                         return TO_DOTDOT;       /* ".." */
01122         }
01123
01124         return TO_OTHER_DIR;    /* anything else */
01125 }
01126
01127 /* directories first... */
01128 static int compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2)
01129 {
01130         int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
01131         int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
01132
01133         /* Handle "." and ".." as special case and move them at the very first beginning. */
01134         if (order1==TO_DIR && order2==TO_DIR) {
01135                 order1 = TypeOrderFromDirname(fd1->cFileName);
01136                 order2 = TypeOrderFromDirname(fd2->cFileName);
01137         }
01138
01139         return order2==order1? 0: order1<order2? -1: 1;
01140 }
01141
01142
01143 static int compareName(const void* arg1, const void* arg2)
01144 {
01145         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01146         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01147
01148         int cmp = compareType(fd1, fd2);
01149         if (cmp)
01150                 return cmp;
01151
01152         return lstrcmpi(fd1->cFileName, fd2->cFileName);
01153 }
01154
01155 static int compareExt(const void* arg1, const void* arg2)
01156 {
01157         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01158         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01159         const TCHAR *name1, *name2, *ext1, *ext2;
01160
01161         int cmp = compareType(fd1, fd2);
01162         if (cmp)
01163                 return cmp;
01164
01165         name1 = fd1->cFileName;
01166         name2 = fd2->cFileName;
01167
01168         ext1 = _tcsrchr(name1, TEXT('.'));
01169         ext2 = _tcsrchr(name2, TEXT('.'));
01170
01171         if (ext1)
01172                 ext1++;
01173         else
01174                 ext1 = sEmpty;
01175
01176         if (ext2)
01177                 ext2++;
01178         else
01179                 ext2 = sEmpty;
01180
01181         cmp = lstrcmpi(ext1, ext2);
01182         if (cmp)
01183                 return cmp;
01184
01185         return lstrcmpi(name1, name2);
01186 }
01187
01188 static int compareSize(const void* arg1, const void* arg2)
01189 {
01190         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01191         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01192
01193         int cmp = compareType(fd1, fd2);
01194         if (cmp)
01195                 return cmp;
01196
01197         cmp = fd2->nFileSizeHigh - fd1->nFileSizeHigh;
01198
01199         if (cmp < 0)
01200                 return -1;
01201         else if (cmp > 0)
01202                 return 1;
01203
01204         cmp = fd2->nFileSizeLow - fd1->nFileSizeLow;
01205
01206         return cmp<0? -1: cmp>0? 1: 0;
01207 }
01208
01209 static int compareDate(const void* arg1, const void* arg2)
01210 {
01211         const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
01212         const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
01213
01214         int cmp = compareType(fd1, fd2);
01215         if (cmp)
01216                 return cmp;
01217
01218         return CompareFileTime(&fd2->ftLastWriteTime, &fd1->ftLastWriteTime);
01219 }
01220
01221
01222 static int (*sortFunctions[])(const void* arg1, const void* arg2) = {
01223         compareName,    /* SORT_NAME */
01224         compareExt,             /* SORT_EXT */
01225         compareSize,    /* SORT_SIZE */
01226         compareDate             /* SORT_DATE */
01227 };
01228
01229
01230 static void SortDirectory(Entry* dir, SORT_ORDER sortOrder)
01231 {
01232         Entry* entry = dir->down;
01233         Entry** array, **p;
01234         int len;
01235
01236         len = 0;
01237         for(entry=dir->down; entry; entry=entry->next)
01238                 len++;
01239
01240         if (len) {
01241                 array = HeapAlloc(GetProcessHeap(), 0, len*sizeof(Entry*));
01242
01243                 p = array;
01244                 for(entry=dir->down; entry; entry=entry->next)
01245                         *p++ = entry;
01246
01247                 /* call qsort with the appropriate compare function */
01248                 qsort(array, len, sizeof(array[0]), sortFunctions[sortOrder]);
01249
01250                 dir->down = array[0];
01251
01252                 for(p=array; --len; p++)
01253                         p[0]->next = p[1];
01254
01255                 (*p)->next = 0;
01256
01257                 HeapFree(GetProcessHeap(), 0, array);
01258         }
01259 }
01260
01261
01262 static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd)
01263 {
01264         TCHAR buffer[MAX_PATH];
01265         Entry* entry;
01266         LPCTSTR s;
01267         PTSTR d;
01268
01269 #ifdef _SHELL_FOLDERS
01270         if (dir->etype == ET_SHELL)
01271         {
01272                 read_directory_shell(dir, hwnd);
01273
01274                 if (Globals.prescan_node) {
01275                         s = path;
01276                         d = buffer;
01277
01278                         while(*s)
01279                                 *d++ = *s++;
01280
01281                         *d++ = TEXT('\\');
01282
01283                         for(entry=dir->down; entry; entry=entry->next)
01284                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01285                                         read_directory_shell(entry, hwnd);
01286                                         SortDirectory(entry, sortOrder);
01287                                 }
01288                 }
01289         }
01290         else
01291 #endif
01292 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
01293         if (dir->etype == ET_UNIX)
01294         {
01295                 read_directory_unix(dir, path);
01296
01297                 if (Globals.prescan_node) {
01298                         s = path;
01299                         d = buffer;
01300
01301                         while(*s)
01302                                 *d++ = *s++;
01303
01304                         *d++ = TEXT('/');
01305
01306                         for(entry=dir->down; entry; entry=entry->next)
01307                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01308                                         lstrcpy(d, entry->data.cFileName);
01309                                         read_directory_unix(entry, buffer);
01310                                         SortDirectory(entry, sortOrder);
01311                                 }
01312                 }
01313         }
01314         else
01315 #endif
01316         {
01317                 read_directory_win(dir, path);
01318
01319                 if (Globals.prescan_node) {
01320                         s = path;
01321                         d = buffer;
01322
01323                         while(*s)
01324                                 *d++ = *s++;
01325
01326                         *d++ = TEXT('\\');
01327
01328                         for(entry=dir->down; entry; entry=entry->next)
01329                                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01330                                         lstrcpy(d, entry->data.cFileName);
01331                                         read_directory_win(entry, buffer);
01332                                         SortDirectory(entry, sortOrder);
01333                                 }
01334                 }
01335         }
01336
01337         SortDirectory(dir, sortOrder);
01338 }
01339
01340
01341 static Entry* read_tree(Root* root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, SORT_ORDER sortOrder, HWND hwnd)
01342 {
01343 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
01344         const static TCHAR sSlash[] = {'/', '\0'};
01345 #endif
01346         const static TCHAR sBackslash[] = {'\\', '\0'};
01347
01348 #ifdef _SHELL_FOLDERS
01349         if (pidl)
01350         {
01351                  /* read shell namespace tree */
01352                 root->drive_type = DRIVE_UNKNOWN;
01353                 drv[0] = '\\';
01354                 drv[1] = '\0';
01355                 load_string(root->volname, IDS_DESKTOP);
01356                 root->fs_flags = 0;
01357                 load_string(root->fs, IDS_SHELL);
01358
01359                 return read_tree_shell(root, pidl, sortOrder, hwnd);
01360         }
01361         else
01362 #endif
01363 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
01364         if (*path == '/')
01365         {
01366                  /* read unix file system tree */
01367                 root->drive_type = GetDriveType(path);
01368
01369                 lstrcat(drv, sSlash);
01370                 load_string(root->volname, IDS_ROOT_FS);
01371                 root->fs_flags = 0;
01372                 load_string(root->fs, IDS_UNIXFS);
01373
01374                 lstrcpy(root->path, sSlash);
01375
01376                 return read_tree_unix(root, path, sortOrder, hwnd);
01377         }
01378 #endif
01379
01380          /* read WIN32 file system tree */
01381         root->drive_type = GetDriveType(path);
01382
01383         lstrcat(drv, sBackslash);
01384         GetVolumeInformation(drv, root->volname, _MAX_FNAME, 0, 0, &root->fs_flags, root->fs, _MAX_DIR);
01385
01386         lstrcpy(root->path, drv);
01387
01388         return read_tree_win(root, path, sortOrder, hwnd);
01389 }
01390
01391
01392 /* flags to filter different file types */
01393 enum TYPE_FILTER {
01394         TF_DIRECTORIES  = 0x01,
01395         TF_PROGRAMS             = 0x02,
01396         TF_DOCUMENTS    = 0x04,
01397         TF_OTHERS               = 0x08,
01398         TF_HIDDEN               = 0x10,
01399         TF_ALL                  = 0x1F
01400 };
01401
01402
01403 static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd)
01404 {
01405         TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
01406         TCHAR b1[BUFFER_LEN];
01407         const static TCHAR sAsterics[] = {'*', '\0'};
01408
01409         ChildWnd* child = (ChildWnd*) malloc(sizeof(ChildWnd));
01410         Root* root = &child->root;
01411         Entry* entry;
01412
01413         memset(child, 0, sizeof(ChildWnd));
01414
01415         child->left.treePane = TRUE;
01416         child->left.visible_cols = 0;
01417
01418         child->right.treePane = FALSE;
01419 #ifndef _NO_EXTENSIONS
01420         child->right.visible_cols = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS;
01421 #else
01422         child->right.visible_cols = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES;
01423 #endif
01424
01425         child->pos.length = sizeof(WINDOWPLACEMENT);
01426         child->pos.flags = 0;
01427         child->pos.showCmd = SW_SHOWNORMAL;
01428         child->pos.rcNormalPosition.left = CW_USEDEFAULT;
01429         child->pos.rcNormalPosition.top = CW_USEDEFAULT;
01430         child->pos.rcNormalPosition.right = CW_USEDEFAULT;
01431         child->pos.rcNormalPosition.bottom = CW_USEDEFAULT;
01432
01433         child->focus_pane = 0;
01434         child->split_pos = DEFAULT_SPLIT_POS;
01435         child->sortOrder = SORT_NAME;
01436         child->header_wdths_ok = FALSE;
01437
01438         if (path)
01439         {
01440                 lstrcpy(child->path, path);
01441
01442                 _tsplitpath(path, drv, dir, name, ext);
01443         }
01444
01445         lstrcpy(child->filter_pattern, sAsterics);
01446         child->filter_flags = TF_ALL;
01447
01448         root->entry.level = 0;
01449
01450         entry = read_tree(root, path, pidl, drv, child->sortOrder, hwnd);
01451
01452 #ifdef _SHELL_FOLDERS
01453         if (root->entry.etype == ET_SHELL)
01454                 load_string(root->entry.data.cFileName, IDS_DESKTOP);
01455         else
01456 #endif
01457                 wsprintf(root->entry.data.cFileName, RS(b1,IDS_TITLEFMT), drv, root->fs);
01458
01459         root->entry.data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
01460
01461         child->left.root = &root->entry;
01462         child->right.root = NULL;
01463
01464         set_curdir(child, entry, 0, hwnd);
01465
01466         return child;
01467 }
01468
01469
01470 /* free all memory associated with a child window */
01471 static void free_child_window(ChildWnd* child)
01472 {
01473         free_entries(&child->root.entry);
01474         free(child);
01475 }
01476
01477
01478 /* get full path of specified directory entry */
01479 static void get_path(Entry* dir, PTSTR path)
01480 {
01481         Entry* entry;
01482         int len = 0;
01483         int level = 0;
01484
01485 #ifdef _SHELL_FOLDERS
01486         if (dir->etype == ET_SHELL)
01487         {
01488                 SFGAOF attribs;
01489                 HRESULT hr = S_OK;
01490
01491                 path[0] = TEXT('\0');
01492
01493                 attribs = 0;
01494
01495                 if (dir->folder)
01496                         hr = IShellFolder_GetAttributesOf(dir->folder, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs);
01497
01498                 if (SUCCEEDED(hr) && (attribs&SFGAO_FILESYSTEM)) {
01499                         IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop;
01500
01501                         hr = path_from_pidl(parent, dir->pidl, path, MAX_PATH);
01502                 }
01503         }
01504         else
01505 #endif
01506         {
01507                 for(entry=dir; entry; level++) {
01508                         LPCTSTR name;
01509                         int l;
01510
01511                         {
01512                                 LPCTSTR s;
01513                                 name = entry->data.cFileName;
01514                                 s = name;
01515
01516                                 for(l=0; *s && *s!=TEXT('/') && *s!=TEXT('\\'); s++)
01517                                         l++;
01518                         }
01519
01520                         if (entry->up) {
01521                                 if (l > 0) {
01522                                         memmove(path+l+1, path, len*sizeof(TCHAR));
01523                                         memcpy(path+1, name, l*sizeof(TCHAR));
01524                                         len += l+1;
01525
01526 #ifndef _NO_EXTENSIONS
01527                                         if (entry->etype == ET_UNIX)
01528                                                 path[0] = TEXT('/');
01529                                         else
01530 #endif
01531                                         path[0] = TEXT('\\');
01532                                 }
01533
01534                                 entry = entry->up;
01535                         } else {
01536                                 memmove(path+l, path, len*sizeof(TCHAR));
01537                                 memcpy(path, name, l*sizeof(TCHAR));
01538                                 len += l;
01539                                 break;
01540                         }
01541                 }
01542
01543                 if (!level) {
01544 #ifndef _NO_EXTENSIONS
01545                         if (entry->etype == ET_UNIX)
01546                                 path[len++] = TEXT('/');
01547                         else
01548 #endif
01549                                 path[len++] = TEXT('\\');
01550                 }
01551
01552                 path[len] = TEXT('\0');
01553         }
01554 }
01555
01556
01557 static void resize_frame_rect(HWND hwnd, PRECT prect)
01558 {
01559         int new_top;
01560         RECT rt;
01561
01562         if (IsWindowVisible(Globals.htoolbar)) {
01563                 SendMessage(Globals.htoolbar, WM_SIZE, 0, 0);
01564                 GetClientRect(Globals.htoolbar, &rt);
01565                 prect->top = rt.bottom+3;
01566                 prect->bottom -= rt.bottom+3;
01567         }
01568
01569         if (IsWindowVisible(Globals.hdrivebar)) {
01570                 SendMessage(Globals.hdrivebar, WM_SIZE, 0, 0);
01571                 GetClientRect(Globals.hdrivebar, &rt);
01572                 new_top = --prect->top + rt.bottom+3;
01573                 MoveWindow(Globals.hdrivebar, 0, prect->top, rt.right, new_top, TRUE);
01574                 prect->top = new_top;
01575                 prect->bottom -= rt.bottom+2;
01576         }
01577
01578         if (IsWindowVisible(Globals.hstatusbar)) {
01579                 int parts[] = {300, 500};
01580
01581                 SendMessage(Globals.hstatusbar, WM_SIZE, 0, 0);
01582                 SendMessage(Globals.hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
01583                 GetClientRect(Globals.hstatusbar, &rt);
01584                 prect->bottom -= rt.bottom;
01585         }
01586
01587         MoveWindow(Globals.hmdiclient, prect->left-1,prect->top-1,prect->right+2,prect->bottom+1, TRUE);
01588 }
01589
01590 static void resize_frame(HWND hwnd, int cx, int cy)
01591 {
01592         RECT rect;
01593
01594         rect.left   = 0;
01595         rect.top    = 0;
01596         rect.right  = cx;
01597         rect.bottom = cy;
01598
01599         resize_frame_rect(hwnd, &rect);
01600 }
01601
01602 static void resize_frame_client(HWND hwnd)
01603 {
01604         RECT rect;
01605
01606         GetClientRect(hwnd, &rect);
01607
01608         resize_frame_rect(hwnd, &rect);
01609 }
01610
01611
01612 static HHOOK hcbthook;
01613 static ChildWnd* newchild = NULL;
01614
01615 static LRESULT CALLBACK CBTProc(int code, WPARAM wparam, LPARAM lparam)
01616 {
01617         if (code==HCBT_CREATEWND && newchild) {
01618                 ChildWnd* child = newchild;
01619                 newchild = NULL;
01620
01621                 child->hwnd = (HWND) wparam;
01622                 SetWindowLongPtr(child->hwnd, GWLP_USERDATA, (LPARAM)child);
01623         }
01624
01625         return CallNextHookEx(hcbthook, code, wparam, lparam);
01626 }
01627
01628 static HWND create_child_window(ChildWnd* child)
01629 {
01630         MDICREATESTRUCT mcs;
01631         int idx;
01632
01633         mcs.szClass = sWINEFILETREE;
01634         mcs.szTitle = (LPTSTR)child->path;
01635         mcs.hOwner  = Globals.hInstance;
01636         mcs.x       = child->pos.rcNormalPosition.left;
01637         mcs.y       = child->pos.rcNormalPosition.top;
01638         mcs.cx      = child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left;
01639         mcs.cy      = child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top;
01640         mcs.style   = 0;
01641         mcs.lParam  = 0;
01642
01643         hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId());
01644
01645         newchild = child;
01646         child->hwnd = (HWND) SendMessage(Globals.hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs);
01647         if (!child->hwnd) {
01648                 UnhookWindowsHookEx(hcbthook);
01649                 return 0;
01650         }
01651
01652         UnhookWindowsHookEx(hcbthook);
01653
01654         ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
01655         ListBox_SetItemHeight(child->right.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
01656
01657         idx = ListBox_FindItemData(child->left.hwnd, 0, child->left.cur);
01658         ListBox_SetCurSel(child->left.hwnd, idx);
01659
01660         return child->hwnd;
01661 }
01662
01663
01664 struct ExecuteDialog {
01665         TCHAR   cmd[MAX_PATH];
01666         int             cmdshow;
01667 };
01668
01669 static INT_PTR CALLBACK ExecuteDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
01670 {
01671         static struct ExecuteDialog* dlg;
01672
01673         switch(nmsg) {
01674                 case WM_INITDIALOG:
01675                         dlg = (struct ExecuteDialog*) lparam;
01676                         return 1;
01677
01678                 case WM_COMMAND: {
01679                         int id = (int)wparam;
01680
01681                         if (id == IDOK) {
01682                                 GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH);
01683                                 dlg->cmdshow = Button_GetState(GetDlgItem(hwnd,214))&BST_CHECKED?
01684                                                                                                 SW_SHOWMINIMIZED: SW_SHOWNORMAL;
01685                                 EndDialog(hwnd, id);
01686                         } else if (id == IDCANCEL)
01687                                 EndDialog(hwnd, id);
01688
01689                         return 1;}
01690         }
01691
01692         return 0;
01693 }
01694
01695
01696 static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
01697 {
01698         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
01699
01700         switch(nmsg) {
01701                 case WM_INITDIALOG:
01702                         SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
01703                         SetWindowText(GetDlgItem(hwnd, 201), (LPCTSTR)lparam);
01704                         return 1;
01705
01706                 case WM_COMMAND: {
01707                         int id = (int)wparam;
01708
01709                         switch(id) {
01710                           case IDOK: {
01711                                 LPTSTR dest = (LPTSTR) GetWindowLongPtr(hwnd, GWLP_USERDATA);
01712                                 GetWindowText(GetDlgItem(hwnd, 201), dest, MAX_PATH);
01713                                 EndDialog(hwnd, id);
01714                                 break;}
01715
01716                           case IDCANCEL:
01717                                 EndDialog(hwnd, id);
01718                                 break;
01719
01720                           case 254:
01721                                 MessageBox(hwnd, RS(b1,IDS_NO_IMPL), RS(b2,IDS_WINEFILE), MB_OK);
01722                                 break;
01723                         }
01724
01725                         return 1;
01726                 }
01727         }
01728
01729         return 0;
01730 }
01731
01732
01733 struct FilterDialog {
01734         TCHAR   pattern[MAX_PATH];
01735         int             flags;
01736 };
01737
01738 static INT_PTR CALLBACK FilterDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
01739 {
01740         static struct FilterDialog* dlg;
01741
01742         switch(nmsg) {
01743                 case WM_INITDIALOG:
01744                         dlg = (struct FilterDialog*) lparam;
01745                         SetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern);
01746                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DIRECTORIES), (dlg->flags&TF_DIRECTORIES? BST_CHECKED: BST_UNCHECKED));
01747                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_PROGRAMS), dlg->flags&TF_PROGRAMS? BST_CHECKED: BST_UNCHECKED);
01748                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DOCUMENTS), dlg->flags&TF_DOCUMENTS? BST_CHECKED: BST_UNCHECKED);
01749                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_OTHERS), dlg->flags&TF_OTHERS? BST_CHECKED: BST_UNCHECKED);
01750                         Button_SetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_HIDDEN), dlg->flags&TF_HIDDEN? BST_CHECKED: BST_UNCHECKED);
01751                         return 1;
01752
01753                 case WM_COMMAND: {
01754                         int id = (int)wparam;
01755
01756                         if (id == IDOK) {
01757                                 int flags = 0;
01758
01759                                 GetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern, MAX_PATH);
01760
01761                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DIRECTORIES))&BST_CHECKED? TF_DIRECTORIES: 0;
01762                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_PROGRAMS))&BST_CHECKED? TF_PROGRAMS: 0;
01763                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_DOCUMENTS))&BST_CHECKED? TF_DOCUMENTS: 0;
01764                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_OTHERS))&BST_CHECKED? TF_OTHERS: 0;
01765                                 flags |= Button_GetCheck(GetDlgItem(hwnd,IDC_VIEW_TYPE_HIDDEN))&BST_CHECKED? TF_HIDDEN: 0;
01766
01767                                 dlg->flags = flags;
01768
01769                                 EndDialog(hwnd, id);
01770                         } else if (id == IDCANCEL)
01771                                 EndDialog(hwnd, id);
01772
01773                         return 1;}
01774         }
01775
01776         return 0;
01777 }
01778
01779
01780 struct PropertiesDialog {
01781         TCHAR   path[MAX_PATH];
01782         Entry   entry;
01783         void*   pVersionData;
01784 };
01785
01786 /* Structure used to store enumerated languages and code pages. */
01787 struct LANGANDCODEPAGE {
01788         WORD wLanguage;
01789         WORD wCodePage;
01790 } *lpTranslate;
01791
01792 static LPCSTR InfoStrings[] = {
01793         "Comments",
01794         "CompanyName",
01795         "FileDescription",
01796         "FileVersion",
01797         "InternalName",
01798         "LegalCopyright",
01799         "LegalTrademarks",
01800         "OriginalFilename",
01801         "PrivateBuild",
01802         "ProductName",
01803         "ProductVersion",
01804         "SpecialBuild",
01805         NULL
01806 };
01807
01808 static void PropDlg_DisplayValue(HWND hlbox, HWND hedit)
01809 {
01810         int idx = ListBox_GetCurSel(hlbox);
01811
01812         if (idx != LB_ERR) {
01813                 LPCTSTR pValue = (LPCTSTR) ListBox_GetItemData(hlbox, idx);
01814
01815                 if (pValue)
01816                         SetWindowText(hedit, pValue);
01817         }
01818 }
01819
01820 static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCTSTR strFilename)
01821 {
01822         static TCHAR sBackSlash[] = {'\\','\0'};
01823         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'};
01824         static TCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
01825                                                                                 '%','0','4','x','%','0','4','x','\\','%','s','\0'};
01826         DWORD dwVersionDataLen = GetFileVersionInfoSize((LPTSTR)strFilename, NULL);     /* VC6 and MinGW headers use LPTSTR instead of LPCTSTR */
01827
01828         if (dwVersionDataLen) {
01829                 dlg->pVersionData = malloc(dwVersionDataLen);
01830
01831                 if (GetFileVersionInfo((LPTSTR)strFilename, 0, dwVersionDataLen, dlg->pVersionData)) {  /* VC6 and MinGW headers use LPTSTR instead of LPCTSTR */
01832                         LPVOID pVal;
01833                         UINT nValLen;
01834
01835                         if (VerQueryValue(dlg->pVersionData, sBackSlash, &pVal, &nValLen)) {
01836                                 if (nValLen == sizeof(VS_FIXEDFILEINFO)) {
01837                                         VS_FIXEDFILEINFO* pFixedFileInfo = (VS_FIXEDFILEINFO*)pVal;
01838                                         char buffer[BUFFER_LEN];
01839
01840                                         sprintf(buffer, "%d.%d.%d.%d",
01841                                                 HIWORD(pFixedFileInfo->dwFileVersionMS), LOWORD(pFixedFileInfo->dwFileVersionMS),
01842                                                 HIWORD(pFixedFileInfo->dwFileVersionLS), LOWORD(pFixedFileInfo->dwFileVersionLS));
01843
01844                                         SetDlgItemTextA(hwnd, IDC_STATIC_PROP_VERSION, buffer);
01845                                 }
01846                         }
01847
01848                         /* Read the list of languages and code pages. */
01849                         if (VerQueryValue(dlg->pVersionData, sTranslation, &pVal, &nValLen)) {
01850                                 struct LANGANDCODEPAGE* pTranslate = (struct LANGANDCODEPAGE*)pVal;
01851                                 struct LANGANDCODEPAGE* pEnd = (struct LANGANDCODEPAGE*)((LPBYTE)pVal+nValLen);
01852
01853                                 HWND hlbox = GetDlgItem(hwnd, IDC_LIST_PROP_VERSION_TYPES);
01854
01855                                 /* Read the file description for each language and code page. */
01856                                 for(; pTranslate<pEnd; ++pTranslate) {
01857                                         LPCSTR* p;
01858
01859                                         for(p=InfoStrings; *p; ++p) {
01860                                                 TCHAR subblock[200];
01861 #ifdef UNICODE
01862                                                 TCHAR infoStr[100];
01863 #endif
01864                                                 LPCTSTR pTxt;
01865                                                 UINT nValLen;
01866
01867                                                 LPCSTR pInfoString = *p;
01868 #ifdef UNICODE
01869                                                 MultiByteToWideChar(CP_ACP, 0, pInfoString, -1, infoStr, 100);
01870 #else
01871 #define infoStr pInfoString
01872 #endif
01873                                                 wsprintf(subblock, sStringFileInfo, pTranslate->wLanguage, pTranslate->wCodePage, infoStr);
01874
01875                                                 /* Retrieve file description for language and code page */
01876                                                 if (VerQueryValue(dlg->pVersionData, subblock, (PVOID)&pTxt, &nValLen)) {
01877                                                         int idx = ListBox_AddString(hlbox, infoStr);
01878                                                         ListBox_SetItemData(hlbox, idx, pTxt);
01879                                                 }
01880                                         }
01881                                 }
01882
01883                                 ListBox_SetCurSel(hlbox, 0);
01884
01885                                 PropDlg_DisplayValue(hlbox, GetDlgItem(hwnd,IDC_LIST_PROP_VERSION_VALUES));
01886                         }
01887                 }
01888         }
01889 }
01890
01891 static INT_PTR CALLBACK PropertiesDialogDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
01892 {
01893         static struct PropertiesDialog* dlg;
01894
01895         switch(nmsg) {
01896                 case WM_INITDIALOG: {
01897                         const static TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'};
01898                         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
01899                         LPWIN32_FIND_DATA pWFD;
01900                         ULONGLONG size;
01901
01902                         dlg = (struct PropertiesDialog*) lparam;
01903                         pWFD = (LPWIN32_FIND_DATA) &dlg->entry.data;
01904
01905                         GetWindowText(hwnd, b1, MAX_PATH);
01906                         wsprintf(b2, b1, pWFD->cFileName);
01907                         SetWindowText(hwnd, b2);
01908
01909                         format_date(&pWFD->ftLastWriteTime, b1, COL_DATE|COL_TIME);
01910                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_LASTCHANGE), b1);
01911
01912                         size = ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow;
01913                         _stprintf(b1, sLongNumFmt, size);
01914                         wsprintf(b2, sByteFmt, b1);
01915                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_SIZE), b2);
01916
01917                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_FILENAME), pWFD->cFileName);
01918                         SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_PATH), dlg->path);
01919
01920                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_READONLY), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_READONLY? BST_CHECKED: BST_UNCHECKED));
01921                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_ARCHIVE), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_ARCHIVE? BST_CHECKED: BST_UNCHECKED));
01922                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_COMPRESSED), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_COMPRESSED? BST_CHECKED: BST_UNCHECKED));
01923                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_HIDDEN), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_HIDDEN? BST_CHECKED: BST_UNCHECKED));
01924                         Button_SetCheck(GetDlgItem(hwnd,IDC_CHECK_SYSTEM), (pWFD->dwFileAttributes&FILE_ATTRIBUTE_SYSTEM? BST_CHECKED: BST_UNCHECKED));
01925
01926                         CheckForFileInfo(dlg, hwnd, dlg->path);
01927                         return 1;}
01928
01929                 case WM_COMMAND: {
01930                         int id = (int)wparam;
01931
01932                         switch(HIWORD(wparam)) {
01933                           case LBN_SELCHANGE: {
01934                                 HWND hlbox = GetDlgItem(hwnd, IDC_LIST_PROP_VERSION_TYPES);
01935                                 PropDlg_DisplayValue(hlbox, GetDlgItem(hwnd,IDC_LIST_PROP_VERSION_VALUES));
01936                                 break;
01937                           }
01938
01939                           case BN_CLICKED:
01940                                 if (id==IDOK || id==IDCANCEL)
01941                                         EndDialog(hwnd, id);
01942                         }
01943
01944                         return 1;}
01945
01946                 case WM_NCDESTROY:
01947                         free(dlg->pVersionData);
01948                         dlg->pVersionData = NULL;
01949                         break;
01950         }
01951
01952         return 0;
01953 }
01954
01955 static void show_properties_dlg(Entry* entry, HWND hwnd)
01956 {
01957         struct PropertiesDialog dlg;
01958
01959         memset(&dlg, 0, sizeof(struct PropertiesDialog));
01960         get_path(entry, dlg.path);
01961         memcpy(&dlg.entry, entry, sizeof(Entry));
01962
01963         DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_PROPERTIES), hwnd, PropertiesDialogDlgProc, (LPARAM)&dlg);
01964 }
01965
01966
01967 #ifndef _NO_EXTENSIONS
01968
01969 static struct FullScreenParameters {
01970         BOOL    mode;
01971         RECT    orgPos;
01972         BOOL    wasZoomed;
01973 } g_fullscreen = {
01974     FALSE,      /* mode */
01975         {0, 0, 0, 0},
01976         FALSE
01977 };
01978
01979 static void frame_get_clientspace(HWND hwnd, PRECT prect)
01980 {
01981         RECT rt;
01982
01983         if (!IsIconic(hwnd))
01984                 GetClientRect(hwnd, prect);
01985         else {
01986                 WINDOWPLACEMENT wp;
01987
01988                 GetWindowPlacement(hwnd, &wp);
01989
01990                 prect->left = prect->top = 0;
01991                 prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left-
01992                                                 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE));
01993                 prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
01994                                                 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
01995                                                 GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
01996         }
01997
01998         if (IsWindowVisible(Globals.htoolbar)) {
01999                 GetClientRect(Globals.htoolbar, &rt);
02000                 prect->top += rt.bottom+2;
02001         }
02002
02003         if (IsWindowVisible(Globals.hdrivebar)) {
02004                 GetClientRect(Globals.hdrivebar, &rt);
02005                 prect->top += rt.bottom+2;
02006         }
02007
02008         if (IsWindowVisible(Globals.hstatusbar)) {
02009                 GetClientRect(Globals.hstatusbar, &rt);
02010                 prect->bottom -= rt.bottom;
02011         }
02012 }
02013
02014 static BOOL toggle_fullscreen(HWND hwnd)
02015 {
02016         RECT rt;
02017
02018         if ((g_fullscreen.mode=!g_fullscreen.mode)) {
02019                 GetWindowRect(hwnd, &g_fullscreen.orgPos);
02020                 g_fullscreen.wasZoomed = IsZoomed(hwnd);
02021
02022                 Frame_CalcFrameClient(hwnd, &rt);
02023                 ClientToScreen(hwnd, (LPPOINT)&rt.left);
02024                 ClientToScreen(hwnd, (LPPOINT)&rt.right);
02025
02026                 rt.left = g_fullscreen.orgPos.left-rt.left;
02027                 rt.top = g_fullscreen.orgPos.top-rt.top;
02028                 rt.right = GetSystemMetrics(SM_CXSCREEN)+g_fullscreen.orgPos.right-rt.right;
02029                 rt.bottom = GetSystemMetrics(SM_CYSCREEN)+g_fullscreen.orgPos.bottom-rt.bottom;
02030
02031                 MoveWindow(hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
02032         } else {
02033                 MoveWindow(hwnd, g_fullscreen.orgPos.left, g_fullscreen.orgPos.top,
02034                                                         g_fullscreen.orgPos.right-g_fullscreen.orgPos.left,
02035                                                         g_fullscreen.orgPos.bottom-g_fullscreen.orgPos.top, TRUE);
02036
02037                 if (g_fullscreen.wasZoomed)
02038                         ShowWindow(hwnd, WS_MAXIMIZE);
02039         }
02040
02041         return g_fullscreen.mode;
02042 }
02043
02044 static void fullscreen_move(HWND hwnd)
02045 {
02046         RECT rt, pos;
02047         GetWindowRect(hwnd, &pos);
02048
02049         Frame_CalcFrameClient(hwnd, &rt);
02050         ClientToScreen(hwnd, (LPPOINT)&rt.left);
02051         ClientToScreen(hwnd, (LPPOINT)&rt.right);
02052
02053         rt.left = pos.left-rt.left;
02054         rt.top = pos.top-rt.top;
02055         rt.right = GetSystemMetrics(SM_CXSCREEN)+pos.right-rt.right;
02056         rt.bottom = GetSystemMetrics(SM_CYSCREEN)+pos.bottom-rt.bottom;
02057
02058         MoveWindow(hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
02059 }
02060
02061 #endif
02062
02063
02064 static void toggle_child(HWND hwnd, UINT cmd, HWND hchild)
02065 {
02066         BOOL vis = IsWindowVisible(hchild);
02067
02068         CheckMenuItem(Globals.hMenuOptions, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
02069
02070         ShowWindow(hchild, vis?SW_HIDE:SW_SHOW);
02071
02072 #ifndef _NO_EXTENSIONS
02073         if (g_fullscreen.mode)
02074                 fullscreen_move(hwnd);
02075 #endif
02076
02077         resize_frame_client(hwnd);
02078 }
02079
02080 static BOOL activate_drive_window(LPCTSTR path)
02081 {
02082         TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE];
02083         HWND child_wnd;
02084
02085         _tsplitpath(path, drv1, 0, 0, 0);
02086
02087         /* search for a already open window for the same drive */
02088         for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) {
02089                 ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA);
02090
02091                 if (child) {
02092                         _tsplitpath(child->root.path, drv2, 0, 0, 0);
02093
02094                         if (!lstrcmpi(drv2, drv1)) {
02095                                 SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
02096
02097                                 if (IsMinimized(child_wnd))
02098                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
02099
02100                                 return TRUE;
02101                         }
02102                 }
02103         }
02104
02105         return FALSE;
02106 }
02107
02108 static BOOL activate_fs_window(LPCTSTR filesys)
02109 {
02110         HWND child_wnd;
02111
02112         /* search for a already open window of the given file system name */
02113         for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) {
02114                 ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA);
02115
02116                 if (child) {
02117                         if (!lstrcmpi(child->root.fs, filesys)) {
02118                                 SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
02119
02120                                 if (IsMinimized(child_wnd))
02121                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
02122
02123                                 return TRUE;
02124                         }
02125                 }
02126         }
02127
02128         return FALSE;
02129 }
02130
02131 static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
02132 {
02133         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
02134
02135         switch(nmsg) {
02136                 case WM_CLOSE:
02137                         DestroyWindow(hwnd);
02138
02139                          /* clear handle variables */
02140                         Globals.hMenuFrame = 0;
02141                         Globals.hMenuView = 0;
02142                         Globals.hMenuOptions = 0;
02143                         Globals.hMainWnd = 0;
02144                         Globals.hmdiclient = 0;
02145                         Globals.hdrivebar = 0;
02146                         break;
02147
02148                 case WM_DESTROY:
02149                          /* don't exit desktop when closing file manager window */
02150                         if (!Globals.hwndParent)
02151                                 PostQuitMessage(0);
02152                         break;
02153
02154                 case WM_INITMENUPOPUP: {
02155                         HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0);
02156
02157                         if (!SendMessage(hwndClient, WM_INITMENUPOPUP, wparam, lparam))
02158                                 return 0;
02159                         break;}
02160
02161                 case WM_COMMAND: {
02162                         UINT cmd = LOWORD(wparam);
02163                         HWND hwndClient = (HWND) SendMessage(Globals.hmdiclient, WM_MDIGETACTIVE, 0, 0);
02164
02165                         if (SendMessage(hwndClient, WM_DISPATCH_COMMAND, wparam, lparam))
02166                                 break;
02167
02168                         if (cmd>=ID_DRIVE_FIRST && cmd<=ID_DRIVE_FIRST+0xFF) {
02169                                 TCHAR drv[_MAX_DRIVE], path[MAX_PATH];
02170                                 ChildWnd* child;
02171                                 LPCTSTR root = Globals.drives;
02172                                 int i;
02173
02174                                 for(i=cmd-ID_DRIVE_FIRST; i--; root++)
02175                                         while(*root)
02176                                                 root++;
02177
02178                                 if (activate_drive_window(root))
02179                                         return 0;
02180
02181                                 _tsplitpath(root, drv, 0, 0, 0);
02182
02183                                 if (!SetCurrentDirectory(drv)) {
02184                                         display_error(hwnd, GetLastError());
02185                                         return 0;
02186                                 }
02187
02188                                 GetCurrentDirectory(MAX_PATH, path); /*TODO: store last directory per drive */
02189                                 child = alloc_child_window(path, NULL, hwnd);
02190
02191                                 if (!create_child_window(child))
02192                                         free(child);
02193                         } else switch(cmd) {
02194                                 case ID_FILE_EXIT:
02195                                         SendMessage(hwnd, WM_CLOSE, 0, 0);
02196                                         break;
02197
02198                                 case ID_WINDOW_NEW: {
02199                                         TCHAR path[MAX_PATH];
02200                                         ChildWnd* child;
02201
02202                                         GetCurrentDirectory(MAX_PATH, path);
02203                                         child = alloc_child_window(path, NULL, hwnd);
02204
02205                                         if (!create_child_window(child))
02206                                                 free(child);
02207                                         break;}
02208
02209                                 case ID_REFRESH:
02210                                         refresh_drives();
02211                                         break;
02212
02213                                 case ID_WINDOW_CASCADE:
02214                                         SendMessage(Globals.hmdiclient, WM_MDICASCADE, 0, 0);
02215                                         break;
02216
02217                                 case ID_WINDOW_TILE_HORZ:
02218                                         SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_HORIZONTAL, 0);
02219                                         break;
02220
02221                                 case ID_WINDOW_TILE_VERT:
02222                                         SendMessage(Globals.hmdiclient, WM_MDITILE, MDITILE_VERTICAL, 0);
02223                                         break;
02224
02225                                 case ID_WINDOW_ARRANGE:
02226                                         SendMessage(Globals.hmdiclient, WM_MDIICONARRANGE, 0, 0);
02227                                         break;
02228
02229                                 case ID_SELECT_FONT: {
02230                                         TCHAR dlg_name[BUFFER_LEN], dlg_info[BUFFER_LEN];
02231                                         CHOOSEFONT chFont;
02232                                         LOGFONT lFont;
02233
02234                                         HDC hdc = GetDC(hwnd);
02235                                         chFont.lStructSize = sizeof(CHOOSEFONT);
02236                                         chFont.hwndOwner = hwnd;
02237                                         chFont.hDC = NULL;
02238                                         chFont.lpLogFont = &lFont;
02239                                         chFont.Flags = CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_LIMITSIZE | CF_NOSCRIPTSEL;
02240                                         chFont.rgbColors = RGB(0,0,0);
02241                                         chFont.lCustData = 0;
02242                                         chFont.lpfnHook = NULL;
02243                                         chFont.lpTemplateName = NULL;
02244                                         chFont.hInstance = Globals.hInstance;
02245                                         chFont.lpszStyle = NULL;
02246                                         chFont.nFontType = SIMULATED_FONTTYPE;
02247                                         chFont.nSizeMin = 0;
02248                                         chFont.nSizeMax = 24;
02249
02250                                         if (ChooseFont(&chFont)) {
02251                                                 HWND childWnd;
02252                                                 HFONT hFontOld;
02253
02254                                                 DeleteObject(Globals.hfont);
02255                                                 Globals.hfont = CreateFontIndirect(&lFont);
02256                                                 hFontOld = SelectFont(hdc, Globals.hfont);
02257                                                 GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
02258
02259                                                 /* change font in all open child windows */
02260                                                 for(childWnd=GetWindow(Globals.hmdiclient,GW_CHILD); childWnd; childWnd=GetNextWindow(childWnd,GW_HWNDNEXT)) {
02261                                                         ChildWnd* child = (ChildWnd*) GetWindowLongPtr(childWnd, GWLP_USERDATA);
02262                                                         SetWindowFont(child->left.hwnd, Globals.hfont, TRUE);
02263                                                         SetWindowFont(child->right.hwnd, Globals.hfont, TRUE);
02264                                                         ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
02265                                                         ListBox_SetItemHeight(child->right.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
02266                                                         InvalidateRect(child->left.hwnd, NULL, TRUE);
02267                                                         InvalidateRect(child->right.hwnd, NULL, TRUE);
02268                                                 }
02269
02270                                                 SelectFont(hdc, hFontOld);
02271                                         }
02272                                         else if (CommDlgExtendedError()) {
02273                                                 LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
02274                                                 LoadString(Globals.hInstance, IDS_FONT_SEL_ERROR, dlg_info, BUFFER_LEN);
02275                                                 MessageBox(hwnd, dlg_info, dlg_name, MB_OK);
02276                                         }
02277
02278                                         ReleaseDC(hwnd, hdc);
02279                                         break;
02280                                 }
02281
02282                                 case ID_VIEW_TOOL_BAR:
02283                                         toggle_child(hwnd, cmd, Globals.htoolbar);
02284                                         break;
02285
02286                                 case ID_VIEW_DRIVE_BAR:
02287                                         toggle_child(hwnd, cmd, Globals.hdrivebar);
02288                                         break;
02289
02290                                 case ID_VIEW_STATUSBAR:
02291                                         toggle_child(hwnd, cmd, Globals.hstatusbar);
02292                                         break;
02293
02294                                 case ID_EXECUTE: {
02295                                         struct ExecuteDialog dlg;
02296
02297                                         memset(&dlg, 0, sizeof(struct ExecuteDialog));
02298
02299                                         if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_EXECUTE), hwnd, ExecuteDialogDlgProc, (LPARAM)&dlg) == IDOK) {
02300                                                 HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
02301
02302                                                 if ((int)hinst <= 32)
02303                                                         display_error(hwnd, GetLastError());
02304                                         }
02305                                         break;}
02306
02307                                 case ID_CONNECT_NETWORK_DRIVE: {
02308                                         DWORD ret = WNetConnectionDialog(hwnd, RESOURCETYPE_DISK);
02309                                         if (ret == NO_ERROR)
02310                                                 refresh_drives();
02311                                         else if (ret != (DWORD)-1) {
02312                                                 if (ret == ERROR_EXTENDED_ERROR)
02313                                                         display_network_error(hwnd);
02314                                                 else
02315                                                         display_error(hwnd, ret);
02316                                         }
02317                                         break;}
02318
02319                                 case ID_DISCONNECT_NETWORK_DRIVE: {
02320                                         DWORD ret = WNetDisconnectDialog(hwnd, RESOURCETYPE_DISK);
02321                                         if (ret == NO_ERROR)
02322                                                 refresh_drives();
02323                                         else if (ret != (DWORD)-1) {
02324                                                 if (ret == ERROR_EXTENDED_ERROR)
02325                                                         display_network_error(hwnd);
02326                                                 else
02327                                                         display_error(hwnd, ret);
02328                                         }
02329                                         break;}
02330
02331 #ifndef __MINGW32__     /* SHFormatDrive missing in MinGW (as of 13.5.2005) */
02332                                 case ID_FORMAT_DISK: {
02333                                         UINT sem_org = SetErrorMode(0); /* Get the current Error Mode settings. */
02334                                         SetErrorMode(sem_org & ~SEM_FAILCRITICALERRORS); /* Force O/S to handle */
02335                                         SHFormatDrive(hwnd, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
02336                                         SetErrorMode(sem_org); /* Put it back the way it was. */
02337                                         break;}
02338 #endif
02339
02340                                 case ID_HELP:
02341                                         WinHelp(hwnd, RS(b1,IDS_WINEFILE), HELP_INDEX, 0);
02342                                         break;
02343
02344 #ifndef _NO_EXTENSIONS
02345                                 case ID_VIEW_FULLSCREEN:
02346                                         CheckMenuItem(Globals.hMenuOptions, cmd, toggle_fullscreen(hwnd)?MF_CHECKED:0);
02347                                         break;
02348
02349 #ifdef __WINE__
02350                                 case ID_DRIVE_UNIX_FS: {
02351                                         TCHAR path[MAX_PATH];
02352 #ifdef UNICODE
02353                                         char cpath[MAX_PATH];
02354 #endif
02355                                         ChildWnd* child;
02356
02357                                         if (activate_fs_window(RS(b1,IDS_UNIXFS)))
02358                                                 break;
02359
02360
02361 #ifdef UNICODE
02362                                         getcwd(cpath, MAX_PATH);
02363                                         MultiByteToWideChar(CP_UNIXCP, 0, cpath, -1, path, MAX_PATH);
02364 #else
02365                                         getcwd(path, MAX_PATH);
02366 #endif
02367                                         child = alloc_child_window(path, NULL, hwnd);
02368
02369                                         if (!create_child_window(child))
02370                                                 free(child);
02371                                         break;}
02372 #endif
02373
02374 #ifdef _SHELL_FOLDERS
02375                                 case ID_DRIVE_SHELL_NS: {
02376                                         TCHAR path[MAX_PATH];
02377                                         ChildWnd* child;
02378
02379                                         if (activate_fs_window(RS(b1,IDS_SHELL)))
02380                                                 break;
02381
02382                                         GetCurrentDirectory(MAX_PATH, path);
02383                                         child = alloc_child_window(path, get_path_pidl(path,hwnd), hwnd);
02384
02385                                         if (!create_child_window(child))
02386                                                 free(child);
02387                                         break;}
02388 #endif
02389 #endif
02390
02391                                 /*TODO: There are even more menu items! */
02392
02393 #ifndef _NO_EXTENSIONS
02394 #ifdef __WINE__
02395                                 case ID_LICENSE:
02396                                         WineLicense(Globals.hMainWnd);
02397                                         break;
02398
02399                                 case ID_NO_WARRANTY:
02400                                         WineWarranty(Globals.hMainWnd);
02401                                         break;
02402
02403                                 case ID_ABOUT_WINE:
02404                                         ShellAbout(hwnd, RS(b2,IDS_WINE), RS(b1,IDS_WINEFILE), 0);
02405                                         break;
02406 #endif
02407
02408                                 case ID_ABOUT:
02409                                         ShellAbout(hwnd, RS(b1,IDS_WINEFILE), NULL, 0);
02410                                         break;
02411 #endif  /* _NO_EXTENSIONS */
02412
02413                                 default:
02414                                         /*TODO: if (wParam >= PM_FIRST_LANGUAGE && wParam <= PM_LAST_LANGUAGE)
02415                                                 STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE);
02416                                         else */if ((cmd<IDW_FIRST_CHILD || cmd>=IDW_FIRST_CHILD+0x100) &&
02417                                                 (cmd<SC_SIZE || cmd>SC_RESTORE))
02418                                                 MessageBox(hwnd, RS(b2,IDS_NO_IMPL), RS(b1,IDS_WINEFILE), MB_OK);
02419
02420                                         return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam);
02421                         }
02422                         break;}
02423
02424                 case WM_SIZE:
02425                         resize_frame(hwnd, LOWORD(lparam), HIWORD(lparam));
02426                         break;  /* do not pass message to DefFrameProc */
02427
02428 #ifndef _NO_EXTENSIONS
02429                 case WM_GETMINMAXINFO: {
02430                         LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
02431
02432                         lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */
02433                         lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */
02434                         break;}
02435
02436                 case FRM_CALC_CLIENT:
02437                         frame_get_clientspace(hwnd, (PRECT)lparam);
02438                         return TRUE;
02439 #endif /* _NO_EXTENSIONS */
02440
02441                 default:
02442                         return DefFrameProc(hwnd, Globals.hmdiclient, nmsg, wparam, lparam);
02443         }
02444
02445         return 0;
02446 }
02447
02448
02449 static TCHAR g_pos_names[COLUMNS][20] = {
02450         {'\0'}  /* symbol */
02451 };
02452
02453 static const int g_pos_align[] = {
02454         0,
02455         HDF_LEFT,       /* Name */
02456         HDF_RIGHT,      /* Size */
02457         HDF_LEFT,       /* CDate */
02458 #ifndef _NO_EXTENSIONS
02459         HDF_LEFT,       /* ADate */
02460         HDF_LEFT,       /* MDate */
02461         HDF_LEFT,       /* Index */
02462         HDF_CENTER,     /* Links */
02463 #endif
02464         HDF_CENTER,     /* Attributes */
02465 #ifndef _NO_EXTENSIONS
02466         HDF_LEFT        /* Security */
02467 #endif
02468 };
02469
02470 static void resize_tree(ChildWnd* child, int cx, int cy)
02471 {
02472         HDWP hdwp = BeginDeferWindowPos(4);
02473         RECT rt;
02474
02475         rt.left   = 0;
02476         rt.top    = 0;
02477         rt.right  = cx;
02478         rt.bottom = cy;
02479
02480         cx = child->split_pos + SPLIT_WIDTH/2;
02481
02482 #ifndef _NO_EXTENSIONS
02483         {
02484                 WINDOWPOS wp;
02485                 HD_LAYOUT hdl;
02486
02487                 hdl.prc   = &rt;
02488                 hdl.pwpos = &wp;
02489
02490                 Header_Layout(child->left.hwndHeader, &hdl);
02491
02492                 DeferWindowPos(hdwp, child->left.hwndHeader, wp.hwndInsertAfter,
02493                                                 wp.x-1, wp.y, child->split_pos-SPLIT_WIDTH/2+1, wp.cy, wp.flags);
02494                 DeferWindowPos(hdwp, child->right.hwndHeader, wp.hwndInsertAfter,
02495                                                 rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
02496         }
02497 #endif /* _NO_EXTENSIONS */
02498
02499         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);
02500         DeferWindowPos(hdwp, child->right.hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
02501
02502         EndDeferWindowPos(hdwp);
02503 }
02504
02505
02506 #ifndef _NO_EXTENSIONS
02507
02508 static HWND create_header(HWND parent, Pane* pane, int id)
02509 {
02510         HD_ITEM hdi;
02511         int idx;
02512
02513         HWND hwnd = CreateWindow(WC_HEADER, 0, WS_CHILD|WS_VISIBLE|HDS_HORZ/*TODO: |HDS_BUTTONS + sort orders*/,
02514                                                                 0, 0, 0, 0, parent, (HMENU)id, Globals.hInstance, 0);
02515         if (!hwnd)
02516                 return 0;
02517
02518         SetWindowFont(hwnd, GetStockObject(DEFAULT_GUI_FONT), FALSE);
02519
02520         hdi.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT;
02521
02522         for(idx=0; idx<COLUMNS; idx++) {
02523                 hdi.pszText = g_pos_names[idx];
02524                 hdi.fmt = HDF_STRING | g_pos_align[idx];
02525                 hdi.cxy = pane->widths[idx];
02526                 Header_InsertItem(hwnd, idx, &hdi);
02527         }
02528
02529         return hwnd;
02530 }
02531
02532 #endif /* _NO_EXTENSIONS */
02533
02534
02535 static void init_output(HWND hwnd)
02536 {
02537         const static TCHAR s1000[] = {'1','0','0','0','\0'};
02538
02539         TCHAR b[16];
02540         HFONT old_font;
02541         HDC hdc = GetDC(hwnd);
02542
02543         if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, s1000, 0, b, 16) > 4)
02544                 Globals.num_sep = b[1];
02545         else
02546                 Globals.num_sep = TEXT('.');
02547
02548         old_font = SelectFont(hdc, Globals.hfont);
02549         GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
02550         SelectFont(hdc, old_font);
02551         ReleaseDC(hwnd, hdc);
02552 }
02553
02554 static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol);
02555
02556
02557 /* calculate preferred width for all visible columns */
02558
02559 static BOOL calc_widths(Pane* pane, BOOL anyway)
02560 {
02561         int col, x, cx, spc=3*Globals.spaceSize.cx;
02562         int entries = ListBox_GetCount(pane->hwnd);
02563         int orgWidths[COLUMNS];
02564         int orgPositions[COLUMNS+1];
02565         HFONT hfontOld;
02566         HDC hdc;
02567         int cnt;
02568
02569         if (!anyway) {
02570                 memcpy(orgWidths, pane->widths, sizeof(orgWidths));
02571                 memcpy(orgPositions, pane->positions, sizeof(orgPositions));
02572         }
02573
02574         for(col=0; col<COLUMNS; col++)
02575                 pane->widths[col] = 0;
02576
02577         hdc = GetDC(pane->hwnd);
02578         hfontOld = SelectFont(hdc, Globals.hfont);
02579
02580         for(cnt=0; cnt<entries; cnt++) {
02581                 Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt);
02582
02583                 DRAWITEMSTRUCT dis;
02584
02585                 dis.CtlType               = 0;
02586                 dis.CtlID                 = 0;
02587                 dis.itemID                = 0;
02588                 dis.itemAction    = 0;
02589                 dis.itemState     = 0;
02590                 dis.hwndItem      = pane->hwnd;
02591                 dis.hDC                   = hdc;
02592                 dis.rcItem.left   = 0;
02593                 dis.rcItem.top    = 0;
02594                 dis.rcItem.right  = 0;
02595                 dis.rcItem.bottom = 0;
02596                 /*dis.itemData    = 0; */
02597
02598                 draw_item(pane, &dis, entry, COLUMNS);
02599         }
02600
02601         SelectObject(hdc, hfontOld);
02602         ReleaseDC(pane->hwnd, hdc);
02603
02604         x = 0;
02605         for(col=0; col<COLUMNS; col++) {
02606                 pane->positions[col] = x;
02607                 cx = pane->widths[col];
02608
02609                 if (cx) {
02610                         cx += spc;
02611
02612                         if (cx < IMAGE_WIDTH)
02613                                 cx = IMAGE_WIDTH;
02614
02615                         pane->widths[col] = cx;
02616                 }
02617
02618                 x += cx;
02619         }
02620
02621         pane->positions[COLUMNS] = x;
02622
02623         ListBox_SetHorizontalExtent(pane->hwnd, x);
02624
02625         /* no change? */
02626         if (!memcmp(orgWidths, pane->widths, sizeof(orgWidths)))
02627                 return FALSE;
02628
02629         /* don't move, if only collapsing an entry */
02630         if (!anyway && pane->widths[0]<orgWidths[0] &&
02631                 !memcmp(orgWidths+1, pane->widths+1, sizeof(orgWidths)-sizeof(int))) {
02632                 pane->widths[0] = orgWidths[0];
02633                 memcpy(pane->positions, orgPositions, sizeof(orgPositions));
02634
02635                 return FALSE;
02636         }
02637
02638         InvalidateRect(pane->hwnd, 0, TRUE);
02639
02640         return TRUE;
02641 }
02642
02643
02644 /* calculate one preferred column width */
02645
02646 static void calc_single_width(Pane* pane, int col)
02647 {
02648         HFONT hfontOld;
02649         int x, cx;
02650         int entries = ListBox_GetCount(pane->hwnd);
02651         int cnt;
02652         HDC hdc;
02653
02654         pane->widths[col] = 0;
02655
02656         hdc = GetDC(pane->hwnd);
02657         hfontOld = SelectFont(hdc, Globals.hfont);
02658
02659         for(cnt=0; cnt<entries; cnt++) {
02660                 Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt);
02661                 DRAWITEMSTRUCT dis;
02662
02663                 dis.CtlType               = 0;
02664                 dis.CtlID                 = 0;
02665                 dis.itemID                = 0;
02666                 dis.itemAction    = 0;
02667                 dis.itemState     = 0;
02668                 dis.hwndItem      = pane->hwnd;
02669                 dis.hDC                   = hdc;
02670                 dis.rcItem.left   = 0;
02671                 dis.rcItem.top    = 0;
02672                 dis.rcItem.right  = 0;
02673                 dis.rcItem.bottom = 0;
02674                 /*dis.itemData    = 0; */
02675
02676                 draw_item(pane, &dis, entry, col);
02677         }
02678
02679         SelectObject(hdc, hfontOld);
02680         ReleaseDC(pane->hwnd, hdc);
02681
02682         cx = pane->widths[col];
02683
02684         if (cx) {
02685                 cx += 3*Globals.spaceSize.cx;
02686
02687                 if (cx < IMAGE_WIDTH)
02688                         cx = IMAGE_WIDTH;
02689         }
02690
02691         pane->widths[col] = cx;
02692
02693         x = pane->positions[col] + cx;
02694
02695         for(; col<COLUMNS; ) {
02696                 pane->positions[++col] = x;
02697                 x += pane->widths[col];
02698         }
02699
02700         ListBox_SetHorizontalExtent(pane->hwnd, x);
02701 }
02702
02703
02704 static BOOL pattern_match(LPCTSTR str, LPCTSTR pattern)
02705 {
02706         for( ; *str&&*pattern; str++,pattern++) {
02707                 if (*pattern == '*') {
02708                         do pattern++;
02709                         while(*pattern == '*');
02710
02711                         if (!*pattern)
02712                                 return TRUE;
02713
02714                         for(; *str; str++)
02715                                 if (*str==*pattern && pattern_match(str, pattern))
02716                                         return TRUE;
02717
02718                         return FALSE;
02719                 }
02720                 else if (*str!=*pattern && *pattern!='?')
02721                         return FALSE;
02722         }
02723
02724         if (*str || *pattern)
02725                 if (*pattern!='*' || pattern[1]!='\0')
02726                         return FALSE;
02727
02728         return TRUE;
02729 }
02730
02731 static BOOL pattern_imatch(LPCTSTR str, LPCTSTR pattern)
02732 {
02733         TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
02734
02735         lstrcpy(b1, str);
02736         lstrcpy(b2, pattern);
02737         CharUpper(b1);
02738         CharUpper(b2);
02739
02740         return pattern_match(b1, b2);
02741 }
02742
02743
02744 enum FILE_TYPE {
02745         FT_OTHER                = 0,
02746         FT_EXECUTABLE   = 1,
02747         FT_DOCUMENT             = 2
02748 };
02749
02750 static enum FILE_TYPE get_file_type(LPCTSTR filename);
02751
02752
02753 /* insert listbox entries after index idx */
02754
02755 static int insert_entries(Pane* pane, Entry* dir, LPCTSTR pattern, int filter_flags, int idx)
02756 {
02757         Entry* entry = dir;
02758
02759         if (!entry)
02760                 return idx;
02761
02762         ShowWindow(pane->hwnd, SW_HIDE);
02763
02764         for(; entry; entry=entry->next) {
02765 #ifndef _LEFT_FILES
02766                 if (pane->treePane && !(entry->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
02767                         continue;
02768 #endif
02769
02770                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
02771                         /* don't display entries "." and ".." in the left pane */
02772                         if (pane->treePane && entry->data.cFileName[0]==TEXT('.'))
02773                                 if (
02774         #ifndef _NO_EXTENSIONS
02775                                         entry->data.cFileName[1]==TEXT('\0') ||
02776         #endif
02777                                         (entry->data.cFileName[1]==TEXT('.') && entry->data.cFileName[2]==TEXT('\0')))
02778                                         continue;
02779
02780                         /* filter directories in right pane */
02781                         if (!pane->treePane && !(filter_flags&TF_DIRECTORIES))
02782                                 continue;
02783                 }
02784
02785                 /* filter using the file name pattern */
02786                 if (pattern)
02787                         if (!pattern_imatch(entry->data.cFileName, pattern))
02788                                 continue;
02789
02790                 /* filter system and hidden files */
02791                 if (!(filter_flags&TF_HIDDEN) && (entry->data.dwFileAttributes&(FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM)))
02792                         continue;
02793
02794                 /* filter looking at the file type */
02795                 if ((filter_flags&(TF_PROGRAMS|TF_DOCUMENTS|TF_OTHERS)) != (TF_PROGRAMS|TF_DOCUMENTS|TF_OTHERS))
02796                         switch(get_file_type(entry->data.cFileName)) {
02797                           case FT_EXECUTABLE:
02798                                 if (!(filter_flags & TF_PROGRAMS))
02799                                         continue;
02800                                 break;
02801
02802                           case FT_DOCUMENT:
02803                                 if (!(filter_flags & TF_DOCUMENTS))
02804                                         continue;
02805                                 break;
02806
02807                           default: /* TF_OTHERS */
02808                                 if (!(filter_flags & TF_OTHERS))
02809                                         continue;
02810                         }
02811
02812                 if (idx != -1)
02813                         idx++;
02814
02815                 ListBox_InsertItemData(pane->hwnd, idx, entry);
02816
02817                 if (pane->treePane && entry->expanded)
02818                         idx = insert_entries(pane, entry->down, pattern, filter_flags, idx);
02819         }
02820
02821         ShowWindow(pane->hwnd, SW_SHOW);
02822
02823         return idx;
02824 }
02825
02826
02827 static void format_bytes(LPTSTR buffer, LONGLONG bytes)
02828 {
02829         const static TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'};
02830         const static TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'};
02831         const static TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'};
02832
02833         float fBytes = (float)bytes;
02834
02835         if (bytes >= 1073741824)        /* 1 GB */
02836                 wsprintf(buffer, sFmtGB, fBytes/1073741824.f+.5f);
02837         else if (bytes >= 1048576)      /* 1 MB */
02838                 wsprintf(buffer, sFmtMB, fBytes/1048576.f+.5f);
02839         else if (bytes >= 1024)         /* 1 kB */
02840                 wsprintf(buffer, sFmtkB, fBytes/1024.f+.5f);
02841         else
02842                 _stprintf(buffer, sLongNumFmt, bytes);
02843 }
02844
02845 static void set_space_status(void)
02846 {
02847         ULARGE_INTEGER ulFreeBytesToCaller, ulTotalBytes, ulFreeBytes;
02848         TCHAR fmt[64], b1[64], b2[64], buffer[BUFFER_LEN];
02849
02850         if (GetDiskFreeSpaceEx(NULL, &ulFreeBytesToCaller, &ulTotalBytes, &ulFreeBytes)) {
02851                 format_bytes(b1, ulFreeBytesToCaller.QuadPart);
02852                 format_bytes(b2, ulTotalBytes.QuadPart);
02853                 wsprintf(buffer, RS(fmt,IDS_FREE_SPACE_FMT), b1, b2);
02854         } else
02855                 lstrcpy(buffer, sQMarks);
02856
02857         SendMessage(Globals.hstatusbar, SB_SETTEXT, 0, (LPARAM)buffer);
02858 }
02859
02860
02861 static WNDPROC g_orgTreeWndProc;
02862
02863 static void create_tree_window(HWND parent, Pane* pane, int id, int id_header, LPCTSTR pattern, int filter_flags)
02864 {
02865         const static TCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'};
02866
02867         static int s_init = 0;
02868         Entry* entry = pane->root;
02869
02870         pane->hwnd = CreateWindow(sListBox, sEmpty, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|
02871                                                                 LBS_DISABLENOSCROLL|LBS_NOINTEGRALHEIGHT|LBS_OWNERDRAWFIXED|LBS_NOTIFY,
02872                                                                 0, 0, 0, 0, parent, (HMENU)id, Globals.hInstance, 0);
02873
02874         SetWindowLongPtr(pane->hwnd, GWLP_USERDATA, (LPARAM)pane);
02875         g_orgTreeWndProc = SubclassWindow(pane->hwnd, TreeWndProc);
02876
02877         SetWindowFont(pane->hwnd, Globals.hfont, FALSE);
02878
02879         /* insert entries into listbox */
02880         if (entry)
02881                 insert_entries(pane, entry, pattern, filter_flags, -1);
02882
02883         /* calculate column widths */
02884         if (!s_init) {
02885                 s_init = 1;
02886                 init_output(pane->hwnd);
02887         }
02888
02889         calc_widths(pane, TRUE);
02890
02891 #ifndef _NO_EXTENSIONS
02892         pane->hwndHeader = create_header(parent, pane, id_header);
02893 #endif
02894 }
02895
02896
02897 static void InitChildWindow(ChildWnd* child)
02898 {
02899         create_tree_window(child->hwnd, &child->left, IDW_TREE_LEFT, IDW_HEADER_LEFT, NULL, TF_ALL);
02900         create_tree_window(child->hwnd, &child->right, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, child->filter_pattern, child->filter_flags);
02901 }
02902
02903
02904 static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols)
02905 {
02906         SYSTEMTIME systime;
02907         FILETIME lft;
02908         int len = 0;
02909
02910         *buffer = TEXT('\0');
02911
02912         if (!ft->dwLowDateTime && !ft->dwHighDateTime)
02913                 return;
02914
02915         if (!FileTimeToLocalFileTime(ft, &lft))
02916                 {err: lstrcpy(buffer,sQMarks); return;}
02917
02918         if (!FileTimeToSystemTime(&lft, &systime))
02919                 goto err;
02920
02921         if (visible_cols & COL_DATE) {
02922                 len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer, BUFFER_LEN);
02923                 if (!len)
02924                         goto err;
02925         }
02926
02927         if (visible_cols & COL_TIME) {
02928                 if (len)
02929                         buffer[len-1] = ' ';
02930
02931                 buffer[len++] = ' ';
02932
02933                 if (!GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer+len, BUFFER_LEN-len))
02934                         buffer[len] = TEXT('\0');
02935         }
02936 }
02937
02938
02939 static void calc_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
02940 {
02941         RECT rt = {0, 0, 0, 0};
02942
02943         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
02944
02945         if (rt.right > pane->widths[col])
02946                 pane->widths[col] = rt.right;
02947 }
02948
02949 static void calc_tabbed_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
02950 {
02951         RECT rt = {0, 0, 0, 0};
02952
02953 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
02954         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
02955
02956         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
02957         /*FIXME rt (0,0) ??? */
02958
02959         if (rt.right > pane->widths[col])
02960                 pane->widths[col] = rt.right;
02961 }
02962
02963
02964 static void output_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str, DWORD flags)
02965 {
02966         int x = dis->rcItem.left;
02967         RECT rt;
02968
02969         rt.left   = x+pane->positions[col]+Globals.spaceSize.cx;
02970         rt.top    = dis->rcItem.top;
02971         rt.right  = x+pane->positions[col+1]-Globals.spaceSize.cx;
02972         rt.bottom = dis->rcItem.bottom;
02973
02974         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags);
02975 }
02976
02977 static void output_tabbed_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
02978 {
02979         int x = dis->rcItem.left;
02980         RECT rt;
02981
02982         rt.left   = x+pane->positions[col]+Globals.spaceSize.cx;
02983         rt.top    = dis->rcItem.top;
02984         rt.right  = x+pane->positions[col+1]-Globals.spaceSize.cx;
02985         rt.bottom = dis->rcItem.bottom;
02986
02987 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
02988         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
02989
02990         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
02991 }
02992
02993 static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
02994 {
02995         int x = dis->rcItem.left;
02996         RECT rt;
02997         LPCTSTR s = str;
02998         TCHAR b[128];
02999         LPTSTR d = b;
03000         int pos;
03001
03002         rt.left   = x+pane->positions[col]+Globals.spaceSize.cx;
03003         rt.top    = dis->rcItem.top;
03004         rt.right  = x+pane->positions[col+1]-Globals.spaceSize.cx;
03005         rt.bottom = dis->rcItem.bottom;
03006
03007         if (*s)
03008                 *d++ = *s++;
03009
03010         /* insert number separator characters */
03011         pos = lstrlen(s) % 3;
03012
03013         while(*s)
03014                 if (pos--)
03015                         *d++ = *s++;
03016                 else {
03017                         *d++ = Globals.num_sep;
03018                         pos = 3;
03019                 }
03020
03021         DrawText(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS);
03022 }
03023
03024
03025 static BOOL is_exe_file(LPCTSTR ext)
03026 {
03027         static const TCHAR executable_extensions[][4] = {
03028                 {'C','O','M','\0'},
03029                 {'E','X','E','\0'},
03030                 {'B','A','T','\0'},
03031                 {'C','M','D','\0'},
03032 #ifndef _NO_EXTENSIONS
03033                 {'C','M','M','\0'},
03034                 {'B','T','M','\0'},
03035                 {'A','W','K','\0'},
03036 #endif /* _NO_EXTENSIONS */
03037                 {'\0'}
03038         };
03039
03040         TCHAR ext_buffer[_MAX_EXT];
03041         const TCHAR (*p)[4];
03042         LPCTSTR s;
03043         LPTSTR d;
03044
03045         for(s=ext+1,d=ext_buffer; (*d=tolower(*s)); s++)
03046                 d++;
03047
03048         for(p=executable_extensions; (*p)[0]; p++)
03049                 if (!lstrcmpi(ext_buffer, *p))
03050                         return TRUE;
03051
03052         return FALSE;
03053 }
03054
03055 static BOOL is_registered_type(LPCTSTR ext)
03056 {
03057         /* check if there exists a classname for this file extension in the registry */
03058         if (!RegQueryValue(HKEY_CLASSES_ROOT, ext, NULL, NULL))
03059                 return TRUE;
03060
03061         return FALSE;
03062 }
03063
03064 static enum FILE_TYPE get_file_type(LPCTSTR filename)
03065 {
03066         LPCTSTR ext = _tcsrchr(filename, '.');
03067         if (!ext)
03068                 ext = sEmpty;
03069
03070         if (is_exe_file(ext))
03071                 return FT_EXECUTABLE;
03072         else if (is_registered_type(ext))
03073                 return FT_DOCUMENT;
03074         else
03075                 return FT_OTHER;
03076 }
03077
03078
03079 static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol)
03080 {
03081         TCHAR buffer[BUFFER_LEN];
03082         DWORD attrs;
03083         int visible_cols = pane->visible_cols;
03084         COLORREF bkcolor, textcolor;
03085         RECT focusRect = dis->rcItem;
03086         HBRUSH hbrush;
03087         enum IMAGE img;
03088         int img_pos, cx;
03089         int col = 0;
03090
03091         if (entry) {
03092                 attrs = entry->data.dwFileAttributes;
03093
03094                 if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
03095                         if (entry->data.cFileName[0]==TEXT('.') && entry->data.cFileName[1]==TEXT('.')
03096                                         && entry->data.cFileName[2]==TEXT('\0'))
03097                                 img = IMG_FOLDER_UP;
03098 #ifndef _NO_EXTENSIONS
03099                         else if (entry->data.cFileName[0]==TEXT('.') && entry->data.cFileName[1]==TEXT('\0'))
03100                                 img = IMG_FOLDER_CUR;
03101 #endif
03102                         else if (
03103 #ifdef _NO_EXTENSIONS
03104                                          entry->expanded ||
03105 #endif
03106                                          (pane->treePane && (dis->itemState&ODS_FOCUS)))
03107                                 img = IMG_OPEN_FOLDER;
03108                         else
03109                                 img = IMG_FOLDER;
03110                 } else {
03111                         switch(get_file_type(entry->data.cFileName)) {
03112                           case FT_EXECUTABLE:   img = IMG_EXECUTABLE;   break;
03113                           case FT_DOCUMENT:             img = IMG_DOCUMENT;             break;
03114                           default:                              img = IMG_FILE;
03115                         }
03116                 }
03117         } else {
03118                 attrs = 0;
03119                 img = IMG_NONE;
03120         }
03121
03122         if (pane->treePane) {
03123                 if (entry) {
03124                         img_pos = dis->rcItem.left + entry->level*(IMAGE_WIDTH+TREE_LINE_DX);
03125
03126                         if (calcWidthCol == -1) {
03127                                 int x;
03128                                 int y = dis->rcItem.top + IMAGE_HEIGHT/2;
03129                                 Entry* up;
03130                                 RECT rt_clip;
03131                                 HRGN hrgn_org = CreateRectRgn(0, 0, 0, 0);
03132                                 HRGN hrgn;
03133
03134                                 rt_clip.left   = dis->rcItem.left;
03135                                 rt_clip.top    = dis->rcItem.top;
03136                                 rt_clip.right  = dis->rcItem.left+pane->widths[col];
03137                                 rt_clip.bottom = dis->rcItem.bottom;
03138
03139                                 hrgn = CreateRectRgnIndirect(&rt_clip);
03140
03141                                 if (!GetClipRgn(dis->hDC, hrgn_org)) {
03142                                         DeleteObject(hrgn_org);
03143                                         hrgn_org = 0;
03144                                 }
03145
03146                                 /* HGDIOBJ holdPen = SelectObject(dis->hDC, GetStockObject(BLACK_PEN)); */
03147                                 ExtSelectClipRgn(dis->hDC, hrgn, RGN_AND);
03148                                 DeleteObject(hrgn);
03149
03150                                 if ((up=entry->up) != NULL) {
03151                                         MoveToEx(dis->hDC, img_pos-IMAGE_WIDTH/2, y, 0);
03152                                         LineTo(dis->hDC, img_pos-2, y);
03153
03154                                         x = img_pos - IMAGE_WIDTH/2;
03155
03156                                         do {
03157                                                 x -= IMAGE_WIDTH+TREE_LINE_DX;
03158
03159                                                 if (up->next
03160 #ifndef _LEFT_FILES
03161                                                         && (up->next->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
03162 #endif
03163                                                         ) {
03164                                                         MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
03165                                                         LineTo(dis->hDC, x, dis->rcItem.bottom);
03166                                                 }
03167                                         } while((up=up->up) != NULL);
03168                                 }
03169
03170                                 x = img_pos - IMAGE_WIDTH/2;
03171
03172                                 MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
03173                                 LineTo(dis->hDC, x, y);
03174
03175                                 if (entry->next
03176 #ifndef _LEFT_FILES
03177                                         && (entry->next->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
03178 #endif
03179                                         )
03180                                         LineTo(dis->hDC, x, dis->rcItem.bottom);
03181
03182                                 SelectClipRgn(dis->hDC, hrgn_org);
03183                                 if (hrgn_org) DeleteObject(hrgn_org);
03184                                 /* SelectObject(dis->hDC, holdPen); */
03185                         } else if (calcWidthCol==col || calcWidthCol==COLUMNS) {
03186                                 int right = img_pos + IMAGE_WIDTH - TREE_LINE_DX;
03187
03188                                 if (right > pane->widths[col])
03189                                         pane->widths[col] = right;
03190                         }
03191                 } else  {
03192                         img_pos = dis->rcItem.left;
03193                 }
03194         } else {
03195                 img_pos = dis->rcItem.left;
03196
03197                 if (calcWidthCol==col || calcWidthCol==COLUMNS)
03198                         pane->widths[col] = IMAGE_WIDTH;
03199         }
03200
03201         if (calcWidthCol == -1) {
03202                 focusRect.left = img_pos - 2;
03203
03204 #ifdef _NO_EXTENSIONS
03205                 if (pane->treePane && entry) {
03206                         RECT rt = {0};
03207
03208                         DrawText(dis->hDC, entry->data.cFileName, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
03209
03210                         focusRect.right = dis->rcItem.left+pane->positions[col+1]+TREE_LINE_DX + rt.right +2;
03211                 }
03212 #else
03213
03214                 if (attrs & FILE_ATTRIBUTE_COMPRESSED)
03215                         textcolor = COLOR_COMPRESSED;
03216                 else
03217 #endif /* _NO_EXTENSIONS */
03218                         textcolor = RGB(0,0,0);
03219
03220                 if (dis->itemState & ODS_FOCUS) {
03221                         textcolor = RGB(255,255,255);
03222                         bkcolor = COLOR_SELECTION;
03223                 } else {
03224                         bkcolor = RGB(255,255,255);
03225                 }
03226
03227                 hbrush = CreateSolidBrush(bkcolor);
03228                 FillRect(dis->hDC, &focusRect, hbrush);
03229                 DeleteObject(hbrush);
03230
03231                 SetBkMode(dis->hDC, TRANSPARENT);
03232                 SetTextColor(dis->hDC, textcolor);
03233
03234                 cx = pane->widths[col];
03235
03236                 if (cx && img!=IMG_NONE) {
03237                         if (cx > IMAGE_WIDTH)
03238                                 cx = IMAGE_WIDTH;
03239
03240 #ifdef _SHELL_FOLDERS
03241                         if (entry->hicon && entry->hicon!=(HICON)-1)
03242                                 DrawIconEx(dis->hDC, img_pos, dis->rcItem.top, entry->hicon, cx, GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL);
03243                         else
03244 #endif
03245                                 ImageList_DrawEx(Globals.himl, img, dis->hDC,
03246                                                                  img_pos, dis->rcItem.top, cx,
03247                                                                  IMAGE_HEIGHT, bkcolor, CLR_DEFAULT, ILD_NORMAL);
03248                 }
03249         }
03250
03251         if (!entry)
03252                 return;
03253
03254 #ifdef _NO_EXTENSIONS
03255         if (img >= IMG_FOLDER_UP)
03256                 return;
03257 #endif
03258
03259         col++;
03260
03261         /* ouput file name */
03262         if (calcWidthCol == -1)
03263                 output_text(pane, dis, col, entry->data.cFileName, 0);
03264         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03265                 calc_width(pane, dis, col, entry->data.cFileName);
03266
03267         col++;
03268
03269 #ifdef _NO_EXTENSIONS
03270   if (!pane->treePane) {
03271 #endif
03272
03273         /* display file size */
03274         if (visible_cols & COL_SIZE) {
03275 #ifdef _NO_EXTENSIONS
03276                 if (!(attrs&FILE_ATTRIBUTE_DIRECTORY))
03277 #endif
03278                 {
03279                         ULONGLONG size;
03280
03281                         size = ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow;
03282
03283                         _stprintf(buffer, sLongNumFmt, size);
03284
03285                         if (calcWidthCol == -1)
03286                                 output_number(pane, dis, col, buffer);
03287                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03288                                 calc_width(pane, dis, col, buffer);/*TODO: not in every case time enough */
03289                 }
03290
03291                 col++;
03292         }
03293
03294         /* display file date */
03295         if (visible_cols & (COL_DATE|COL_TIME)) {
03296 #ifndef _NO_EXTENSIONS
03297                 format_date(&entry->data.ftCreationTime, buffer, visible_cols);
03298                 if (calcWidthCol == -1)
03299                         output_text(pane, dis, col, buffer, 0);
03300                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03301                         calc_width(pane, dis, col, buffer);
03302                 col++;
03303
03304                 format_date(&entry->data.ftLastAccessTime, buffer, visible_cols);
03305                 if (calcWidthCol == -1)
03306                         output_text(pane, dis, col, buffer, 0);
03307                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03308                         calc_width(pane, dis, col, buffer);
03309                 col++;
03310 #endif /* _NO_EXTENSIONS */
03311
03312                 format_date(&entry->data.ftLastWriteTime, buffer, visible_cols);
03313                 if (calcWidthCol == -1)
03314                         output_text(pane, dis, col, buffer, 0);
03315                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03316                         calc_width(pane, dis, col, buffer);
03317                 col++;
03318         }
03319
03320 #ifndef _NO_EXTENSIONS
03321         if (entry->bhfi_valid) {
03322             ULONGLONG index = ((ULONGLONG)entry->bhfi.nFileIndexHigh << 32) | entry->bhfi.nFileIndexLow;
03323
03324                 if (visible_cols & COL_INDEX) {
03325                         _stprintf(buffer, sLongHexFmt, index);
03326
03327                         if (calcWidthCol == -1)
03328                                 output_text(pane, dis, col, buffer, DT_RIGHT);
03329                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03330                                 calc_width(pane, dis, col, buffer);
03331
03332                         col++;
03333                 }
03334
03335                 if (visible_cols & COL_LINKS) {
03336                         wsprintf(buffer, sNumFmt, entry->bhfi.nNumberOfLinks);
03337
03338                         if (calcWidthCol == -1)
03339                                 output_text(pane, dis, col, buffer, DT_CENTER);
03340                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03341                                 calc_width(pane, dis, col, buffer);
03342
03343                         col++;
03344                 }
03345         } else
03346                 col += 2;
03347 #endif /* _NO_EXTENSIONS */
03348
03349         /* show file attributes */
03350         if (visible_cols & COL_ATTRIBUTES) {
03351 #ifdef _NO_EXTENSIONS
03352                 const static TCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
03353                 lstrcpy(buffer, s4Tabs);
03354 #else
03355                 const static TCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
03356                 lstrcpy(buffer, s11Tabs);
03357 #endif
03358
03359                 if (attrs & FILE_ATTRIBUTE_NORMAL)                                      buffer[ 0] = 'N';
03360                 else {
03361                         if (attrs & FILE_ATTRIBUTE_READONLY)                    buffer[ 2] = 'R';
03362                         if (attrs & FILE_ATTRIBUTE_HIDDEN)                              buffer[ 4] = 'H';
03363                         if (attrs & FILE_ATTRIBUTE_SYSTEM)                              buffer[ 6] = 'S';
03364                         if (attrs & FILE_ATTRIBUTE_ARCHIVE)                             buffer[ 8] = 'A';
03365                         if (attrs & FILE_ATTRIBUTE_COMPRESSED)                  buffer[10] = 'C';
03366 #ifndef _NO_EXTENSIONS
03367                         if (attrs & FILE_ATTRIBUTE_DIRECTORY)                   buffer[12] = 'D';
03368                         if (attrs & FILE_ATTRIBUTE_ENCRYPTED)                   buffer[14] = 'E';
03369                         if (attrs & FILE_ATTRIBUTE_TEMPORARY)                   buffer[16] = 'T';
03370                         if (attrs & FILE_ATTRIBUTE_SPARSE_FILE)                 buffer[18] = 'P';
03371                         if (attrs & FILE_ATTRIBUTE_REPARSE_POINT)               buffer[20] = 'Q';
03372                         if (attrs & FILE_ATTRIBUTE_OFFLINE)                             buffer[22] = 'O';
03373                         if (attrs & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) buffer[24] = 'X';
03374 #endif /* _NO_EXTENSIONS */
03375                 }
03376
03377                 if (calcWidthCol == -1)
03378                         output_tabbed_text(pane, dis, col, buffer);
03379                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
03380                         calc_tabbed_width(pane, dis, col, buffer);
03381
03382                 col++;
03383         }
03384
03385 /*TODO
03386         if (flags.security) {
03387                 const static TCHAR sSecTabs[] = {
03388                         ' ','\t',' ','\t',' ','\t',' ',
03389                         ' ','\t',' ',
03390                         ' ','\t',' ','\t',' ','\t',' ',
03391                         ' ','\t',' ',
03392                         ' ','\t',' ','\t',' ','\t',' ',
03393                         '\0'
03394                 };
03395
03396                 DWORD rights = get_access_mask();
03397
03398                 lstrcpy(buffer, sSecTabs);
03399
03400                 if (rights & FILE_READ_DATA)                    buffer[ 0] = 'R';
03401                 if (rights & FILE_WRITE_DATA)                   buffer[ 2] = 'W';
03402                 if (rights & FILE_APPEND_DATA)                  buffer[ 4] = 'A';
03403                 if (rights & FILE_READ_EA)                              {buffer[6] = 'entry'; buffer[ 7] = 'R';}
03404                 if (rights & FILE_WRITE_EA)                             {buffer[9] = 'entry'; buffer[10] = 'W';}
03405                 if (rights & FILE_EXECUTE)                              buffer[12] = 'X';
03406                 if (rights & FILE_DELETE_CHILD)                 buffer[14] = 'D';
03407                 if (rights & FILE_READ_ATTRIBUTES)              {buffer[16] = 'a'; buffer[17] = 'R';}
03408                 if (rights & FILE_WRITE_ATTRIBUTES)             {buffer[19] = 'a'; buffer[20] = 'W';}
03409                 if (rights & WRITE_DAC)                                 buffer[22] = 'C';
03410                 if (rights & WRITE_OWNER)                               buffer[24] = 'O';
03411                 if (rights & SYNCHRONIZE)                               buffer[26] = 'S';
03412
03413                 output_text(dis, col++, buffer, DT_LEFT, 3, psize);
03414         }
03415
03416         if (flags.description) {
03417                 get_description(buffer);
03418                 output_text(dis, col++, buffer, 0, psize);
03419         }
03420 */
03421
03422 #ifdef _NO_EXTENSIONS
03423   }
03424
03425         /* draw focus frame */
03426         if ((dis->itemState&ODS_FOCUS) && calcWidthCol==-1) {
03427                 /* Currently [04/2000] Wine neither behaves exactly the same */
03428                 /* way as WIN 95 nor like Windows NT... */
03429                 HGDIOBJ lastBrush;
03430                 HPEN lastPen;
03431                 HPEN hpen;
03432
03433                 if (!(GetVersion() & 0x80000000)) {     /* Windows NT? */
03434                         LOGBRUSH lb = {PS_SOLID, RGB(255,255,255)};
03435                         hpen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, 0);
03436                 } else
03437                         hpen = CreatePen(PS_DOT, 0, RGB(255,255,255));
03438
03439                 lastPen = SelectPen(dis->hDC, hpen);
03440                 lastBrush = SelectObject(dis->hDC, GetStockObject(HOLLOW_BRUSH));
03441                 SetROP2(dis->hDC, R2_XORPEN);
03442                 Rectangle(dis->hDC, focusRect.left, focusRect.top, focusRect.right, focusRect.bottom);
03443                 SelectObject(dis->hDC, lastBrush);
03444                 SelectObject(dis->hDC, lastPen);
03445                 DeleteObject(hpen);
03446         }
03447 #endif /* _NO_EXTENSIONS */
03448 }
03449
03450
03451 #ifdef _NO_EXTENSIONS
03452
03453 static void draw_splitbar(HWND hwnd, int x)
03454 {
03455         RECT rt;
03456         HDC hdc = GetDC(hwnd);
03457
03458         GetClientRect(hwnd, &rt);
03459
03460         rt.left = x - SPLIT_WIDTH/2;
03461         rt.right = x + SPLIT_WIDTH/2+1;
03462
03463         InvertRect(hdc, &rt);
03464
03465         ReleaseDC(hwnd, hdc);
03466 }
03467
03468 #endif /* _NO_EXTENSIONS */
03469
03470
03471 #ifndef _NO_EXTENSIONS
03472
03473 static void set_header(Pane* pane)
03474 {
03475         HD_ITEM item;
03476         int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ);
03477         int i=0, x=0;
03478
03479         item.mask = HDI_WIDTH;
03480         item.cxy = 0;
03481
03482         for(; x+pane->widths[i]<scroll_pos && i<COLUMNS; i++) {
03483                 x += pane->widths[i];
03484                 Header_SetItem(pane->hwndHeader, i, &item);
03485         }
03486
03487         if (i < COLUMNS) {
03488                 x += pane->widths[i];
03489                 item.cxy = x - scroll_pos;
03490                 Header_SetItem(pane->hwndHeader, i++, &item);
03491
03492                 for(; i<COLUMNS; i++) {
03493                         item.cxy = pane->widths[i];
03494                         x += pane->widths[i];
03495                         Header_SetItem(pane->hwndHeader, i, &item);
03496                 }
03497         }
03498 }
03499
03500 static LRESULT pane_notify(Pane* pane, NMHDR* pnmh)
03501 {
03502         switch(pnmh->code) {
03503                 case HDN_TRACK:
03504                 case HDN_ENDTRACK: {
03505                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
03506                         int idx = phdn->iItem;
03507                         int dx = phdn->pitem->cxy - pane->widths[idx];
03508                         int i;
03509
03510                         RECT clnt;
03511                         GetClientRect(pane->hwnd, &clnt);
03512
03513                         /* move immediate to simulate HDS_FULLDRAG (for now [04/2000] not really needed with WINELIB) */
03514                         Header_SetItem(pane->hwndHeader, idx, phdn->pitem);
03515
03516                         pane->widths[idx] += dx;
03517
03518                         for(i=idx; ++i<=COLUMNS; )
03519                                 pane->positions[i] += dx;
03520
03521                         {
03522                                 int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ);
03523                                 RECT rt_scr;
03524                                 RECT rt_clip;
03525
03526                                 rt_scr.left   = pane->positions[idx+1]-scroll_pos;
03527                                 rt_scr.top    = 0;
03528                                 rt_scr.right  = clnt.right;
03529                                 rt_scr.bottom = clnt.bottom;
03530
03531                                 rt_clip.left   = pane->positions[idx]-scroll_pos;
03532                                 rt_clip.top    = 0;
03533                                 rt_clip.right  = clnt.right;
03534                                 rt_clip.bottom = clnt.bottom;
03535
03536                                 if (rt_scr.left < 0) rt_scr.left = 0;
03537                                 if (rt_clip.left < 0) rt_clip.left = 0;
03538
03539                                 ScrollWindowEx(pane->hwnd, dx, 0, &rt_scr, &rt_clip, 0, 0, SW_INVALIDATE);
03540
03541                                 rt_clip.right = pane->positions[idx+1];
03542                                 RedrawWindow(pane->hwnd, &rt_clip, 0, RDW_INVALIDATE|RDW_UPDATENOW);
03543
03544                                 if (pnmh->code == HDN_ENDTRACK) {
03545                                         ListBox_SetHorizontalExtent(pane->hwnd, pane->positions[COLUMNS]);
03546
03547                                         if (GetScrollPos(pane->hwnd, SB_HORZ) != scroll_pos)
03548                                                 set_header(pane);
03549                                 }
03550                         }
03551
03552                         return FALSE;
03553                 }
03554
03555                 case HDN_DIVIDERDBLCLICK: {
03556                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
03557                         HD_ITEM item;
03558
03559                         calc_single_width(pane, phdn->iItem);
03560                         item.mask = HDI_WIDTH;
03561                         item.cxy = pane->widths[phdn->iItem];
03562
03563                         Header_SetItem(pane->hwndHeader, phdn->iItem, &item);
03564                         InvalidateRect(pane->hwnd, 0, TRUE);
03565                         break;}
03566         }
03567
03568         return 0;
03569 }
03570
03571 #endif /* _NO_EXTENSIONS */
03572
03573
03574 static void scan_entry(ChildWnd* child, Entry* entry, int idx, HWND hwnd)
03575 {
03576         TCHAR path[MAX_PATH];
03577         HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
03578
03579         /* delete sub entries in left pane */
03580         for(;;) {
03581                 LRESULT res = ListBox_GetItemData(child->left.hwnd, idx+1);
03582                 Entry* sub = (Entry*) res;
03583
03584                 if (res==LB_ERR || !sub || sub->level<=entry->level)
03585                         break;
03586
03587                 ListBox_DeleteString(child->left.hwnd, idx+1);
03588         }
03589
03590         /* empty right pane */
03591         ListBox_ResetContent(child->right.hwnd);
03592
03593         /* release memory */
03594         free_entries(entry);
03595
03596         /* read contents from disk */
03597 #ifdef _SHELL_FOLDERS
03598         if (entry->etype == ET_SHELL)
03599         {
03600                 read_directory(entry, NULL, child->sortOrder, hwnd);
03601         }
03602         else
03603 #endif
03604         {
03605                 get_path(entry, path);
03606                 read_directory(entry, path, child->sortOrder, hwnd);
03607         }
03608
03609         /* insert found entries in right pane */
03610         insert_entries(&child->right, entry->down, child->filter_pattern, child->filter_flags, -1);
03611         calc_widths(&child->right, FALSE);
03612 #ifndef _NO_EXTENSIONS
03613         set_header(&child->right);
03614 #endif
03615
03616         child->header_wdths_ok = FALSE;
03617
03618         SetCursor(old_cursor);
03619 }
03620
03621
03622 /* expand a directory entry */
03623
03624 static BOOL expand_entry(ChildWnd* child, Entry* dir)
03625 {
03626         int idx;
03627         Entry* p;
03628
03629         if (!dir || dir->expanded || !dir->down)
03630                 return FALSE;
03631
03632         p = dir->down;
03633
03634         if (p->data.cFileName[0]=='.' && p->data.cFileName[1]=='\0' && p->next) {
03635                 p = p->next;
03636
03637                 if (p->data.cFileName[0]=='.' && p->data.cFileName[1]=='.' &&
03638                                 p->data.cFileName[2]=='\0' && p->next)
03639                         p = p->next;
03640         }
03641
03642         /* no subdirectories ? */
03643         if (!(p->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
03644                 return FALSE;
03645
03646         idx = ListBox_FindItemData(child->left.hwnd, 0, dir);
03647
03648         dir->expanded = TRUE;
03649
03650         /* insert entries in left pane */
03651         insert_entries(&child->left, p, NULL, TF_ALL, idx);
03652
03653         if (!child->header_wdths_ok) {
03654                 if (calc_widths(&child->left, FALSE)) {
03655 #ifndef _NO_EXTENSIONS
03656                         set_header(&child->left);
03657 #endif
03658
03659                         child->header_wdths_ok = TRUE;
03660                 }
03661         }
03662
03663         return TRUE;
03664 }
03665
03666
03667 static void collapse_entry(Pane* pane, Entry* dir)
03668 {
03669         int idx = ListBox_FindItemData(pane->hwnd, 0, dir);
03670
03671         ShowWindow(pane->hwnd, SW_HIDE);
03672
03673         /* hide sub entries */
03674         for(;;) {
03675                 LRESULT res = ListBox_GetItemData(pane->hwnd, idx+1);
03676                 Entry* sub = (Entry*) res;
03677
03678                 if (res==LB_ERR || !sub || sub->level<=dir->level)
03679                         break;
03680
03681                 ListBox_DeleteString(pane->hwnd, idx+1);
03682         }
03683
03684         dir->expanded = FALSE;
03685
03686         ShowWindow(pane->hwnd, SW_SHOW);
03687 }
03688
03689
03690 static void refresh_right_pane(ChildWnd* child)
03691 {
03692         ListBox_ResetContent(child->right.hwnd);
03693         insert_entries(&child->right, child->right.root, child->filter_pattern, child->filter_flags, -1);
03694         calc_widths(&child->right, FALSE);
03695
03696 #ifndef _NO_EXTENSIONS
03697         set_header(&child->right);
03698 #endif
03699 }
03700
03701 static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd)
03702 {
03703         TCHAR path[MAX_PATH];
03704
03705         if (!entry)
03706                 return;
03707
03708         path[0] = '\0';
03709
03710         child->left.cur = entry;
03711
03712         child->right.root = entry->down? entry->down: entry;
03713         child->right.cur = entry;
03714
03715         if (!entry->scanned)
03716                 scan_entry(child, entry, idx, hwnd);
03717         else
03718                 refresh_right_pane(child);
03719
03720         get_path(entry, path);
03721         lstrcpy(child->path, path);
03722
03723         if (child->hwnd)        /* only change window title, if the window already exists */
03724                 SetWindowText(child->hwnd, path);
03725
03726         if (path[0])
03727                 if (SetCurrentDirectory(path))
03728                         set_space_status();
03729 }
03730
03731
03732 static void refresh_child(ChildWnd* child)
03733 {
03734         TCHAR path[MAX_PATH], drv[_MAX_DRIVE+1];
03735         Entry* entry;
03736         int idx;
03737
03738         get_path(child->left.cur, path);
03739         _tsplitpath(path, drv, NULL, NULL, NULL);
03740
03741         child->right.root = NULL;
03742
03743         scan_entry(child, &child->root.entry, 0, child->hwnd);
03744
03745 #ifdef _SHELL_FOLDERS
03746         if (child->root.entry.etype == ET_SHELL)
03747                 entry = read_tree(&child->root, NULL, get_path_pidl(path,child->hwnd), drv, child->sortOrder, child->hwnd);
03748         else
03749 #endif
03750                 entry = read_tree(&child->root, path, NULL, drv, child->sortOrder, child->hwnd);
03751
03752         if (!entry)
03753                 entry = &child->root.entry;
03754
03755         insert_entries(&child->left, child->root.entry.down, NULL, TF_ALL, 0);
03756
03757         set_curdir(child, entry, 0, child->hwnd);
03758
03759         idx = ListBox_FindItemData(child->left.hwnd, 0, child->left.cur);
03760         ListBox_SetCurSel(child->left.hwnd, idx);
03761 }
03762
03763
03764 static void create_drive_bar(void)
03765 {
03766         TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0};
03767 #ifndef _NO_EXTENSIONS
03768         TCHAR b1[BUFFER_LEN];
03769 #endif
03770         int btn = 1;
03771         PTSTR p;
03772
03773         GetLogicalDriveStrings(BUFFER_LEN, Globals.drives);
03774
03775         Globals.hdrivebar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
03776                                 IDW_DRIVEBAR, 2, Globals.hInstance, IDB_DRIVEBAR, &drivebarBtn,
03777                                 0, 16, 13, 16, 13, sizeof(TBBUTTON));
03778
03779 #ifndef _NO_EXTENSIONS
03780 #ifdef __WINE__
03781         /* insert unix file system button */
03782         b1[0] = '/';
03783         b1[1] = '\0';
03784         b1[2] = '\0';
03785         SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
03786
03787         drivebarBtn.idCommand = ID_DRIVE_UNIX_FS;
03788         SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
03789         drivebarBtn.iString++;
03790 #endif
03791 #ifdef _SHELL_FOLDERS
03792         /* insert shell namespace button */
03793         load_string(b1, IDS_SHELL);
03794         b1[lstrlen(b1)+1] = '\0';
03795         SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
03796
03797         drivebarBtn.idCommand = ID_DRIVE_SHELL_NS;
03798         SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
03799         drivebarBtn.iString++;
03800 #endif
03801
03802         /* register windows drive root strings */
03803         SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)Globals.drives);
03804 #endif
03805
03806         drivebarBtn.idCommand = ID_DRIVE_FIRST;
03807
03808         for(p=Globals.drives; *p; ) {
03809 #ifdef _NO_EXTENSIONS
03810                 /* insert drive letter */
03811                 TCHAR b[3] = {tolower(*p)};
03812                 SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b);
03813 #endif
03814                 switch(GetDriveType(p)) {
03815                         case DRIVE_REMOVABLE:   drivebarBtn.iBitmap = 1;        break;
03816                         case DRIVE_CDROM:               drivebarBtn.iBitmap = 3;        break;
03817                         case DRIVE_REMOTE:              drivebarBtn.iBitmap = 4;        break;
03818                         case DRIVE_RAMDISK:             drivebarBtn.iBitmap = 5;        break;
03819                         default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
03820                 }
03821
03822                 SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
03823                 drivebarBtn.idCommand++;
03824                 drivebarBtn.iString++;
03825
03826                 while(*p++);
03827         }
03828 }
03829
03830 static void refresh_drives(void)
03831 {
03832         RECT rect;
03833
03834         /* destroy drive bar */
03835         DestroyWindow(Globals.hdrivebar);
03836         Globals.hdrivebar = 0;
03837
03838         /* re-create drive bar */
03839         create_drive_bar();
03840
03841         /* update window layout */
03842         GetClientRect(Globals.hMainWnd, &rect);
03843         SendMessage(Globals.hMainWnd, WM_SIZE, 0, MAKELONG(rect.right, rect.bottom));
03844 }
03845
03846
03847 static BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
03848 {
03849         HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow);
03850
03851         if ((int)hinst <= 32) {
03852                 display_error(hwnd, GetLastError());
03853                 return FALSE;
03854         }
03855
03856         return TRUE;
03857 }
03858
03859
03860 static BOOL launch_entry(Entry* entry, HWND hwnd, UINT nCmdShow)
03861 {
03862         TCHAR cmd[MAX_PATH];
03863
03864 #ifdef _SHELL_FOLDERS
03865         if (entry->etype == ET_SHELL) {
03866                 BOOL ret = TRUE;
03867
03868                 SHELLEXECUTEINFO shexinfo;
03869
03870                 shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
03871                 shexinfo.fMask = SEE_MASK_IDLIST;
03872                 shexinfo.hwnd = hwnd;
03873                 shexinfo.lpVerb = NULL;
03874                 shexinfo.lpFile = NULL;
03875                 shexinfo.lpParameters = NULL;
03876                 shexinfo.lpDirectory = NULL;
03877                 shexinfo.nShow = nCmdShow;
03878                 shexinfo.lpIDList = get_to_absolute_pidl(entry, hwnd);
03879
03880                 if (!ShellExecuteEx(&shexinfo)) {
03881                         display_error(hwnd, GetLastError());
03882                         ret = FALSE;
03883                 }
03884
03885                 if (shexinfo.lpIDList != entry->pidl)
03886                         IMalloc_Free(Globals.iMalloc, shexinfo.lpIDList);
03887
03888                 return ret;
03889         }
03890 #endif
03891
03892         get_path(entry, cmd);
03893
03894          /* start program, open document... */
03895         return launch_file(hwnd, cmd, nCmdShow);
03896 }
03897
03898
03899 static void activate_entry(ChildWnd* child, Pane* pane, HWND hwnd)
03900 {
03901         Entry* entry = pane->cur;
03902
03903         if (!entry)
03904                 return;
03905
03906         if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
03907                 int scanned_old = entry->scanned;
03908
03909                 if (!scanned_old)
03910                         scan_entry(child, entry, ListBox_GetCurSel(child->left.hwnd), hwnd);
03911
03912 #ifndef _NO_EXTENSIONS
03913                 if (entry->data.cFileName[0]=='.' && entry->data.cFileName[1]=='\0')
03914                         return;
03915 #endif
03916
03917                 if (entry->data.cFileName[0]=='.' && entry->data.cFileName[1]=='.' && entry->data.cFileName[2]=='\0') {
03918                         entry = child->left.cur->up;
03919                         collapse_entry(&child->left, entry);
03920                         goto focus_entry;
03921                 } else if (entry->expanded)
03922                         collapse_entry(pane, child->left.cur);
03923                 else {
03924                         expand_entry(child, child->left.cur);
03925
03926                         if (!pane->treePane) focus_entry: {
03927                                 int idx = ListBox_FindItemData(child->left.hwnd, ListBox_GetCurSel(child->left.hwnd), entry);
03928                                 ListBox_SetCurSel(child->left.hwnd, idx);
03929                                 set_curdir(child, entry, idx, hwnd);
03930                         }
03931                 }
03932
03933                 if (!scanned_old) {
03934                         calc_widths(pane, FALSE);
03935
03936 #ifndef _NO_EXTENSIONS
03937                         set_header(pane);
03938 #endif
03939                 }
03940         } else {
03941                 if (GetKeyState(VK_MENU) < 0)
03942                         show_properties_dlg(entry, child->hwnd);
03943                 else
03944                         launch_entry(entry, child->hwnd, SW_SHOWNORMAL);
03945         }
03946 }
03947
03948
03949 static BOOL pane_command(Pane* pane, UINT cmd)
03950 {
03951         switch(cmd) {
03952                 case ID_VIEW_NAME:
03953                         if (pane->visible_cols) {
03954                                 pane->visible_cols = 0;
03955                                 calc_widths(pane, TRUE);
03956 #ifndef _NO_EXTENSIONS
03957                                 set_header(pane);
03958 #endif
03959                                 InvalidateRect(pane->hwnd, 0, TRUE);
03960                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND|MF_CHECKED);
03961                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND);
03962                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
03963                         }
03964                         break;
03965
03966                 case ID_VIEW_ALL_ATTRIBUTES:
03967                         if (pane->visible_cols != COL_ALL) {
03968                                 pane->visible_cols = COL_ALL;
03969                                 calc_widths(pane, TRUE);
03970 #ifndef _NO_EXTENSIONS
03971                                 set_header(pane);
03972 #endif
03973                                 InvalidateRect(pane->hwnd, 0, TRUE);
03974                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND);
03975                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND|MF_CHECKED);
03976                                 CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
03977                         }
03978                         break;
03979
03980 #ifndef _NO_EXTENSIONS
03981                 case ID_PREFERRED_SIZES: {
03982                         calc_widths(pane, TRUE);
03983                         set_header(pane);
03984                         InvalidateRect(pane->hwnd, 0, TRUE);
03985                         break;}
03986 #endif
03987
03988                         /* TODO: more command ids... */
03989
03990                 default:
03991                         return FALSE;
03992         }
03993
03994         return TRUE;
03995 }
03996
03997
03998 static void set_sort_order(ChildWnd* child, SORT_ORDER sortOrder)
03999 {
04000         if (child->sortOrder != sortOrder) {
04001                 child->sortOrder = sortOrder;
04002                 refresh_child(child);
04003         }
04004 }
04005
04006 static void update_view_menu(ChildWnd* child)
04007 {
04008         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_NAME, child->sortOrder==SORT_NAME? MF_CHECKED: MF_UNCHECKED);
04009         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_TYPE, child->sortOrder==SORT_EXT? MF_CHECKED: MF_UNCHECKED);
04010         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_SIZE, child->sortOrder==SORT_SIZE? MF_CHECKED: MF_UNCHECKED);
04011         CheckMenuItem(Globals.hMenuView, ID_VIEW_SORT_DATE, child->sortOrder==SORT_DATE? MF_CHECKED: MF_UNCHECKED);
04012 }
04013
04014
04015 static BOOL is_directory(LPCTSTR target)
04016 {
04017         /*TODO correctly handle UNIX paths */
04018         DWORD target_attr = GetFileAttributes(target);
04019
04020         if (target_attr == INVALID_FILE_ATTRIBUTES)
04021                 return FALSE;
04022
04023         return target_attr&FILE_ATTRIBUTE_DIRECTORY? TRUE: FALSE;
04024 }
04025
04026 static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target)
04027 {
04028         TCHAR path[MAX_PATH];
04029         int len;
04030
04031         get_path(pane->cur, path);
04032
04033         if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_SELECT_DESTINATION), pane->hwnd, DestinationDlgProc, (LPARAM)path) != IDOK)
04034                 return FALSE;
04035
04036         get_path(pane->cur, source);
04037
04038         /* convert relative targets to absolute paths */
04039         if (path[0]!='/' && path[1]!=':') {
04040                 get_path(pane->cur->up, target);
04041                 len = lstrlen(target);
04042
04043                 if (target[len-1]!='\\' && target[len-1]!='/')
04044                         target[len++] = '/';
04045
04046                 lstrcpy(target+len, path);
04047         } else
04048                 lstrcpy(target, path);
04049
04050         /* If the target already exists as directory, create a new target below this. */
04051         if (is_directory(path)) {
04052                 TCHAR fname[_MAX_FNAME], ext[_MAX_EXT];
04053                 const static TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'};
04054
04055                 _tsplitpath(source, NULL, NULL, fname, ext);
04056
04057                 wsprintf(target, sAppend, path, fname, ext);
04058         }
04059
04060         return TRUE;
04061 }
04062
04063
04064 static IContextMenu2* s_pctxmenu2 = NULL;
04065
04066 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04067 static IContextMenu3* s_pctxmenu3 = NULL;
04068 #endif
04069
04070 static void CtxMenu_reset(void)
04071 {
04072         s_pctxmenu2 = NULL;
04073
04074 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04075         s_pctxmenu3 = NULL;
04076 #endif
04077 }
04078
04079 static IContextMenu* CtxMenu_query_interfaces(IContextMenu* pcm1)
04080 {
04081         IContextMenu* pcm = NULL;
04082
04083         CtxMenu_reset();
04084
04085 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04086         if (IUnknown_QueryInterface(pcm1, &IID_IContextMenu3, (void**)&pcm) == NOERROR)
04087                 s_pctxmenu3 = (LPCONTEXTMENU3)pcm;
04088         else
04089 #endif
04090         if (IUnknown_QueryInterface(pcm1, &IID_IContextMenu2, (void**)&pcm) == NOERROR)
04091                 s_pctxmenu2 = (LPCONTEXTMENU2)pcm;
04092
04093         if (pcm) {
04094                 IUnknown_Release(pcm1);
04095                 return pcm;
04096         } else
04097                 return pcm1;
04098 }
04099
04100 static BOOL CtxMenu_HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam)
04101 {
04102 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04103         if (s_pctxmenu3) {
04104                 if (SUCCEEDED((*s_pctxmenu3->lpVtbl->HandleMenuMsg)(s_pctxmenu3, nmsg, wparam, lparam)))
04105                         return TRUE;
04106         }
04107 #endif
04108
04109         if (s_pctxmenu2)
04110                 if (SUCCEEDED((*s_pctxmenu2->lpVtbl->HandleMenuMsg)(s_pctxmenu2, nmsg, wparam, lparam)))
04111                         return TRUE;
04112
04113         return FALSE;
04114 }
04115
04116
04117 static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST* apidl, int x, int y)
04118 {
04119         IContextMenu* pcm;
04120         BOOL executed = FALSE;
04121
04122         HRESULT hr = IShellFolder_GetUIObjectOf(shell_folder, hwndParent, cidl, apidl, &IID_IContextMenu, NULL, (LPVOID*)&pcm);
04123 /*      HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm); */
04124
04125         if (SUCCEEDED(hr)) {
04126                 HMENU hmenu = CreatePopupMenu();
04127
04128                 pcm = CtxMenu_query_interfaces(pcm);
04129
04130                 if (hmenu) {
04131                         hr = (*pcm->lpVtbl->QueryContextMenu)(pcm, hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
04132
04133                         if (SUCCEEDED(hr)) {
04134                                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
04135
04136                                 CtxMenu_reset();
04137
04138                                 if (idCmd) {
04139                                         CMINVOKECOMMANDINFO cmi;
04140
04141                                         cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
04142                                         cmi.fMask = 0;
04143                                         cmi.hwnd = hwndParent;
04144                                         cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
04145                                         cmi.lpParameters = NULL;
04146                                         cmi.lpDirectory = NULL;
04147                                         cmi.nShow = SW_SHOWNORMAL;
04148                                         cmi.dwHotKey = 0;
04149                                         cmi.hIcon = 0;
04150
04151                                         hr = (*pcm->lpVtbl->InvokeCommand)(pcm, &cmi);
04152                                         executed = TRUE;
04153                                 }
04154                         } else
04155                                 CtxMenu_reset();
04156                 }
04157
04158                 IUnknown_Release(pcm);
04159         }
04160
04161         return FAILED(hr)? hr: executed? S_OK: S_FALSE;
04162 }
04163
04164
04165 static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
04166 {
04167         ChildWnd* child = (ChildWnd*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
04168         ASSERT(child);
04169
04170         switch(nmsg) {
04171                 case WM_DRAWITEM: {
04172                         LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lparam;
04173                         Entry* entry = (Entry*) dis->itemData;
04174
04175                         if (dis->CtlID == IDW_TREE_LEFT)
04176                                 draw_item(&child->left, dis, entry, -1);
04177                         else if (dis->CtlID == IDW_TREE_RIGHT)
04178                                 draw_item(&child->right, dis, entry, -1);
04179                         else
04180                                 goto draw_menu_item;
04181
04182                         return TRUE;}
04183
04184                 case WM_CREATE:
04185                         InitChildWindow(child);
04186                         break;
04187
04188                 case WM_NCDESTROY:
04189                         free_child_window(child);
04190                         SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
04191                         break;
04192
04193                 case WM_PAINT: {
04194                         PAINTSTRUCT ps;
04195                         HBRUSH lastBrush;
04196                         RECT rt;
04197                         GetClientRect(hwnd, &rt);
04198                         BeginPaint(hwnd, &ps);
04199                         rt.left = child->split_pos-SPLIT_WIDTH/2;
04200                         rt.right = child->split_pos+SPLIT_WIDTH/2+1;
04201                         lastBrush = SelectBrush(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
04202                         Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
04203                         SelectObject(ps.hdc, lastBrush);
04204 #ifdef _NO_EXTENSIONS
04205                         rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
04206                         FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
04207 #endif
04208                         EndPaint(hwnd, &ps);
04209                         break;}
04210
04211                 case WM_SETCURSOR:
04212                         if (LOWORD(lparam) == HTCLIENT) {
04213                                 POINT pt;
04214                                 GetCursorPos(&pt);
04215                                 ScreenToClient(hwnd, &pt);
04216
04217                                 if (pt.x>=child->split_pos-SPLIT_WIDTH/2 && pt.x<child->split_pos+SPLIT_WIDTH/2+1) {
04218                                         SetCursor(LoadCursor(0, IDC_SIZEWE));
04219                                         return TRUE;
04220                                 }
04221                         }
04222                         goto def;
04223
04224                 case WM_LBUTTONDOWN: {
04225                         RECT rt;
04226                         int x = GET_X_LPARAM(lparam);
04227
04228                         GetClientRect(hwnd, &rt);
04229
04230                         if (x>=child->split_pos-SPLIT_WIDTH/2 && x<child->split_pos+SPLIT_WIDTH/2+1) {
04231                                 last_split = child->split_pos;
04232 #ifdef _NO_EXTENSIONS
04233                                 draw_splitbar(hwnd, last_split);
04234 #endif
04235                                 SetCapture(hwnd);
04236                         }
04237
04238                         break;}
04239
04240                 case WM_LBUTTONUP:
04241                         if (GetCapture() == hwnd) {
04242 #ifdef _NO_EXTENSIONS
04243                                 RECT rt;
04244                                 int x = LOWORD(lparam);
04245                                 draw_splitbar(hwnd, last_split);
04246                                 last_split = -1;
04247                                 GetClientRect(hwnd, &rt);
04248                                 child->split_pos = x;
04249                                 resize_tree(child, rt.right, rt.bottom);
04250 #endif
04251                                 ReleaseCapture();
04252                         }
04253                         break;
04254
04255 #ifdef _NO_EXTENSIONS
04256                 case WM_CAPTURECHANGED:
04257                         if (GetCapture()==hwnd && last_split>=0)
04258                                 draw_splitbar(hwnd, last_split);
04259                         break;
04260 #endif
04261
04262                 case WM_KEYDOWN:
04263                         if (wparam == VK_ESCAPE)
04264                                 if (GetCapture() == hwnd) {
04265                                         RECT rt;
04266 #ifdef _NO_EXTENSIONS
04267                                         draw_splitbar(hwnd, last_split);
04268 #else
04269                                         child->split_pos = last_split;
04270 #endif
04271                                         GetClientRect(hwnd, &rt);
04272                                         resize_tree(child, rt.right, rt.bottom);
04273                                         last_split = -1;
04274                                         ReleaseCapture();
04275                                         SetCursor(LoadCursor(0, IDC_ARROW));
04276                                 }
04277                         break;
04278
04279                 case WM_MOUSEMOVE:
04280                         if (GetCapture() == hwnd) {
04281                                 RECT rt;
04282                                 int x = LOWORD(lparam);
04283
04284 #ifdef _NO_EXTENSIONS
04285                                 HDC hdc = GetDC(hwnd);
04286                                 GetClientRect(hwnd, &rt);
04287
04288                                 rt.left = last_split-SPLIT_WIDTH/2;
04289                                 rt.right = last_split+SPLIT_WIDTH/2+1;
04290                                 InvertRect(hdc, &rt);
04291
04292                                 last_split = x;
04293                                 rt.left = x-SPLIT_WIDTH/2;
04294                                 rt.right = x+SPLIT_WIDTH/2+1;
04295                                 InvertRect(hdc, &rt);
04296
04297                                 ReleaseDC(hwnd, hdc);
04298 #else
04299                                 GetClientRect(hwnd, &rt);
04300
04301                                 if (x>=0 && x<rt.right) {
04302                                         child->split_pos = x;
04303                                         resize_tree(child, rt.right, rt.bottom);
04304                                         rt.left = x-SPLIT_WIDTH/2;
04305                                         rt.right = x+SPLIT_WIDTH/2+1;
04306                                         InvalidateRect(hwnd, &rt, FALSE);
04307                                         UpdateWindow(child->left.hwnd);
04308                                         UpdateWindow(hwnd);
04309                                         UpdateWindow(child->right.hwnd);
04310                                 }
04311 #endif
04312                         }
04313                         break;
04314
04315 #ifndef _NO_EXTENSIONS
04316                 case WM_GETMINMAXINFO:
04317                         DefMDIChildProc(hwnd, nmsg, wparam, lparam);
04318
04319                         {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
04320
04321                         lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */
04322                         lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */
04323                         break;}
04324 #endif /* _NO_EXTENSIONS */
04325
04326                 case WM_SETFOCUS:
04327                         if (SetCurrentDirectory(child->path))
04328                                 set_space_status();
04329                         SetFocus(child->focus_pane? child->right.hwnd: child->left.hwnd);
04330                         break;
04331
04332                 case WM_DISPATCH_COMMAND: {
04333                         Pane* pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
04334
04335                         switch(LOWORD(wparam)) {
04336                                 case ID_WINDOW_NEW: {
04337                                         ChildWnd* new_child = alloc_child_window(child->path, NULL, hwnd);
04338
04339                                         if (!create_child_window(new_child))
04340                                                 free(new_child);
04341
04342                                         break;}
04343
04344                                 case ID_REFRESH:
04345                                         refresh_drives();
04346                                         refresh_child(child);
04347                                         break;
04348
04349                                 case ID_ACTIVATE:
04350                                         activate_entry(child, pane, hwnd);
04351                                         break;
04352
04353                                 case ID_FILE_MOVE: {
04354                                         TCHAR source[BUFFER_LEN], target[BUFFER_LEN];
04355
04356                                         if (prompt_target(pane, source, target)) {
04357                                                 SHFILEOPSTRUCT shfo = {hwnd, FO_MOVE, source, target};
04358
04359                                                 source[lstrlen(source)+1] = '\0';
04360                                                 target[lstrlen(target)+1] = '\0';
04361
04362                                                 if (!SHFileOperation(&shfo))
04363                                                         refresh_child(child);
04364                                         }
04365                                         break;}
04366
04367                                 case ID_FILE_COPY: {
04368                                         TCHAR source[BUFFER_LEN], target[BUFFER_LEN];
04369
04370                                         if (prompt_target(pane, source, target)) {
04371                                                 SHFILEOPSTRUCT shfo = {hwnd, FO_COPY, source, target};
04372
04373                                                 source[lstrlen(source)+1] = '\0';
04374                                                 target[lstrlen(target)+1] = '\0';
04375
04376                                                 if (!SHFileOperation(&shfo))
04377                                                         refresh_child(child);
04378                                         }
04379                                         break;}
04380
04381                                 case ID_FILE_DELETE: {
04382                                         TCHAR path[BUFFER_LEN];
04383                                         SHFILEOPSTRUCT shfo = {hwnd, FO_DELETE, path};
04384
04385                                         get_path(pane->cur, path);
04386
04387                                         path[lstrlen(path)+1] = '\0';
04388
04389                                         if (!SHFileOperation(&shfo))
04390                                                 refresh_child(child);
04391                                         break;}
04392
04393                                 case ID_VIEW_SORT_NAME:
04394                                         set_sort_order(child, SORT_NAME);
04395                                         break;
04396
04397                                 case ID_VIEW_SORT_TYPE:
04398                                         set_sort_order(child, SORT_EXT);
04399                                         break;
04400
04401                                 case ID_VIEW_SORT_SIZE:
04402                                         set_sort_order(child, SORT_SIZE);
04403                                         break;
04404
04405                                 case ID_VIEW_SORT_DATE:
04406                                         set_sort_order(child, SORT_DATE);
04407                                         break;
04408
04409                                 case ID_VIEW_FILTER: {
04410                                         struct FilterDialog dlg;
04411
04412                                         memset(&dlg, 0, sizeof(struct FilterDialog));
04413                                         lstrcpy(dlg.pattern, child->filter_pattern);
04414                                         dlg.flags = child->filter_flags;
04415
04416                                         if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_VIEW_TYPE), hwnd, FilterDialogDlgProc, (LPARAM)&dlg) == IDOK) {
04417                                                 lstrcpy(child->filter_pattern, dlg.pattern);
04418                                                 child->filter_flags = dlg.flags;
04419                                                 refresh_right_pane(child);
04420                                         }
04421                                         break;}
04422
04423                                 case ID_VIEW_SPLIT: {
04424                                         last_split = child->split_pos;
04425 #ifdef _NO_EXTENSIONS
04426                                         draw_splitbar(hwnd, last_split);
04427 #endif
04428                                         SetCapture(hwnd);
04429                                         break;}
04430
04431                                 case ID_EDIT_PROPERTIES:
04432                                         show_properties_dlg(pane->cur, child->hwnd);
04433                                         break;
04434
04435                                 default:
04436                                         return pane_command(pane, LOWORD(wparam));
04437                         }
04438
04439                         return TRUE;}
04440
04441                 case WM_COMMAND: {
04442                         Pane* pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
04443
04444                         switch(HIWORD(wparam)) {
04445                                 case LBN_SELCHANGE: {
04446                                         int idx = ListBox_GetCurSel(pane->hwnd);
04447                                         Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, idx);
04448
04449                                         if (pane == &child->left)
04450                                                 set_curdir(child, entry, idx, hwnd);
04451                                         else
04452                                                 pane->cur = entry;
04453                                         break;}
04454
04455                                 case LBN_DBLCLK:
04456                                         activate_entry(child, pane, hwnd);
04457                                         break;
04458                         }
04459                         break;}
04460
04461 #ifndef _NO_EXTENSIONS
04462                 case WM_NOTIFY: {
04463                         NMHDR* pnmh = (NMHDR*) lparam;
04464                         return pane_notify(pnmh->idFrom==IDW_HEADER_LEFT? &child->left: &child->right, pnmh);}
04465 #endif
04466
04467 #ifdef _SHELL_FOLDERS
04468                 case WM_CONTEXTMENU: {
04469                         POINT pt, pt_clnt;
04470                         Pane* pane;
04471                         int idx;
04472
04473                          /* first select the current item in the listbox */
04474                         HWND hpanel = (HWND) wparam;
04475                         pt_clnt.x = pt.x = (short)LOWORD(lparam);
04476                         pt_clnt.y = pt.y = (short)HIWORD(lparam);
04477                         ScreenToClient(hpanel, &pt_clnt);
04478                         SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
04479                         SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
04480
04481                          /* now create the popup menu using shell namespace and IContextMenu */
04482                         pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
04483                         idx = ListBox_GetCurSel(pane->hwnd);
04484
04485                         if (idx != -1) {
04486                                 Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, idx);
04487
04488                                 LPITEMIDLIST pidl_abs = get_to_absolute_pidl(entry, hwnd);
04489
04490                                 if (pidl_abs) {
04491                                         IShellFolder* parentFolder;
04492                                         LPCITEMIDLIST pidlLast;
04493
04494                                          /* get and use the parent folder to display correct context menu in all cases */
04495                                         if (SUCCEEDED(SHBindToParent(pidl_abs, &IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) {
04496                                                 if (ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pt.x, pt.y) == S_OK)
04497                                                         refresh_child(child);
04498
04499                                                 IShellFolder_Release(parentFolder);
04500                                         }
04501
04502                                         IMalloc_Free(Globals.iMalloc, pidl_abs);
04503                                 }
04504                         }
04505                         break;}
04506 #endif
04507
04508                   case WM_MEASUREITEM:
04509                   draw_menu_item:
04510                         if (!wparam)    /* Is the message menu-related? */
04511                                 if (CtxMenu_HandleMenuMsg(nmsg, wparam, lparam))
04512                                         return TRUE;
04513
04514                         break;
04515
04516                   case WM_INITMENUPOPUP:
04517                         if (CtxMenu_HandleMenuMsg(nmsg, wparam, lparam))
04518                                 return 0;
04519
04520                         update_view_menu(child);
04521                         break;
04522
04523 #ifndef __MINGW32__     /* IContextMenu3 missing in MinGW (as of 6.2.2005) */
04524                   case WM_MENUCHAR:     /* only supported by IContextMenu3 */
04525                    if (s_pctxmenu3) {
04526                            LRESULT lResult = 0;
04527
04528                            (*s_pctxmenu3->lpVtbl->HandleMenuMsg2)(s_pctxmenu3, nmsg, wparam, lparam, &lResult);
04529
04530                            return lResult;
04531                    }
04532
04533                    break;
04534 #endif
04535
04536                 case WM_SIZE:
04537                         if (wparam != SIZE_MINIMIZED)
04538                                 resize_tree(child, LOWORD(lparam), HIWORD(lparam));
04539                         /* fall through */
04540
04541                 default: def:
04542                         return DefMDIChildProc(hwnd, nmsg, wparam, lparam);
04543         }
04544
04545         return 0;
04546 }
04547
04548
04549 static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
04550 {
04551         ChildWnd* child = (ChildWnd*) GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
04552         Pane* pane = (Pane*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
04553         ASSERT(child);
04554
04555         switch(nmsg) {
04556 #ifndef _NO_EXTENSIONS
04557                 case WM_HSCROLL:
04558                         set_header(pane);
04559                         break;
04560 #endif
04561
04562                 case WM_SETFOCUS:
04563                         child->focus_pane = pane==&child->right? 1: 0;
04564                         ListBox_SetSel(hwnd, TRUE, 1);
04565                         /*TODO: check menu items */
04566                         break;
04567
04568                 case WM_KEYDOWN:
04569                         if (wparam == VK_TAB) {
04570                                 /*TODO: SetFocus(Globals.hdrivebar) */
04571                                 SetFocus(child->focus_pane? child->left.hwnd: child->right.hwnd);
04572                         }
04573         }
04574
04575         return CallWindowProc(g_orgTreeWndProc, hwnd, nmsg, wparam, lparam);
04576 }
04577
04578
04579 static void InitInstance(HINSTANCE hinstance)
04580 {
04581         const static TCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
04582
04583         WNDCLASSEX wcFrame;
04584         WNDCLASS wcChild;
04585         ATOM hChildClass;
04586         int col;
04587
04588         INITCOMMONCONTROLSEX icc = {
04589                 sizeof(INITCOMMONCONTROLSEX),
04590                 ICC_BAR_CLASSES
04591         };
04592
04593         HDC hdc = GetDC(0);
04594
04595         setlocale(LC_COLLATE, "");      /* set collating rules to local settings for compareName */
04596
04597         InitCommonControlsEx(&icc);
04598
04599
04600         /* register frame window class */
04601
04602         wcFrame.cbSize        = sizeof(WNDCLASSEX);
04603         wcFrame.style         = 0;
04604         wcFrame.lpfnWndProc   = FrameWndProc;
04605         wcFrame.cbClsExtra    = 0;
04606         wcFrame.cbWndExtra    = 0;
04607         wcFrame.hInstance     = hinstance;
04608         wcFrame.hIcon         = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_WINEFILE));
04609         wcFrame.hCursor       = LoadCursor(0, IDC_ARROW);
04610         wcFrame.hbrBackground = 0;
04611         wcFrame.lpszMenuName  = 0;
04612         wcFrame.lpszClassName = sWINEFILEFRAME;
04613         wcFrame.hIconSm       = (HICON)LoadImage(hinstance,
04614                                                                                          MAKEINTRESOURCE(IDI_WINEFILE),
04615                                                                                          IMAGE_ICON,
04616                                                                                          GetSystemMetrics(SM_CXSMICON),
04617                                                                                          GetSystemMetrics(SM_CYSMICON),
04618                                                                                          LR_SHARED);
04619
04620         Globals.hframeClass = RegisterClassEx(&wcFrame);
04621
04622
04623         /* register tree windows class */
04624
04625         wcChild.style         = CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW;
04626         wcChild.lpfnWndProc   = ChildWndProc;
04627         wcChild.cbClsExtra    = 0;
04628         wcChild.cbWndExtra    = 0;
04629         wcChild.hInstance     = hinstance;
04630         wcChild.hIcon         = 0;
04631         wcChild.hCursor       = LoadCursor(0, IDC_ARROW);
04632         wcChild.hbrBackground = 0;
04633         wcChild.lpszMenuName  = 0;
04634         wcChild.lpszClassName = sWINEFILETREE;
04635
04636         hChildClass = RegisterClass(&wcChild);
04637
04638
04639         Globals.haccel = LoadAccelerators(hinstance, MAKEINTRESOURCE(IDA_WINEFILE));
04640
04641         Globals.hfont = CreateFont(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sFont);
04642
04643         ReleaseDC(0, hdc);
04644
04645         Globals.hInstance = hinstance;
04646
04647 #ifdef _SHELL_FOLDERS
04648         CoInitialize(NULL);
04649         CoGetMalloc(MEMCTX_TASK, &Globals.iMalloc);
04650         SHGetDesktopFolder(&Globals.iDesktop);
04651 #ifdef __WINE__
04652         Globals.cfStrFName = RegisterClipboardFormatA(CFSTR_FILENAME);
04653 #else
04654         Globals.cfStrFName = RegisterClipboardFormat(CFSTR_FILENAME);
04655 #endif
04656 #endif
04657
04658         /* load column strings */
04659         col = 1;
04660
04661         load_string(g_pos_names[col++], IDS_COL_NAME);
04662         load_string(g_pos_names[col++], IDS_COL_SIZE);
04663         load_string(g_pos_names[col++], IDS_COL_CDATE);
04664 #ifndef _NO_EXTENSIONS
04665         load_string(g_pos_names[col++], IDS_COL_ADATE);
04666         load_string(g_pos_names[col++], IDS_COL_MDATE);
04667         load_string(g_pos_names[col++], IDS_COL_IDX);
04668         load_string(g_pos_names[col++], IDS_COL_LINKS);
04669 #endif
04670         load_string(g_pos_names[col++], IDS_COL_ATTR);
04671 #ifndef _NO_EXTENSIONS
04672         load_string(g_pos_names[col++], IDS_COL_SEC);
04673 #endif
04674 }
04675
04676
04677 static void show_frame(HWND hwndParent, int cmdshow)
04678 {
04679         const static TCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'};
04680
04681         TCHAR path[MAX_PATH], b1[BUFFER_LEN];
04682         ChildWnd* child;
04683         HMENU hMenuFrame, hMenuWindow;
04684
04685         CLIENTCREATESTRUCT ccs;
04686
04687         if (Globals.hMainWnd)
04688                 return;
04689
04690         Globals.hwndParent = hwndParent;
04691
04692         hMenuFrame = LoadMenu(Globals.hInstance, MAKEINTRESOURCE(IDM_WINEFILE));
04693         hMenuWindow = GetSubMenu(hMenuFrame, GetMenuItemCount(hMenuFrame)-2);
04694
04695         Globals.hMenuFrame = hMenuFrame;
04696         Globals.hMenuView = GetSubMenu(hMenuFrame, 3);
04697         Globals.hMenuOptions = GetSubMenu(hMenuFrame, 4);
04698
04699         ccs.hWindowMenu  = hMenuWindow;
04700         ccs.idFirstChild = IDW_FIRST_CHILD;
04701
04702
04703         /* create main window */
04704         Globals.hMainWnd = CreateWindowEx(0, (LPCTSTR)(int)Globals.hframeClass, RS(b1,IDS_WINE_FILE), WS_OVERLAPPEDWINDOW,
04705                                         CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
04706                                         hwndParent, Globals.hMenuFrame, Globals.hInstance, 0/*lpParam*/);
04707
04708
04709         Globals.hmdiclient = CreateWindowEx(0, sMDICLIENT, NULL,
04710                                         WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
04711                                         0, 0, 0, 0,
04712                                         Globals.hMainWnd, 0, Globals.hInstance, &ccs);
04713
04714
04715         CheckMenuItem(Globals.hMenuOptions, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
04716
04717         create_drive_bar();
04718
04719         {
04720                 TBBUTTON toolbarBtns[] = {
04721                         {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
04722                         {0, ID_WINDOW_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04723                         {1, ID_WINDOW_CASCADE, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04724                         {2, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04725                         {3, ID_WINDOW_TILE_VERT, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04726 /*TODO
04727                         {4, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04728                         {5, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
04729 */              };
04730
04731                 Globals.htoolbar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE,
04732                         IDW_TOOLBAR, 2, Globals.hInstance, IDB_TOOLBAR, toolbarBtns,
04733                         sizeof(toolbarBtns)/sizeof(TBBUTTON), 16, 15, 16, 15, sizeof(TBBUTTON));
04734                 CheckMenuItem(Globals.hMenuOptions, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED);
04735         }
04736
04737         Globals.hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, Globals.hMainWnd, IDW_STATUSBAR);
04738         CheckMenuItem(Globals.hMenuOptions, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
04739
04740 /* CreateStatusWindow does not accept WS_BORDER
04741         Globals.hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0,
04742                                         WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0,
04743                                         Globals.hMainWnd, (HMENU)IDW_STATUSBAR, hinstance, 0);*/
04744
04745         /*TODO: read paths and window placements from registry */
04746         GetCurrentDirectory(MAX_PATH, path);
04747
04748         ShowWindow(Globals.hMainWnd, cmdshow);
04749
04750 //#if defined(_SHELL_FOLDERS) && !defined(__WINE__)
04751 //       // Shell Namespace as default:
04752 //      child = alloc_child_window(path, get_path_pidl(path,Globals.hMainWnd), Globals.hMainWnd);
04753 //#else
04754         child = alloc_child_window(path, NULL, Globals.hMainWnd);
04755 //#endif
04756
04757         child->pos.showCmd = SW_SHOWMAXIMIZED;
04758         child->pos.rcNormalPosition.left = 0;
04759         child->pos.rcNormalPosition.top = 0;
04760         child->pos.rcNormalPosition.right = 320;
04761         child->pos.rcNormalPosition.bottom = 280;
04762
04763         if (!create_child_window(child))
04764                 free(child);
04765
04766         SetWindowPlacement(child->hwnd, &child->pos);
04767
04768         Globals.himl = ImageList_LoadBitmap(Globals.hInstance, MAKEINTRESOURCE(IDB_IMAGES), 16, 0, RGB(0,255,0));
04769
04770         Globals.prescan_node = FALSE;
04771
04772         UpdateWindow(Globals.hMainWnd);
04773 }
04774
04775 static void ExitInstance(void)
04776 {
04777 #ifdef _SHELL_FOLDERS
04778         IShellFolder_Release(Globals.iDesktop);
04779         IMalloc_Release(Globals.iMalloc);
04780         CoUninitialize();
04781 #endif
04782
04783         DeleteObject(Globals.hfont);
04784         ImageList_Destroy(Globals.himl);
04785 }
04786
04787 #ifdef _NO_EXTENSIONS
04788
04789 /* search for already running win[e]files */
04790
04791 static int g_foundPrevInstance = 0;
04792
04793 static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam)
04794 {
04795         TCHAR cls[128];
04796
04797         GetClassName(hwnd, cls, 128);
04798
04799         if (!lstrcmp(cls, (LPCTSTR)lparam)) {
04800                 g_foundPrevInstance++;
04801                 return FALSE;
04802         }
04803
04804         return TRUE;
04805 }
04806
04807 /* search for window of given class name to allow only one running instance */
04808 static int find_window_class(LPCTSTR classname)
04809 {
04810         EnumWindows(EnumWndProc, (LPARAM)classname);
04811
04812         if (g_foundPrevInstance)
04813                 return 1;
04814
04815         return 0;
04816 }
04817
04818 #endif
04819
04820 static int winefile_main(HINSTANCE hinstance, HWND hwndParent, int cmdshow)
04821 {
04822         MSG msg;
04823
04824         InitInstance(hinstance);
04825
04826         if (cmdshow == SW_SHOWNORMAL)
04827                 /*TODO: read window placement from registry */
04828                 cmdshow = SW_MAXIMIZE;
04829
04830         show_frame(hwndParent, cmdshow);
04831
04832         while(GetMessage(&msg, 0, 0, 0)) {
04833                 if (Globals.hmdiclient && TranslateMDISysAccel(Globals.hmdiclient, &msg))
04834                         continue;
04835
04836                 if (Globals.hMainWnd && TranslateAccelerator(Globals.hMainWnd, Globals.haccel, &msg))
04837                         continue;
04838
04839                 TranslateMessage(&msg);
04840                 DispatchMessage(&msg);
04841         }
04842
04843         ExitInstance();
04844
04845         return msg.wParam;
04846 }
04847
04848
04849 int APIENTRY WinMain(HINSTANCE hinstance,
04850                                          HINSTANCE previnstance,
04851                                          LPSTR     cmdline,
04852                                          int       cmdshow)
04853 {
04854 #ifdef _NO_EXTENSIONS
04855         if (find_window_class(sWINEFILEFRAME))
04856                 return 1;
04857 #endif
04858
04859         winefile_main(hinstance, 0, cmdshow);
04860
04861         return 0;
04862 }


Winefile: winefile.h Source File

winefile.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2000, 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019 #define WIN32_LEAN_AND_MEAN
00020 #define WIN32_EXTRA_LEAN
00021 #define NOSERVICE
00022 #define NOMCX
00023 #define NOIME
00024 #define NOCOMM
00025 #define NOKANJI
00026 #define NORPC
00027 #define NOPROXYSTUB
00028 #define NOIMAGE
00029 #define NOTAPE
00030
00031 #define NONAMELESSUNION
00032 #include <windows.h>
00033 #include <windowsx.h>
00034 #include <commctrl.h>
00035 #include <commdlg.h>
00036
00037 #ifdef UNICODE
00038 #define _UNICODE
00039 #endif
00040
00041 #include <stdlib.h>
00042 #include <stdio.h>
00043 #include <ctype.h>
00044 #include <locale.h>
00045 #include <time.h>
00046
00047 #ifndef __WINE__
00048 #include <malloc.h> /* for alloca() */
00049
00050  // ugly hack to use alloca() while keeping Wine's developers happy
00051 #define HeapAlloc(h,f,s) alloca(s)
00052 #define HeapFree(h,f,p)
00053 #endif
00054
00055 #include <shellapi.h>   /* for ShellExecute() */
00056 #include <shlobj.h>     /* for SHFormatDrive() */
00057
00058 #ifndef _NO_EXTENSIONS
00059 #define _SHELL_FOLDERS
00060 #endif /* _NO_EXTENSIONS */
00061
00062 #ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
00063 #define FILE_ATTRIBUTE_ENCRYPTED            0x00000040
00064 #define FILE_ATTRIBUTE_SPARSE_FILE          0x00000200
00065 #define FILE_ATTRIBUTE_REPARSE_POINT        0x00000400
00066 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  0x00002000
00067 #endif
00068
00069
00070 #ifdef  _DEBUG
00071 #define ASSERT(x)   {if (!(x)) DebugBreak();}
00072 #else
00073 #define ASSERT(x)   /* nothing */
00074 #endif
00075
00076 #define BUFFER_LEN  1024
00077
00078
00079 enum IMAGE {
00080     IMG_NONE=-1,    IMG_FILE=0,         IMG_DOCUMENT,   IMG_EXECUTABLE,
00081     IMG_FOLDER,     IMG_OPEN_FOLDER,    IMG_FOLDER_PLUS,IMG_OPEN_PLUS,  IMG_OPEN_MINUS,
00082     IMG_FOLDER_UP,  IMG_FOLDER_CUR
00083 };
00084
00085 #define IMAGE_WIDTH         16
00086 #define IMAGE_HEIGHT        13
00087 #define SPLIT_WIDTH         5
00088 #define TREE_LINE_DX        3
00089
00090 #define IDW_STATUSBAR       0x100
00091 #define IDW_TOOLBAR         0x101
00092 #define IDW_DRIVEBAR        0x102
00093 #define IDW_FIRST_CHILD     0xC000  /*0x200*/
00094
00095 #define IDW_TREE_LEFT       3
00096 #define IDW_TREE_RIGHT      6
00097 #define IDW_HEADER_LEFT     2
00098 #define IDW_HEADER_RIGHT    5
00099
00100 #define WM_DISPATCH_COMMAND 0xBF80
00101
00102 #define COLOR_COMPRESSED    RGB(0,0,255)
00103 #define COLOR_SELECTION     RGB(0,0,128)
00104
00105 #ifdef _NO_EXTENSIONS
00106 #define COLOR_SPLITBAR      WHITE_BRUSH
00107 #else
00108 #define COLOR_SPLITBAR      LTGRAY_BRUSH
00109 #endif
00110
00111 #define FRM_CALC_CLIENT     0xBF83
00112 #define Frame_CalcFrameClient(hwnd, prt) ((BOOL)SNDMSG(hwnd, FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))
00113
00114
00115 typedef struct
00116 {
00117   HANDLE    hInstance;
00118   HACCEL    haccel;
00119   ATOM      hframeClass;
00120   HWND      hwndParent;
00121
00122   HWND      hMainWnd;
00123   HMENU     hMenuFrame;
00124   HMENU     hWindowsMenu;
00125   HMENU     hLanguageMenu;
00126   HMENU     hMenuView;
00127   HMENU     hMenuOptions;
00128   HWND      hmdiclient;
00129   HWND      hstatusbar;
00130   HWND      htoolbar;
00131   HWND      hdrivebar;
00132   HFONT     hfont;
00133
00134   TCHAR     num_sep;
00135   SIZE      spaceSize;
00136   HIMAGELIST himl;
00137
00138   TCHAR     drives[BUFFER_LEN];
00139   BOOL      prescan_node;   /*TODO*/
00140
00141 #ifdef _SHELL_FOLDERS
00142   IShellFolder* iDesktop;
00143   IMalloc*      iMalloc;
00144   UINT          cfStrFName;
00145 #endif
00146 } WINEFILE_GLOBALS;
00147
00148 extern WINEFILE_GLOBALS Globals;
00149
00150 #ifdef __WINE__
00151
00152 extern void WineLicense(HWND hwnd);
00153 extern void WineWarranty(HWND hwnd);
00154
00155
00156 #ifdef UNICODE
00157 extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
00158 #define _tsplitpath _wsplitpath
00159 #define _stprintf msvcrt_swprintf
00160 #else
00161 extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext);
00162 #define _tsplitpath _splitpath
00163 #define _stprintf sprintf
00164 #endif
00165
00166 #else
00167
00168 #include <tchar.h>      /* for _tsplitpath() */
00169
00170 #endif