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
5d19e6c3
Commit
5d19e6c3
authored
Jan 06, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted DlgDirList to Unicode.
parent
d888d36e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
36 deletions
+35
-36
dialog.c
windows/dialog.c
+35
-36
No files found.
windows/dialog.c
View file @
5d19e6c3
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
#include "wine/winuser16.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "controls.h"
#include "controls.h"
#include "heap.h"
#include "win.h"
#include "win.h"
#include "user.h"
#include "user.h"
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -1544,37 +1543,36 @@ static BOOL DIALOG_DlgDirSelect( HWND hwnd, LPSTR str, INT len,
...
@@ -1544,37 +1543,36 @@ static BOOL DIALOG_DlgDirSelect( HWND hwnd, LPSTR str, INT len,
/**********************************************************************
/**********************************************************************
* DIALOG_DlgDirList
* DIALOG_DlgDirList
W
*
*
* Helper function for DlgDirList*
* Helper function for DlgDirList*
W
*/
*/
static
INT
DIALOG_DlgDirList
(
HWND
hDlg
,
LP
STR
spec
,
INT
idLBox
,
static
INT
DIALOG_DlgDirList
W
(
HWND
hDlg
,
LPW
STR
spec
,
INT
idLBox
,
INT
idStatic
,
UINT
attrib
,
BOOL
combo
)
INT
idStatic
,
UINT
attrib
,
BOOL
combo
)
{
{
HWND
hwnd
;
HWND
hwnd
;
LPSTR
orig_spec
=
spec
;
LP
W
STR
orig_spec
=
spec
;
char
any
[]
=
"*.*"
;
WCHAR
any
[]
=
{
'*'
,
'.'
,
'*'
,
0
}
;
#define SENDMSG(msg,wparam,lparam) \
#define SENDMSG(msg,wparam,lparam) \
((attrib & DDL_POSTMSGS) ? PostMessage
A
( hwnd, msg, wparam, lparam ) \
((attrib & DDL_POSTMSGS) ? PostMessage
W
( hwnd, msg, wparam, lparam ) \
: SendMessage
A
( hwnd, msg, wparam, lparam ))
: SendMessage
W
( hwnd, msg, wparam, lparam ))
TRACE
(
"%p '%s' %d %d %04x
\n
"
,
TRACE
(
"%p %s %d %d %04x
\n
"
,
hDlg
,
debugstr_w
(
spec
),
idLBox
,
idStatic
,
attrib
);
hDlg
,
spec
?
spec
:
"NULL"
,
idLBox
,
idStatic
,
attrib
);
/* If the path exists and is a directory, chdir to it */
/* If the path exists and is a directory, chdir to it */
if
(
!
spec
||
!
spec
[
0
]
||
SetCurrentDirectory
A
(
spec
))
spec
=
any
;
if
(
!
spec
||
!
spec
[
0
]
||
SetCurrentDirectory
W
(
spec
))
spec
=
any
;
else
else
{
{
char
*
p
,
*
p2
;
WCHAR
*
p
,
*
p2
;
p
=
spec
;
p
=
spec
;
if
((
p2
=
strrchr
(
p
,
'\\'
)))
p
=
p2
;
if
((
p2
=
strrchr
W
(
p
,
'\\'
)))
p
=
p2
;
if
((
p2
=
strrchr
(
p
,
'/'
)))
p
=
p2
;
if
((
p2
=
strrchr
W
(
p
,
'/'
)))
p
=
p2
;
if
(
p
!=
spec
)
if
(
p
!=
spec
)
{
{
char
sep
=
*
p
;
WCHAR
sep
=
*
p
;
*
p
=
0
;
*
p
=
0
;
if
(
!
SetCurrentDirectory
A
(
spec
))
if
(
!
SetCurrentDirectory
W
(
spec
))
{
{
*
p
=
sep
;
/* Restore the original spec */
*
p
=
sep
;
/* Restore the original spec */
return
FALSE
;
return
FALSE
;
...
@@ -1583,7 +1581,7 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
...
@@ -1583,7 +1581,7 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
}
}
}
}
TRACE
(
"mask=%s
\n
"
,
spec
);
TRACE
(
"mask=%s
\n
"
,
debugstr_w
(
spec
)
);
if
(
idLBox
&&
((
hwnd
=
GetDlgItem
(
hDlg
,
idLBox
))
!=
0
))
if
(
idLBox
&&
((
hwnd
=
GetDlgItem
(
hDlg
,
idLBox
))
!=
0
))
{
{
...
@@ -1599,7 +1597,7 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
...
@@ -1599,7 +1597,7 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
}
}
if
(
SENDMSG
(
combo
?
CB_DIR
:
LB_DIR
,
if
(
SENDMSG
(
combo
?
CB_DIR
:
LB_DIR
,
(
attrib
&
(
DDL_DIRECTORY
|
DDL_DRIVES
))
|
DDL_EXCLUSIVE
,
(
attrib
&
(
DDL_DIRECTORY
|
DDL_DRIVES
))
|
DDL_EXCLUSIVE
,
(
LPARAM
)
"*.*"
)
==
LB_ERR
)
(
LPARAM
)
any
)
==
LB_ERR
)
return
FALSE
;
return
FALSE
;
}
}
else
else
...
@@ -1612,17 +1610,17 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
...
@@ -1612,17 +1610,17 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
if
(
idStatic
&&
((
hwnd
=
GetDlgItem
(
hDlg
,
idStatic
))
!=
0
))
if
(
idStatic
&&
((
hwnd
=
GetDlgItem
(
hDlg
,
idStatic
))
!=
0
))
{
{
char
temp
[
MAX_PATH
];
WCHAR
temp
[
MAX_PATH
];
GetCurrentDirectory
A
(
sizeof
(
temp
),
temp
);
GetCurrentDirectory
W
(
sizeof
(
temp
)
/
sizeof
(
WCHAR
),
temp
);
CharLower
A
(
temp
);
CharLower
W
(
temp
);
/* Can't use PostMessage() here, because the string is on the stack */
/* Can't use PostMessage() here, because the string is on the stack */
SetDlgItemText
A
(
hDlg
,
idStatic
,
temp
);
SetDlgItemText
W
(
hDlg
,
idStatic
,
temp
);
}
}
if
(
orig_spec
&&
(
spec
!=
orig_spec
))
if
(
orig_spec
&&
(
spec
!=
orig_spec
))
{
{
/* Update the original file spec */
/* Update the original file spec */
char
*
p
=
spec
;
WCHAR
*
p
=
spec
;
while
((
*
orig_spec
++
=
*
p
++
));
while
((
*
orig_spec
++
=
*
p
++
));
}
}
...
@@ -1632,23 +1630,24 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
...
@@ -1632,23 +1630,24 @@ static INT DIALOG_DlgDirList( HWND hDlg, LPSTR spec, INT idLBox,
/**********************************************************************
/**********************************************************************
* DIALOG_DlgDirList
W
* DIALOG_DlgDirList
A
*
*
* Helper function for DlgDirList*
W
* Helper function for DlgDirList*
A
*/
*/
static
INT
DIALOG_DlgDirList
W
(
HWND
hDlg
,
LPW
STR
spec
,
INT
idLBox
,
static
INT
DIALOG_DlgDirList
A
(
HWND
hDlg
,
LP
STR
spec
,
INT
idLBox
,
INT
idStatic
,
UINT
attrib
,
BOOL
combo
)
INT
idStatic
,
UINT
attrib
,
BOOL
combo
)
{
{
if
(
spec
)
if
(
spec
)
{
{
LPSTR
specA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
spec
);
INT
ret
,
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
spec
,
-
1
,
NULL
,
0
);
INT
ret
=
DIALOG_DlgDirList
(
hDlg
,
specA
,
idLBox
,
idStatic
,
LPWSTR
specW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
attrib
,
combo
);
MultiByteToWideChar
(
CP_ACP
,
0
,
spec
,
-
1
,
specW
,
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
specA
,
-
1
,
spec
,
0x7fffffff
);
ret
=
DIALOG_DlgDirListW
(
hDlg
,
specW
,
idLBox
,
idStatic
,
attrib
,
combo
);
HeapFree
(
GetProcessHeap
(),
0
,
specA
);
WideCharToMultiByte
(
CP_ACP
,
0
,
specW
,
-
1
,
spec
,
0x7fffffff
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
specW
);
return
ret
;
return
ret
;
}
}
return
DIALOG_DlgDirList
(
hDlg
,
NULL
,
idLBox
,
idStatic
,
attrib
,
combo
);
return
DIALOG_DlgDirList
W
(
hDlg
,
NULL
,
idLBox
,
idStatic
,
attrib
,
combo
);
}
}
...
@@ -1696,7 +1695,7 @@ BOOL WINAPI DlgDirSelectComboBoxExW( HWND hwnd, LPWSTR str, INT len,
...
@@ -1696,7 +1695,7 @@ BOOL WINAPI DlgDirSelectComboBoxExW( HWND hwnd, LPWSTR str, INT len,
INT
WINAPI
DlgDirListA
(
HWND
hDlg
,
LPSTR
spec
,
INT
idLBox
,
INT
WINAPI
DlgDirListA
(
HWND
hDlg
,
LPSTR
spec
,
INT
idLBox
,
INT
idStatic
,
UINT
attrib
)
INT
idStatic
,
UINT
attrib
)
{
{
return
DIALOG_DlgDirList
(
hDlg
,
spec
,
idLBox
,
idStatic
,
attrib
,
FALSE
);
return
DIALOG_DlgDirList
A
(
hDlg
,
spec
,
idLBox
,
idStatic
,
attrib
,
FALSE
);
}
}
...
@@ -1716,7 +1715,7 @@ INT WINAPI DlgDirListW( HWND hDlg, LPWSTR spec, INT idLBox,
...
@@ -1716,7 +1715,7 @@ INT WINAPI DlgDirListW( HWND hDlg, LPWSTR spec, INT idLBox,
INT
WINAPI
DlgDirListComboBoxA
(
HWND
hDlg
,
LPSTR
spec
,
INT
idCBox
,
INT
WINAPI
DlgDirListComboBoxA
(
HWND
hDlg
,
LPSTR
spec
,
INT
idCBox
,
INT
idStatic
,
UINT
attrib
)
INT
idStatic
,
UINT
attrib
)
{
{
return
DIALOG_DlgDirList
(
hDlg
,
spec
,
idCBox
,
idStatic
,
attrib
,
TRUE
);
return
DIALOG_DlgDirList
A
(
hDlg
,
spec
,
idCBox
,
idStatic
,
attrib
,
TRUE
);
}
}
...
...
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