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. ATL / WTL / STL
  4. How to make the ActiveX control full transparent int word

How to make the ActiveX control full transparent int word

Scheduled Pinned Locked Moved ATL / WTL / STL
comhelptutorial
3 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.
  • L Offline
    L Offline
    liuguang
    wrote on last edited by
    #1

    I want to write a ActiveX control for word, which has the transparent effect,which can't envelop the test in word document no matter what drawn in the control. But I don't know how to achieve the transparent effect. My English is poor. I hope you can follow me and can help me

    J 1 Reply Last reply
    0
    • L liuguang

      I want to write a ActiveX control for word, which has the transparent effect,which can't envelop the test in word document no matter what drawn in the control. But I don't know how to achieve the transparent effect. My English is poor. I hope you can follow me and can help me

      J Offline
      J Offline
      Ju ncho
      wrote on last edited by
      #2

      Ni Hao, To draw your control as transparent must Override the OnDraw() of the ActiveX. If you Do nothing there the control will never be written ad you should see what lies bellow it. Also you could use the function TransparentBlt() to draw any overlay you want. A third option could be capturing the screen below the control an drawing it (for avoiding the . HRESULT CCAxQuantMaster::OnDraw(ATL_DRAWINFO& di) { RECT& rc = *(RECT*)di.prcBounds; // Set Clip region to the rectangle specified by di.prcBounds HRGN hRgnOld = NULL; if (GetClipRgn(di.hdcDraw, hRgnOld) != 1) hRgnOld = NULL; bool bSelectOldRgn = false; HRGN hRgnNew = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom); if (hRgnNew != NULL) { bSelectOldRgn = (SelectClipRgn(di.hdcDraw, hRgnNew) != ERROR); } //Select Transparent Brush SelectObject(di.hdcDraw, GetStockObject(NULL_BRUSH)); Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom); }

      JO :)

      L 1 Reply Last reply
      0
      • J Ju ncho

        Ni Hao, To draw your control as transparent must Override the OnDraw() of the ActiveX. If you Do nothing there the control will never be written ad you should see what lies bellow it. Also you could use the function TransparentBlt() to draw any overlay you want. A third option could be capturing the screen below the control an drawing it (for avoiding the . HRESULT CCAxQuantMaster::OnDraw(ATL_DRAWINFO& di) { RECT& rc = *(RECT*)di.prcBounds; // Set Clip region to the rectangle specified by di.prcBounds HRGN hRgnOld = NULL; if (GetClipRgn(di.hdcDraw, hRgnOld) != 1) hRgnOld = NULL; bool bSelectOldRgn = false; HRGN hRgnNew = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom); if (hRgnNew != NULL) { bSelectOldRgn = (SelectClipRgn(di.hdcDraw, hRgnNew) != ERROR); } //Select Transparent Brush SelectObject(di.hdcDraw, GetStockObject(NULL_BRUSH)); Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom); }

        JO :)

        L Offline
        L Offline
        liuguang
        wrote on last edited by
        #3

        Thank you all the same! :)

        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