Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Spanish
  4. Cambiar color barra de titulo windows
Forum Updated to NodeBB v4.3 + New Features

Cambiar color barra de titulo windows

Scheduled Pinned Locked Moved Unsolved Spanish
1 Posts 1 Posters 554 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • GilgameshG Offline
    GilgameshG Offline
    Gilgamesh
    wrote on last edited by Gilgamesh
    #1

    Encontré aquí en el foro una respuesta a medias de como hacerlo de manera nativa , pero me quedo la duda de como se implementaría usando PySide6.

    Función SetSysColors

    Ya que en el método nativo usan C++. Antes pensaba que se podía con PySide6

    Esto es lo que propone en la documentación de Microsoft

    #include <windows.h>
    #include <stdio.h>
    #pragma comment(lib, "user32.lib")
    
    void main()
    {
        int aElements[2] = {COLOR_WINDOW, COLOR_ACTIVECAPTION};
        DWORD aOldColors[2];
        DWORD aNewColors[2];
    
        // Get the current color of the window background. 
     
        aOldColors[0] = GetSysColor(aElements[0]); 
    
        printf("Current window color: {0x%x, 0x%x, 0x%x}\n", 
            GetRValue(aOldColors[0]), 
            GetGValue(aOldColors[0]), 
            GetBValue(aOldColors[0]));
    
        // Get the current color of the active caption. 
     
        aOldColors[1] = GetSysColor(aElements[1]); 
    
        printf("Current active caption color: {0x%x, 0x%x, 0x%x}\n", 
            GetRValue(aOldColors[1]), 
            GetGValue(aOldColors[1]), 
            GetBValue(aOldColors[1]));
    
        // Define new colors for the elements
    
        aNewColors[0] = RGB(0x80, 0x80, 0x80);  // light gray 
        aNewColors[1] = RGB(0x80, 0x00, 0x80);  // dark purple 
    
        printf("\nNew window color: {0x%x, 0x%x, 0x%x}\n", 
            GetRValue(aNewColors[0]), 
            GetGValue(aNewColors[0]), 
            GetBValue(aNewColors[0]));
    
        printf("New active caption color: {0x%x, 0x%x, 0x%x}\n", 
            GetRValue(aNewColors[1]), 
            GetGValue(aNewColors[1]), 
            GetBValue(aNewColors[1]));
    
        // Set the elements defined in aElements to the colors defined
        // in aNewColors
    
        SetSysColors(2, aElements, aNewColors); 
    
        printf("\nWindow background and active border have been changed.\n");
        printf("Reverting to previous colors in 10 seconds...\n");
    
        Sleep(10000);    
    
        // Restore the elements to their original colors
    
        SetSysColors(2, aElements, aOldColors); 
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved