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 <shellapi.h>
#include <shlobj.h>
#include <tchar.h>
#include "resource.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  WINDOW_OPTIONS
struct  WINEFILE_GLOBALS
struct  _Entry
struct  _Root
struct  _Pane
struct  _ChildWnd
struct  ExecuteDialog
struct  FilterDialog

Defines

#define heap_alloc(s)   malloc(s)
#define heap_free(p)   free(p)
#define COBJMACROS
#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 _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_SELECTION_TXT   RGB(255,255,255)
#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))
#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 RS(b, i)   load_string(b, i)
#define DEFAULT_SPLIT_POS   300
#define COLUMNS   10
#define get_strret   get_strretA
#define path_from_pidl   path_from_pidlA

Typedefs

typedef struct _Entry Entry
typedef struct _Root Root
typedef struct _Pane Pane
typedef struct _ChildWnd ChildWnd

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
}
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_FILTER {
  TF_DIRECTORIES = 0x01, TF_PROGRAMS = 0x02, TF_DOCUMENTS = 0x04, TF_OTHERS = 0x08,
  TF_HIDDEN = 0x10, TF_ALL = 0x1F
}

Functions

LPTSTR load_string (LPTSTR buffer, UINT id)
Entryalloc_entry (void)
void free_entries (Entry *dir)
Entryread_tree (Root *root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, enum SORT_ORDER sortOrder, HWND hwnd)
void get_path (Entry *dir, PTSTR path)
void format_date (const FILETIME *ft, TCHAR *buffer, int visible_cols)
void read_directory (Entry *dir, LPCTSTR path, enum SORT_ORDER sortOrder, HWND hwnd)
void display_error (HWND hwnd, DWORD error)
void display_network_error (HWND hwnd)
void read_directory_win (Entry *dir, LPCTSTR path)
Entryread_tree_win (Root *root, LPCTSTR path, enum SORT_ORDER sortOrder, HWND hwnd)
void read_directory_shell (Entry *dir, HWND hwnd)
Entryread_tree_shell (Root *root, LPITEMIDLIST pidl, enum SORT_ORDER sortOrder, HWND hwnd)
LPITEMIDLIST get_path_pidl (LPCTSTR path, HWND hwnd)
LPITEMIDLIST get_to_absolute_pidl (Entry *entry, HWND hwnd)
HRESULT path_from_pidlA (IShellFolder *folder, LPITEMIDLIST pidl, LPSTR buffer, int len)
HRESULT path_from_pidlW (IShellFolder *folder, LPITEMIDLIST pidl, LPWSTR buffer, int len)
BOOL CtxMenu_HandleMenuMsg (UINT nmsg, WPARAM wparam, LPARAM lparam)
HRESULT ShellFolderContextMenu (IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *apidl, int x, int y)
void save_registry_settings (void)
void load_registry_settings (struct WINDOW_OPTIONS *pOpts)
INT_PTR CALLBACK ExecuteDialogDlgProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
INT_PTR CALLBACK FilterDialogDlgProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
void choose_font (HWND hwnd)
void show_properties_dlg (Entry *entry, HWND hwnd)
INT_PTR CALLBACK DestinationDlgProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)

Variables

struct WINEFILE_GLOBALS Globals
const TCHAR sEmpty []
const TCHAR sSpace []
const TCHAR sNumFmt []
const TCHAR sQMarks []
const TCHAR sLongHexFmt []
const TCHAR sLongNumFmt []
IContextMenu3 * s_pctxmenu3


Define Documentation

#define _MAX_DIR   _MAX_FNAME

Definition at line 194 of file winefile.h.

Referenced by alloc_child_window(), and read_tree().

#define _MAX_DRIVE   3

Definition at line 192 of file winefile.h.

Referenced by alloc_child_window(), and FrameWndProc().

#define _MAX_EXT   _MAX_FNAME

Definition at line 195 of file winefile.h.

Referenced by alloc_child_window().

#define _MAX_FNAME   256

Definition at line 193 of file winefile.h.

Referenced by alloc_child_window(), and read_tree().

#define _MAX_PATH   260

Definition at line 196 of file winefile.h.

Referenced by extract_icon().

#define _SHELL_FOLDERS

Definition at line 68 of file winefile.h.

#define ASSERT (  ) 

Definition at line 82 of file winefile.h.

Referenced by TreeWndProc().

#define BUFFER_LEN   1024

Definition at line 85 of file winefile.h.

Referenced by alloc_child_window(), CheckForFileInfo(), choose_font(), DestinationDlgProc(), display_error(), display_network_error(), draw_item(), format_date(), FrameWndProc(), load_string(), pattern_imatch(), and PropertiesDialogDlgProc().

#define COBJMACROS

Definition at line 34 of file winefile.h.

#define COLOR_COMPRESSED   RGB(0,0,255)

Definition at line 111 of file winefile.h.

Referenced by draw_item().

#define COLOR_SELECTION   RGB(0,0,128)

Definition at line 112 of file winefile.h.

Referenced by draw_item().

#define COLOR_SELECTION_TXT   RGB(255,255,255)

Definition at line 113 of file winefile.h.

Referenced by draw_item().

#define COLOR_SPLITBAR   LTGRAY_BRUSH

Definition at line 118 of file winefile.h.

#define COLUMNS   10

Definition at line 289 of file winefile.h.

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

#define DEFAULT_SPLIT_POS   300

Definition at line 215 of file winefile.h.

Referenced by alloc_child_window().

#define FILE_ATTRIBUTE_ENCRYPTED   0x00000040

Definition at line 72 of file winefile.h.

Referenced by draw_item().

#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED   0x00002000

Definition at line 75 of file winefile.h.

Referenced by draw_item().

#define FILE_ATTRIBUTE_REPARSE_POINT   0x00000400

Definition at line 74 of file winefile.h.

Referenced by draw_item().

#define FILE_ATTRIBUTE_SPARSE_FILE   0x00000200

Definition at line 73 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 122 of file winefile.h.

#define FRM_CALC_CLIENT   0xBF83

Definition at line 121 of file winefile.h.

Referenced by FrameWndProc().

#define get_strret   get_strretA

Definition at line 385 of file winefile.h.

Referenced by name_from_pidl().

#define heap_alloc (  )     malloc(s)

Definition at line 30 of file winefile.h.

Referenced by alloc_child_window(), alloc_entry(), CheckForFileInfo(), and SortDirectory().

#define heap_free (  )     free(p)

Definition at line 31 of file winefile.h.

Referenced by FrameWndProc(), free_child_window(), free_entry(), PropertiesDialogDlgProc(), and SortDirectory().

