Ignore:
Timestamp:
Jul 20, 1999, 5:46:54 PM (26 years ago)
Author:
sandervl
Message:

Accelerator + icon changes

File:
1 edited

Legend:

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

    r342 r345  
    1 /* $Id: win32wnd.cpp,v 1.17 1999-07-20 07:42:36 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.18 1999-07-20 15:46:54 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    2929#include <oslibutil.h>
    3030#include <oslibgdi.h>
     31#include <oslibres.h>
    3132#include <winres.h>
    3233
     
    102103  acceltableResource = NULL;
    103104  menuResource       = NULL;
    104 }
    105 //******************************************************************************
     105  iconResource       = NULL;
     106}
     107//******************************************************************************
     108//todo get rid of resources (menu, accel, icon etc)
    106109//******************************************************************************
    107110Win32Window::~Win32Window()
     
    389392  else  windowId = (UINT)cs->hMenu;
    390393
     394  //Set icon from class
     395  if(windowClass->getIcon())
     396        SetIcon(windowClass->getIcon());
     397
    391398  /* Send the WM_CREATE message
    392399   * Perhaps we shouldn't allow width/height changes as well.
     
    416423                HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
    417424#endif
     425        SetLastError(0);
    418426        return TRUE;
    419427        }
     
    10561064//******************************************************************************
    10571065//******************************************************************************
    1058 BOOL Win32Window::SetMenu(ULONG hMenu)
     1066BOOL Win32Window::SetMenu(HMENU hMenu)
    10591067{
    10601068 PVOID          menutemplate;
     
    10821090//******************************************************************************
    10831091//******************************************************************************
    1084 BOOL Win32Window::SetAccelTable(ULONG hAccel)
     1092BOOL Win32Window::SetAccelTable(HACCEL hAccel)
    10851093{
    10861094 Win32Resource *winres = (Win32Resource *)hAccel;
     1095 HANDLE         accelhandle;
    10871096
    10881097    if(HIWORD(hAccel) == 0) {
    10891098        dprintf(("SetAccelTable: hAccel %x invalid", hAccel));
    1090             SetLastError(ERROR_INVALID_PARAMETER);
    1091             return FALSE;
     1099        SetLastError(ERROR_INVALID_PARAMETER);
     1100        return FALSE;
    10921101    }
    10931102    acceltableResource = winres;
    1094         return OSLibWinSetAccelTable(OS2HwndFrame, winres->lockOS2Resource());
     1103    accelhandle = OSLibWinSetAccelTable(OS2HwndFrame, winres->getOS2Handle(), winres->lockOS2Resource());
     1104    winres->setOS2Handle(accelhandle);
     1105    return(accelhandle != 0);
     1106}
     1107//******************************************************************************
     1108//******************************************************************************
     1109BOOL Win32Window::SetIcon(HICON hIcon)
     1110{
     1111 Win32Resource *winres = (Win32Resource *)hIcon;
     1112 HANDLE         iconhandle;
     1113
     1114    if(HIWORD(hIcon) == 0) {
     1115        dprintf(("SetIcon: hIcon %x invalid", hIcon));
     1116        SetLastError(ERROR_INVALID_PARAMETER);
     1117        return FALSE;
     1118    }
     1119    dprintf(("Win32Window::SetIcon %x", hIcon));
     1120    iconResource = winres;
     1121    iconhandle = OSLibWinSetIcon(OS2HwndFrame, winres->getOS2Handle(), winres->lockOS2Resource());
     1122    winres->setOS2Handle(iconhandle);
     1123    return(iconhandle != 0);
    10951124}
    10961125//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.