Changeset 601 for trunk/src


Ignore:
Timestamp:
Aug 20, 1999, 10:09:51 PM (26 years ago)
Author:
sandervl
Message:

Icon + Cursor resource changes

Location:
trunk/src/user32/new
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/loadres.cpp

    r599 r601  
    1 /* $Id: loadres.cpp,v 1.6 1999-08-20 15:03:41 sandervl Exp $ */
     1/* $Id: loadres.cpp,v 1.7 1999-08-20 20:09:50 sandervl Exp $ */
    22
    33/*
     
    1414#include <winres.h>
    1515#include <heapstring.h>
     16#include <oslibres.h>
    1617
    1718//******************************************************************************
     
    7273HICON WIN32API LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon)
    7374{
    74  HICON rc;
    75 
    76     rc = (HICON)FindResourceA(hinst, lpszIcon, RT_ICONA);
    77     dprintf(("LoadIconA (%X) returned %d\n", hinst, rc));
    78     return(rc);
     75 Win32Resource *winres;
     76 HICON          hIcon;
     77
     78    hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon);
     79    if(hIcon == 0) {//not a system icon
     80        winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_ICONA);
     81        if(winres == 0) {
     82                winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_GROUP_ICONA);
     83        }
     84        if(winres) {
     85                hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
     86                delete winres;
     87        }
     88    }
     89    dprintf(("LoadIconA (%X) returned %x\n", hinst, hIcon));
     90
     91    return(hIcon);
    7992}
    8093//******************************************************************************
     
    8295HICON WIN32API LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon)
    8396{
    84  HICON rc;
    85 
    86     rc = (HICON)FindResourceW(hinst, lpszIcon, RT_ICONW);
    87     dprintf(("LoadIconW (%X) returned %d\n", hinst, rc));
    88     return(rc);
     97 Win32Resource *winres;
     98 HICON          hIcon;
     99
     100    hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon);
     101    if(hIcon == 0) {//not a system icon
     102        winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_ICONW);
     103        if(winres == 0) {
     104                winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_GROUP_ICONW);
     105        }
     106        if(winres) {
     107                hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
     108                delete winres;
     109        }
     110    }
     111    dprintf(("LoadIconW (%X) returned %x\n", hinst, hIcon));
     112
     113    return(hIcon);
    89114}
    90115//******************************************************************************
     
    92117HCURSOR WIN32API LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor)
    93118{
    94  HCURSOR rc;
    95 
    96     if((int)lpszCursor >> 16 != 0) {//convert string name identifier to numeric id
    97          dprintf(("LoadCursor %s\n", lpszCursor));
    98          lpszCursor = (LPCSTR)ConvertNameId(hinst, (char *)lpszCursor);
    99     }
    100     else dprintf(("LoadCursor %d\n", (int)lpszCursor));
    101 
    102     rc = O32_LoadCursor(hinst, lpszCursor);
    103 
    104     dprintf(("LoadCursor from %X returned %d\n", hinst, rc));
    105     return(rc);
     119 Win32Resource *winres;
     120 HCURSOR        hCursor;
     121
     122    hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor);
     123    if(hCursor == 0) {//not a system pointer
     124        winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_CURSORA);
     125        if(winres == 0) {
     126                winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_GROUP_CURSORA);
     127        }
     128        if(winres) {
     129                hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
     130                delete winres;
     131        }
     132    }
     133    dprintf(("LoadCursorA (%X) returned %x\n", hinst, hCursor));
     134
     135    return(hCursor);
     136}
     137//******************************************************************************
     138//******************************************************************************
     139HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor)
     140{
     141 Win32Resource *winres;
     142 HCURSOR        hCursor;
     143
     144    hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor);
     145    if(hCursor == 0) {//not a system pointer
     146        winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_CURSORW);
     147        if(winres == 0) {
     148                winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_GROUP_CURSORW);
     149        }
     150        if(winres) {
     151                hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
     152                delete winres;
     153        }
     154    }
     155    dprintf(("LoadCursorW (%X) returned %x\n", hinst, hCursor));
     156
     157    return(hCursor);
    106158}
    107159//******************************************************************************
     
    111163 HBITMAP rc;
    112164
    113   if((int)lpszBitmap >> 16 != 0)
    114   {  //convert string name identifier to numeric id
    115     dprintf(("lpszBitmap [%s]\n",
    116              lpszBitmap));
     165  if(HIWORD(lpszBitmap) != 0)
     166  {     //convert string name identifier to numeric id
     167        dprintf(("lpszBitmap [%s]\n", lpszBitmap));
    117168   
    118     lpszBitmap = (LPCSTR)ConvertNameId(hinst,
    119                                        (char *)lpszBitmap);
     169        lpszBitmap = (LPCSTR)ConvertNameId(hinst, (char *)lpszBitmap);
    120170  }
    121   else
    122     dprintf(("lpszBitmap %08xh\n",
    123              (int)lpszBitmap));
     171  else  dprintf(("lpszBitmap %08xh\n", (int)lpszBitmap));
    124172
    125173  rc = O32_LoadBitmap(hinst, lpszBitmap);
    126174
    127   dprintf(("LoadBitmapA returned %08xh\n",
    128            rc));
     175  dprintf(("LoadBitmapA returned %08xh\n", rc));
    129176 
    130177  return(rc);
     
    137184 HBITMAP rc;
    138185
    139     if((int)lpszBitmap >> 16 != 0) {//convert string name identifier to numeric id
     186    if(HIWORD(lpszBitmap) != 0) {//convert string name identifier to numeric id
    140187         astring = UnicodeToAsciiString((LPWSTR)lpszBitmap);
    141188         dprintf(("lpszBitmap %s\n", astring));
     
    153200}
    154201//******************************************************************************
    155 //******************************************************************************
    156 HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor)
    157 {
    158  char   *astring = NULL;
    159  HCURSOR rc;
    160 
    161     if((int)lpszCursor >> 16 != 0) {//convert string name identifier to numeric id
    162          astring = UnicodeToAsciiString((LPWSTR)lpszCursor);
    163          dprintf(("lpszCursor %s\n", astring));
    164          lpszCursor = (LPWSTR)ConvertNameId(hinst, (char *)astring);
    165     }
    166     else dprintf(("lpszCursor %d\n", (int)lpszCursor));
    167 
    168     rc = O32_LoadCursor(hinst, (char *)lpszCursor);
    169     if(astring)
    170         FreeAsciiString(astring);
    171 
    172     dprintf(("LoadCursorW returned %d\n", rc));
    173     return(rc);
    174 }
    175 //******************************************************************************
    176202//TODO: Far from complete, but works for loading resources from exe
    177203//fuLoad flag ignored
     
    182208 HANDLE hRet = 0;
    183209
    184   dprintf(("OS2LoadImageA NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
     210  dprintf(("LoadImageA NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
    185211
    186212  switch(uType) {
     
    194220                hRet = (HANDLE)LoadIconA(hinst, lpszName);
    195221                break;
     222        default:
     223                dprintf(("LoadImageA: unsupported type %d!!", uType));
     224                return 0;
    196225  }
    197   dprintf(("OS2LoadImageA returned %d\n", (int)hRet));
     226  dprintf(("LoadImageA returned %d\n", (int)hRet));
    198227
    199228  return(hRet);
     
    206235 HANDLE hRet = 0;
    207236
    208   dprintf(("OS2LoadImageW NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
     237  dprintf(("LoadImageW NOT COMPLETE (%d,%d)\n", cxDesired, cyDesired));
    209238
    210239  switch(uType) {
     
    218247                hRet = (HANDLE)LoadIconW(hinst, lpszName);
    219248                break;
     249        default:
     250                dprintf(("LoadImageW: unsupported type %d!!", uType));
     251                return 0;
    220252  }
    221   dprintf(("OS2LoadImageW returned %d\n", (int)hRet));
     253  dprintf(("LoadImageW returned %d\n", (int)hRet));
    222254
    223255  return(hRet);
  • trunk/src/user32/new/makefile

    r596 r601  
    1 # $Id: makefile,v 1.26 1999-08-20 11:52:18 sandervl Exp $
     1# $Id: makefile,v 1.27 1999-08-20 20:09:51 sandervl Exp $
    22
    33#
     
    103103win32wndchild.obj: win32wndchild.cpp win32wndchild.h
    104104gen_object.obj: gen_object.cpp gen_object.h
    105 oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h oslibgdi.h
     105oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h oslibgdi.h $(PDWIN32_INCLUDE)\winconst.h
    106106oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h
    107107oslibmsg.obj:   oslibmsg.cpp oslibmsg.h
    108108oslibgdi.obj:   oslibgdi.cpp oslibgdi.h
    109 oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h
     109oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h
    110110
    111111clipboard.obj:  clipboard.cpp
  • trunk/src/user32/new/oslibres.cpp

    r397 r601  
    1 /* $Id: oslibres.cpp,v 1.4 1999-07-26 09:01:33 sandervl Exp $ */
     1/* $Id: oslibres.cpp,v 1.5 1999-08-20 20:09:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1818
    1919#include <misc.h>
    20 #include <oslibwin.h>
    21 #include "oslibstyle.h"
     20#include <winconst.h>
     21#include "oslibwin.h"
    2222#include "oslibutil.h"
    2323#include "oslibmsg.h"
     
    5151}
    5252//******************************************************************************
    53 //todo: save mask handle somewhere
    54 //******************************************************************************
    55 HANDLE OSLibWinSetIcon(HWND hwnd, HANDLE hIcon, PVOID iconbitmap)
     53//TODO: handle single icons
     54//******************************************************************************
     55HANDLE OSLibWinCreateIcon(PVOID iconbitmap)
    5656{
    5757 POINTERINFO pointerInfo = {0};
     
    6060 BITMAPFILEHEADER2 *bfh;
    6161 HPS         hps;
     62 HANDLE      hIcon;
    6263
    6364    if(iconbitmap == NULL) {
    64         dprintf(("OSLibWinSetIcon %x %x: iconbitmap == NULL!!", hwnd, hIcon));
     65        dprintf(("OSLibWinCreateIcon iconbitmap == NULL!!"));
    6566        return 0;
    6667    }
    67     if(hIcon == 0) {
    68             //skip xor/and mask
    69             bfh = (BITMAPFILEHEADER2 *)((char *)&bafh->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2));
    70             hps = WinGetPS(hwnd);
    71             hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT,
    72                                        (char *)bafh + bfh->offBits,
    73                                        (BITMAPINFO2 *)&bfh->bmp2);
    74             if(hbmColor == GPI_ERROR) {
    75                 dprintf(("OSLibWinSetIcon: GpiCreateBitmap failed!"));
    76                 WinReleasePS(hps);
    77                 return 0;
    78             }
    79             hbmMask = GpiCreateBitmap(hps, &bafh->bfh2.bmp2, CBM_INIT,
    80                                       (char *)bafh + bafh->bfh2.offBits,
    81                                       (BITMAPINFO2 *)&bafh->bfh2.bmp2);
    82             if(hbmMask == GPI_ERROR) {
    83                 dprintf(("OSLibWinSetIcon: GpiCreateBitmap hbmMask failed!"));
    84                 WinReleasePS(hps);
    85                 return 0;
    86             }
    87        
    88             pointerInfo.fPointer   = FALSE; //icon
    89             pointerInfo.xHotspot   = bfh->xHotspot;
    90             pointerInfo.yHotspot   = bfh->yHotspot;
    91             pointerInfo.hbmColor   = hbmColor;
    92             pointerInfo.hbmPointer = hbmMask;
    93             hIcon = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo);
    94             if(hIcon == NULL) {
    95                 dprintf(("WinSetIcon: WinCreatePointerIndirect failed!"));
    96                 GpiDeleteBitmap(hbmMask);
    97                 GpiDeleteBitmap(hbmColor);
    98                 WinReleasePS(hps);
    99             }
    100     }
    101     WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0);
     68    //skip xor/and mask
     69    bfh = (BITMAPFILEHEADER2 *)((char *)&bafh->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2));
     70    hps = WinGetPS(HWND_DESKTOP);
     71    hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT,
     72                               (char *)bafh + bfh->offBits,
     73                               (BITMAPINFO2 *)&bfh->bmp2);
     74    if(hbmColor == GPI_ERROR) {
     75        dprintf(("OSLibWinCreateIcon: GpiCreateBitmap failed!"));
     76        WinReleasePS(hps);
     77        return 0;
     78    }
     79    hbmMask = GpiCreateBitmap(hps, &bafh->bfh2.bmp2, CBM_INIT,
     80                              (char *)bafh + bafh->bfh2.offBits,
     81                              (BITMAPINFO2 *)&bafh->bfh2.bmp2);
     82    if(hbmMask == GPI_ERROR) {
     83        dprintf(("OSLibWinCreateIcon: GpiCreateBitmap hbmMask failed!"));
     84        GpiDeleteBitmap(hbmColor);
     85        WinReleasePS(hps);
     86        return 0;
     87    }
     88
     89    pointerInfo.fPointer   = FALSE; //icon
     90    pointerInfo.xHotspot   = bfh->xHotspot;
     91    pointerInfo.yHotspot   = bfh->yHotspot;
     92    pointerInfo.hbmColor   = hbmColor;
     93    pointerInfo.hbmPointer = hbmMask;
     94    hIcon = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo);
     95    if(hIcon == NULL) {
     96        dprintf(("OSLibWinCreateIcon: WinCreatePointerIndirect failed!"));
     97    }
     98    GpiDeleteBitmap(hbmMask);
     99    GpiDeleteBitmap(hbmColor);
    102100    WinReleasePS(hps);
    103101    return hIcon;
     
    105103//******************************************************************************
    106104//******************************************************************************
    107 
     105HANDLE OSLibWinCreatePointer(PVOID cursorbitmap)
     106{
     107 POINTERINFO pointerInfo = {0};
     108 HBITMAP     hbmColor;
     109 BITMAPFILEHEADER2 *bfh = (BITMAPFILEHEADER2 *)cursorbitmap;
     110 HPS         hps;
     111 HANDLE      hPointer;
     112
     113    if(cursorbitmap == NULL) {
     114        dprintf(("OSLibWinCreatePointer cursorbitmap == NULL!!"));
     115        return 0;
     116    }
     117    //skip xor/and mask
     118    hps = WinGetPS(HWND_DESKTOP);
     119    hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT,
     120                               (char *)bfh + bfh->offBits,
     121                               (BITMAPINFO2 *)&bfh->bmp2);
     122    if(hbmColor == GPI_ERROR) {
     123        dprintf(("OSLibWinCreatePointer: GpiCreateBitmap failed!"));
     124        WinReleasePS(hps);
     125        return 0;
     126    }
     127
     128    pointerInfo.fPointer   = TRUE;
     129    pointerInfo.xHotspot   = bfh->xHotspot;
     130    pointerInfo.yHotspot   = bfh->yHotspot;
     131    pointerInfo.hbmColor   = 0;
     132    pointerInfo.hbmPointer = hbmColor;
     133    hPointer = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo);
     134    if(hPointer == NULL) {
     135        dprintf(("OSLibWinCreatePointer: WinCreatePointerIndirect failed!"));
     136    }
     137    GpiDeleteBitmap(hbmColor);
     138    WinReleasePS(hps);
     139    return hPointer;
     140}
     141//******************************************************************************
     142//******************************************************************************
     143HANDLE OSLibWinQuerySysIcon(ULONG type)
     144{
     145 ULONG os2type = 0;
     146
     147    switch(type) {
     148        case IDI_APPLICATION_W:
     149                os2type = SPTR_PROGRAM;
     150                break;
     151        case IDI_HAND_W:
     152                os2type = SPTR_ICONWARNING;
     153                break;
     154        case IDI_QUESTION_W:
     155                os2type = SPTR_ICONQUESTION;
     156                break;
     157        case IDI_EXCLAMATION_W:
     158                os2type = SPTR_ICONWARNING;
     159                break;
     160        case IDI_ASTERISK_W:
     161                os2type = SPTR_ICONINFORMATION;
     162                break;
     163        default:
     164                return 0;
     165    }
     166
     167    return WinQuerySysPointer(HWND_DESKTOP, os2type, TRUE);
     168}
     169//******************************************************************************
     170//******************************************************************************
     171HANDLE OSLibWinQuerySysPointer(ULONG type)
     172{
     173 ULONG os2type = 0;
     174
     175    switch(type) {
     176        case IDC_ARROW_W:
     177                os2type = SPTR_ARROW;
     178                break;
     179        case IDC_UPARROW_W:
     180                os2type = SPTR_ARROW;
     181                break;
     182        case IDC_IBEAM_W:
     183                os2type = SPTR_TEXT;
     184                break;
     185        case IDC_ICON_W:
     186                os2type = SPTR_PROGRAM;
     187                break;
     188        case IDC_NO_W:
     189                os2type = SPTR_ILLEGAL;
     190                break;
     191        case IDC_CROSS_W:
     192                os2type = SPTR_MOVE;
     193                break;
     194        case IDC_SIZE_W:
     195                os2type = SPTR_MOVE;
     196                break;
     197        case IDC_SIZEALL_W:
     198                os2type = SPTR_MOVE;
     199                break;
     200        case IDC_SIZENESW_W:
     201                os2type = SPTR_SIZENESW;
     202                break;
     203        case IDC_SIZENS_W:
     204                os2type = SPTR_SIZENS;
     205                break;
     206        case IDC_SIZENWSE_W:
     207                os2type = SPTR_SIZENWSE;
     208                break;
     209        case IDC_SIZEWE_W:
     210                os2type = SPTR_SIZEWE;
     211                break;
     212        case IDC_WAIT_W:
     213                os2type = SPTR_WAIT;
     214                break;
     215        case IDC_APPSTARTING_W:
     216                os2type = SPTR_WAIT;
     217                break;
     218        case IDC_HELP_W: //TODO: Create a cursor for this one
     219                os2type = SPTR_WAIT;
     220                break;
     221        default:
     222                return 0;
     223    }
     224    return WinQuerySysPointer(HWND_DESKTOP, os2type, TRUE);
     225}
     226//******************************************************************************
     227//******************************************************************************
  • trunk/src/user32/new/oslibres.h

    r345 r601  
    1 /* $Id: oslibres.h,v 1.1 1999-07-20 15:46:53 sandervl Exp $ */
     1/* $Id: oslibres.h,v 1.2 1999-08-20 20:09:51 sandervl Exp $ */
    22/*
    33 * Window GUI resource wrapper functions for OS/2
     
    1919HWND    OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate);
    2020HANDLE  OSLibWinSetAccelTable(HWND hwnd, HANDLE hAccel, PVOID acceltemplate);
    21 HANDLE  OSLibWinSetIcon(HWND hwnd, HANDLE hIcon, PVOID iconbitmap);
     21HANDLE  OSLibWinCreateIcon(PVOID iconbitmap);
     22HANDLE  OSLibWinCreatePointer(PVOID cursorbitmap);
     23HANDLE  OSLibWinQuerySysPointer(ULONG type);
     24HANDLE  OSLibWinQuerySysIcon(ULONG type);
    2225
    2326#endif //__OSLIBGDI_H__
  • trunk/src/user32/new/oslibwin.cpp

    r398 r601  
    1 /* $Id: oslibwin.cpp,v 1.21 1999-07-26 20:03:49 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.22 1999-08-20 20:09:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1818
    1919#include <misc.h>
    20 #include <oslibwin.h>
    21 #include "oslibstyle.h"
     20#include <winconst.h>
     21#include "oslibwin.h"
    2222#include "oslibutil.h"
    2323#include "oslibmsg.h"
     
    8787
    8888  /* Window styles */
    89   if(dwStyle & WINWS_MINIMIZE)
     89  if(dwStyle & WS_MINIMIZE_W)
    9090        *OSWinStyle |= WS_MINIMIZED;
    9191//Done explicitely in CreateWindowExA
    9292#if 0
    93   if(dwStyle & WINWS_VISIBLE)
     93  if(dwStyle & WS_VISIBLE_W)
    9494        *OSWinStyle |= WS_VISIBLE;
    9595#endif
    96   if(dwStyle & WINWS_DISABLED)
     96  if(dwStyle & WS_DISABLED_W)
    9797        *OSWinStyle |= WS_DISABLED;
    98   if(dwStyle & WINWS_CLIPSIBLINGS)
     98  if(dwStyle & WS_CLIPSIBLINGS_W)
    9999        *OSWinStyle |= WS_CLIPSIBLINGS;
    100   if(dwStyle & WINWS_CLIPCHILDREN)
     100  if(dwStyle & WS_CLIPCHILDREN_W)
    101101        *OSWinStyle |= WS_CLIPCHILDREN;
    102   if(dwStyle & WINWS_MAXIMIZE)
     102  if(dwStyle & WS_MAXIMIZE_W)
    103103        *OSWinStyle |= WS_MAXIMIZED;
    104   if(dwStyle & WINWS_GROUP)
     104  if(dwStyle & WS_GROUP_W)
    105105        *OSWinStyle |= WS_GROUP;
    106   if(dwStyle & WINWS_TABSTOP)
     106  if(dwStyle & WS_TABSTOP_W)
    107107        *OSWinStyle |= WS_TABSTOP;
    108108
    109   if(dwStyle & WINWS_CAPTION)
     109  if(dwStyle & WS_CAPTION_W)
    110110        *OSFrameStyle |= FCF_TITLEBAR;
    111   if(dwStyle & WINWS_DLGFRAME)
     111  if(dwStyle & WS_DLGFRAME_W)
    112112        *OSFrameStyle |= FCF_DLGBORDER;
    113113  else
    114   if(dwStyle & WINWS_BORDER)
     114  if(dwStyle & WS_BORDER_W)
    115115        *OSFrameStyle |= FCF_BORDER;
    116116
    117   if(dwStyle & WINWS_VSCROLL)
     117  if(dwStyle & WS_VSCROLL_W)
    118118        *OSFrameStyle |= FCF_VERTSCROLL;
    119   if(dwStyle & WINWS_HSCROLL)
     119  if(dwStyle & WS_HSCROLL_W)
    120120        *OSFrameStyle |= FCF_HORZSCROLL;
    121   if(dwStyle & WINWS_SYSMENU)
     121  if(dwStyle & WS_SYSMENU_W)
    122122        *OSFrameStyle |= FCF_SYSMENU;
    123   if(dwStyle & WINWS_THICKFRAME)
     123  if(dwStyle & WS_THICKFRAME_W)
    124124        *OSFrameStyle |= FCF_SIZEBORDER;        //??
    125   if(dwStyle & WINWS_MINIMIZEBOX)
     125  if(dwStyle & WS_MINIMIZEBOX_W)
    126126        *OSFrameStyle |= FCF_MINBUTTON;
    127   if(dwStyle & WINWS_MAXIMIZEBOX)
     127  if(dwStyle & WS_MAXIMIZEBOX_W)
    128128        *OSFrameStyle |= FCF_MAXBUTTON;
    129129
    130   if(dwExStyle & WINWS_EX_DLGMODALFRAME)
     130  if(dwExStyle & WS_EX_DLGMODALFRAME_W)
    131131        *OSFrameStyle |= FCF_DLGBORDER;
    132132
     
    381381//******************************************************************************
    382382//******************************************************************************
    383 
     383BOOL OSLibWinSetIcon(HWND hwnd, HANDLE hIcon)
     384{
     385    return (BOOL) WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0);
     386}
     387//******************************************************************************
     388//******************************************************************************
     389
  • trunk/src/user32/new/oslibwin.h

    r398 r601  
    1 /* $Id: oslibwin.h,v 1.19 1999-07-26 20:03:49 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.20 1999-08-20 20:09:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    211211
    212212BOOL  OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl);
     213BOOL  OSLibWinSetIcon(HWND hwnd, HANDLE hIcon);
    213214
    214215#endif //__OSLIBWIN_H__
  • trunk/src/user32/new/win32wnd.cpp

    r508 r601  
    1 /* $Id: win32wnd.cpp,v 1.25 1999-08-16 15:54:11 dengert Exp $ */
     1/* $Id: win32wnd.cpp,v 1.26 1999-08-20 20:09:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    13461346BOOL Win32Window::SetIcon(HICON hIcon)
    13471347{
    1348  Win32Resource *winres = (Win32Resource *)hIcon;
    1349  HANDLE         iconhandle;
    1350 
    1351     if(HIWORD(hIcon) == 0) {
    1352         dprintf(("SetIcon: hIcon %x invalid", hIcon));
    1353         SetLastError(ERROR_INVALID_PARAMETER);
    1354         return FALSE;
    1355     }
    13561348    dprintf(("Win32Window::SetIcon %x", hIcon));
    1357     iconResource = winres;
    1358     iconhandle = OSLibWinSetIcon(OS2HwndFrame, winres->getOS2Handle(), winres->lockOS2Resource());
    1359     winres->setOS2Handle(iconhandle);
    1360     return(iconhandle != 0);
     1349    return OSLibWinSetIcon(OS2HwndFrame, hIcon);
    13611350}
    13621351//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.