#define IDW_DRIVEBAR   0x102

Definition at line 101 of file winefile.h.

#define IDW_FIRST_CHILD   0xC000

Definition at line 102 of file winefile.h.

Referenced by FrameWndProc().

#define IDW_HEADER_LEFT   2

Definition at line 106 of file winefile.h.

Referenced by InitChildWindow().

#define IDW_HEADER_RIGHT   5

Definition at line 107 of file winefile.h.

Referenced by InitChildWindow().

#define IDW_STATUSBAR   0x100

Definition at line 99 of file winefile.h.

#define IDW_TOOLBAR   0x101

Definition at line 100 of file winefile.h.

#define IDW_TREE_LEFT   3

Definition at line 104 of file winefile.h.

Referenced by InitChildWindow().

#define IDW_TREE_RIGHT   6

Definition at line 105 of file winefile.h.

Referenced by InitChildWindow().

#define IMAGE_HEIGHT   13

Definition at line 95 of file winefile.h.

Referenced by choose_font(), and draw_item().

#define IMAGE_WIDTH   16

Definition at line 94 of file winefile.h.

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

#define NOCOMM

Definition at line 41 of file winefile.h.

#define NOIMAGE

Definition at line 45 of file winefile.h.

#define NOIME

Definition at line 40 of file winefile.h.

#define NOKANJI

Definition at line 42 of file winefile.h.

#define NOMCX

Definition at line 39 of file winefile.h.

#define NONAMELESSUNION

Definition at line 48 of file winefile.h.

#define NOPROXYSTUB

Definition at line 44 of file winefile.h.

#define NORPC

Definition at line 43 of file winefile.h.

#define NOSERVICE

Definition at line 38 of file winefile.h.

#define NOTAPE

Definition at line 46 of file winefile.h.

#define path_from_pidl   path_from_pidlA

Definition at line 386 of file winefile.h.

Referenced by get_path().

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

Definition at line 211 of file winefile.h.

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

#define SPLIT_WIDTH   5

Definition at line 96 of file winefile.h.

#define TREE_LINE_DX   3

Definition at line 97 of file winefile.h.

Referenced by draw_item().

#define UNION_MEMBER (  )     DUMMYUNIONNAME.x

Definition at line 200 of file winefile.h.

#define WIN32_EXTRA_LEAN

Definition at line 37 of file winefile.h.

#define WIN32_LEAN_AND_MEAN

Definition at line 36 of file winefile.h.

#define WM_DISPATCH_COMMAND   0xBF80

Definition at line 109 of file winefile.h.

Referenced by FrameWndProc().


Typedef Documentation

typedef struct _ChildWnd ChildWnd

typedef struct _Entry Entry

typedef struct _Pane Pane

typedef struct _Root Root


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 260 of file winefile.h.

