Window styles

This is a discussion on Window styles within the Windows Programming forums, part of the Platform Specific Boards category; I want to check, if a style DWORD contains a certain style. I know I can remove styles by using: ...

  1. #1
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318

    Window styles

    I want to check, if a style DWORD contains a certain style.
    I know I can remove styles by using:
    Code:
    dwStyle &= ~(WS_MAXIMIZEBOX|WS_THICKFRAME);
    But I don't know how to check, if there is a style.

  2. #2
    Mad OnionKnight's Avatar
    Join Date
    Jan 2005
    Location
    Umeň, Sweden
    Posts
    555
    Code:
    dwStyle & (WS_MAXIMIZEBOX|WS_THICKFRAME)
    Will evaluate to true if either of the two is set, if you strictly want to check if both are set you do
    Code:
    dwStyle & (WS_MAXIMIZEBOX|WS_THICKFRAME) == (WS_MAXIMIZEBOX|WS_THICKFRAME)

  3. #3
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Thanks, now I can finish my little program.
    I'll post the source code when I finish

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 10:06 AM
  3. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  5. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21