c++window-style

Getting window style


I'm trying to check if a window has a certain style using GetWindowLong(hWnd, GWL_STYLE) but that gives me a LONG type of variable. how would you check for a specific style from that say a const value type 'WS_CAPTION'?


Solution

  • use the bitwise & operator to compare with that long type,

    example

    if (szLng & WS_CAPTION){
        // that window has caption
    }