00263                   {
00264     COL_SIZE        = 0x01,
00265     COL_DATE        = 0x02,
00266     COL_TIME        = 0x04,
00267     COL_ATTRIBUTES  = 0x08,
00268     COL_DOSNAMES    = 0x10,
00269 #ifdef _NO_EXTENSIONS
00270     COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES
00271 #else
00272     COL_INDEX       = 0x20,
00273     COL_LINKS       = 0x40,

enum ENTRY_TYPE

Enumerator:
ET_WINDOWS 
ET_UNIX 
ET_SHELL 

Definition at line 220 of file winefile.h.

00223                 {
00224     ET_WINDOWS,
00225     ET_UNIX,
00226 #ifdef _SHELL_FOLDERS

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 88 of file winefile.h.

enum SORT_ORDER

Enumerator:
SORT_NAME 
SORT_EXT 
SORT_SIZE 
SORT_DATE 

Definition at line 275 of file winefile.h.

00278                 {
00279     SORT_NAME,
00280     SORT_EXT,

enum TYPE_FILTER

Enumerator:
TF_DIRECTORIES 
TF_PROGRAMS 
TF_DOCUMENTS 
TF_OTHERS 
TF_HIDDEN 
TF_ALL 

Definition at line 321 of file winefile.h.

00325                  {
00326     TF_DIRECTORIES  = 0x01,
00327     TF_PROGRAMS     = 0x02,
00328     TF_DOCUMENTS    = 0x04,


Function Documentation

Entry* alloc_entry ( void   ) 

Definition at line 25 of file entries.c.

References PropertiesDialog::entry, _Entry::folder, heap_alloc, _Entry::hicon, and _Entry::pidl.

Referenced by read_directory_shell(), and read_directory_win().

00026 {
00027     Entry* entry = (Entry*) heap_alloc(sizeof(Entry));
00028 
00029 #ifdef _SHELL_FOLDERS
00030     entry->pidl = NULL;
00031     entry->folder = NULL;
00032     entry->hicon = 0;
00033 #endif
00034 
00035     return entry;
00036 }

Here is the caller graph for this function:

void choose_font ( HWND  hwnd  )  [inline]

Definition at line 38 of file dialogs.c.

References BUFFER_LEN, Globals, WINEFILE_GLOBALS::hfont, WINEFILE_GLOBALS::hInstance, WINEFILE_GLOBALS::hmdiclient, _Pane::hwnd, IDS_FONT_SEL_DLG_NAME, IDS_FONT_SEL_ERROR, IMAGE_HEIGHT, _ChildWnd::left, _ChildWnd::right, WINEFILE_GLOBALS::spaceSize, and sSpace.

Referenced by FrameWndProc().

00039 {
00040     WCHAR dlg_name[BUFFER_LEN], dlg_info[BUFFER_LEN];
00041     CHOOSEFONTW chFont;
00042     LOGFONTW lFont;
00043 
00044     HDC hdc = GetDC(hwnd);
00045     chFont.lStructSize = sizeof(CHOOSEFONT);
00046     chFont.hwndOwner = hwnd;
00047     chFont.hDC = NULL;
00048     chFont.lpLogFont = &lFont;
00049     chFont.Flags = CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_LIMITSIZE | CF_NOSCRIPTSEL;
00050     chFont.rgbColors = RGB(0,0,0);
00051     chFont.lCustData = 0;
00052     chFont.lpfnHook = NULL;
00053     chFont.lpTemplateName = NULL;
00054     chFont.hInstance = Globals.hInstance;
00055     chFont.lpszStyle = NULL;
00056     chFont.nFontType = SIMULATED_FONTTYPE;
00057     chFont.nSizeMin = 0;
00058     chFont.nSizeMax = 24;
00059 
00060     if (ChooseFontW(&chFont)) {
00061         HWND childWnd;
00062         HFONT hFontOld;
00063 
00064         DeleteObject(Globals.hfont);
00065         Globals.hfont = CreateFontIndirectW(&lFont);
00066         hFontOld = SelectObject(hdc, Globals.hfont);
00067         GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
00068 
00069         /* change font in all open child windows */
00070         for(childWnd=GetWindow(Globals.hmdiclient,GW_CHILD); childWnd; childWnd=GetNextWindow(childWnd,GW_HWNDNEXT)) {
00071             ChildWnd* child = (ChildWnd*) GetWindowLongPtrW(childWnd, GWLP_USERDATA);
00072             SendMessageW(child->left.hwnd, WM_SETFONT, (WPARAM)Globals.hfont, TRUE);
00073             SendMessageW(child->right.hwnd, WM_SETFONT, (WPARAM)Globals.hfont, TRUE);
00074             SendMessageW(child->left.hwnd, LB_SETITEMHEIGHT, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
00075             SendMessageW(child->right.hwnd, LB_SETITEMHEIGHT, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3));
00076             InvalidateRect(child->left.hwnd, NULL, TRUE);
00077             InvalidateRect(child->right.hwnd, NULL, TRUE);
00078         }
00079 
00080         SelectObject(hdc, hFontOld);
00081     }
00082     else if (CommDlgExtendedError()) {
00083         LoadStringW(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
00084         LoadStringW(Globals.hInstance, IDS_FONT_SEL_ERROR, dlg_info, BUFFER_LEN);
00085         MessageBoxW(hwnd, dlg_info, dlg_name, MB_OK);
00086     }
00087 
00088     ReleaseDC(hwnd, hdc);
00089 }

Here is the caller graph for this function:

BOOL CtxMenu_HandleMenuMsg ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)

Definition at line 56 of file shelltools.c.

References s_pctxmenu2, and s_pctxmenu3.

00057 {
00058     if (s_pctxmenu3) {
00059         if (SUCCEEDED((*s_pctxmenu3->lpVtbl->HandleMenuMsg)(s_pctxmenu3, nmsg, wparam, lparam)))
00060             return TRUE;
00061     }
00062 
00063     if (s_pctxmenu2)
00064         if (SUCCEEDED((*s_pctxmenu2->lpVtbl->HandleMenuMsg)(s_pctxmenu2, nmsg, wparam, lparam)))
00065             return TRUE;
00066 
00067     return FALSE;
00068 }

INT_PTR CALLBACK DestinationDlgProc ( HWND  hwnd,
UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)

Definition at line 166 of file dialogs.c.

References BUFFER_LEN, IDS_NO_IMPL, IDS_WINEFILE, and RS.

00167 {
00168     TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
00169 
00170     switch(nmsg) {
00171         case WM_INITDIALOG:
00172             SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
00173             SetWindowText(GetDlgItem(hwnd, 201), (LPCTSTR)lparam);
00174             return 1;
00175 
00176         case WM_COMMAND: {
00177             int id = (int)wparam;
00178 
00179             switch(id) {
00180               case IDOK: {
00181                 LPTSTR dest = (LPTSTR) GetWindowLongPtr(hwnd, GWLP_USERDATA);
00182                 GetWindowText(GetDlgItem(hwnd, 201), dest, MAX_PATH);
00183                 EndDialog(hwnd, id);
00184                 break;}
00185 
00186               case IDCANCEL:
00187                 EndDialog(hwnd, id);
00188                 break;
00189 
00190               case 254:
00191                 MessageBox(hwnd, RS(b1,IDS_NO_IMPL), RS(b2,IDS_WINEFILE), MB_OK);
00192                 break;
00193             }
00194 
00195             return 1;
00196         }
00197     }
00198 
00199     return 0;
00200 }

void display_error ( HWND  hwnd,
DWORD  error 
)

Definition at line 65 of file winefile.c.

References BUFFER_LEN, IDS_ERROR, IDS_WINEFILE, and RS.

Referenced by FrameWndProc().

00066 {
00067     TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
00068     PTSTR msg;
00069 
00070     if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00071         0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL))
00072         MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
00073     else
00074         MessageBox(hwnd, RS(b1,IDS_ERROR), RS(b2,IDS_WINEFILE), MB_OK);
00075 
00076     LocalFree(msg);
00077 }

Here is the caller graph for this function:

void display_network_error ( HWND  hwnd  ) 

Definition at line 81 of file winefile.c.

References BUFFER_LEN, IDS_WINEFILE, and RS.

Referenced by FrameWndProc().

00082 {
00083     TCHAR msg[BUFFER_LEN], provider[BUFFER_LEN], b2[BUFFER_LEN];
00084     DWORD error;
00085 
00086     if (WNetGetLastError(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR)
00087         MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
00088 }

Here is the caller graph for this function:

INT_PTR CALLBACK ExecuteDialogDlgProc ( HWND  hwnd,
UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)

Definition at line 138 of file dialogs.c.

References ExecuteDialog::cmd, ExecuteDialog::cmdshow, and get_check().

Referenced by FrameWndProc().

00139 {
00140     static struct ExecuteDialog* dlg;
00141 
00142     switch(nmsg) {
00143         case WM_INITDIALOG:
00144             dlg = (struct ExecuteDialog*) lparam;
00145             return 1;
00146 
00147         case WM_COMMAND: {
00148             int id = (int)wparam;
00149 
00150             if (id == IDOK) {
00151                 GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH);
00152                 dlg->cmdshow = get_check(hwnd, 214) ? SW_SHOWMINIMIZED : SW_SHOWNORMAL;
00153                 EndDialog(hwnd, id);
00154             } else if (id == IDCANCEL)
00155                 EndDialog(hwnd, id);
00156 
00157             return 1;}
00158     }
00159 
00160     return 0;
00161 }

Here is the call graph for this function:

Here is the caller graph for this function:

INT_PTR CALLBACK FilterDialogDlgProc ( HWND  hwnd,
UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)

Definition at line 94 of file dialogs.c.

References FilterDialog::flags, get_check(), 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, set_check(), TF_DIRECTORIES, TF_DOCUMENTS, TF_HIDDEN, TF_OTHERS, and TF_PROGRAMS.

00095 {
00096     static struct FilterDialog* dlg;
00097 
00098     switch(nmsg) {
00099         case WM_INITDIALOG:
00100             dlg = (struct FilterDialog*) lparam;
00101             SetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern);
00102             set_check(hwnd, IDC_VIEW_TYPE_DIRECTORIES, dlg->flags&TF_DIRECTORIES);
00103             set_check(hwnd, IDC_VIEW_TYPE_PROGRAMS, dlg->flags&TF_PROGRAMS);
00104             set_check(hwnd, IDC_VIEW_TYPE_DOCUMENTS, dlg->flags&TF_DOCUMENTS);
00105             set_check(hwnd, IDC_VIEW_TYPE_OTHERS, dlg->flags&TF_OTHERS);
00106             set_check(hwnd, IDC_VIEW_TYPE_HIDDEN, dlg->flags&TF_HIDDEN);
00107             return 1;
00108 
00109         case WM_COMMAND: {
00110             int id = (int)wparam;
00111 
00112             if (id == IDOK) {
00113                 int flags = 0;
00114 
00115                 GetWindowText(GetDlgItem(hwnd, IDC_VIEW_PATTERN), dlg->pattern, MAX_PATH);
00116 
00117                 flags |= get_check(hwnd, IDC_VIEW_TYPE_DIRECTORIES) ? TF_DIRECTORIES : 0;
00118                 flags |= get_check(hwnd, IDC_VIEW_TYPE_PROGRAMS) ? TF_PROGRAMS : 0;
00119                 flags |= get_check(hwnd, IDC_VIEW_TYPE_DOCUMENTS) ? TF_DOCUMENTS : 0;
00120                 flags |= get_check(hwnd, IDC_VIEW_TYPE_OTHERS) ? TF_OTHERS : 0;
00121                 flags |= get_check(hwnd, IDC_VIEW_TYPE_HIDDEN) ? TF_HIDDEN : 0;
00122 
00123                 dlg->flags = flags;
00124 
00125                 EndDialog(hwnd, id);
00126             } else if (id == IDCANCEL)
00127                 EndDialog(hwnd, id);
00128 
00129             return 1;}
00130     }
00131 
00132     return 0;
00133 }

Here is the call graph for this function:

void format_date ( const FILETIME *  ft,
TCHAR *  buffer,
int  visible_cols 
)

Definition at line 1381 of file winefile.c.

References BUFFER_LEN, COL_DATE, COL_TIME, and sQMarks.

Referenced by draw_item(), and PropertiesDialogDlgProc().

01386 {
01387     SYSTEMTIME systime;
01388     FILETIME lft;
01389     int len = 0;
01390 
01391     *buffer = '\0';
01392 
01393     if (!ft->dwLowDateTime && !ft->dwHighDateTime)
01394         return;
01395 
01396     if (!FileTimeToLocalFileTime(ft, &lft))
01397         {err: lstrcpy(buffer,sQMarks); return;}
01398 
01399     if (!FileTimeToSystemTime(&lft, &systime))
01400         goto err;
01401 
01402     if (visible_cols & COL_DATE) {
01403         len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer, BUFFER_LEN);
01404         if (!len)
01405             goto err;
01406     }
01407 
01408     if (visible_cols & COL_TIME) {
01409         if (len)
01410             buffer[len-1] = ' ';
01411 
01412         buffer[len++] = ' ';
01413 

Here is the caller graph for this function:

void free_entries ( Entry dir  ) 

Definition at line 56 of file entries.c.

References _Entry::down, PropertiesDialog::entry, free_entries(), free_entry(), and _Entry::next.

Referenced by free_child_window(), free_entries(), and scan_entry().

00057 {
00058     Entry *entry, *next=dir->down;
00059 
00060     if (next) {
00061         dir->down = 0;
00062 
00063         do {
00064             entry = next;
00065             next = entry->next;
00066 
00067             free_entries(entry);
00068             free_entry(entry);
00069         } while(next);
00070     }
00071 }

Here is the call graph for this function:

Here is the caller graph for this function:

void get_path ( Entry dir,
PTSTR  path 
)

Definition at line 376 of file entries.c.

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

Referenced by get_to_absolute_pidl(), scan_entry(), and show_properties_dlg().

00377 {
00378     Entry* entry;
00379     int len = 0;
00380     int level = 0;
00381 
00382 #ifdef _SHELL_FOLDERS
00383     if (dir->etype == ET_SHELL) {
00384         SFGAOF attribs;
00385         HRESULT hr = S_OK;
00386 
00387         path[0] = '\0';
00388 
00389         attribs = 0;
00390 
00391         if (dir->folder)
00392             hr = IShellFolder_GetAttributesOf(dir->folder, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs);
00393 
00394         if (SUCCEEDED(hr) && (attribs&SFGAO_FILESYSTEM)) {
00395             IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop;
00396 
00397             hr = path_from_pidl(parent, dir->pidl, path, MAX_PATH);
00398         }
00399     }
00400     else
00401 #endif
00402     {
00403         for(entry=dir; entry; level++) {
00404             LPCTSTR name;
00405             int l;
00406 
00407             {
00408                 LPCTSTR s;
00409                 name = entry->data.cFileName;
00410                 s = name;
00411 
00412                 for(l=0; *s && *s!='/' && *s!='\\'; s++)
00413                     l++;
00414             }
00415 
00416             if (entry->up) {
00417                 if (l > 0) {
00418                     memmove(path+l+1, path, len*sizeof(TCHAR));
00419                     memcpy(path+1, name, l*sizeof(TCHAR));
00420                     len += l+1;
00421 
00422 #ifndef _NO_EXTENSIONS
00423                     if (entry->etype == ET_UNIX)
00424                         path[0] = '/';
00425                     else
00426 #endif
00427                     path[0] = '\\';
00428                 }
00429 
00430                 entry = entry->up;
00431             } else {
00432                 memmove(path+l, path, len*sizeof(TCHAR));
00433                 memcpy(path, name, l*sizeof(TCHAR));
00434                 len += l;
00435                 break;
00436             }
00437         }
00438 
00439         if (!level) {
00440 #ifndef _NO_EXTENSIONS
00441             if (entry->etype == ET_UNIX)
00442                 path[len++] = '/';
00443             else
00444 #endif
00445                 path[len++] = '\\';
00446         }
00447 
00448         path[len] = '\0';
00449     }
00450 }

Here is the caller graph for this function:

LPITEMIDLIST get_path_pidl ( LPCTSTR  path,
HWND  hwnd 
)

Definition at line 153 of file shellfs.c.

References Globals, and WINEFILE_GLOBALS::iDesktop.

Referenced by FrameWndProc(), and get_to_absolute_pidl().

00154 {
00155     LPITEMIDLIST pidl;
00156     HRESULT hr;
00157     ULONG len;
00158 
00159 #ifdef UNICODE
00160     LPCWSTR buffer = path;
00161 #else
00162     WCHAR buffer[MAX_PATH];
00163     MultiByteToWideChar(CP_ACP, 0, path, -1, buffer, MAX_PATH);
00164 #endif
00165 
00166     hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, (LPOLESTR)buffer, &len, &pidl, NULL);
00167     if (FAILED(hr))
00168         return NULL;
00169 
00170     return pidl;
00171 }

Here is the caller graph for this function:

LPITEMIDLIST get_to_absolute_pidl ( Entry entry,
HWND  hwnd 
)

Definition at line 176 of file shellfs.c.

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

00177 {
00178     if (entry->up && entry->up->etype==ET_SHELL) {
00179         IShellFolder* folder = entry->up->folder;
00180         WCHAR buffer[MAX_PATH];
00181 
00182         HRESULT hr = path_from_pidlW(folder, entry->pidl, buffer, MAX_PATH);
00183 
00184         if (SUCCEEDED(hr)) {
00185             LPITEMIDLIST pidl;
00186             ULONG len;
00187 
00188             hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
00189 
00190             if (SUCCEEDED(hr))
00191                 return pidl;
00192         }
00193     } else if (entry->etype == ET_WINDOWS) {
00194         TCHAR path[MAX_PATH];
00195 
00196         get_path(entry, path);
00197 
00198         return get_path_pidl(path, hwnd);
00199     } else if (entry->pidl)
00200         return ILClone(entry->pidl);
00201 
00202     return NULL;
00203 }

Here is the call graph for this function:

void load_registry_settings ( struct WINDOW_OPTIONS pOpts  ) 

Definition at line 82 of file settings.c.

References Globals, WINDOW_OPTIONS::height, WINEFILE_GLOBALS::hfont, reg_height, reg_logfont, reg_start_x, reg_start_y, reg_width, registry_key, WINDOW_OPTIONS::start_x, WINDOW_OPTIONS::start_y, and WINDOW_OPTIONS::width.

00083 {
00084     DWORD size;
00085     DWORD type;
00086     HKEY hKey;
00087     LOGFONT logfont;
00088 
00089     RegOpenKeyExW(HKEY_CURRENT_USER, registry_key, 0, KEY_QUERY_VALUE, &hKey);
00090 
00091     size = sizeof(DWORD);
00092 
00093     if (RegQueryValueExW(hKey, reg_start_x, NULL, &type,
00094                   (LPBYTE) &pOpts->start_x, &size) != ERROR_SUCCESS)
00095         pOpts->start_x = CW_USEDEFAULT;
00096 
00097     if (RegQueryValueExW(hKey, reg_start_y, NULL, &type,
00098                   (LPBYTE) &pOpts->start_y, &size) != ERROR_SUCCESS)
00099         pOpts->start_y = CW_USEDEFAULT;
00100 
00101     if (RegQueryValueExW(hKey, reg_width, NULL, &type,
00102                   (LPBYTE) &pOpts->width, &size) != ERROR_SUCCESS)
00103         pOpts->width = CW_USEDEFAULT;
00104 
00105     if (RegQueryValueExW(hKey, reg_height, NULL, &type,
00106                   (LPBYTE) &pOpts->height, &size) != ERROR_SUCCESS)
00107         pOpts->height = CW_USEDEFAULT;
00108 
00109     size = sizeof(logfont);
00110 
00111     if (RegQueryValueExW(hKey, reg_logfont, NULL, &type,
00112                   (LPBYTE) &logfont, &size) != ERROR_SUCCESS)
00113         GetObject(GetStockObject(DEFAULT_GUI_FONT),sizeof(logfont),&logfont);
00114 
00115     RegCloseKey(hKey);
00116 
00117     Globals.hfont = CreateFontIndirect(&logfont);
00118 }

LPTSTR load_string ( LPTSTR  buffer,
UINT  id 
)

Definition at line 56 of file winefile.c.

References BUFFER_LEN, Globals, and WINEFILE_GLOBALS::hInstance.

Referenced by alloc_child_window(), and read_tree().

00057 {
00058     LoadString(Globals.hInstance, id, buffer, BUFFER_LEN);
00059 
00060     return buffer;
00061 }

Here is the caller graph for this function:

HRESULT path_from_pidlA ( IShellFolder *  folder,
LPITEMIDLIST  pidl,
LPSTR  buffer,
int  len 
)

Definition at line 66 of file shellfs.c.

References free_strret(), and get_strretA().

00067 {
00068     STRRET str;
00069 
00070     /* SHGDN_FORPARSING: get full path of id list */
00071     HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
00072 
00073     if (SUCCEEDED(hr)) {
00074         get_strretA(&str, &pidl->mkid, buffer, len);
00075         free_strret(&str);
00076     } else
00077         buffer[0] = '\0';
00078 
00079     return hr;
00080 }

Here is the call graph for this function:

HRESULT path_from_pidlW ( IShellFolder *  folder,
LPITEMIDLIST  pidl,
LPWSTR  buffer,
int  len 
)

Definition at line 134 of file shellfs.c.

References free_strret(), and get_strretW().

Referenced by get_to_absolute_pidl().

00135 {
00136     STRRET str;
00137 
00138     /* SHGDN_FORPARSING: get full path of id list */
00139     HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
00140 
00141     if (SUCCEEDED(hr)) {
00142         get_strretW(&str, &pidl->mkid, buffer, len);
00143         free_strret(&str);
00144     } else
00145         buffer[0] = '\0';
00146 
00147     return hr;
00148 }

Here is the call graph for this function:

Here is the caller graph for this function:

void read_directory ( Entry dir,
LPCTSTR  path,
enum SORT_ORDER  sortOrder,
HWND  hwnd 
)

Definition at line 242 of file entries.c.

References _Entry::data, _Entry::down, PropertiesDialog::entry, ET_SHELL, ET_UNIX, _Entry::etype, Globals, _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().

00243 {
00244     TCHAR buffer[MAX_PATH];
00245     Entry* entry;
00246     LPCTSTR s;
00247     PTSTR d;
00248 
00249 #ifdef _SHELL_FOLDERS
00250     if (dir->etype == ET_SHELL)
00251     {
00252         read_directory_shell(dir, hwnd);
00253 
00254         if (Globals.prescan_node) {
00255             s = path;
00256             d = buffer;
00257 
00258             while(*s)
00259                 *d++ = *s++;
00260 
00261             *d++ = '\\';
00262 
00263             for(entry=dir->down; entry; entry=entry->next)
00264                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00265                     read_directory_shell(entry, hwnd);
00266                     SortDirectory(entry, sortOrder);
00267                 }
00268         }
00269     }
00270     else
00271 #endif
00272 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
00273     if (dir->etype == ET_UNIX)
00274     {
00275         read_directory_unix(dir, path);
00276 
00277         if (Globals.prescan_node) {
00278             s = path;
00279             d = buffer;
00280 
00281             while(*s)
00282                 *d++ = *s++;
00283 
00284             *d++ = '/';
00285 
00286             for(entry=dir->down; entry; entry=entry->next)
00287                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00288                     lstrcpy(d, entry->data.cFileName);
00289                     read_directory_unix(entry, buffer);
00290                     SortDirectory(entry, sortOrder);
00291                 }
00292         }
00293     }
00294     else
00295 #endif
00296     {
00297         read_directory_win(dir, path);
00298 
00299         if (Globals.prescan_node) {
00300             s = path;
00301             d = buffer;
00302 
00303             while(*s)
00304                 *d++ = *s++;
00305 
00306             *d++ = '\\';
00307 
00308             for(entry=dir->down; entry; entry=entry->next)
00309                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00310                     lstrcpy(d, entry->data.cFileName);
00311                     read_directory_win(entry, buffer);
00312                     SortDirectory(entry, sortOrder);
00313                 }
00314         }
00315     }
00316 
00317     SortDirectory(dir, sortOrder);
00318 }

