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
6c4aaf77
Commit
6c4aaf77
authored
Jan 25, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Always use original Open File dialog template.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8f21b352
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
filedlg.c
dlls/comdlg32/filedlg.c
+29
-21
No files found.
dlls/comdlg32/filedlg.c
View file @
6c4aaf77
...
@@ -248,11 +248,8 @@ static BOOL BrowseSelectedFolder(HWND hwnd);
...
@@ -248,11 +248,8 @@ static BOOL BrowseSelectedFolder(HWND hwnd);
*/
*/
static
BOOL
GetFileName95
(
FileOpenDlgInfos
*
fodInfos
)
static
BOOL
GetFileName95
(
FileOpenDlgInfos
*
fodInfos
)
{
{
LRESULT
lRes
;
LRESULT
lRes
;
LPCVOID
origTemplate
;
void
*
template
;
DWORD
dwSize
;
LPDLGTEMPLATEW
template
;
HRSRC
hRes
;
HRSRC
hRes
;
HANDLE
hDlgTmpl
=
0
;
HANDLE
hDlgTmpl
=
0
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -271,36 +268,25 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
...
@@ -271,36 +268,25 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
COMDLG32_SetCommDlgExtendedError
(
CDERR_FINDRESFAILURE
);
COMDLG32_SetCommDlgExtendedError
(
CDERR_FINDRESFAILURE
);
return
FALSE
;
return
FALSE
;
}
}
if
(
!
(
dwSize
=
SizeofResource
(
COMDLG32_hInstance
,
hRes
))
||
if
(
!
(
hDlgTmpl
=
LoadResource
(
COMDLG32_hInstance
,
hRes
))
||
!
(
hDlgTmpl
=
LoadResource
(
COMDLG32_hInstance
,
hRes
))
||
!
(
template
=
LockResource
(
hDlgTmpl
)))
!
(
origTemplate
=
LockResource
(
hDlgTmpl
)))
{
{
COMDLG32_SetCommDlgExtendedError
(
CDERR_LOADRESFAILURE
);
COMDLG32_SetCommDlgExtendedError
(
CDERR_LOADRESFAILURE
);
return
FALSE
;
return
FALSE
;
}
}
if
(
!
(
template
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
)))
{
COMDLG32_SetCommDlgExtendedError
(
CDERR_MEMALLOCFAILURE
);
return
FALSE
;
}
memcpy
(
template
,
origTemplate
,
dwSize
);
/* msdn: explorer style dialogs permit sizing by default.
/* msdn: explorer style dialogs permit sizing by default.
* The OFN_ENABLESIZING flag is only needed when a hook or
* The OFN_ENABLESIZING flag is only needed when a hook or
* custom t
me
plate is provided */
* custom t
em
plate is provided */
if
(
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_EXPLORER
)
&&
if
(
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_EXPLORER
)
&&
!
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_ENABLEHOOK
|
OFN_ENABLETEMPLATE
|
OFN_ENABLETEMPLATEHANDLE
)))
!
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_ENABLEHOOK
|
OFN_ENABLETEMPLATE
|
OFN_ENABLETEMPLATEHANDLE
)))
fodInfos
->
ofnInfos
->
Flags
|=
OFN_ENABLESIZING
;
fodInfos
->
ofnInfos
->
Flags
|=
OFN_ENABLESIZING
;
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
{
{
template
->
style
|=
WS_SIZEBOX
;
fodInfos
->
sizedlg
.
cx
=
fodInfos
->
sizedlg
.
cy
=
0
;
fodInfos
->
sizedlg
.
cx
=
fodInfos
->
sizedlg
.
cy
=
0
;
fodInfos
->
initial_size
.
x
=
fodInfos
->
initial_size
.
y
=
0
;
fodInfos
->
initial_size
.
x
=
fodInfos
->
initial_size
.
y
=
0
;
}
}
else
template
->
style
&=
~
WS_SIZEBOX
;
/* old style hook messages */
/* old style hook messages */
if
(
IsHooked
(
fodInfos
))
if
(
IsHooked
(
fodInfos
))
...
@@ -329,8 +315,6 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
...
@@ -329,8 +315,6 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
OleUninitialize
();
OleUninitialize
();
HeapFree
(
GetProcessHeap
(),
0
,
template
);
/* Unable to create the dialog */
/* Unable to create the dialog */
if
(
lRes
==
-
1
)
if
(
lRes
==
-
1
)
return
FALSE
;
return
FALSE
;
...
@@ -1286,7 +1270,31 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
...
@@ -1286,7 +1270,31 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
{
{
GetWindowRect
(
hwnd
,
&
rc
);
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
DWORD
ex_style
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
RECT
client
,
client_adjusted
;
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
{
style
|=
WS_SIZEBOX
;
ex_style
|=
WS_EX_WINDOWEDGE
;
}
else
style
&=
~
WS_SIZEBOX
;
SetWindowLongW
(
hwnd
,
GWL_STYLE
,
style
);
SetWindowLongW
(
hwnd
,
GWL_EXSTYLE
,
ex_style
);
GetClientRect
(
hwnd
,
&
client
);
GetClientRect
(
hwnd
,
&
client_adjusted
);
AdjustWindowRectEx
(
&
client_adjusted
,
style
,
FALSE
,
ex_style
);
GetWindowRect
(
hwnd
,
&
rc
);
rc
.
right
+=
client_adjusted
.
right
-
client
.
right
;
rc
.
bottom
+=
client_adjusted
.
bottom
-
client
.
bottom
;
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
SWP_FRAMECHANGED
|
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_NOMOVE
);
GetWindowRect
(
hwnd
,
&
rc
);
fodInfos
->
DlgInfos
.
hwndGrip
=
fodInfos
->
DlgInfos
.
hwndGrip
=
CreateWindowExA
(
0
,
"SCROLLBAR"
,
NULL
,
CreateWindowExA
(
0
,
"SCROLLBAR"
,
NULL
,
WS_CHILD
|
WS_GROUP
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CHILD
|
WS_GROUP
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
...
...
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