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. Layered ATL Window

Layered ATL Window

Scheduled Pinned Locked Moved ATL / WTL / STL
questionc++htmlcomjson
2 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.
  • M Offline
    M Offline
    macattack
    wrote on last edited by
    #1

    I have a Browser Helper Object that I have created and I want it to create a Window using the API function CreateWindowEx so that I can using the window layering extended style described here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/layerwin.asp My question is how do I create a window using this API in my ATL project? I have tried creating a class that inherates from CWindows and then using the http://www.codeproject.com/w2k/QDWndTransparency.asp?print=true But this does not have the same effect. I really need a faded window using: hwnd = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, gszFade, gszFade, WS_POPUP | WS_VISIBLE, prc->left, prc->top, 0, 0, NULL, (HMENU)0, ghinst, NULL); My goal is to have a window placed over the browser main window that I can then draw on. Any suggestions? Thank you much, Mike

    I 1 Reply Last reply
    0
    • M macattack

      I have a Browser Helper Object that I have created and I want it to create a Window using the API function CreateWindowEx so that I can using the window layering extended style described here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/layerwin.asp My question is how do I create a window using this API in my ATL project? I have tried creating a class that inherates from CWindows and then using the http://www.codeproject.com/w2k/QDWndTransparency.asp?print=true But this does not have the same effect. I really need a faded window using: hwnd = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, gszFade, gszFade, WS_POPUP | WS_VISIBLE, prc->left, prc->top, 0, 0, NULL, (HMENU)0, ghinst, NULL); My goal is to have a window placed over the browser main window that I can then draw on. Any suggestions? Thank you much, Mike

      I Offline
      I Offline
      Igor Vigdorchik
      wrote on last edited by
      #2

      Try this: typedef BOOL (__stdcall *PFUNCSETLAYEREDWINDOWATTR)(HWND, COLORREF, BYTE, DWORD); PFUNCSETLAYEREDWINDOWATTR m_pfSetLayeredWindowAttributes; HMODULE hUser32 = GetModuleHandle(_T("User32.dll")); if (hUser32) { m_pfSetLayeredWindowAttributes = (PFUNCSETLAYEREDWINDOWATTR)::GetProcAddress(hUser32, "SetLayeredWindowAttributes"); if (m_pfSetLayeredWindowAttributes) { ::SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE)^WS_EX_LAYERED); // After the SetWindowLong call, the layered window will not become visible // until the SetLayeredWindowAttributes function has been called for this window m_pfSetLayeredWindowAttributes(m_hWnd, 0, (BYTE)255, LWA_ALPHA); } } and then somewhere // Sets the transparency of the window void MakeTransparent(int nAlpha) { if (m_pfSetLayeredWindowAttributes) m_pfSetLayeredWindowAttributes(m_hWnd, 0, (BYTE)nAlpha, LWA_ALPHA); }

      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