Index: trunk/src/user32/new/loadres.cpp
===================================================================
--- trunk/src/user32/new/loadres.cpp	(revision 600)
+++ trunk/src/user32/new/loadres.cpp	(revision 601)
@@ -1,3 +1,3 @@
-/* $Id: loadres.cpp,v 1.6 1999-08-20 15:03:41 sandervl Exp $ */
+/* $Id: loadres.cpp,v 1.7 1999-08-20 20:09:50 sandervl Exp $ */
 
 /*
@@ -14,4 +14,5 @@
 #include <winres.h>
 #include <heapstring.h>
+#include <oslibres.h>
 
 //******************************************************************************
@@ -72,9 +73,21 @@
 HICON WIN32API LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon)
 {
- HICON rc;
-
-    rc = (HICON)FindResourceA(hinst, lpszIcon, RT_ICONA);
-    dprintf(("LoadIconA (%X) returned %d\n", hinst, rc));
-    return(rc);
+ Win32Resource *winres;
+ HICON          hIcon;
+
+    hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon);
+    if(hIcon == 0) {//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;
+    	}
+    }
+    dprintf(("LoadIconA (%X) returned %x\n", hinst, hIcon));
+
+    return(hIcon);
 }
 //******************************************************************************
@@ -82,9 +95,21 @@
 HICON WIN32API LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon)
 {
- HICON rc;
-
-    rc = (HICON)FindResourceW(hinst, lpszIcon, RT_ICONW);
-    dprintf(("LoadIconW (%X) returned %d\n", hinst, rc));
-    return(rc);
+ Win32Resource *winres;
+ HICON          hIcon;
+
+    hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon);
+    if(hIcon == 0) {//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;
+    	}
+    }
+    dprintf(("LoadIconW (%X) returned %x\n", hinst, hIcon));
+
+    return(hIcon);
 }
 //******************************************************************************
@@ -92,16 +117,43 @@
 HCURSOR WIN32API LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor)
 {
- HCURSOR rc;
-
-    if((int)lpszCursor >> 16 != 0) {//convert string name identifier to numeric id
-         dprintf(("LoadCursor %s\n", lpszCursor));
-	 lpszCursor = (LPCSTR)ConvertNameId(hinst, (char *)lpszCursor);
-    }
-    else dprintf(("LoadCursor %d\n", (int)lpszCursor));
-
-    rc = O32_LoadCursor(hinst, lpszCursor);
-
-    dprintf(("LoadCursor from %X returned %d\n", hinst, rc));
-    return(rc);
+ Win32Resource *winres;
+ HCURSOR        hCursor;
+
+    hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor);
+    if(hCursor == 0) {//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;
+    	}
+    }
+    dprintf(("LoadCursorA (%X) returned %x\n", hinst, hCursor));
+
+    return(hCursor);
+}
+//******************************************************************************
+//******************************************************************************
+HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor)
+{
+ Win32Resource *winres;
+ HCURSOR        hCursor;
+
+    hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor);
+    if(hCursor == 0) {//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;
+    	}
+    }
+    dprintf(("LoadCursorW (%X) returned %x\n", hinst, hCursor));
+
+    return(hCursor);
 }
 //******************************************************************************
@@ -111,20 +163,15 @@
  HBITMAP rc;
 
-  if((int)lpszBitmap >> 16 != 0) 
-  {  //convert string name identifier to numeric id
-    dprintf(("lpszBitmap [%s]\n",
-             lpszBitmap));
+  if(HIWORD(lpszBitmap) != 0) 
+  {  	//convert string name identifier to numeric id
+    	dprintf(("lpszBitmap [%s]\n", lpszBitmap));
     
-    lpszBitmap = (LPCSTR)ConvertNameId(hinst, 
-                                       (char *)lpszBitmap);
+    	lpszBitmap = (LPCSTR)ConvertNameId(hinst, (char *)lpszBitmap);
   }
-  else 
-    dprintf(("lpszBitmap %08xh\n",
-             (int)lpszBitmap));
+  else  dprintf(("lpszBitmap %08xh\n", (int)lpszBitmap));
 
   rc = O32_LoadBitmap(hinst, lpszBitmap);
 
-  dprintf(("LoadBitmapA returned %08xh\n",
-           rc));
+  dprintf(("LoadBitmapA returned %08xh\n", rc));
   
   return(rc);
@@ -137,5 +184,5 @@
  HBITMAP rc;
 
-    if((int)lpszBitmap >> 16 != 0) {//convert string name identifier to numeric id
+    if(HIWORD(lpszBitmap) != 0) {//convert string name identifier to numeric id
 	 astring = UnicodeToAsciiString((LPWSTR)lpszBitmap);
          dprintf(("lpszBitmap %s\n", astring));
@@ -153,25 +200,4 @@
 }
 //******************************************************************************
-//******************************************************************************
-HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor)
-{
- char   *astring = NULL;
- HCURSOR rc;
-
-    if((int)lpszCursor >> 16 != 0) {//convert string name identifier to numeric id
-	 astring = UnicodeToAsciiString((LPWSTR)lpszCursor);
-         dprintf(("lpszCursor %s\n", astring));
-	 lpszCursor = (LPWSTR)ConvertNameId(hinst, (char *)astring);
-    }
-    else dprintf(("lpszCursor %d\n", (int)lpszCursor));
-
-    rc = O32_LoadCursor(hinst, (char *)lpszCursor);
-    if(astring)
-	FreeAsciiString(astring);
-
-    dprintf(("LoadCursorW returned %d\n", rc));
-    return(rc);
-}
-//******************************************************************************
 //TODO: Far from complete, but works for loading resources from exe
 //fuLoad flag ignored
@@ -182,5 +208,5 @@
  HANDLE hRet = 0;
 
-  dprintf(("OS2LoadImageA NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
+  dprintf(("LoadImageA NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
 
   switch(uType) {
@@ -194,6 +220,9 @@
 		hRet = (HANDLE)LoadIconA(hinst, lpszName);
 		break;
+	default:
+		dprintf(("LoadImageA: unsupported type %d!!", uType));
+		return 0;
   }
-  dprintf(("OS2LoadImageA returned %d\n", (int)hRet));
+  dprintf(("LoadImageA returned %d\n", (int)hRet));
 
   return(hRet);
@@ -206,5 +235,5 @@
  HANDLE hRet = 0;
 
-  dprintf(("OS2LoadImageW NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
+  dprintf(("LoadImageW NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
 
   switch(uType) {
@@ -218,6 +247,9 @@
 		hRet = (HANDLE)LoadIconW(hinst, lpszName);
 		break;
+	default:
+		dprintf(("LoadImageW: unsupported type %d!!", uType));
+		return 0;
   }
-  dprintf(("OS2LoadImageW returned %d\n", (int)hRet));
+  dprintf(("LoadImageW returned %d\n", (int)hRet));
 
   return(hRet);
Index: trunk/src/user32/new/makefile
===================================================================
--- trunk/src/user32/new/makefile	(revision 600)
+++ trunk/src/user32/new/makefile	(revision 601)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.26 1999-08-20 11:52:18 sandervl Exp $
+# $Id: makefile,v 1.27 1999-08-20 20:09:51 sandervl Exp $
 
 #
@@ -103,9 +103,9 @@
 win32wndchild.obj: win32wndchild.cpp win32wndchild.h
 gen_object.obj: gen_object.cpp gen_object.h
-oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h oslibgdi.h
+oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h oslibgdi.h $(PDWIN32_INCLUDE)\winconst.h
 oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h
 oslibmsg.obj:   oslibmsg.cpp oslibmsg.h
 oslibgdi.obj:   oslibgdi.cpp oslibgdi.h
-oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h
+oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h
 
 clipboard.obj:  clipboard.cpp
Index: trunk/src/user32/new/oslibres.cpp
===================================================================
--- trunk/src/user32/new/oslibres.cpp	(revision 600)
+++ trunk/src/user32/new/oslibres.cpp	(revision 601)
@@ -1,3 +1,3 @@
-/* $Id: oslibres.cpp,v 1.4 1999-07-26 09:01:33 sandervl Exp $ */
+/* $Id: oslibres.cpp,v 1.5 1999-08-20 20:09:51 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -18,6 +18,6 @@
 
 #include <misc.h>
-#include <oslibwin.h>
-#include "oslibstyle.h"
+#include <winconst.h>
+#include "oslibwin.h"
 #include "oslibutil.h"
 #include "oslibmsg.h"
@@ -51,7 +51,7 @@
 }
 //******************************************************************************
-//todo: save mask handle somewhere
-//******************************************************************************
-HANDLE OSLibWinSetIcon(HWND hwnd, HANDLE hIcon, PVOID iconbitmap)
+//TODO: handle single icons
+//******************************************************************************
+HANDLE OSLibWinCreateIcon(PVOID iconbitmap)
 {
  POINTERINFO pointerInfo = {0};
@@ -60,44 +60,42 @@
  BITMAPFILEHEADER2 *bfh;
  HPS         hps;
+ HANDLE      hIcon;
 
     if(iconbitmap == NULL) {
-	dprintf(("OSLibWinSetIcon %x %x: iconbitmap == NULL!!", hwnd, hIcon));
+	dprintf(("OSLibWinCreateIcon iconbitmap == NULL!!"));
 	return 0;
     }
-    if(hIcon == 0) {
-	    //skip xor/and mask
-	    bfh = (BITMAPFILEHEADER2 *)((char *)&bafh->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2));
-	    hps = WinGetPS(hwnd);
-	    hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT, 
-		     	               (char *)bafh + bfh->offBits,
-	                               (BITMAPINFO2 *)&bfh->bmp2);
-	    if(hbmColor == GPI_ERROR) {
-	        dprintf(("OSLibWinSetIcon: GpiCreateBitmap failed!"));
-	        WinReleasePS(hps);
-	        return 0;
-	    }
-	    hbmMask = GpiCreateBitmap(hps, &bafh->bfh2.bmp2, CBM_INIT, 
-		     	              (char *)bafh + bafh->bfh2.offBits,
-	                              (BITMAPINFO2 *)&bafh->bfh2.bmp2);
-	    if(hbmMask == GPI_ERROR) {
-	        dprintf(("OSLibWinSetIcon: GpiCreateBitmap hbmMask failed!"));
-	        WinReleasePS(hps);
-	        return 0;
-	    }
-	
-	    pointerInfo.fPointer   = FALSE; //icon
-	    pointerInfo.xHotspot   = bfh->xHotspot;
-	    pointerInfo.yHotspot   = bfh->yHotspot;
-	    pointerInfo.hbmColor   = hbmColor;
-	    pointerInfo.hbmPointer = hbmMask;
-	    hIcon = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo);
-	    if(hIcon == NULL) {
-	        dprintf(("WinSetIcon: WinCreatePointerIndirect failed!"));
-		GpiDeleteBitmap(hbmMask);
-		GpiDeleteBitmap(hbmColor);
-		WinReleasePS(hps);
-	    }
-    }
-    WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0);
+    //skip xor/and mask
+    bfh = (BITMAPFILEHEADER2 *)((char *)&bafh->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2));
+    hps = WinGetPS(HWND_DESKTOP);
+    hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT, 
+	     	               (char *)bafh + bfh->offBits,
+                               (BITMAPINFO2 *)&bfh->bmp2);
+    if(hbmColor == GPI_ERROR) {
+        dprintf(("OSLibWinCreateIcon: GpiCreateBitmap failed!"));
+        WinReleasePS(hps);
+        return 0;
+    }
+    hbmMask = GpiCreateBitmap(hps, &bafh->bfh2.bmp2, CBM_INIT, 
+	     	              (char *)bafh + bafh->bfh2.offBits,
+                              (BITMAPINFO2 *)&bafh->bfh2.bmp2);
+    if(hbmMask == GPI_ERROR) {
+        dprintf(("OSLibWinCreateIcon: GpiCreateBitmap hbmMask failed!"));
+        GpiDeleteBitmap(hbmColor);
+        WinReleasePS(hps);
+        return 0;
+    }
+
+    pointerInfo.fPointer   = FALSE; //icon
+    pointerInfo.xHotspot   = bfh->xHotspot;
+    pointerInfo.yHotspot   = bfh->yHotspot;
+    pointerInfo.hbmColor   = hbmColor;
+    pointerInfo.hbmPointer = hbmMask;
+    hIcon = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo);
+    if(hIcon == NULL) {
+        dprintf(("OSLibWinCreateIcon: WinCreatePointerIndirect failed!"));
+    }
+    GpiDeleteBitmap(hbmMask);
+    GpiDeleteBitmap(hbmColor);
     WinReleasePS(hps);
     return hIcon;
@@ -105,3 +103,125 @@
 //******************************************************************************
 //******************************************************************************
-
+HANDLE OSLibWinCreatePointer(PVOID cursorbitmap)
+{
+ POINTERINFO pointerInfo = {0};
+ HBITMAP     hbmColor;
+ BITMAPFILEHEADER2 *bfh = (BITMAPFILEHEADER2 *)cursorbitmap;
+ HPS         hps;
+ HANDLE      hPointer;
+
+    if(cursorbitmap == NULL) {
+	dprintf(("OSLibWinCreatePointer cursorbitmap == NULL!!"));
+	return 0;
+    }
+    //skip xor/and mask
+    hps = WinGetPS(HWND_DESKTOP);
+    hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT, 
+	     	               (char *)bfh + bfh->offBits,
+                               (BITMAPINFO2 *)&bfh->bmp2);
+    if(hbmColor == GPI_ERROR) {
+        dprintf(("OSLibWinCreatePointer: GpiCreateBitmap failed!"));
+        WinReleasePS(hps);
+        return 0;
+    }
+
+    pointerInfo.fPointer   = TRUE;
+    pointerInfo.xHotspot   = bfh->xHotspot;
+    pointerInfo.yHotspot   = bfh->yHotspot;
+    pointerInfo.hbmColor   = 0;
+    pointerInfo.hbmPointer = hbmColor;
+    hPointer = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo);
+    if(hPointer == NULL) {
+        dprintf(("OSLibWinCreatePointer: WinCreatePointerIndirect failed!"));
+    }
+    GpiDeleteBitmap(hbmColor);
+    WinReleasePS(hps);
+    return hPointer;
+}
+//******************************************************************************
+//******************************************************************************
+HANDLE OSLibWinQuerySysIcon(ULONG type)
+{
+ ULONG os2type = 0;
+
+    switch(type) {
+    	case IDI_APPLICATION_W:
+		os2type = SPTR_PROGRAM;
+		break;
+	case IDI_HAND_W:
+		os2type = SPTR_ICONWARNING;
+		break;
+	case IDI_QUESTION_W:
+		os2type = SPTR_ICONQUESTION;
+		break;
+	case IDI_EXCLAMATION_W:
+		os2type = SPTR_ICONWARNING;
+		break;
+	case IDI_ASTERISK_W:
+		os2type = SPTR_ICONINFORMATION;
+		break;
+	default:
+		return 0;
+    }
+
+    return WinQuerySysPointer(HWND_DESKTOP, os2type, TRUE);
+}
+//******************************************************************************
+//******************************************************************************
+HANDLE OSLibWinQuerySysPointer(ULONG type)
+{
+ ULONG os2type = 0;
+
+    switch(type) {
+    	case IDC_ARROW_W:
+		os2type = SPTR_ARROW;
+		break;
+    	case IDC_UPARROW_W:
+		os2type = SPTR_ARROW;
+		break;
+    	case IDC_IBEAM_W:
+		os2type = SPTR_TEXT;
+		break;
+    	case IDC_ICON_W:
+		os2type = SPTR_PROGRAM;
+		break;
+    	case IDC_NO_W:
+		os2type = SPTR_ILLEGAL;
+		break;
+    	case IDC_CROSS_W:
+		os2type = SPTR_MOVE;
+		break;
+    	case IDC_SIZE_W:
+		os2type = SPTR_MOVE;
+		break;
+    	case IDC_SIZEALL_W:
+		os2type = SPTR_MOVE;
+		break;
+    	case IDC_SIZENESW_W:
+		os2type = SPTR_SIZENESW;
+		break;
+    	case IDC_SIZENS_W:
+		os2type = SPTR_SIZENS;
+		break;
+    	case IDC_SIZENWSE_W:
+		os2type = SPTR_SIZENWSE;
+		break;
+    	case IDC_SIZEWE_W:
+		os2type = SPTR_SIZEWE;
+		break;
+    	case IDC_WAIT_W:
+		os2type = SPTR_WAIT;
+		break;
+    	case IDC_APPSTARTING_W:
+		os2type = SPTR_WAIT;
+		break;
+	case IDC_HELP_W: //TODO: Create a cursor for this one
+		os2type = SPTR_WAIT;
+		break;
+	default:
+		return 0;
+    }
+    return WinQuerySysPointer(HWND_DESKTOP, os2type, TRUE);
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/new/oslibres.h
===================================================================
--- trunk/src/user32/new/oslibres.h	(revision 600)
+++ trunk/src/user32/new/oslibres.h	(revision 601)
@@ -1,3 +1,3 @@
-/* $Id: oslibres.h,v 1.1 1999-07-20 15:46:53 sandervl Exp $ */
+/* $Id: oslibres.h,v 1.2 1999-08-20 20:09:51 sandervl Exp $ */
 /*
  * Window GUI resource wrapper functions for OS/2
@@ -19,5 +19,8 @@
 HWND    OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate);
 HANDLE  OSLibWinSetAccelTable(HWND hwnd, HANDLE hAccel, PVOID acceltemplate);
-HANDLE  OSLibWinSetIcon(HWND hwnd, HANDLE hIcon, PVOID iconbitmap);
+HANDLE  OSLibWinCreateIcon(PVOID iconbitmap);
+HANDLE  OSLibWinCreatePointer(PVOID cursorbitmap);
+HANDLE  OSLibWinQuerySysPointer(ULONG type);
+HANDLE  OSLibWinQuerySysIcon(ULONG type);
 
 #endif //__OSLIBGDI_H__
Index: trunk/src/user32/new/oslibstyle.h
===================================================================
--- trunk/src/user32/new/oslibstyle.h	(revision 600)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/* $Id: oslibstyle.h,v 1.1 1999-07-14 08:35:35 sandervl Exp $ */
-/*
- * Win32 Window styles
- *
- *
- * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
- *
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
-#ifndef __OSLIBSTYLE_H__
-#define __OSLIBSTYLE_H__
-
-/* Window Styles */
-#define WINWS_OVERLAPPED    0x00000000L
-#define WINWS_POPUP         0x80000000L
-#define WINWS_CHILD         0x40000000L
-#define WINWS_MINIMIZE      0x20000000L
-#define WINWS_VISIBLE       0x10000000L
-#define WINWS_DISABLED      0x08000000L
-#define WINWS_CLIPSIBLINGS  0x04000000L
-#define WINWS_CLIPCHILDREN  0x02000000L
-#define WINWS_MAXIMIZE      0x01000000L
-#define WINWS_CAPTION       0x00C00000L
-#define WINWS_BORDER        0x00800000L
-#define WINWS_DLGFRAME      0x00400000L
-#define WINWS_VSCROLL       0x00200000L
-#define WINWS_HSCROLL       0x00100000L
-#define WINWS_SYSMENU       0x00080000L
-#define WINWS_THICKFRAME    0x00040000L
-#define WINWS_GROUP         0x00020000L
-#define WINWS_TABSTOP       0x00010000L
-#define WINWS_MINIMIZEBOX   0x00020000L
-#define WINWS_MAXIMIZEBOX   0x00010000L
-
-/* Window extended styles */
-#define WINWS_EX_DLGMODALFRAME    0x00000001L
-#define WINWS_EX_DRAGDETECT       0x00000002L
-#define WINWS_EX_NOPARENTNOTIFY   0x00000004L
-#define WINWS_EX_TOPMOST          0x00000008L
-#define WINWS_EX_ACCEPTFILES      0x00000010L
-#define WINWS_EX_TRANSPARENT      0x00000020L
-
-#endif //__OSLIBSTYLE_H__
Index: trunk/src/user32/new/oslibwin.cpp
===================================================================
--- trunk/src/user32/new/oslibwin.cpp	(revision 600)
+++ trunk/src/user32/new/oslibwin.cpp	(revision 601)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.cpp,v 1.21 1999-07-26 20:03:49 sandervl Exp $ */
+/* $Id: oslibwin.cpp,v 1.22 1999-08-20 20:09:51 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -18,6 +18,6 @@
 
 #include <misc.h>
-#include <oslibwin.h>
-#include "oslibstyle.h"
+#include <winconst.h>
+#include "oslibwin.h"
 #include "oslibutil.h"
 #include "oslibmsg.h"
@@ -87,46 +87,46 @@
 
   /* Window styles */
