title: Win32 dialog based borderless window with bitmap background and visual styles
body: <p>i'm new to StackOverflow so forgive me for any stupid mistakes I make on the post.</p>
  
  <p>I'm having an issue to create a borderless window with a bitmap background using the Win32 API (no MFC) and a dialog based application. I'm using visual studio 2010.</p>
  
  <p>The issue only happens if I use the windows XP Visual Styles, by linking the common controls lib with the following snippet:</p>
  
  <pre><code>  #pragma comment(linker, \
    "\"/manifestdependency:type='Win32' "\
    "name='Microsoft.Windows.Common-Controls' "\
    "version='6.0.0.0' "\
    "processorArchitecture='*' "\
    "publicKeyToken='6595b64144ccf1df' "\
    "language='*'\"")
  </code></pre>
  
  <p>I have a simple dialog and inside it a PictureControl with a bitmap image that will be the background of the window. I want this image to fill the entire Window, no resize or drag and drop will be needed, so i just put it centered on screen and defined both the dialog and the Picture Control dimensions to be the same in my RC file as shown below (both with dimensions 356, 210):</p>
  
  <pre><code>//Main Dialog
  IDD_DIALOG_MAIN DIALOGEX 0, 0, 356, 210
  STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE
  FONT 8, "MS Shell Dlg", 400, 0, 0x1
  BEGIN
      //Picture Control
      CONTROL         103,IDC_PB_SPLASH,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_REALSIZEIMAGE,0,0,356,210
      DEFPUSHBUTTON   "OK",IDOK,152,169,50,14
  END
  </code></pre>
  
  <p>Now the issue is, when the I'm using the visual styles, the image doesn't fill the entire area of the dialog Window. A small white space can be seen on both sides of the dialog(if a remove the SS_CENTERIMAGE it's a white space on right side). This doesn't happen without the Visual Styles. The pictures below show the problem (The image used there is just an example, the actual background image is more complex, so just painting with a brush is not an option) </p>
  
  <p>Without Visual Styles
  <a href="http://postimg.org/image/hji8sa6j1/" rel="nofollow noreferrer">http://postimg.org/image/hji8sa6j1/</a></p>
  
  <p>With Visual Styles
  <a href="http://postimg.org/image/b733ig3gt/" rel="nofollow noreferrer">http://postimg.org/image/b733ig3gt/</a></p>
  
  <p>Sorry for the links, still don't have enough reputation to post images.</p>
  
  <p>Any suggestions on how to make the bitmap fill the entire window with visual styles enabled?
  I found this nice answer <a href="https://stackoverflow.com/a/17713810/3022281">https://stackoverflow.com/a/17713810/3022281</a> by melak47 to making a borderless window but it's not dialog based. If nothing else works I guess I'll have to go with that solution.</p>