title: Using an icon on a dialog box window C++ Win32 API
body: <p>I am trying to create a dialog box with an icon at the top like so.</p>
  
  <p><img src="https://i.stack.imgur.com/g7pYr.png" alt="icon dialog"></p>
  
  <p>I am using a resource file to load the icon like so.</p>
  
  <pre><code>IDI_ICON1          ICON           ".\\usb.ico"
  </code></pre>
  
  <p>I have tried setting the window icon using the following code.</p>
  
  <pre><code>SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IDI_ICON1);
  SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)IDI_ICON1);
  </code></pre>
  
  <p>hwnd is the window. As a result, I get a blue circle that looks just like the loading icon for Windows 7 and Vista. I am almost positive the icon is being loaded correctly as when I look at the task bar, my program has that icon representing my program. If you need the code I am using for the dialog window itself, let me know I will post it. I am using mingw32 C++ compiler on Windows 7. Thanks!</p>