Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Is It Possible to do this?

Is It Possible to do this?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 Posters 0 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.
  • S Offline
    S Offline
    Shuang Wu
    wrote on last edited by
    #1

    I want to know if a dialog based program can be in the following style. 1. there is a title bar; 2. there is no caption on the title bar; 3. there is a caption on the windows task bar button. |-|3llo Wo|2ld

    A I 2 Replies Last reply
    0
    • S Shuang Wu

      I want to know if a dialog based program can be in the following style. 1. there is a title bar; 2. there is no caption on the title bar; 3. there is a caption on the windows task bar button. |-|3llo Wo|2ld

      A Offline
      A Offline
      Abin
      wrote on last edited by
      #2

      1. there is a title bar;

      BOOL bHasTitleBar = this->GetStyle() & WS_CAPTION;

      2. there is no caption on the title bar;

      CString sCaption;
      this->GetWIndowText(sCaption);
      BOOL bHasCaptionOnTheTitleBar = sCaption.GetLength() > 0;

      3. there is a caption on the windows task bar button.

      // Huh? If a window has caption on its title bar, then
      // it also has the same caption on the system task bar button,
      // if it does have a task bar button.
      // If you mean "this window has a task bar button"
      BOOL bHasTaskBarButton = (this->IsWindowVisible() && this == AfxGetMainWnd());

      S 1 Reply Last reply
      0
      • A Abin

        1. there is a title bar;

        BOOL bHasTitleBar = this->GetStyle() & WS_CAPTION;

        2. there is no caption on the title bar;

        CString sCaption;
        this->GetWIndowText(sCaption);
        BOOL bHasCaptionOnTheTitleBar = sCaption.GetLength() > 0;

        3. there is a caption on the windows task bar button.

        // Huh? If a window has caption on its title bar, then
        // it also has the same caption on the system task bar button,
        // if it does have a task bar button.
        // If you mean "this window has a task bar button"
        BOOL bHasTaskBarButton = (this->IsWindowVisible() && this == AfxGetMainWnd());

        S Offline
        S Offline
        Shuang Wu
        wrote on last edited by
        #3

        =[ Abin ]= wrote: // Huh? If a window has caption on its title bar, then // it also has the same caption on the system task bar button, // if it does have a task bar button. // If you mean "this window has a task bar button" I mean this window has a task bar button with caption as well as a title bar without caption. The requirements are quite strange and make me hard to implement. I am now considering if i can set the caption color to transparent or to the same of the title bar. Do you have any idea? Thanks very much |-|3llo Wo|2ld

        1 Reply Last reply
        0
        • S Shuang Wu

          I want to know if a dialog based program can be in the following style. 1. there is a title bar; 2. there is no caption on the title bar; 3. there is a caption on the windows task bar button. |-|3llo Wo|2ld

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          Requirements 2 & 3 collide. As you already know... But you can cheat. Set a title as you normally would. Then handle the WM_NCPAINT message and draw the title bar yourself (and don''t bother drawing the text!). For examples of custom title bars, search codeproject for WM_NCPAINT and OnNcPaint. And I agree, it is a strange request! Iain.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups