< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp

Print this page




1165                 if ( pMenu == awtMenubar )
1166                 {
1167                         HWND hWnd = GetHWnd();
1168                         HDC hDC = ::GetDC(hWnd);
1169                         DASSERT(hDC != NULL);
1170                         awtMenubar->MeasureItem(hDC, measureInfo);
1171                         VERIFY(::ReleaseDC(hWnd, hDC));
1172                         return mrConsume;
1173                 }
1174         }
1175 
1176         return AwtComponent::WmMeasureItem(ctrlId, measureInfo);
1177 }
1178 
1179 MsgRouting AwtFrame::WmGetIcon(WPARAM iconType, LRESULT& retVal)
1180 {
1181     //Workaround windows bug:
1182     //when reseting from specific icon to class icon
1183     //taskbar is not updated
1184     if (iconType <= 2 /*ICON_SMALL2*/) {
1185         retVal = (LRESULT)GetEffectiveIcon(iconType);
1186         return mrConsume;
1187     } else {
1188         return mrDoDefault;
1189     }
1190 }
1191 
1192 void AwtFrame::DoUpdateIcon()
1193 {
1194     //Workaround windows bug:
1195     //when reseting from specific icon to class icon
1196     //taskbar is not updated
1197     HICON hIcon = GetEffectiveIcon(ICON_BIG);
1198     HICON hIconSm = GetEffectiveIcon(ICON_SMALL);
1199     SendMessage(WM_SETICON, ICON_BIG,   (LPARAM)hIcon);
1200     SendMessage(WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
1201 }
1202 
1203 HICON AwtFrame::GetEffectiveIcon(int iconType)
1204 {
1205     BOOL smallIcon = ((iconType == ICON_SMALL) || (iconType == 2/*ICON_SMALL2*/));




1165                 if ( pMenu == awtMenubar )
1166                 {
1167                         HWND hWnd = GetHWnd();
1168                         HDC hDC = ::GetDC(hWnd);
1169                         DASSERT(hDC != NULL);
1170                         awtMenubar->MeasureItem(hDC, measureInfo);
1171                         VERIFY(::ReleaseDC(hWnd, hDC));
1172                         return mrConsume;
1173                 }
1174         }
1175 
1176         return AwtComponent::WmMeasureItem(ctrlId, measureInfo);
1177 }
1178 
1179 MsgRouting AwtFrame::WmGetIcon(WPARAM iconType, LRESULT& retVal)
1180 {
1181     //Workaround windows bug:
1182     //when reseting from specific icon to class icon
1183     //taskbar is not updated
1184     if (iconType <= 2 /*ICON_SMALL2*/) {
1185         retVal = (LRESULT)GetEffectiveIcon(static_cast<int>(iconType));
1186         return mrConsume;
1187     } else {
1188         return mrDoDefault;
1189     }
1190 }
1191 
1192 void AwtFrame::DoUpdateIcon()
1193 {
1194     //Workaround windows bug:
1195     //when reseting from specific icon to class icon
1196     //taskbar is not updated
1197     HICON hIcon = GetEffectiveIcon(ICON_BIG);
1198     HICON hIconSm = GetEffectiveIcon(ICON_SMALL);
1199     SendMessage(WM_SETICON, ICON_BIG,   (LPARAM)hIcon);
1200     SendMessage(WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
1201 }
1202 
1203 HICON AwtFrame::GetEffectiveIcon(int iconType)
1204 {
1205     BOOL smallIcon = ((iconType == ICON_SMALL) || (iconType == 2/*ICON_SMALL2*/));


< prev index next >