Here is the call graph for this function:

Here is the caller graph for this function:

void read_directory_shell ( Entry dir,
HWND  hwnd 
)

Definition at line 368 of file shellfs.c.

References alloc_entry(), _Entry::bhfi_valid, _Entry::data, _Entry::down, PropertiesDialog::entry, 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().

00369 {
00370     IShellFolder* folder = dir->folder;
00371     int level = dir->level + 1;
00372     HRESULT hr;
00373 
00374     IShellFolder* child;
00375     IEnumIDList* idlist;
00376 
00377     Entry* first_entry = NULL;
00378     Entry* last = NULL;
00379     Entry* entry;
00380 
00381     if (!folder)
00382         return;
00383 
00384     hr = IShellFolder_EnumObjects(folder, hwnd, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE, &idlist);
00385 
00386     if (SUCCEEDED(hr)) {
00387         for(;;) {
00388 #define FETCH_ITEM_COUNT    32
00389             LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
00390             SFGAOF attribs;
00391             ULONG cnt = 0;
00392             ULONG n;
00393 
00394             memset(pidls, 0, sizeof(pidls));
00395 
00396             hr = IEnumIDList_Next(idlist, FETCH_ITEM_COUNT, pidls, &cnt);
00397             if (!SUCCEEDED(hr))
00398                 break;
00399 
00400             if (hr == S_FALSE)
00401                 break;
00402 
00403             for(n=0; n<cnt; ++n) {
00404                 entry = alloc_entry();
00405 
00406                 if (!first_entry)
00407                     first_entry = entry;
00408 
00409                 if (last)
00410                     last->next = entry;
00411 
00412                 memset(&entry->data, 0, sizeof(WIN32_FIND_DATA));
00413                 entry->bhfi_valid = FALSE;
00414 
00415                 attribs = ~SFGAO_FILESYSTEM;    /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daß "My Documents" anstatt von "Martin's Documents" angezeigt wird */
00416 
00417                 hr = IShellFolder_GetAttributesOf(folder, 1, (LPCITEMIDLIST*)&pidls[n], &attribs);
00418 
00419                 if (SUCCEEDED(hr)) {
00420                     if (attribs != (SFGAOF)~SFGAO_FILESYSTEM) {
00421                         fill_w32fdata_shell(folder, pidls[n], attribs, &entry->data);
00422 
00423                         entry->bhfi_valid = TRUE;
00424                     } else
00425                         attribs = 0;
00426                 } else
00427                     attribs = 0;
00428 
00429                 entry->pidl = pidls[n];
00430 
00431                 if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00432                     hr = IShellFolder_BindToObject(folder, pidls[n], 0, &IID_IShellFolder, (void**)&child);
00433 
00434                     if (SUCCEEDED(hr))
00435                         entry->folder = child;
00436                     else
00437                         entry->folder = NULL;
00438                 }
00439                 else
00440                     entry->folder = NULL;
00441 
00442                 if (!entry->data.cFileName[0])
00443                     /*hr = */name_from_pidl(folder, pidls[n], entry->data.cFileName, MAX_PATH, /*SHGDN_INFOLDER*/0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/);
00444 
00445                 /* get display icons for files and virtual objects */
00446                 if (!(entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
00447                     !(attribs & SFGAO_FILESYSTEM)) {
00448                     entry->hicon = extract_icon(folder, pidls[n]);
00449 
00450                     if (!entry->hicon)
00451                         entry->hicon = (HICON)-1;   /* don't try again later */
00452                 }
00453 
00454                 entry->down = NULL;
00455                 entry->up = dir;
00456                 entry->expanded = FALSE;
00457                 entry->scanned = FALSE;
00458                 entry->level = level;
00459 
00460 #ifndef _NO_EXTENSIONS
00461                 entry->etype = ET_SHELL;
00462                 entry->bhfi_valid = FALSE;
00463 #endif
00464 
00465                 last = entry;
00466             }
00467         }
00468 
00469         IEnumIDList_Release(idlist);
00470     }
00471 
00472     if (last)
00473         last->next = NULL;
00474 
00475     dir->down = first_entry;
00476     dir->scanned = TRUE;
00477 }

