MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / MsgThemeChanged

Function MsgThemeChanged

src/Notepad2.c:1491–1527  ·  view source on GitHub ↗

============================================================================= MsgThemeChanged() - Handle WM_THEMECHANGED

Source from the content-addressed store, hash-verified

1489//
1490//
1491void 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//=============================================================================

Callers 1

MainWndProcFunction · 0.85

Calls 7

GetWindowLongPtrFunction · 0.85
PrivateIsAppThemedFunction · 0.85
SetWindowLongPtrFunction · 0.85
Toolbar_GetButtonsFunction · 0.85
CreateBarsFunction · 0.85
UpdateToolbarFunction · 0.85
UpdateStatusbarFunction · 0.85

Tested by

no test coverage detected