-  if(dwStyle & WINWS_MINIMIZE)
+  if(dwStyle & WS_MINIMIZE_W)
         *OSWinStyle |= WS_MINIMIZED;
 //Done explicitely in CreateWindowExA
 #if 0
-  if(dwStyle & WINWS_VISIBLE)
+  if(dwStyle & WS_VISIBLE_W)
         *OSWinStyle |= WS_VISIBLE;
 #endif
-  if(dwStyle & WINWS_DISABLED)
+  if(dwStyle & WS_DISABLED_W)
         *OSWinStyle |= WS_DISABLED;
-  if(dwStyle & WINWS_CLIPSIBLINGS)
+  if(dwStyle & WS_CLIPSIBLINGS_W)
         *OSWinStyle |= WS_CLIPSIBLINGS;
-  if(dwStyle & WINWS_CLIPCHILDREN)
+  if(dwStyle & WS_CLIPCHILDREN_W)
         *OSWinStyle |= WS_CLIPCHILDREN;
-  if(dwStyle & WINWS_MAXIMIZE)
+  if(dwStyle & WS_MAXIMIZE_W)
         *OSWinStyle |= WS_MAXIMIZED;
-  if(dwStyle & WINWS_GROUP)
+  if(dwStyle & WS_GROUP_W)
         *OSWinStyle |= WS_GROUP;