Here is the call graph for this function:

Here is the caller graph for this function:

void read_directory_win ( Entry dir,
LPCTSTR  path 
)

Definition at line 26 of file winfs.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().

00027 {
00028     Entry* first_entry = NULL;
00029     Entry* last = NULL;
00030     Entry* entry;
00031 
00032     int level = dir->level + 1;
00033     WIN32_FIND_DATA w32fd;
00034     HANDLE hFind;
00035 #ifndef _NO_EXTENSIONS
00036     HANDLE hFile;
00037 #endif
00038 
00039     TCHAR buffer[MAX_PATH], *p;
00040     for(p=buffer; *path; )
00041         *p++ = *path++;
00042 
00043     *p++ = '\\';
00044     p[0] = '*';
00045     p[1] = '\0';
00046 
00047     hFind = FindFirstFile(buffer, &w32fd);
00048 
00049     if (hFind != INVALID_HANDLE_VALUE) {
00050         do {
00051 #ifdef _NO_EXTENSIONS
00052             /* hide directory entry "." */
00053             if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00054                 LPCTSTR name = w32fd.cFileName;
00055 
00056                 if (name[0]=='.' && name[1]=='\0')
00057                     continue;
00058             }
00059 #endif
00060             entry = alloc_entry();
00061 
00062             if (!first_entry)
00063                 first_entry = entry;
00064 
00065             if (last)
00066                 last->next = entry;
00067 
00068             memcpy(&entry->data, &w32fd, sizeof(WIN32_FIND_DATA));
00069             entry->down = NULL;
00070             entry->up = dir;
00071             entry->expanded = FALSE;
00072             entry->scanned = FALSE;
00073             entry->level = level;
00074 
00075 #ifndef _NO_EXTENSIONS
00076             entry->etype = ET_WINDOWS;
00077             entry->bhfi_valid = FALSE;
00078 
00079             lstrcpy(p, entry->data.cFileName);
00080 
00081             hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00082                                 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00083 
00084             if (hFile != INVALID_HANDLE_VALUE) {
00085                 if (GetFileInformationByHandle(hFile, &entry->bhfi))
00086                     entry->bhfi_valid = TRUE;
00087 
00088                 CloseHandle(hFile);
00089             }
00090 #endif
00091 
00092             last = entry;
00093         } while(FindNextFile(hFind, &w32fd));
00094 
00095         if (last)
00096             last->next = NULL;
00097 
00098         FindClose(hFind);
00099     }
00100 
00101     dir->down = first_entry;
00102     dir->scanned = TRUE;
00103 }

