Results 1 to 5 of 5

Thread: Doesn't anybody know? CBEM_SETIMAGELIST and SendMessage problems

  1. #1

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78

    Unhappy Doesn't anybody know? CBEM_SETIMAGELIST and SendMessage problems

    I guess I need to be more descriptive. I am using mainly the SendMessage API function and the CBEM_SETIMAGELIST constant in order to attach an ImageList to my API-created ComboBoxEx (aka "ImageCombo") control. Here are the declarations:

    Code:
    Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
    lParam As Any) As Long
    
    WM_USER = &H400
    CBEM_SETIMAGELIST = (WM_USER + 1)
    ImgList is the ImageList, and CmboEx is the ComboBoxEx (aka "ImageCombo") handler. Here is the code:

    Code:
    SendMessage CmboEx, CBEM_SETIMAGELIST, 0, ImgList
    Can somebody please tell me what I am doing wrong? I am just having a hard time figuring it out!
    Last edited by dubae524; Jul 3rd, 2001 at 06:56 PM.
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

  2. #2

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78
    Doesn't anybody know how to answer my question?
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Is ImgList an ImageList from the Common Controls OCX, or one that you created through the API?
    If you created it with the API then I don't see a problem with your code, but if it's from the OCX, you'll need to do this:
    VB Code:
    1. SendMessage CmboEx, CBEM_SETIMAGELIST, 0, ByVal ImgList.hImageList
    Hope this helps

  4. #4
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Oh wait, one more thing that I just noticed:
    You said that CBEM_SETIMAGELIST = (WM_USER + 1)... Well, it should be WM_USER + 2.
    Oh well

  5. #5

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78

    Talking

    Thank you so much!!! It works, too! Thank you!
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

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