From 5a2efbcb7d51732ad11c37ad22d569656ffdadd3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Wed, 22 Aug 2007 22:45:11 +0200 Subject: [PATCH] wordpad: Support drag-and-drop. --- programs/wordpad/wordpad.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 52ca75025c6..37b7368f334 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "resource.h" @@ -1230,6 +1231,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam) registry_read_filelist(hWnd); registry_read_options(); + DragAcceptFiles(hWnd, TRUE); return 0; } @@ -1759,6 +1761,17 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case WM_SIZE: return OnSize( hWnd, wParam, lParam ); + case WM_DROPFILES: + { + WCHAR file[MAX_PATH]; + DragQueryFileW((HDROP)wParam, 0, file, MAX_PATH); + DragFinish((HDROP)wParam); + + if(prompt_save_changes()) + DoOpenFile(file); + } + break; + default: return DefWindowProcW(hWnd, msg, wParam, lParam); } -- 2.11.4.GIT