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. SetWindowRgn Menu Problem

SetWindowRgn Menu Problem

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 2 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.
  • G Offline
    G Offline
    guojianbo
    wrote on last edited by
    #1

    Hi: first i invoke CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5) create a HRGN, then Invoke SetWindowRgn. SetWindowRgn is successful But RoundRect(hdc, rc.left, rc.top, rc.right, rc.bottom, 5, 5) can not Draw round border, I am surprised Because RoundRect Draw the top and left border, but not draw right and bottom border. Please Help me thanks. the code as follow: HRGN hRgn = CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5); ::SetWindowRgn(hwnd, hRgn, TRUE); RoundRect(dcMem, rc.left, rc.top, rc.right, rc.bottom, 5, 5);

    V 1 Reply Last reply
    0
    • G guojianbo

      Hi: first i invoke CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5) create a HRGN, then Invoke SetWindowRgn. SetWindowRgn is successful But RoundRect(hdc, rc.left, rc.top, rc.right, rc.bottom, 5, 5) can not Draw round border, I am surprised Because RoundRect Draw the top and left border, but not draw right and bottom border. Please Help me thanks. the code as follow: HRGN hRgn = CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5); ::SetWindowRgn(hwnd, hRgn, TRUE); RoundRect(dcMem, rc.left, rc.top, rc.right, rc.bottom, 5, 5);

      V Offline
      V Offline
      venkatmakam
      wrote on last edited by
      #2

      how you are calculating rc?

      http://www.mono-project.com/Main\_Page

      G 1 Reply Last reply
      0
      • V venkatmakam

        how you are calculating rc?

        http://www.mono-project.com/Main\_Page

        G Offline
        G Offline
        guojianbo
        wrote on last edited by
        #3

        calculate like this: RECT rc; GetWindowRect(hwnd,&rc); OffsetRect(&rc,-rc.left,-rc.top);

        G 1 Reply Last reply
        0
        • G guojianbo

          calculate like this: RECT rc; GetWindowRect(hwnd,&rc); OffsetRect(&rc,-rc.left,-rc.top);

          G Offline
          G Offline
          guojianbo
          wrote on last edited by
          #4

          thanks the problem is solved

          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