aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-01 04:38:20 +0000
committerRichard M. Stallman1998-05-01 04:38:20 +0000
commit12857dfd21cd7f07bc6b2a9731203f36824f81a4 (patch)
tree6bd1f4969322944cf82ddeb2635b1f542c45a3d9 /src
parentcb9e33d4a56f5bc9067df32244dbb4c4dfac5348 (diff)
downloademacs-12857dfd21cd7f07bc6b2a9731203f36824f81a4.tar.gz
emacs-12857dfd21cd7f07bc6b2a9731203f36824f81a4.zip
Include shellapi.h.
(construct_drag_n_drop): New function. (w32_read_socket): Handle WM_DROPFILES messages.
Diffstat (limited to 'src')
-rw-r--r--src/w32term.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 34045bf6ea4..7a329964fe7 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */
28#include "blockinput.h" 28#include "blockinput.h"
29 29
30#include "w32term.h" 30#include "w32term.h"
31#include <shellapi.h>
31 32
32#include "systty.h" 33#include "systty.h"
33#include "systime.h" 34#include "systime.h"
@@ -1408,6 +1409,52 @@ construct_mouse_wheel (result, msg, f)
1408 XSETFRAME (result->frame_or_window, f); 1409 XSETFRAME (result->frame_or_window, f);
1409} 1410}
1410 1411
1412static void
1413construct_drag_n_drop (result, msg, f)
1414 struct input_event *result;
1415 W32Msg *msg;
1416 struct frame *f;
1417{
1418 Lisp_Object files;
1419 Lisp_Object frame;
1420 HDROP hdrop;
1421 POINT p;
1422 WORD num_files;
1423 char *name;
1424 int i, len;
1425
1426 result->kind = drag_n_drop;
1427 result->code = 0;
1428 result->timestamp = msg->msg.time;
1429 result->modifiers = msg->dwModifiers;
1430
1431 p.x = LOWORD (msg->msg.lParam);
1432 p.y = HIWORD (msg->msg.lParam);
1433 ScreenToClient (msg->msg.hwnd, &p);
1434 XSETINT (result->x, p.x);
1435 XSETINT (result->y, p.y);
1436
1437 hdrop = (HDROP) msg->msg.wParam;
1438 DragQueryPoint (hdrop, &p);
1439 num_files = DragQueryFile (hdrop, 0xFFFFFFFF, NULL, 0);
1440 files = Qnil;
1441
1442 for (i = 0; i < num_files; i++)
1443 {
1444 len = DragQueryFile (hdrop, i, NULL, 0);
1445 if (len <= 0)
1446 continue;
1447 name = alloca (len + 1);
1448 DragQueryFile (hdrop, i, name, len + 1);
1449 files = Fcons (build_string (name), files);
1450 }
1451
1452 DragFinish (hdrop);
1453
1454 XSETFRAME (frame, f);
1455 result->frame_or_window = Fcons (frame, files);
1456}
1457
1411 1458
1412/* Function to report a mouse movement to the mainstream Emacs code. 1459/* Function to report a mouse movement to the mainstream Emacs code.
1413 The input handler calls this. 1460 The input handler calls this.
@@ -2991,6 +3038,18 @@ w32_read_socket (sd, bufp, numchars, expected)
2991 } 3038 }
2992 break; 3039 break;
2993 3040
3041 case WM_DROPFILES:
3042 f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
3043
3044 if (f)
3045 {
3046 construct_drag_n_drop (bufp, &msg, f);
3047 bufp++;
3048 count++;
3049 numchars--;
3050 }
3051 break;
3052
2994 case WM_VSCROLL: 3053 case WM_VSCROLL:
2995 { 3054 {
2996 struct scroll_bar *bar = 3055 struct scroll_bar *bar =