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
0913cdf0
Commit
0913cdf0
authored
Oct 24, 1998
by
Kai Morich
Committed by
Alexandre Julliard
Oct 24, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Drag*32 functions.
parent
6a387e50
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
189 additions
and
54 deletions
+189
-54
shell.spec
if1632/shell.spec
+4
-4
shell.h
include/shell.h
+28
-2
shell.c
misc/shell.c
+150
-41
main.c
programs/notepad/main.c
+1
-1
shell32.spec
relay32/shell32.spec
+6
-6
No files found.
if1632/shell.spec
View file @
0913cdf0
...
...
@@ -8,10 +8,10 @@ type win16
5 pascal RegSetValue(long str long str long) RegSetValue16
6 pascal RegQueryValue(long str ptr ptr) RegQueryValue16
7 pascal RegEnumKey(long long ptr long) RegEnumKey16
9 pascal16 DragAcceptFiles(word word) DragAcceptFiles
11 pascal16 DragQueryFile(word s_word ptr s_word) DragQueryFile
12 pascal16 DragFinish(word) DragFinish
13 pascal16 DragQueryPoint(word ptr) DragQueryPoint
9 pascal16 DragAcceptFiles(word word) DragAcceptFiles
16
11 pascal16 DragQueryFile(word s_word ptr s_word) DragQueryFile
16
12 pascal16 DragFinish(word) DragFinish
16
13 pascal16 DragQueryPoint(word ptr) DragQueryPoint
16
20 pascal16 ShellExecute(word str str str str s_word) ShellExecute16
21 pascal16 FindExecutable(str str ptr) FindExecutable16
22 pascal16 ShellAbout(word ptr ptr word) ShellAbout16
...
...
include/shell.h
View file @
0913cdf0
...
...
@@ -68,14 +68,40 @@ typedef WORD FILEOP_FLAGS;
typedef
WORD
PRINTEROP_FLAGS
;
/******************************
* DR
OPFILESTRUCT
* DR
AG&DROP API
*/
typedef
struct
{
/* structure for dropped files */
WORD
wSize
;
POINT16
ptMousePos
;
BOOL16
fInNonClientArea
;
/* memory block with filenames follows */
}
DROPFILESTRUCT
,
*
LPDROPFILESTRUCT
;
}
DROPFILESTRUCT16
,
*
LPDROPFILESTRUCT16
;
typedef
struct
{
/* structure for dropped files */
DWORD
lSize
;
POINT32
ptMousePos
;
BOOL32
fInNonClientArea
;
BOOL32
fWideChar
;
/* memory block with filenames follows */
}
DROPFILESTRUCT32
,
*
LPDROPFILESTRUCT32
;
DECL_WINELIB_TYPE
(
DROPFILESTRUCT
)
DECL_WINELIB_TYPE
(
LPDROPFILESTRUCT
)
void
WINAPI
DragAcceptFiles16
(
HWND16
hWnd
,
BOOL16
b
);
void
WINAPI
DragAcceptFiles32
(
HWND32
hWnd
,
BOOL32
b
);
#define DragAcceptFiles WINELIB_NAME(DragAcceptFiles)
UINT16
WINAPI
DragQueryFile16
(
HDROP16
hDrop
,
WORD
wFile
,
LPSTR
lpszFile
,
WORD
wLength
);
UINT32
WINAPI
DragQueryFile32A
(
HDROP32
hDrop
,
UINT32
lFile
,
LPSTR
lpszFile
,
UINT32
lLength
);
UINT32
WINAPI
DragQueryFile32W
(
HDROP32
hDrop
,
UINT32
lFile
,
LPWSTR
lpszFile
,
UINT32
lLength
);
#define DragQueryFile WINELIB_NAME_AW(DragQueryFile)
void
WINAPI
DragFinish32
(
HDROP32
h
);
void
WINAPI
DragFinish16
(
HDROP16
h
);
#define DragFinish WINELIB_NAME(DragFinish)
BOOL32
WINAPI
DragQueryPoint32
(
HDROP32
hDrop
,
POINT32
*
p
);
BOOL16
WINAPI
DragQueryPoint16
(
HDROP16
hDrop
,
POINT16
*
p
);
#define DragQueryPoint WINELIB_NAME(DragQueryPoint)
/****************************************************************************
* NOTIFYICONDATA
...
...
misc/shell.c
View file @
0913cdf0
...
...
@@ -65,82 +65,191 @@ static UINT16 uMsgWndDestroyed = 0;
static
UINT16
uMsgShellActivate
=
0
;
/*************************************************************************
* DragAcceptFiles
[SHELL.9
]
* DragAcceptFiles
32 [SHELL32.54
]
*/
void
WINAPI
DragAcceptFiles
(
HWND16
hWnd
,
BOOL16
b
)
{
WND
*
wnd
=
WIN_FindWndPtr
(
hWnd
);
void
WINAPI
DragAcceptFiles32
(
HWND32
hWnd
,
BOOL32
b
)
{
WND
*
wnd
=
WIN_FindWndPtr
(
hWnd
);
if
(
wnd
)
wnd
->
dwExStyle
=
b
?
wnd
->
dwExStyle
|
WS_EX_ACCEPTFILES
:
wnd
->
dwExStyle
&
~
WS_EX_ACCEPTFILES
;
}
if
(
wnd
)
wnd
->
dwExStyle
=
b
?
wnd
->
dwExStyle
|
WS_EX_ACCEPTFILES
:
wnd
->
dwExStyle
&
~
WS_EX_ACCEPTFILES
;
/*************************************************************************
* DragAcceptFiles16 [SHELL.9]
*/
void
WINAPI
DragAcceptFiles16
(
HWND16
hWnd
,
BOOL16
b
)
{
DragAcceptFiles32
(
hWnd
,
b
);
}
/*************************************************************************
* SHELL_DragQueryFile [internal]
*
*/
static
UINT32
SHELL_DragQueryFile
(
LPSTR
lpDrop
,
LPWSTR
lpwDrop
,
UINT32
lFile
,
LPSTR
lpszFile
,
LPWSTR
lpszwFile
,
UINT32
lLength
)
{
UINT32
i
;
i
=
0
;
if
(
lpDrop
)
{
while
(
i
++
<
lFile
)
{
while
(
*
lpDrop
++
);
/* skip filename */
if
(
!*
lpDrop
)
return
(
lFile
==
0xFFFFFFFF
)
?
i
:
0
;
}
}
if
(
lpwDrop
)
{
while
(
i
++
<
lFile
)
{
while
(
*
lpwDrop
++
);
/* skip filename */
if
(
!*
lpwDrop
)
return
(
lFile
==
0xFFFFFFFF
)
?
i
:
0
;
}
}
if
(
lpDrop
)
i
=
lstrlen32A
(
lpDrop
);
if
(
lpwDrop
)
i
=
lstrlen32W
(
lpwDrop
);
i
++
;
if
(
!
lpszFile
&&
!
lpszwFile
)
{
return
i
;
/* needed buffer size */
}
i
=
(
lLength
>
i
)
?
i
:
lLength
;
if
(
lpszFile
)
{
if
(
lpDrop
)
lstrcpyn32A
(
lpszFile
,
lpDrop
,
i
);
else
lstrcpynWtoA
(
lpszFile
,
lpwDrop
,
i
);
}
else
{
if
(
lpDrop
)
lstrcpynAtoW
(
lpszwFile
,
lpDrop
,
i
);
else
lstrcpyn32W
(
lpszwFile
,
lpwDrop
,
i
);
}
return
i
;
}
/*************************************************************************
* DragQueryFile
[SHELL.11
]
* DragQueryFile
32A [SHELL32.81] [shell32.82
]
*/
UINT
16
WINAPI
DragQueryFile
(
HDROP16
hDrop
,
WORD
w
File
,
LPSTR
lpszFile
,
WORD
w
Length
)
UINT
32
WINAPI
DragQueryFile32A
(
HDROP32
hDrop
,
UINT32
l
File
,
LPSTR
lpszFile
,
UINT32
l
Length
)
{
/* hDrop is a global memory block allocated with GMEM_SHARE
* with DROPFILESTRUCT as a header and filenames following
* it, zero length filename is in the end */
LPDROPFILESTRUCT
lpDropFileStruct
;
LPDROPFILESTRUCT
32
lpDropFileStruct
;
LPSTR
lpCurrent
;
WORD
i
;
UINT32
i
;
TRACE
(
shell
,
"(%04x, %i, %p, %u)
\n
"
,
hDrop
,
wFile
,
lpszFile
,
wLength
);
TRACE
(
shell
,
"(%08x, %x, %p, %u)
\n
"
,
hDrop
,
lFile
,
lpszFile
,
lLength
);
lpDropFileStruct
=
(
LPDROPFILESTRUCT
)
GlobalLock16
(
hDrop
);
if
(
!
lpDropFileStruct
)
return
0
;
lpDropFileStruct
=
(
LPDROPFILESTRUCT
32
)
GlobalLock32
(
hDrop
);
if
(
!
lpDropFileStruct
)
return
0
;
lpCurrent
=
(
LPSTR
)
lpDropFileStruct
+
lpDropFileStruct
->
wSize
;
lpCurrent
=
(
LPSTR
)
lpDropFileStruct
+
lpDropFileStruct
->
lSize
;
i
=
SHELL_DragQueryFile
(
lpCurrent
,
NULL
,
lFile
,
lpszFile
,
NULL
,
lLength
);
GlobalUnlock32
(
hDrop
);
return
i
;
}
/*************************************************************************
* DragQueryFile32W [shell32.133]
*/
UINT32
WINAPI
DragQueryFile32W
(
HDROP32
hDrop
,
UINT32
lFile
,
LPWSTR
lpszwFile
,
UINT32
lLength
)
{
LPDROPFILESTRUCT32
lpDropFileStruct
;
LPWSTR
lpwCurrent
;
UINT32
i
;
i
=
0
;
while
(
i
++
<
wFile
)
{
while
(
*
lpCurrent
++
);
/* skip filename */
if
(
!*
lpCurrent
)
return
(
wFile
==
0xFFFF
)
?
i
:
0
;
}
TRACE
(
shell
,
"(%08x, %x, %p, %u)
\n
"
,
hDrop
,
lFile
,
lpszwFile
,
lLength
);
i
=
strlen
(
lpCurrent
);
if
(
!
lpszFile
)
return
i
+
1
;
/* needed buffer size */
lpDropFileStruct
=
(
LPDROPFILESTRUCT32
)
GlobalLock32
(
hDrop
);
if
(
!
lpDropFileStruct
)
return
0
;
lpwCurrent
=
(
LPWSTR
)
lpDropFileStruct
+
lpDropFileStruct
->
lSize
;
i
=
SHELL_DragQueryFile
(
NULL
,
lpwCurrent
,
lFile
,
NULL
,
lpszwFile
,
lLength
);
GlobalUnlock32
(
hDrop
);
return
i
;
}
/*************************************************************************
* DragQueryFile16 [SHELL.11]
*/
UINT16
WINAPI
DragQueryFile16
(
HDROP16
hDrop
,
WORD
wFile
,
LPSTR
lpszFile
,
WORD
wLength
)
{
/* hDrop is a global memory block allocated with GMEM_SHARE
* with DROPFILESTRUCT as a header and filenames following
* it, zero length filename is in the end */
i
=
(
wLength
>
i
)
?
i
:
wLength
-
1
;
strncpy
(
lpszFile
,
lpCurrent
,
i
);
lpszFile
[
i
]
=
'\0'
;
LPDROPFILESTRUCT16
lpDropFileStruct
;
LPSTR
lpCurrent
;
WORD
i
;
TRACE
(
shell
,
"(%04x, %x, %p, %u)
\n
"
,
hDrop
,
wFile
,
lpszFile
,
wLength
);
lpDropFileStruct
=
(
LPDROPFILESTRUCT16
)
GlobalLock16
(
hDrop
);
if
(
!
lpDropFileStruct
)
return
0
;
lpCurrent
=
(
LPSTR
)
lpDropFileStruct
+
lpDropFileStruct
->
wSize
;
i
=
(
WORD
)
SHELL_DragQueryFile
(
lpCurrent
,
NULL
,
wFile
==
0xffff
?
0xffffffff
:
wFile
,
lpszFile
,
NULL
,
wLength
);
GlobalUnlock16
(
hDrop
);
return
i
;
}
/*************************************************************************
* DragFinish
[SHELL.12
]
* DragFinish
32 [SHELL32.80
]
*/
void
WINAPI
DragFinish
(
HDROP16
h
)
void
WINAPI
DragFinish32
(
HDROP32
h
)
{
TRACE
(
shell
,
"
\n
"
);
GlobalFree32
((
HGLOBAL32
)
h
);
}
/*************************************************************************
* DragFinish16 [SHELL.12]
*/
void
WINAPI
DragFinish16
(
HDROP16
h
)
{
TRACE
(
shell
,
"
\n
"
);
GlobalFree16
((
HGLOBAL16
)
h
);
}
/*************************************************************************
* DragQueryPoint
[SHELL.13
]
* DragQueryPoint
32 [SHELL32.135
]
*/
BOOL16
WINAPI
DragQueryPoint
(
HDROP16
hDrop
,
POINT16
*
p
)
{
LPDROPFILESTRUCT
lpDropFileStruct
;
BOOL16
bRet
;
BOOL32
WINAPI
DragQueryPoint32
(
HDROP32
hDrop
,
POINT32
*
p
)
{
LPDROPFILESTRUCT32
lpDropFileStruct
;
BOOL32
bRet
;
TRACE
(
shell
,
"
\n
"
);
lpDropFileStruct
=
(
LPDROPFILESTRUCT
)
GlobalLock16
(
hDrop
);
memcpy
(
p
,
&
lpDropFileStruct
->
ptMousePos
,
sizeof
(
POINT16
));
bRet
=
lpDropFileStruct
->
fInNonClientArea
;
lpDropFileStruct
=
(
LPDROPFILESTRUCT32
)
GlobalLock32
(
hDrop
);
memcpy
(
p
,
&
lpDropFileStruct
->
ptMousePos
,
sizeof
(
POINT32
));
bRet
=
lpDropFileStruct
->
fInNonClientArea
;
GlobalUnlock32
(
hDrop
);
return
bRet
;
}
GlobalUnlock16
(
hDrop
);
return
bRet
;
/*************************************************************************
* DragQueryPoint16 [SHELL.13]
*/
BOOL16
WINAPI
DragQueryPoint16
(
HDROP16
hDrop
,
POINT16
*
p
)
{
LPDROPFILESTRUCT16
lpDropFileStruct
;
BOOL16
bRet
;
TRACE
(
shell
,
"
\n
"
);
lpDropFileStruct
=
(
LPDROPFILESTRUCT16
)
GlobalLock16
(
hDrop
);
memcpy
(
p
,
&
lpDropFileStruct
->
ptMousePos
,
sizeof
(
POINT16
));
bRet
=
lpDropFileStruct
->
fInNonClientArea
;
GlobalUnlock16
(
hDrop
);
return
bRet
;
}
/*************************************************************************
...
...
programs/notepad/main.c
View file @
0913cdf0
...
...
@@ -103,7 +103,7 @@ LRESULT NOTEPAD_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
break
;
case
WM_DROPFILES
:
DragQueryFile
s
(
wParam
,
0
,
szFileName
,
sizeof
(
szFileName
));
DragQueryFile
(
wParam
,
0
,
szFileName
,
sizeof
(
szFileName
));
printf
(
"file %s to be opened by drag and drop !
\n
"
,
szFileName
);
DragFinish
(
wParam
);
break
;
...
...
relay32/shell32.spec
View file @
0913cdf0
...
...
@@ -59,7 +59,7 @@ init Shell32LibMain
51 stdcall PathResolve(str long long) PathResolve
52 stdcall PathGetArgs(str) PathGetArgs
53 stub DoEnvironmentSubstW@8 # exported by name
54 stdcall DragAcceptFiles(long long) DragAcceptFiles
# exported by name
54 stdcall DragAcceptFiles(long long) DragAcceptFiles
32
55 stub PathQuoteSpaces
56 stdcall PathUnquoteSpaces(str) PathUnquoteSpaces
57 stdcall PathGetDriveNumber (str) PathGetDriveNumber32
...
...
@@ -85,9 +85,9 @@ init Shell32LibMain
77 stdcall SHMapPIDLToSystemImageListIndex(long long long) SHMapPIDLToSystemImageListIndex
78 stdcall OleStrToStrN(str long wstr long) OleStrToStrN
79 stdcall StrToOleStrN(wstr long str long) StrToOleStrN
80 st
ub DragFinish # exported by name
81 st
ub DragQueryFile # exported by name
82 st
ub DragQueryFileA # exported by name
80 st
dcall DragFinish(long) DragFinish32
81 st
dcall DragQueryFile(long long ptr long) DragQueryFile32A
82 st
dcall DragQueryFileA(long long ptr long) DragQueryFile32A
83 stub CIDLData_CreateFromIDArray
84 stub SHIsBadInterfacePtr
85 stdcall OpenRegStream(long long long long) OpenRegStream
...
...
@@ -138,9 +138,9 @@ init Shell32LibMain
130 stub DAD_DragEnter
131 stub DAD_DragEnterEx
132 stub DAD_DragLeave
133 st
ub DragQueryFileW # exported by name
133 st
dcall DragQueryFileW(long long ptr long) DragQueryFile32W
134 stub DAD_DragMove
135 st
ub DragQueryPoint # exported by name
135 st
dcall DragQueryPoint(long ptr) DragQueryPoint32
136 stub DAD_SetDragImage
137 stdcall DAD_ShowDragImage (long) DAD_ShowDragImage
138 stub DuplicateIcon # exported by name
...
...
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