Here is the call graph for this function:

Here is the caller graph for this function:

Entry* read_tree ( Root root,
LPCTSTR  path,
LPITEMIDLIST  pidl,
LPTSTR  drv,
enum SORT_ORDER  sortOrder,
HWND  hwnd 
)

Definition at line 323 of file entries.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().

00324 {
00325 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
00326     static const TCHAR sSlash[] = {'/', '\0'};
00327 #endif
00328     static const TCHAR sBackslash[] = {'\\', '\0'};
00329 
00330 #ifdef _SHELL_FOLDERS
00331     if (pidl)
00332     {
00333         /* read shell namespace tree */
00334         root->drive_type = DRIVE_UNKNOWN;
00335         drv[0] = '\\';
00336         drv[1] = '\0';
00337         load_string(root->volname, IDS_DESKTOP);
00338         root->fs_flags = 0;
00339         load_string(root->fs, IDS_SHELL);
00340 
00341         return read_tree_shell(root, pidl, sortOrder, hwnd);
00342     }
00343     else
00344 #endif
00345 #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
00346     if (*path == '/')
00347     {
00348         /* read unix file system tree */
00349         root->drive_type = GetDriveType(path);
00350 
00351         lstrcat(drv, sSlash);
00352         load_string(root->volname, IDS_ROOT_FS);
00353         root->fs_flags = 0;
00354         load_string(root->fs, IDS_UNIXFS);
00355 
00356         lstrcpy(root->path, sSlash);
00357 
00358         return read_tree_unix(root, path, sortOrder, hwnd);
00359     }
00360 #endif
00361 
00362     /* read WIN32 file system tree */
00363     root->drive_type = GetDriveType(path);
00364 
00365     lstrcat(drv, sBackslash);
00366     GetVolumeInformation(drv, root->volname, _MAX_FNAME, 0, 0, &root->fs_flags, root->fs, _MAX_DIR);
00367 
00368     lstrcpy(root->path, drv);
00369 
00370     return read_tree_win(root, path, sortOrder, hwnd);
00371 }