-  if(dwStyle & WINWS_TABSTOP)
+  if(dwStyle & WS_TABSTOP_W)
         *OSWinStyle |= WS_TABSTOP;
 
-  if(dwStyle & WINWS_CAPTION)
+  if(dwStyle & WS_CAPTION_W)
         *OSFrameStyle |= FCF_TITLEBAR;
-  if(dwStyle & WINWS_DLGFRAME)
+  if(dwStyle & WS_DLGFRAME_W)
         *OSFrameStyle |= FCF_DLGBORDER;
   else
-  if(dwStyle & WINWS_BORDER)
+  if(dwStyle & WS_BORDER_W)
         *OSFrameStyle |= FCF_BORDER;
 
-  if(dwStyle & WINWS_VSCROLL)
+  if(dwStyle & WS_VSCROLL_W)
         *OSFrameStyle |= FCF_VERTSCROLL;
-  if(dwStyle & WINWS_HSCROLL)
+  if(dwStyle & WS_HSCROLL_W)
         *OSFrameStyle |= FCF_HORZSCROLL;
-  if(dwStyle & WINWS_SYSMENU)
+  if(dwStyle & WS_SYSMENU_W)
         *OSFrameStyle |= FCF_SYSMENU;
-  if(dwStyle & WINWS_THICKFRAME)
+  if(dwStyle & WS_THICKFRAME_W)
         *OSFrameStyle |= FCF_SIZEBORDER;        //??
