# GuiRegisterMsg Confusion

## Recommended Posts

Alright, There has been one particular function that i still can't seem to understand.

GUIRegisterMsg()

How exactly does GUIRegisterMsg work? Where do you get the constant that you use when you call the function, such as these constants from the example: (Which is so complex it is rather hard to follow)

```Global Const \$WM_DRAWITEM           = 0x002B
Global Const \$WM_COMMAND            = 0x0111oÝ÷ Ø    l£rv¬z÷«ÊÞ¡ûaz·z·§qç_ºw-ì²Ö«·­Øb²ì¢g­)àrZ,y«­¢+ØÀÌØí¹9½Ñ¥å
½ô    ¥ÑM¡¥Ð ÀÌØíÝAÉ´°ÄØ¤(ÀÌØí¹%ô   ¥Ñ¹ ÀÌØíÝAÉ´°ÁàÀÀÀÁ¤(ÀÌØí¡
ÑÉ°ôÀÌØí±AÉ´```

Is this information necessary? I don't know how or where to apply it.

It would really help if somebody were to walk me through the use of this function. Perhaps explain the logic. I just can't seem to understand the helpfile examples.

Thanks

Edited by Paulie

##### Share on other sites

Where do you get the constant that you use when you call the function, such as these constants from the example: (Which is so complex it is rather hard to follow)

```Global Const \$WM_DRAWITEM           = 0x002B
g¬±¨#
.×h²¶§X¤zØb±«­¢+Ù±½°
½¹ÍÐÀÌØí]5}
=559ôÁàÀÄÄÄ((ÀÌØí¡]¹ôU%
ÉÑ ÅÕ½Ðí¡±±¼Ý½É±ÅÕ½Ðì°ØÐÀ°ÐàÀ¤(ÀÌØíÑ¸ôU%
ÑÉ±
ÉÑ    ÕÑÑ½¸ ÅÕ½Ðí!±±¼]½É±ÌÌìÅÕ½Ðì°À°À¤)U%I¥ÍÑÉ5Í ÀÌØí]5}
=559°ÅÕ½Ðí5å
1½ÍÕ¹ÅÕ½Ðì¤)U%MÑMÑÑ ¤()Ý¡¥± Ä¤)]¹()Õ¹5å
½¹ÍÐÀÌØí]5}
=559ôÁàÀÄÄÄ((ÀÌØí¡]¹ôU%
ÉÑ ÅÕ½Ðí¡±±¼Ý½É±ÅÕ½Ðì°ØÐÀ°ÐàÀ¤(ÀÌØíÑ¸ôU%
ÑÉ±
ÉÑ    ÕÑÑ½¸ ÅÕ½Ðí   ÕÑÑ½¸ÄÅÕ½Ðì°À°À¤(ÀÌØíÑ¸ÈôU%
ÑÉ±
ÉÑ    ÕÑÑ½¸ ÅÕ½Ðí   ÕÑÑ½¸ÈÅÕ½Ðì°ÄÀÀ°À¤)U%I¥ÍÑÉ5Í ÀÌØí]5}
=559°ÅÕ½Ðí5å
½µµ¹Õ¹ÅÕ½Ðì¤)U%MÑMÑÑ ¤()Ý¡¥± Ä¤)]¹()Õ¹5å
½µµ¹Õ¹ ÀÌØí¡]¹°ÀÌØíÕ5Í°ÀÌØíÝAÉ´°ÀÌØí±AÉ´¤(ìÀÌØí±AÉ´Ý¥±°½¹Ñ¥¸Ñ¡½¹ÑÉ½°Ñ¡ÐÝÌÁÉÍÍ¸¸¸(¥ ÀÌØí±AÉ´ôôU%
ÑÉ±Ñ!¹± ÀÌØíÑ¸¤¤Q¡¸(5Í ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðíe½ÔÁÉÍÍÕÑÑ½¸ÄÅÕ½Ðì¤(±Í¥ ÀÌØí±AÉ´ôôU%
ÑÉ±Ñ!¹± ÀÌØíÑ¸È¤¤Q¡¸(5Í   ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðíe½ÔÁÉÍÍÕÑÑ½¸ÈÅÕ½Ðì¤(¹%(á¥Ð)¹Õ¹```

This example makes use of the \$lParam parameter.. this parameter contains the HWND(window handle) of the control that was pressed. As you can see I am using GUICtrlGetHandle() because AutoIt doesn't return the window handle.. it returns the ID of the control.

Hopefully this helped you a little?

Edited by chris95219

##### Share on other sites

Ahh.. That makes sense, I was just going to ask this. So its a bit like GuiSetOnEvent() only a bit better, and a bit harder.

## Create an account

Register a new account

×

• Wiki

• Back

• Git