Here is the call graph for this function:

Here is the caller graph for this function:

Entry* read_tree_shell ( Root root,
LPITEMIDLIST  pidl,
enum SORT_ORDER  sortOrder,
HWND  hwnd 
)

Definition at line 257 of file shellfs.c.

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

Referenced by read_tree().

00258 {
00259     Entry* entry = &root->entry;
00260     Entry* next;
00261     LPITEMIDLIST next_pidl = pidl;
00262     IShellFolder* folder;
00263     IShellFolder* child = NULL;
00264     HRESULT hr;
00265 
00266     HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00267 
00268 #ifndef _NO_EXTENSIONS
00269     entry->etype = ET_SHELL;
00270 #endif
00271 
00272     folder = Globals.iDesktop;
00273 
00274     while(entry) {
00275         entry->pidl = next_pidl;
00276         entry->folder = folder;
00277 
00278         if (!pidl->mkid.cb)
00279             break;
00280 
00281         /* copy first element of item id list */
00282         next_pidl = IMalloc_Alloc(Globals.iMalloc, pidl->mkid.cb+sizeof(USHORT));
00283         memcpy(next_pidl, pidl, pidl->mkid.cb);
00284         ((LPITEMIDLIST)((LPBYTE)next_pidl+pidl->mkid.cb))->mkid.cb = 0;
00285 
00286         hr = IShellFolder_BindToObject(folder, next_pidl, 0, &IID_IShellFolder, (void**)&child);
00287         if (!SUCCEEDED(hr))
00288             break;
00289 
00290         read_directory(entry, NULL, sortOrder, hwnd);
00291 
00292         if (entry->down)
00293             entry->expanded = TRUE;
00294 
00295         next = find_entry_shell(entry, next_pidl);
00296         if (!next)
00297             break;
00298 
00299         folder = child;
00300         entry = next;
00301 
00302         /* go to next element */
00303         pidl = (LPITEMIDLIST) ((LPBYTE)pidl+pidl->mkid.cb);
00304     }
00305 
00306     SetCursor(old_cursor);
00307 
00308     return entry;
00309 }

Here is the call graph for this function:

Here is the caller graph for this function:

Entry* read_tree_win ( Root root,
LPCTSTR  path,
enum SORT_ORDER  sortOrder,
HWND  hwnd 
)

Definition at line 136 of file winfs.c.

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

Referenced by read_tree().

00137 {
00138     TCHAR buffer[MAX_PATH];
00139     Entry* entry = &root->entry;
00140     LPCTSTR s = path;
00141     PTSTR d = buffer;
00142 
00143     HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00144 
00145 #ifndef _NO_EXTENSIONS
00146     entry->etype = ET_WINDOWS;
00147 #endif
00148 
00149     while(entry) {
00150         while(*s && *s!='\\' && *s!='/')
00151             *d++ = *s++;
00152 
00153         while(*s=='\\' || *s=='/')
00154             s++;
00155 
00156         *d++ = '\\';
00157         *d = '\0';
00158 
00159         read_directory(entry, buffer, sortOrder, hwnd);
00160 
00161         if (entry->down)
00162             entry->expanded = TRUE;
00163 
00164         if (!*s)
00165             break;
00166 
00167         entry = find_entry_win(entry, s);
00168     }
00169 
00170     SetCursor(old_cursor);
00171 
00172     return entry;
00173 }

