Index: trunk/src/user32/USER32.DEF
===================================================================
--- trunk/src/user32/USER32.DEF	(revision 3418)
+++ trunk/src/user32/USER32.DEF	(revision 3419)
@@ -1,3 +1,3 @@
-; $Id: USER32.DEF,v 1.29 2000-02-23 17:05:15 cbratschi Exp $
+; $Id: USER32.DEF,v 1.30 2000-04-18 11:12:59 sandervl Exp $
 
 ;Created by BLAST for IBM's compiler
@@ -635,4 +635,5 @@
     Win32ToOS2Handle__FUl      = Win32ToOS2Handle__15Win32BaseWindowFUl @2006
     OS2ToWin32Handle__FUl      = OS2ToWin32Handle__15Win32BaseWindowFUl @2012
+;    IsOS2FrameWindowHandle__FUlUl = IsOS2FrameWindowHandle__15Win32BaseWindowFUlUl @2013
 
     _MOUSE_Enable@4                                              @2007
Index: trunk/src/user32/loadres.cpp
===================================================================
--- trunk/src/user32/loadres.cpp	(revision 3418)
+++ trunk/src/user32/loadres.cpp	(revision 3419)
@@ -1,3 +1,3 @@
-/* $Id: loadres.cpp,v 1.25 2000-03-13 13:10:45 sandervl Exp $ */
+/* $Id: loadres.cpp,v 1.26 2000-04-18 11:12:59 sandervl Exp $ */
 
 /*
@@ -108,28 +108,46 @@
 //******************************************************************************
 //******************************************************************************
-HICON WIN32API LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon)
+HICON LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon, DWORD cxDesired,
+                DWORD cyDesired, DWORD fuLoad)
 {
  Win32Resource *winres;
  HICON          hIcon;
-
-    if (!hinst)
-    {
-      winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA);
-      if (!winres) winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA);
-      if (winres)
-      {
-        hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
-        delete winres;
-      } else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
-    } else
-    { //not a system icon
-        winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_ICONA);
-        if(winres == 0) {
-                winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_GROUP_ICONA);
-        }
-        if(winres) {
-                hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
-                delete winres;
-        } else hIcon = 0;
+ HANDLE 	hMapping = 0;
+ char 	       *ptr = NULL;
+
+    if(fuLoad & LR_LOADFROMFILE) 
+    {
+        hMapping = VIRTUAL_MapFileA( lpszIcon, (LPVOID *)&ptr, TRUE);
+        if(hMapping == INVALID_HANDLE_VALUE) 
+		return 0;
+       	hIcon = OSLibWinCreatePointer(ptr);
+	CloseHandle(hMapping);    
+    }
+    else
+    {
+    	if(!hinst)
+    	{
+	      	winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA);
+	      	if(!winres) 
+			winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA);
+	      	if(winres)
+	      	{
+	        	hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
+	        	delete winres;
+	      	} 
+		else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
+    	} 
+    	else
+    	{ //not a system icon
+	        winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_ICONA);
+	        if(winres == 0) {
+	                winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_GROUP_ICONA);
+	        }
+	        if(winres) {
+	                hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
+	                delete winres;
+	        } 
+		else 	hIcon = 0;
+	}
     }
     dprintf(("LoadIconA (%X) returned %x\n", hinst, hIcon));
@@ -139,28 +157,46 @@
 //******************************************************************************
 //******************************************************************************
-HICON WIN32API LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon)
+HICON LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon, DWORD cxDesired,
+                DWORD cyDesired, DWORD fuLoad)
 {
  Win32Resource *winres;
  HICON          hIcon;
-
-    if (!hinst)
-    {
-      winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW);
-      if (!winres) winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW);
-      if (winres)
-      {
-        hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
-        delete winres;
-      } else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
-    } else
-    {//not a system icon
-        winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_ICONW);
-        if(winres == 0) {
-                winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_GROUP_ICONW);
-        }
-        if(winres) {
-                hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
-                delete winres;
-        } else hIcon = 0;
+ HANDLE 	hMapping = 0;
+ char 	       *ptr = NULL;
+
+    if(fuLoad & LR_LOADFROMFILE) 
+    {
+        hMapping = VIRTUAL_MapFileW( lpszIcon, (LPVOID *)&ptr, TRUE);
+        if(hMapping == INVALID_HANDLE_VALUE) 
+		return 0;
+       	hIcon = OSLibWinCreatePointer(ptr);
+	CloseHandle(hMapping);    
+    }
+    else
+    {
+    	if (!hinst)
+    	{
+	      	winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW);
+	      	if(!winres) 
+			winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW);
+	      	if(winres)
+	      	{
+	        	hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
+	        	delete winres;
+	      	} 
+	      	else 	hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
+	} 
+	else
+    	{//not a system icon
+	        winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_ICONW);
+	        if(winres == 0) {
+	                winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_GROUP_ICONW);
+	        }
+	        if(winres) {
+	                hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
+	                delete winres;
+	        } 
+	        else 	hIcon = 0;
+	}
     }
     dprintf(("LoadIconW (%X) returned %x\n", hinst, hIcon));
@@ -170,28 +206,58 @@
 //******************************************************************************
 //******************************************************************************
-HCURSOR WIN32API LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor)
+HICON WIN32API LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon)
+{
+    return LoadIconA(hinst, lpszIcon, 0, 0, 0);
+}
+//******************************************************************************
+//******************************************************************************
+HICON WIN32API LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon)
+{
+    return LoadIconW(hinst, lpszIcon, 0, 0, 0);
+}
+//******************************************************************************
+//******************************************************************************
+HCURSOR LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor, DWORD cxDesired, 
+                    DWORD cyDesired, DWORD fuLoad)
 {
  Win32Resource *winres;
  HCURSOR        hCursor;
-
-    if (!hinst)
-    {
-      winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA);
-      if (!winres) winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA);
-      if (winres)
-      {
-        hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
-        delete winres;
-      } else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR));
-    } else
-    {//not a system pointer
-        winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_CURSORA);
-        if(winres == 0) {
-                winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_GROUP_CURSORA);
-        }
-        if(winres) {
-                hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
-                delete winres;
-        } else hCursor = 0;
+ HANDLE 	hMapping = 0;
+ char 	       *ptr = NULL;
+
+    if(fuLoad & LR_LOADFROMFILE) 
+    {
+        hMapping = VIRTUAL_MapFileA( lpszCursor, (LPVOID *)&ptr, TRUE);
+        if(hMapping == INVALID_HANDLE_VALUE) 
+		return 0;
+       	hCursor = OSLibWinCreatePointer(ptr);
+	CloseHandle(hMapping);    
+    }
+    else
+    {
+    	if (!hinst)
+    	{
+	      	winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA);
+	      	if(!winres) 
+			winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA);
+	      	if(winres)
+	      	{
+	        	hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
+	        	delete winres;
+	      	} 
+		else 	hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR));
+	} 
+	else
+	{//not a system pointer
+	        winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_CURSORA);
+	        if(winres == 0) {
+	                winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_GROUP_CURSORA);
+	        }
+        	if(winres) {
+	                hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
+	                delete winres;
+	        } 
+		else 	hCursor = 0;
+    	}
     }
     if(HIWORD(lpszCursor)) {
@@ -204,32 +270,62 @@
 //******************************************************************************
 //******************************************************************************
-HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor)
+HCURSOR LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor, DWORD cxDesired, 
+                    DWORD cyDesired, DWORD fuLoad)
 {
  Win32Resource *winres;
  HCURSOR        hCursor;
-
-    if (!hinst)
-    {
-      winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW);
-      if (!winres) winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW);
-      if (winres)
-      {
-        hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
-        delete winres;
-      } else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR));
-    } else
-    {//not a system pointer
-        winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_CURSORW);
-        if(winres == 0) {
-                winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_GROUP_CURSORW);
-        }
-        if(winres) {
-                hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
-                delete winres;
-        } else hCursor = 0;
+ HANDLE 	hMapping = 0;
+ char 	       *ptr = NULL;
+
+    if(fuLoad & LR_LOADFROMFILE) 
+    {
+        hMapping = VIRTUAL_MapFileW( lpszCursor, (LPVOID *)&ptr, TRUE);
+        if(hMapping == INVALID_HANDLE_VALUE) 
+		return 0;
+       	hCursor = OSLibWinCreatePointer(ptr);
+	CloseHandle(hMapping);    
+    }
+    else
+    {
+    	if(!hinst)
+    	{
+      		winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW);
+      		if(!winres) 
+			winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW);
+	      	if(winres)
+	      	{
+	        	hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
+	        	delete winres;
+	      	} 
+		else 	hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR));
+	    } 
+	    else
+	    {//not a system pointer
+	        winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_CURSORW);
+	        if(winres == 0) {
+	                winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_GROUP_CURSORW);
+	        }
+	        if(winres) {
+	                hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
+	                delete winres;
+	        } 
+		else 	hCursor = 0;
+	    }
     }
     dprintf(("LoadCursorW (%X) returned %x\n", hinst, hCursor));
 
     return(hCursor);
+}
+//******************************************************************************
+//******************************************************************************
+HCURSOR WIN32API LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor)
+{
+    return LoadCursorA(hinst, lpszCursor, 0, 0, 0);
+}
+//******************************************************************************
+//******************************************************************************
+HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor)
+{
+    return LoadCursorW(hinst, lpszCursor, 0, 0, 0);
 }
 //******************************************************************************
@@ -436,5 +532,5 @@
   else  dprintf(("LoadImageA NOT COMPLETE %x %x %d (%d,%d)\n", hinst, lpszName, uType, cxDesired, cyDesired));
 
-  if (fuLoad & LR_DEFAULTSIZE) {
+  if(fuLoad & LR_DEFAULTSIZE) {
         if (uType == IMAGE_ICON) {
             if (!cxDesired) cxDesired = GetSystemMetrics(SM_CXICON);
@@ -453,8 +549,8 @@
                 break;
         case IMAGE_CURSOR:
-                hRet = (HANDLE)LoadCursorA(hinst, lpszName);
+                hRet = (HANDLE)LoadCursorA(hinst, lpszName, cxDesired, cyDesired, fuLoad);
                 break;
         case IMAGE_ICON:
-                hRet = (HANDLE)LoadIconA(hinst, lpszName);
+                hRet = (HANDLE)LoadIconA(hinst, lpszName, cxDesired, cyDesired, fuLoad);
                 break;
         default:
@@ -492,8 +588,8 @@
                 break;
         case IMAGE_CURSOR:
-                hRet = (HANDLE)LoadCursorW(hinst, lpszName);
+                hRet = (HANDLE)LoadCursorW(hinst, lpszName, cxDesired, cyDesired, fuLoad);
                 break;
         case IMAGE_ICON:
-                hRet = (HANDLE)LoadIconW(hinst, lpszName);
+                hRet = (HANDLE)LoadIconW(hinst, lpszName, cxDesired, cyDesired, fuLoad);
                 break;
         default:
Index: trunk/src/user32/win32wbase.cpp
===================================================================
--- trunk/src/user32/win32wbase.cpp	(revision 3418)
+++ trunk/src/user32/win32wbase.cpp	(revision 3419)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.179 2000-04-15 15:11:14 sandervl Exp $ */
+/* $Id: win32wbase.cpp,v 1.180 2000-04-18 11:13:00 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -2903,4 +2903,6 @@
 }
 //******************************************************************************
+//Note: Should return NULL if window is frame window! (IsOS2FrameWindowHandle depends on this 
+//      behaviour)
 //******************************************************************************
 Win32BaseWindow *Win32BaseWindow::GetWindowFromOS2Handle(HWND hwnd)
@@ -2969,4 +2971,15 @@
     return 0;
 //    else    return hwnd;    //OS/2 window handle
+}
+//******************************************************************************
+//******************************************************************************
+BOOL Win32BaseWindow::IsOS2FrameWindowHandle(HWND hwndWin32, HWND hwndOS2)
+{
+ Win32BaseWindow *window = GetWindowFromHandle(hwndWin32);
+
+    if(window->getOS2FrameWindowHandle() == hwndOS2) {
+	return TRUE;
+    }
+    return FALSE;
 }
 //******************************************************************************
Index: trunk/src/user32/win32wbase.h
===================================================================
--- trunk/src/user32/win32wbase.h	(revision 3418)
+++ trunk/src/user32/win32wbase.h	(revision 3419)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.h,v 1.92 2000-04-10 19:40:46 sandervl Exp $ */
+/* $Id: win32wbase.h,v 1.93 2000-04-18 11:13:01 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -284,4 +284,5 @@
     static HWND Win32ToOS2FrameHandle(HWND hwnd);
     static HWND OS2ToWin32Handle(HWND hwnd);
+    static BOOL IsOS2FrameWindowHandle(HWND hwndWin32, HWND hwndOS2);
 
 static Win32BaseWindow *GetWindowFromHandle(HWND hwnd);
Index: trunk/src/user32/window.cpp
===================================================================
--- trunk/src/user32/window.cpp	(revision 3418)
+++ trunk/src/user32/window.cpp	(revision 3419)
@@ -1,3 +1,3 @@
-/* $Id: window.cpp,v 1.60 2000-04-13 18:50:44 sandervl Exp $ */
+/* $Id: window.cpp,v 1.61 2000-04-18 11:13:01 sandervl Exp $ */
 /*
  * Win32 window apis for OS/2
@@ -658,5 +658,4 @@
       window = windowDesktop;
 
-
     if(!window) {
         dprintf(("GetWindowRect, window %x not found", hwnd));
@@ -670,7 +669,4 @@
     *pRect = *window->getWindowRect(); //always in screen coordinates
 
-    if(hwnd == 0x68000034) {
-        window = 0;
-    }
     dprintf(("GetWindowRect %x (%d,%d) (%d,%d)", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom));
     return TRUE;
