--- ./GUI.h.orig	2005-10-06 22:27:40.000000000 +0100
+++ ./GUI.h	2006-03-08 14:09:14.836250000 +0100
@@ -270,6 +270,7 @@
     DWORD       dwEventMask;
     DWORD       dwFlags;
     DWORD       dwFlagsMask;
+    int         iDropFiles;
 } PERLWIN32GUI_CREATESTRUCT, *LPPERLWIN32GUI_CREATESTRUCT;
 
 /*
@@ -306,7 +307,17 @@
     SV*         svCode;
 } PERLWIN32GUI_MENUITEMDATA, *LPPERLWIN32GUI_MENUITEMDATA;
 
+typedef struct tagPERLWIN32GUI_NMCUSTOMDRAWINFO {
+    NMHDR hdr;
+    DWORD dwDrawStage;
+    HDC   hdc;
+    RECT  rc;
+    DWORD* dwItemSpec;
+    UINT uItemState;
+    LPARAM lItemlParam;
+} PERLWIN32GUI_NMCUSTOMDRAW, *LPPERLWIN32GUI_NMCUSTOMDRAW;
+
 
 #define ValidUserData(ptr) (ptr != NULL && ptr->dwSize == sizeof(PERLWIN32GUI_USERDATA))
 #define PERLUD_FROM_WND(hwnd) \
--- ./GUI.pm.orig	2005-11-21 23:33:34.000000000 +0100
+++ ./GUI.pm	2006-03-08 15:07:04.648750000 +0100
@@ -24,7 +24,7 @@
 ###############################################################################
 # STATIC OBJECT PROPERTIES
 #
-$VERSION             = "1.03";        # For MakeMaker
+$VERSION             = "1.04";        # For MakeMaker
 $XS_VERSION          = $VERSION;      # For dynaloader
 $VERSION             = eval $VERSION; # For Perl  (see perldoc perlmodstyle)
 $MenuIdCounter       = 1;
@@ -884,7 +884,9 @@
     #     correctly.
     #   -dialogui => 0/1
     #     Act as a dialog box.
+    #   -dropfiles => 0/1 (default 0)
+    #     Accept DragAcceptFiles. Reacts on a DropFiles event.
 sub new {
     my $self = Win32::GUI->_new(Win32::GUI::constant("WIN32__GUI__WINDOW", 0), @_);
     if($self) {
--- ./GUI.xs.orig	2005-11-17 22:59:32.000000000 +0100
+++ ./GUI.xs	2006-03-08 15:30:33.008125000 +0100
@@ -975,7 +975,7 @@
 
 
     ###########################################################################
-    # (@)METHOD:DoEvents()
+    # (@)METHOD:DoEvents(hwnd=NULL,wMsgFilterMin=0,wMsgFilterMax=0,wRemoveMsg=PM_REMOVE)
     # Performs all pending GUI events and returns the status. If DoEvents()
     # returns -1, your GUI has normally terminated.
     #
@@ -985,8 +985,11 @@
     #
     # see also Dialog()
 DWORD
-DoEvents(hwnd=NULL)
+DoEvents(hwnd=NULL,wMsgFilterMin=0,wMsgFilterMax=0,wRemoveMsg=PM_REMOVE)
     HWND hwnd
+    UINT wMsgFilterMin
+    UINT wMsgFilterMax
+    UINT wRemoveMsg
 PREINIT:
     MSG msg;
     HWND phwnd;
@@ -1000,7 +1003,7 @@
     stayhere = 1;
     fIsDialog = FALSE;
     while(stayhere) {
-        stayhere = PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE);
+        stayhere = PeekMessage(&msg, hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
 #ifdef PERLWIN32GUI_STRONGDEBUG
         printf("XS(DoEvents): PeekMessage returned %d\n", stayhere);
 #endif
@@ -1418,6 +1421,10 @@
     moduleHandle = GetModuleHandle(NULL);
     // Attempt to load from current EXE:
     bitmap = (HBITMAP) LoadImage((HINSTANCE) moduleHandle, filename, iType, iX, iY, LR_DEFAULTCOLOR);
+    // Try OEM ressource
+    if(bitmap == NULL) {
+        bitmap = (HBITMAP) LoadImage((HINSTANCE) NULL, MAKEINTRESOURCE(filename), iType, iX, iY, LR_DEFAULTCOLOR);
+    }
     if(bitmap == NULL) {
         // Ok, that failed. So attempt to load from file:
         bitmap = (HBITMAP) LoadImage((HINSTANCE) NULL, filename, iType, iX, iY, iFlags);
@@ -5738,7 +5745,95 @@
         XSRETURN_UNDEF;
     }
 
+    ###########################################################################
+    # (@)PACKAGE:Win32::GUI::DragDrop
+    # Win32::GUI::DragDrop enables you to drag-n-drop files on
+    # Window and DialogBox windows.
+    #
+    # A Window can use the -dropfiles => 0|1 option to accept dropping files,
+    # or the DragAcceptFiles() method.
+    # The event can be registered via <name>_DropFiles, like:
+    # sub win_DropFiles { $files = Win32::GUI::DragDrop::DragQueryFiles(shift); }
+    ###########################################################################
+
+MODULE = Win32::GUI     PACKAGE = Win32::GUI::DragDrop
+
+#pragma message( "*** PACKAGE Win32::GUI::DragDrop..." )
+
+    ###########################################################################
+    # (@)METHOD:DragQueryFile(DragDrop, iFile)
+    # Retrieves the number or name of a dropped file that result from a successful 
+    # drag-and-drop operation.
+    #   iFile = 0xFFFFFFFF to return the number of files
+    #   iFile = 1 for the first file in the buffer.
+void
+DragQueryFile(hdrop, iFile)
+    HDROP hdrop
+    UINT  iFile
+PPCODE:
+    char szFile[1024];
+    int len;
+
+    if (len = DragQueryFileA(hdrop,iFile,szFile,1024) &&  iFile != 0xFFFFFFFF)
+        ST(0) = sv_2mortal(newSVpv(szFile,len));
+    else 
+        ST(0) = sv_2mortal(newSViv(len));
+
+    ###########################################################################
+    # (@)METHOD:DragQueryFiles(DragDrop)
+    # Returns an arrayref of the dropped files that result from a successful 
+    # drag-and-drop operation on a window or dialogbox.
+AV *
+DragQueryFiles(hdrop)
+    HDROP hdrop
+CODE:
+    char szFile[1024];
+    int len,i,n;
+
+    n = DragQueryFileA(hdrop,0xFFFFFFFF,szFile,1024);
+    if (!n) { XSRETURN_NO; }
+    RETVAL = newAV();
+    for (i=0; i<n; i++) {
+        if (len = DragQueryFileA(hdrop,i,szFile,1024))
+            av_push(RETVAL, newSVpvn(szFile, len));
+    }
+    DragFinish(hdrop);
+OUTPUT:
+    RETVAL
+
+    ###########################################################################
+    # (@)METHOD:DragQueryPoint(DragDrop)
+    # Returns the mouse position on a successful drag-and-drop operation.
+    #
+AV *
+DragQueryPoint(hdrop)
+    HDROP hdrop;
+CODE:
+    POINT point;
+
+    RETVAL = 0;
+    if (DragQueryPoint(hdrop, &point)) {
+       RETVAL = (AV*)sv_2mortal((SV*)newAV());
+       av_push(RETVAL, newSViv(point.x));
+       av_push(RETVAL, newSViv(point.y));
+    }
+OUTPUT:
+    RETVAL
+
+    ###########################################################################
+    # (@)INTERNAL:DESTROY(HANDLE)
+    # Releases memory that the system allocated for use in transferring file 
+    # names to the application.
+    # Called implicitly by DragQueryFiles.
+void
+DESTROY(handle)
+    HDROP handle
+CODE:
+    DragFinish(handle);
+
+
+    ###########################################################################
 
 
 BOOT:
--- ./TYPEMAP.orig	2004-04-04 19:01:34.000000000 +0100
+++ ./TYPEMAP	2006-03-08 11:56:29.008125000 +0100
@@ -12,7 +12,8 @@
 HBRUSH       T_HANDLE
 HPEN         T_HANDLE
 HRGN         T_HANDLE
+HDROP        T_HANDLE
 HTREEITEM    T_IV
 LONG         T_IV
 LPCTSTR      T_PV
--- ./Window.xs.orig	2005-11-13 19:57:52.000000000 +0100
+++ ./Window.xs	2006-03-08 15:20:17.430000000 +0100
@@ -81,6 +81,10 @@
         perlcs->hAcc = (HACCEL) handle_From(NOTXSCALL value);
         storing = newSViv((LONG) handle_From(NOTXSCALL value));
         stored = hv_store_mg(NOTXSCALL perlcs->hvSelf, "-accel", 6, storing, 0);
+    } else if(strcmp(option, "-dropfiles") == 0) {
+        perlcs->iDropFiles = (int) SvIV(value);
+        storing = newSViv((LONG) SvIV(value));
+        stored = hv_store_mg(NOTXSCALL perlcs->hvSelf, "-dropfiles", 10, storing, 0);
     } else if(strcmp(option, "-hasmaximize") == 0
     ||        strcmp(option, "-maximizebox") == 0) {
         SwitchBit(perlcs->cs.style, WS_MAXIMIZEBOX, SvIV(value));
@@ -112,6 +116,10 @@
 
 void 
 Window_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) {
+
+    if (perlcs->iDropFiles) {
+	DragAcceptFiles(myhandle, 1);
+    }
 }
 
 BOOL
@@ -127,6 +135,7 @@
     else if Parse_Event("Resize",     PERLWIN32GUI_NEM_CONTROL6)
     else if Parse_Event("Scroll",     PERLWIN32GUI_NEM_CONTROL7)
     else if Parse_Event("InitMenu",   PERLWIN32GUI_NEM_CONTROL8)
+    else if Parse_Event("DropFiles",  PERLWIN32GUI_NEM_DROPFILE)
     else if Parse_Event("Paint",      PERLWIN32GUI_NEM_PAINT)
     else retval = FALSE;
 
@@ -266,6 +275,20 @@
                              PERLWIN32GUI_ARGTYPE_INT, (int) wParam,
                              -1 );
         break;
+
+    case WM_DROPFILES :
+
+	/*
+	 * (@)EVENT:DropFiles(DROP_HANDLE)
+	 * Sent when the window receives dropped files. Puts just the handle and 
+         * not the Win32::GUI::DragDrop object onto the stack. So the event may only 
+         * called as function, not as method yet.
+	 * (@)APPLIES_TO:Window, DialogBox
+	 */
+	PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, "DropFiles",
+                             PERLWIN32GUI_ARGTYPE_LONG, wParam,
+                             -1 );
+        break;
     }
 
     return PerlResult;
@@ -452,7 +475,33 @@
 
 #pragma message( "*** PACKAGE Win32::GUI::Window..." )
 
+    ###########################################################################
+    # (@)METHOD:DragAcceptFiles(HANDLE, [ fAccept ] )
+    # Set or get the status whether a window or dialogbox accepts dropped files. Returns 0 or 1
+    #
+int
+DragAcceptFiles(handle,...)
+    HWND handle;
+CODE:
+    int  fAccept;
+    HV*  self;
+    SV** tmp;
+
+    RETVAL = -1;
+    self = (HV*) SvRV(ST(0));
+    if (self) {
+        if ( items > 1 ) {
+	    fAccept = SvIV(ST(1)) ? 1 : 0;
+	    DragAcceptFiles(handle, (BOOL)fAccept);
+	    RETVAL = fAccept;
+	} else {
+	    if (tmp = hv_fetch_mg(NOTXSCALL self, "-dropfiles", 10, 0))
+		RETVAL = SvIV(*tmp);;
+	}
+    }
+OUTPUT:
+    RETVAL
 
     ###########################################################################
     # (@)PACKAGE:Win32::GUI::DialogBox
