Hello,
I am using the latest (5.48) emWin evaluation version for prototyping our project by simulating it on PC and have a very strange problem using BUTTON widget.
I create some buttons with BUTTON_CreateUser(), because I need to exchange data with it. For detecting the usage of the button I use WM_GetId() with the handle found from WM_GetFocusedWindow() and everything works, the right Id of the button having focus at the moment is properly detected.
But now I want to customize the style of the button and use the callback routine. And it doesn't work anymore. After any usage of WM_SetCallback for the buttons the Id of the focused button is not more detectable. I get the right handle of the button using WM_GetFocusedWindow(), but WM_GetId() for the received handle returns only zero (0). Then I comment the line with WM_SetCallback() out it works again how it should be.
I have checked everything in the callback routine, it seems to be ok. I have put WM_GetId() at the top of the callback routine, but it doesn't really help, the result Id is always 0, so I'm sure the Id is not destroyed within the callback.
Is it possible, that the usage of callback routine destroys the Id of the widget? I have used older versions of emWin (5.28 for example) before and have never seen such a problem.
Thank you in advance and waiting for your reply.
I am using the latest (5.48) emWin evaluation version for prototyping our project by simulating it on PC and have a very strange problem using BUTTON widget.
I create some buttons with BUTTON_CreateUser(), because I need to exchange data with it. For detecting the usage of the button I use WM_GetId() with the handle found from WM_GetFocusedWindow() and everything works, the right Id of the button having focus at the moment is properly detected.
But now I want to customize the style of the button and use the callback routine. And it doesn't work anymore. After any usage of WM_SetCallback for the buttons the Id of the focused button is not more detectable. I get the right handle of the button using WM_GetFocusedWindow(), but WM_GetId() for the received handle returns only zero (0). Then I comment the line with WM_SetCallback() out it works again how it should be.
I have checked everything in the callback routine, it seems to be ok. I have put WM_GetId() at the top of the callback routine, but it doesn't really help, the result Id is always 0, so I'm sure the Id is not destroyed within the callback.
Is it possible, that the usage of callback routine destroys the Id of the widget? I have used older versions of emWin (5.28 for example) before and have never seen such a problem.
Thank you in advance and waiting for your reply.
The post was edited 1 time, last by Polarisru ().