-  if(dwStyle & WINWS_MINIMIZEBOX)
+  if(dwStyle & WS_MINIMIZEBOX_W)
         *OSFrameStyle |= FCF_MINBUTTON;
-  if(dwStyle & WINWS_MAXIMIZEBOX)
+  if(dwStyle & WS_MAXIMIZEBOX_W)
         *OSFrameStyle |= FCF_MAXBUTTON;
 
-  if(dwExStyle & WINWS_EX_DLGMODALFRAME)
+  if(dwExStyle & WS_EX_DLGMODALFRAME_W)
         *OSFrameStyle |= FCF_DLGBORDER;
 
@@ -381,3 +381,9 @@
 //******************************************************************************
 //******************************************************************************
-
+BOOL OSLibWinSetIcon(HWND hwnd, HANDLE hIcon)
+{
+    return (BOOL) WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0);
+}
+//******************************************************************************
+//******************************************************************************
+
Index: trunk/src/user32/new/oslibwin.h
===================================================================
--- trunk/src/user32/new/oslibwin.h	(revision 600)
+++ trunk/src/user32/new/oslibwin.h	(revision 601)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.h,v 1.19 1999-07-26 20:03:49 sandervl Exp $ */
+/* $Id: oslibwin.h,v 1.20 1999-08-20 20:09:51 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -211,4 +211,5 @@
 
 BOOL  OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl);
+BOOL  OSLibWinSetIcon(HWND hwnd, HANDLE hIcon);
 
 #endif //__OSLIBWIN_H__
Index: trunk/src/user32/new/win32wnd.cpp
===================================================================
--- trunk/src/user32/new/win32wnd.cpp	(revision 600)
+++ trunk/src/user32/new/win32wnd.cpp	(revision 601)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.cpp,v 1.25 1999-08-16 15:54:11 dengert Exp $ */
+/* $Id: win32wnd.cpp,v 1.26 1999-08-20 20:09:51 sandervl Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -1346,17 +1346,6 @@
 BOOL Win32Window::SetIcon(HICON hIcon)
 {
- Win32Resource *winres = (Win32Resource *)hIcon;
- HANDLE         iconhandle;
-
-    if(HIWORD(hIcon) == 0) {
-        dprintf(("SetIcon: hIcon %x invalid", hIcon));
-        SetLastError(ERROR_INVALID_PARAMETER);
-        return FALSE;
-    }
     dprintf(("Win32Window::SetIcon %x", hIcon));
-    iconResource = winres;
-    iconhandle = OSLibWinSetIcon(OS2HwndFrame, winres->getOS2Handle(), winres->lockOS2Resource());
-    winres->setOS2Handle(iconhandle);
-    return(iconhandle != 0);
+    return OSLibWinSetIcon(OS2HwndFrame, hIcon);
 }
 //******************************************************************************
