Getting a part of bytes

This is a discussion on Getting a part of bytes within the C++ Programming forums, part of the General Programming Boards category; The title is vague and may be wrong but I am using the SetStyle and GetStyle function in the Win32 ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    Getting a part of bytes

    The title is vague and may be wrong but I am using the SetStyle and GetStyle function in the Win32 API and the GetStyle returns the style bytes. I want to know how you tell if (lets say) WS_VISIBLE is part of those bytes returned by GetStyle.

  2. #2
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341
    Code:
    if (GetStyle() & WS_VISIBLE)
    {
    
    }
    -- Rocky
    -- DreamSys Software (http://www.dreamsyssoft.com)
    -- Free Tiff 2 PDF Library (http://www.dreamsyssoft.com/tiff-to-pdf-api)

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    ok so how do I tell if it isn't in there, I tried !& and !GetStyle() & style but neither seemed to work.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    (GetStyle() & WS_VISIBLE) == 0

    or

    !(GetStyle() & WS_VISIBLE)

    Operator precedence matters.

  5. #5
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    ok thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 11:36 AM
  2. No. of bytes?
    By jnwk888hwq in forum C Programming
    Replies: 14
    Last Post: 11-08-2003, 02:00 PM
  3. Pointer's
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 10-14-2003, 03:15 PM
  4. Suspicious Pointer Conversion
    By mr_spanky202 in forum C Programming
    Replies: 35
    Last Post: 04-11-2003, 01:35 PM

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