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. Get Window styles and exstyles ?

Get Window styles and exstyles ?

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpwpfcomhelp
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.
  • D Offline
    D Offline
    dlhson
    wrote on last edited by
    #1

    How can I get the style of a window class. Ex: I have a window (handle=0x00000b94, class name=#32770(dialog) ) I want to get the styles and extended styles of it as CS_DBLCLKS, WS_EX_CLIENTEDGE.... How can I do that ? I try this way: LONG lStyles=::GetWindowLong(hwnd,GWL_STYLE); LONG lExStyles=::GetWindowLong(hwnd,GWL_EXSTYLE); CString strStyles; if ((lStyles&BS_OWNERDRAW)==BS_OWNERDRAW) strStyles+="BS_OWNERDRAW"; if ((lStyles&CS_VREDDRAW)==CS_VREDDRAW) strStyles+="CS_VREDDRAW"; ... ... (hundreds of "if" !!!!!!!!!!!!!!!) Help me ! Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com

    L 1 Reply Last reply
    0
    • D dlhson

      How can I get the style of a window class. Ex: I have a window (handle=0x00000b94, class name=#32770(dialog) ) I want to get the styles and extended styles of it as CS_DBLCLKS, WS_EX_CLIENTEDGE.... How can I do that ? I try this way: LONG lStyles=::GetWindowLong(hwnd,GWL_STYLE); LONG lExStyles=::GetWindowLong(hwnd,GWL_EXSTYLE); CString strStyles; if ((lStyles&BS_OWNERDRAW)==BS_OWNERDRAW) strStyles+="BS_OWNERDRAW"; if ((lStyles&CS_VREDDRAW)==CS_VREDDRAW) strStyles+="CS_VREDDRAW"; ... ... (hundreds of "if" !!!!!!!!!!!!!!!) Help me ! Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      dlhson wrote: extended styles of it as CS_DBLCLKS, WS_EX_CLIENTEDGE First off the CS_DBLCLKS is a CLASS style, not a window style the GetWindowLong, using the GWL_STYLE or GWL_EXSTYLE will only return you the window styles (i.e. WS_XXX ,or WS_EX_XXX) for CS_XXX you need to call GetClassLong( hwnd, GCL_STYLE ) As far as conmverting them to a string, I think you are stuck with a big if/else statement, sorry ! :)

      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