Results 1 to 40 of 40

Thread: Load image into STATIC control Win32

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2013
    Posts
    658

    Load image into STATIC control Win32

    Code:
    hwnd = CreateWindowEx(0, "STATIC", "", SS_BITMAP + WS_CHILD + WS_VISIBLE, 50, 55, 200, 200, hWnd, 0, Application.Hinstance, ByVal 0&)
    Call SendMessage(hwnd, STM_SETIMAGE, IMAGE_BITMAP, GetHBMP(UserForm1.Image1))
    I am trying to add an image to a win32 static control using the code above.

    The Static control is created successfully onto its parent form, but no image is displayed.

    GetHBMP is a user function that successfully returns a valid bitmap handle from another image activeX on the form (<==tested and confirmed).

    Do I need to set the static image in the static control window procedure for it to take effect or do I need to set the OwnerDrawn style and set the image in its Parent window procedure?

    Note:
    The Static control IS NOT OwnerDrawn.
    Last edited by JAAFAR; Oct 2nd, 2020 at 02:12 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width