Here is the call graph for this function:

Here is the caller graph for this function:

void save_registry_settings ( void   ) 

Definition at line 37 of file settings.c.

References Globals, WINEFILE_GLOBALS::hfont, WINEFILE_GLOBALS::hMainWnd, reg_height, reg_logfont, reg_start_x, reg_start_y, reg_width, and registry_key.

Referenced by FrameWndProc().

00038 {
00039     WINDOWINFO wi;
00040     HKEY hKey;
00041     INT width, height;
00042     LOGFONT logfont;
00043 
00044     wi.cbSize = sizeof(WINDOWINFO);
00045     GetWindowInfo(Globals.hMainWnd, &wi);
00046     width = wi.rcWindow.right - wi.rcWindow.left;
00047     height = wi.rcWindow.bottom - wi.rcWindow.top;
00048 
00049     if (RegOpenKeyExW(HKEY_CURRENT_USER, registry_key,
00050                 0, KEY_SET_VALUE, &hKey) != ERROR_SUCCESS)
00051     {
00052         /* Unable to save registry settings - try to create key */
00053         if (RegCreateKeyExW(HKEY_CURRENT_USER, registry_key,
00054                       0, NULL, REG_OPTION_NON_VOLATILE,
00055                       KEY_SET_VALUE, NULL, &hKey, NULL) != ERROR_SUCCESS)
00056         {
00057             /* FIXME: Cannot create key */
00058             return;
00059         }
00060     }
00061 
00062     /* Save all of the settings */
00063     RegSetValueExW(hKey, reg_start_x, 0, REG_DWORD,
00064             (LPBYTE) &wi.rcWindow.left, sizeof(DWORD));
00065     RegSetValueExW(hKey, reg_start_y, 0, REG_DWORD,
00066             (LPBYTE) &wi.rcWindow.top, sizeof(DWORD));
00067     RegSetValueExW(hKey, reg_width, 0, REG_DWORD,
00068             (LPBYTE) &width, sizeof(DWORD));
00069     RegSetValueExW(hKey, reg_height, 0, REG_DWORD,
00070             (LPBYTE) &height, sizeof(DWORD));
00071     GetObject(Globals.hfont, sizeof(logfont), &logfont);
00072     RegSetValueExW(hKey, reg_logfont, 0, REG_BINARY,
00073             (LPBYTE) &logfont, sizeof(LOGFONT));
00074 
00075     /* TODO: Save more settings here (List vs. Detailed View, etc.) */
00076     RegCloseKey(hKey);
00077 }

Here is the caller graph for this function:

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

Definition at line 72 of file shelltools.c.

References CtxMenu_query_interfaces(), and CtxMenu_reset().

00073 {
00074     IContextMenu* pcm;
00075     BOOL executed = FALSE;
00076 
00077     HRESULT hr = IShellFolder_GetUIObjectOf(shell_folder, hwndParent, cidl, apidl, &IID_IContextMenu, NULL, (LPVOID*)&pcm);
00078 /*  HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm); */
00079 
00080     if (SUCCEEDED(hr)) {
00081         HMENU hmenu = CreatePopupMenu();
00082 
00083         pcm = CtxMenu_query_interfaces(pcm);
00084 
00085         if (hmenu) {
00086             hr = (*pcm->lpVtbl->QueryContextMenu)(pcm, hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
00087 
00088             if (SUCCEEDED(hr)) {
00089                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
00090 
00091                 CtxMenu_reset();
00092 
00093                 if (idCmd) {
00094                     CMINVOKECOMMANDINFO cmi;
00095 
00096                     cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
00097                     cmi.fMask = 0;
00098                     cmi.hwnd = hwndParent;
00099                     cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
00100                     cmi.lpParameters = NULL;
00101                     cmi.lpDirectory = NULL;
00102                     cmi.nShow = SW_SHOWNORMAL;
00103                     cmi.dwHotKey = 0;
00104                     cmi.hIcon = 0;
00105 
00106                     hr = (*pcm->lpVtbl->InvokeCommand)(pcm, &cmi);
00107                     executed = TRUE;
00108                 }
00109             } else
00110                 CtxMenu_reset();
00111         }
00112 
00113         IUnknown_Release(pcm);
00114     }
00115 
00116     return FAILED(hr)? hr: executed? S_OK: S_FALSE;
00117 }

Here is the call graph for this function:

void show_properties_dlg ( Entry entry,
HWND  hwnd 
)

Definition at line 382 of file dialogs.c.

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

00383 {
00384     struct PropertiesDialog dlg;
00385 
00386     memset(&dlg, 0, sizeof(struct PropertiesDialog));
00387     get_path(entry, dlg.path);
00388     memcpy(&dlg.entry, entry, sizeof(Entry));
00389 
00390     DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_DIALOG_PROPERTIES), hwnd, PropertiesDialogDlgProc, (LPARAM)&dlg);
00391 }

Here is the call graph for this function:


Variable Documentation

struct WINEFILE_GLOBALS Globals

Definition at line 50 of file winefile.c.

Referenced by calc_single_width(), calc_widths(), choose_font(), create_header(), create_tree_window(), draw_item(), fill_w32fdata_shell(), frame_get_clientspace(), FrameWndProc(), free_entry(), free_strret(), get_path(), get_path_pidl(), get_to_absolute_pidl(), init_output(), load_registry_settings(), load_string(), read_directory(), read_tree_shell(), resize_frame_rect(), save_registry_settings(), show_properties_dlg(), and toggle_child().

IContextMenu3* s_pctxmenu3

Definition at line 27 of file shelltools.c.

Referenced by CtxMenu_HandleMenuMsg(), CtxMenu_query_interfaces(), and CtxMenu_reset().

const TCHAR sEmpty[]

Definition at line 31 of file winefile.c.

Referenced by compareExt(), and create_tree_window().

const TCHAR sLongHexFmt[]

Definition at line 40 of file winefile.c.

Referenced by draw_item().

const TCHAR sLongNumFmt[]

Definition at line 41 of file winefile.c.

Referenced by draw_item(), and PropertiesDialogDlgProc().

const TCHAR sNumFmt[]

Definition at line 33 of file winefile.c.

Referenced by draw_item().

const TCHAR sQMarks[]

Definition at line 34 of file winefile.c.

Referenced by format_date().

const TCHAR sSpace[]

Definition at line 32 of file winefile.c.

Referenced by choose_font(), and init_output().


Winefile Source Code Documentation
generated on 15.09.2008 by doxygen

Winefile Homepage