|
-
Jul 2nd, 2001, 08:09 PM
#1
Thread Starter
Lively Member
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
-
Jul 3rd, 2001, 06:57 PM
#2
Thread Starter
Lively Member
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
-
Jul 4th, 2001, 11:21 AM
#3
Guru
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:
SendMessage CmboEx, CBEM_SETIMAGELIST, 0, ByVal ImgList.hImageList
Hope this helps
-
Jul 4th, 2001, 11:24 AM
#4
Guru
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
-
Jul 4th, 2001, 11:54 AM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|