// WM_SETICON LRESULT FASTCALL DefWndSetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam) { HICON hIcon, hIconSmall, hIconOld; if ( wParam > ICON_SMALL2 ) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } hIconSmall = UserGetProp(UserHMGetHandle(pWnd), gpsi->atomIconSmProp); hIcon = UserGetProp(UserHMGetHandle(pWnd), gpsi->atomIconProp); hIconOld = wParam == ICON_BIG ? hIcon : hIconSmall; switch(wParam) { case ICON_BIG: hIcon = (HICON)lParam; break; case ICON_SMALL: hIconSmall = (HICON)lParam; break; case ICON_SMALL2: ERR("FIXME: Set ICON_SMALL2 support!\n"); default: break; } NtUserSetProp(UserHMGetHandle(pWnd), gpsi->atomIconProp, hIcon); NtUserSetProp(UserHMGetHandle(pWnd), gpsi->atomIconSmProp, hIconSmall); if ((pWnd->style & WS_CAPTION ) == WS_CAPTION) UserPaintCaption(UserHMGetHandle(pWnd)); /* Repaint caption */ return (LRESULT)hIconOld; }
/* * @implemented */ BOOL WINAPI SetPropW(HWND hWnd, LPCWSTR lpString, HANDLE hData) { ATOM Atom; if (HIWORD(lpString)) { Atom = GlobalAddAtomW(lpString); } else { Atom = LOWORD((DWORD_PTR)lpString); } return(NtUserSetProp(hWnd, Atom, hData)); }