Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
125102f5
Commit
125102f5
authored
Aug 25, 2000
by
Eric Pouech
Committed by
Alexandre Julliard
Aug 25, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved a bit the folder browsing implementation.
parent
010bc4e7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
52 deletions
+91
-52
brsfolder.c
dlls/shell32/brsfolder.c
+71
-28
shres.rc
dlls/shell32/shres.rc
+10
-7
shresdef.h
dlls/shell32/shresdef.h
+6
-0
shlobj.h
include/shlobj.h
+4
-17
No files found.
dlls/shell32/brsfolder.c
View file @
125102f5
#include <stdlib.h>
#include <string.h>
#include "winerror.h"
#include "heap.h"
#include "dlgs.h"
#include "debugtools.h"
#include "winreg.h"
#include "winnls.h"
#include "commctrl.h"
#include "wine/obj_base.h"
#include "wine/obj_enumidlist.h"
#include "wine/obj_shellfolder.h"
#include "wine/undocshell.h"
#include "shlguid.h"
#include "pidl.h"
#include "shell32_main.h"
#include "shellapi.h"
#include "sh
lguid
.h"
#include "sh
resdef
.h"
DEFAULT_DEBUG_CHANNEL
(
shell
);
#define IDD_TREEVIEW 99
DEFAULT_DEBUG_CHANNEL
(
shell
)
static
HWND
hwndTreeView
;
static
LPBROWSEINFOA
lpBrowseInfo
;
...
...
@@ -29,7 +17,7 @@ static LPITEMIDLIST pidlRet;
static
void
FillTreeView
(
LPSHELLFOLDER
lpsf
,
LPITEMIDLIST
lpifq
,
HTREEITEM
hParent
);
static
void
InitializeTreeView
(
HWND
hwndParent
)
static
void
InitializeTreeView
(
HWND
hwndParent
,
LPCITEMIDLIST
root
)
{
HIMAGELIST
hImageList
;
IShellFolder
*
lpsf
;
...
...
@@ -44,7 +32,22 @@ static void InitializeTreeView(HWND hwndParent)
{
TreeView_SetImageList
(
hwndTreeView
,
hImageList
,
0
);
}
/* so far, this method doesn't work (still missing the upper level), keep the old way */
#if 0
if (root == NULL) {
hr = SHGetDesktopFolder(&lpsf);
} else {
IShellFolder * lpsfdesktop;
hr = SHGetDesktopFolder(&lpsfdesktop);
if (SUCCEEDED(hr)) {
hr = IShellFolder_BindToObject(lpsfdesktop, root, 0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf);
IShellFolder_Release(lpsfdesktop);
}
}
#else
hr
=
SHGetDesktopFolder
(
&
lpsf
);
#endif
if
(
SUCCEEDED
(
hr
)
&&
hwndTreeView
)
{
TreeView_DeleteAllItems
(
hwndTreeView
);
...
...
@@ -54,6 +57,7 @@ static void InitializeTreeView(HWND hwndParent)
if
(
SUCCEEDED
(
hr
))
{
IShellFolder_Release
(
lpsf
);
}
TRACE
(
"done
\n
"
);
}
static
int
GetIcon
(
LPITEMIDLIST
lpi
,
UINT
uFlags
)
...
...
@@ -206,10 +210,12 @@ static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh)
case
TVN_SELCHANGEDA
:
lptvid
=
(
LPTV_ITEMDATA
)
pnmtv
->
itemNew
.
lParam
;
pidlRet
=
lptvid
->
lpifq
;
if
(
lpBrowseInfo
->
lpfn
)
(
lpBrowseInfo
->
lpfn
)(
hWnd
,
BFFM_SELCHANGED
,
(
LPARAM
)
pidlRet
,
lpBrowseInfo
->
lParam
);
break
;
default:
FIXME
(
"unhandled
\n
"
);
FIXME
(
"unhandled
(%d)
\n
"
,
pnmtv
->
hdr
.
code
);
break
;
}
break
;
...
...
@@ -233,17 +239,27 @@ static BOOL WINAPI BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
{
case
WM_INITDIALOG
:
pidlRet
=
NULL
;
lpBrowseInfo
=
(
LPBROWSEINFOA
)
lParam
;
if
(
lpBrowseInfo
->
lpfn
)
FIXME
(
"Callbacks not implemented
\n
"
);
if
(
lpBrowseInfo
->
ulFlags
)
FIXME
(
"flag %x not implemented
\n
"
,
lpBrowseInfo
->
ulFlags
);
if
(
lpBrowseInfo
->
lpszTitle
)
FIXME
(
"title %s not displayed
\n
"
,
lpBrowseInfo
->
lpszTitle
);
if
(
lpBrowseInfo
->
ulFlags
&
~
(
BIF_STATUSTEXT
))
FIXME
(
"flags %x not implemented
\n
"
,
lpBrowseInfo
->
ulFlags
&
~
(
BIF_STATUSTEXT
));
if
(
lpBrowseInfo
->
lpszTitle
)
{
SetWindowTextA
(
GetDlgItem
(
hWnd
,
IDD_TITLE
),
lpBrowseInfo
->
lpszTitle
);
}
else
{
ShowWindow
(
GetDlgItem
(
hWnd
,
IDD_TITLE
),
SW_HIDE
);
}
if
(
!
(
lpBrowseInfo
->
ulFlags
&
BIF_STATUSTEXT
))
ShowWindow
(
GetDlgItem
(
hWnd
,
IDD_STATUS
),
SW_HIDE
);
if
(
lpBrowseInfo
->
pidlRoot
)
FIXME
(
"root is desktop
\n
"
);
InitializeTreeView
(
hWnd
);
return
1
;
InitializeTreeView
(
hWnd
,
lpBrowseInfo
->
pidlRoot
);
if
(
lpBrowseInfo
->
lpfn
)
{
(
lpBrowseInfo
->
lpfn
)(
hWnd
,
BFFM_INITIALIZED
,
0
,
lpBrowseInfo
->
lParam
);
(
lpBrowseInfo
->
lpfn
)(
hWnd
,
BFFM_SELCHANGED
,
0
/*FIXME*/
,
lpBrowseInfo
->
lParam
);
}
return
TRUE
;
case
WM_NOTIFY
:
MsgNotify
(
hWnd
,
(
UINT
)
wParam
,
(
LPNMHDR
)
lParam
);
...
...
@@ -260,10 +276,35 @@ static BOOL WINAPI BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
case
IDCANCEL
:
EndDialog
(
hWnd
,
0
);
return
TRUE
;
break
;
}
break
;
case
BFFM_SETSTATUSTEXTA
:
TRACE
(
"Set status %s
\n
"
,
debugstr_a
((
LPSTR
)
lParam
));
SetWindowTextA
(
GetDlgItem
(
hWnd
,
IDD_STATUS
),
(
LPSTR
)
lParam
);
break
;
case
BFFM_SETSTATUSTEXTW
:
TRACE
(
"Set status %s
\n
"
,
debugstr_w
((
LPWSTR
)
lParam
));
SetWindowTextW
(
GetDlgItem
(
hWnd
,
IDD_STATUS
),
(
LPWSTR
)
lParam
);
break
;
case
BFFM_ENABLEOK
:
TRACE
(
"Enable %ld
\n
"
,
lParam
);
EnableWindow
(
GetDlgItem
(
hWnd
,
1
),
(
lParam
)
?
TRUE
:
FALSE
);
break
;
case
BFFM_SETSELECTIONA
:
if
(
wParam
)
TRACE
(
"Set selection %s
\n
"
,
debugstr_a
((
LPSTR
)
lParam
));
else
TRACE
(
"Set selection %p
\n
"
,
(
void
*
)
lParam
);
break
;
case
BFFM_SETSELECTIONW
:
if
(
wParam
)
TRACE
(
"Set selection %s
\n
"
,
debugstr_w
((
LPWSTR
)
lParam
));
else
TRACE
(
"Set selection %p
\n
"
,
(
void
*
)
lParam
);
break
;
}
return
0
;
return
FALSE
;
}
/*************************************************************************
...
...
@@ -272,9 +313,11 @@ static BOOL WINAPI BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
*/
LPITEMIDLIST
WINAPI
SHBrowseForFolderA
(
LPBROWSEINFOA
lpbi
)
{
TRACE
(
"(%p{lpszTitle=%s})
\n
"
,
lpbi
,
debugstr_a
(
lpbi
->
lpszTitle
));
TRACE
(
"(%p{lpszTitle=%s,owner=%i})
\n
"
,
lpbi
,
debugstr_a
(
lpbi
->
lpszTitle
),
lpbi
->
hwndOwner
);
return
(
LPITEMIDLIST
)
DialogBoxParamA
(
shell32_hInstance
,
"SHBRSFORFOLDER_MSGBOX"
,
lpbi
->
hwndOwner
,
"SHBRSFORFOLDER_MSGBOX"
,
lpbi
->
hwndOwner
,
BrsFolderDlgProc
,
(
INT
)
lpbi
);
}
dlls/shell32/shres.rc
View file @
125102f5
...
...
@@ -15,7 +15,7 @@
* and translated. The language 0,0 is a hack to get it
* loaded properly for all languages by pretending that
* they are neutral.
* The menus are not
j
et properly implemented.
* The menus are not
y
et properly implemented.
* Don't localize it yet. (js)
*/
...
...
@@ -91,17 +91,20 @@ BEGIN
MENUITEM "&Properties", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG 15, 40, 128, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Choose a Directory:"
FONT 8, "Helv"
{
DEFPUSHBUTTON "OK", 1, 4, 132, 50, 12
PUSHBUTTON "Cancel", 2, 58, 132, 50, 12
CONTROL "Tree1",99,"SysTreeView32",
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Cancel", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 18, 12
LTEXT "", IDD_STATUS, 4, 25, 18, 12
CONTROL "Tree1",IDD_TREEVIEW,"SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 4
, 12
0, 120
4, 4
0, 18
0, 120
}
/*
...
...
dlls/shell32/shresdef.h
View file @
125102f5
...
...
@@ -26,4 +26,10 @@
#define IDS_CREATEFOLDER_CAPTION 31
#define IDS_DELETEFOLDER_TEXT 32
#define IDS_DELETEFOLDER_CAPTION 33
/* browse for folder dialog box */
#define IDD_STATUS 97
#define IDD_TITLE 98
#define IDD_TREEVIEW 99
#endif
include/shlobj.h
View file @
125102f5
...
...
@@ -239,25 +239,12 @@ typedef struct tagBROWSEINFOW {
#define BFFM_SETSELECTIONW (WM_USER+103)
#define BFFM_SETSTATUSTEXTW (WM_USER+104)
/*
#ifdef UNICODE
#define SHBrowseForFolder SHBrowseForFolderW
#define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
#define BFFM_SETSELECTION BFFM_SETSELECTIONW
#define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
#else
#define SHBrowseForFolder SHBrowseForFolderA
#define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
#define BFFM_SETSELECTION BFFM_SETSELECTIONA
#define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
#endif
*/
LPITEMIDLIST
WINAPI
SHBrowseForFolderA
(
LPBROWSEINFOA
lpbi
);
LPITEMIDLIST
WINAPI
SHBrowseForFolder
32
W
(
LPBROWSEINFOW
lpbi
);
LPITEMIDLIST
WINAPI
SHBrowseForFolderW
(
LPBROWSEINFOW
lpbi
);
#define SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
#define BFFM_SETSTATUSTEXT WINELIB_NAME_AW(BFFM_SETSTATUSTEXT)
#define BFFM_SETSELECTION WINELIB_NAME_AW(BFFM_SETSELECTION)
#define BFFM_VALIDATEFAILED WINELIB_NAME_AW(BFFM_VALIDATEFAILED)
/****************************************************************************
* SHGetDataFromIDList API
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment