Results 1 to 5 of 5

Thread: window title bar

  1. #1
    Join Date
    Aug 2006
    Posts
    83

    Default window title bar

    Hello,

    I want to know if there is a way to define the height of the title bar. I want it to be as big as it is in WindowsXP theme (in windows). I know that I won't be able to achieve this from qt commands, but through native windows controls. Does anyone know how to handle this ??

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: window title bar

    Check this thread.

    It's kind of "global" setting in Windows. Modify the value and it affects ALL title bars. Have you ever seen different programs having title bars with different heights? The only exception is programs which use custom (fake) title bars.
    J-P Nurmi

  3. #3
    Join Date
    Aug 2006
    Posts
    83

    Default Re: window title bar

    Ok. I'll try another aproach then. How can I retrieve the information about the height of the title bar. I saw a function

    Qt Code:
    1. BOOL GetTitleBarInfo( HWND hWnd
    2. PTITLEBARINFO pti
    3. ) const;
    To copy to clipboard, switch view to plain text mode 

    but I don't know how to use the PTITLEBARINFO pti part, I have the HWND hWnd defined and using it, but the other PTITLEBARINFO confuses me. I saw in the MSDN what it does. I just don't know how to implement the pointer to that structure.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: window title bar

    Check how QStyle::pixelMetric(QStyle::PM_TitleBarHeight) is implemented in QWindowsStyle and/or QWindowsXPStyle, maybe they use native winapi methods to retrieve title bar height.
    J-P Nurmi

  5. #5
    Join Date
    Aug 2006
    Posts
    83

    Default Re: window title bar

    Ok. Tnx, I have solved the problem.
    If anyone wants to know how : (I used this function which return the height od the title bar)
    Qt Code:
    1. int titleBarHeight = GetSystemMetrics(SM_CYSMCAPTION) - 1;
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 5
    Last Post: 4th August 2006, 23:44
  2. Replies: 3
    Last Post: 23rd July 2006, 18:02
  3. animate a window
    By iGoo in forum Qt Programming
    Replies: 4
    Last Post: 27th June 2006, 10:46
  4. Move window in Clone Mode
    By ultrabrite in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2006, 18:22
  5. cannot make a main window modal
    By Dark_Tower in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 10:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.