Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Suppose you added <code>STATIC</code> control into dialog template. Right there in template editor, in control properties you can assign an identifier, e.g. <code>IDC_PICTURE</code>. From there - the control already will be created on runtime for you. In code, you will add <code>CWindow</code> variable, and in your <code>OnInitDialog</code> handler (I assume you already have it - AFAIR it is created by default and exists is various samples) you will add member variable initialization, so it will be available to your code for further things like message processing.</p> <pre><code>class CMainDialog : public CDialogImpl&lt;CMainDialog&gt; { // ... private: CWindow m_PictureStatic; HBITMAP m_hPictureBitmap; // Window Message Handlers LRESULT OnInitDialog(UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL&amp; bHandled) { m_PictureStatic = GetDlgItem(IDC_PICTURE); m_hPictureBitmap = LoadBitmap(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(IDB_PICTURE)); ATLASSERT(m_hPictureBitmap); m_PictureStatic.SendMessage(STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) m_hPictureBitmap); // ... } LRESULT OnDestroy(UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL&amp; bHandled) { ATLVERIFY(DeleteObject(m_hPictureBitmap)); return 0; } </code></pre> <p>The picture itself is (in this code snippet, there might be other options) a bitmap resource with identifier <code>IDB_PICTURE</code>. The code loads bitmap from resource and passes it to the control.</p> <p><img src="https://i.stack.imgur.com/gFTja.png" alt="enter image description here"></p> <p><a href="http://www.alax.info/trac/public/browser/trunk/Utilities/AtlDialogSample" rel="nofollow noreferrer">Source Code</a> + <a href="http://www.alax.info/trac/public/browser/trunk/Utilities/AtlDialogSample?rev=71" rel="nofollow noreferrer">Source Code before adding Picture Static</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload