============================================================================= MsgThemeChanged() - Handle WM_THEMECHANGED
| 1489 | // |
| 1490 | // |
| 1491 | void MsgThemeChanged ( HWND hwnd, WPARAM wParam, LPARAM lParam ) |
| 1492 | { |
| 1493 | RECT rc, rc2; |
| 1494 | HINSTANCE hInstance = ( HINSTANCE ) ( INT_PTR ) GetWindowLongPtr ( hwnd, GWLP_HINSTANCE ); |
| 1495 | // reinitialize edit frame |
| 1496 | if ( PrivateIsAppThemed() ) { |
| 1497 | bIsAppThemed = TRUE; |
| 1498 | SetWindowLongPtr ( hwndEdit, GWL_EXSTYLE, GetWindowLongPtr ( hwndEdit, GWL_EXSTYLE ) & ~WS_EX_CLIENTEDGE ); |
| 1499 | SetWindowPos ( hwndEdit, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE ); |
| 1500 | if ( IsVista() ) { |
| 1501 | cxEditFrame = 0; |
| 1502 | cyEditFrame = 0; |
| 1503 | } else { |
| 1504 | SetWindowPos ( hwndEditFrame, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED ); |
| 1505 | GetClientRect ( hwndEditFrame, &rc ); |
| 1506 | GetWindowRect ( hwndEditFrame, &rc2 ); |
| 1507 | cxEditFrame = ( ( rc2.right - rc2.left ) - ( rc.right - rc.left ) ) / 2; |
| 1508 | cyEditFrame = ( ( rc2.bottom - rc2.top ) - ( rc.bottom - rc.top ) ) / 2; |
| 1509 | } |
| 1510 | } else { |
| 1511 | bIsAppThemed = FALSE; |
| 1512 | SetWindowLongPtr ( hwndEdit, GWL_EXSTYLE, WS_EX_CLIENTEDGE | GetWindowLongPtr ( hwndEdit, GWL_EXSTYLE ) ); |
| 1513 | SetWindowPos ( hwndEdit, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED ); |
| 1514 | cxEditFrame = 0; |
| 1515 | cyEditFrame = 0; |
| 1516 | } |
| 1517 | // recreate toolbar and statusbar |
| 1518 | Toolbar_GetButtons ( hwndToolbar, IDT_FILE_NEW, tchToolbarButtons, COUNTOF ( tchToolbarButtons ) ); |
| 1519 | DestroyWindow ( hwndToolbar ); |
| 1520 | DestroyWindow ( hwndReBar ); |
| 1521 | DestroyWindow ( hwndStatus ); |
| 1522 | CreateBars ( hwnd, hInstance ); |
| 1523 | UpdateToolbar(); |
| 1524 | GetClientRect ( hwnd, &rc ); |
| 1525 | SendMessage ( hwnd, WM_SIZE, SIZE_RESTORED, MAKELONG ( rc.right, rc.bottom ) ); |
| 1526 | UpdateStatusbar(); |
| 1527 | } |
| 1528 | |
| 1529 | |
| 1530 | //============================================================================= |
no test coverage detected