Sign in to follow this  
Followers 0
mikehunt114

GUISend/RecvMSG

7 posts in this topic

#1 ·  Posted (edited)

I'm trying to invoke the BM_GETIMAGE message for a button control. I want to verify the handle to/and or the type of image associated with my button. I'm using the following code:

#include <GUIConstants.au3>
#include <Array.au3>

Opt("GUIOnEventMode", 1)

$myGUI = GUICreate("TEST")
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")

$button = GUICtrlCreateButton ("my picture button", 10, 10,40,40, $BS_ICON)
GUICtrlSetImage(-1, "shell32.dll", 22)
GUISetState()

Sleep(1000)

$val = GUICtrlSendMsg($button, 0x00F6, $BS_ICON, 0)
MsgBox(0, "", $val)
_ArrayDisplay($val)

While 1
    Sleep(10)
WEnd

Func Quit()
    Exit 0
EndFunc

I've never used "custom" message events before, so I must be doing something wrong. Advice?

Thanks.

Edit: I've tried using both $BS_ICON and $BS_BITMAP as the wParam.

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe you should read the command again :whistle:

Little help:

Global Const $IMAGE_BITMAP = 0
Global Const $IMAGE_ICON = 1
Global Const $BM_GETIMAGE = 0x00F6
...
$val = GUICtrlSendMsg($button, $BM_GETIMAGE, $IMAGE_ICON, 0)
...

Greets

Holger

Edited by Holger

Share this post


Link to post
Share on other sites

Thanks, where did you find the values of IMAGE_ICON/IMAGE_BITMAP?


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Local MSDN :whistle:

You can also use the MSDN library online: http://msdn2.microsoft.com/en-us/library/default.aspx

Then type "BM_GETIMAGE" in the field at left top and enter...

Greets

Holger

Edited by Holger

Share this post


Link to post
Share on other sites

Yes, I browsed MSDN extensively before posting here. Notice my link to the MSDN doc in my first post? :whistle:

I couldn't find values for those parameters, I ended up using Google to find the value for the BM_GETIMAGE message. Where exactly did you find the values? I want to be able to find things like this for myself.

Thanks!


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Ah, ok. That's what I had to do for the message code. Thanks.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0