Skip to main content
totti001
Associate III
Jun 24, 2014 2:36 PM UTC
Question

STemWin switch between windows

Posted on June 24, 2014 at 16:36

Hello everybody.

I have a problem with emWin library. I created 2 windows. At the first windows I have a button to switch to the another window. I use WM_SetFocus(win2) to switch. It working well. But when I want to switch back, it doesn'-t work. The display show the second window always.
    This topic has been closed for replies.

    2 replies

    rigomate2
    Associate II
    Jun 26, 2014 1:26 PM UTC
    Posted on June 26, 2014 at 15:26

    What do you call to switch it back?

    If you call WM_SetFocus(win1), are you sure the win1 holds the correct handle?

    totti001
    totti001Author
    Associate III
    Jun 26, 2014 8:40 PM UTC
    Posted on June 26, 2014 at 22:40

    I checked and the handle is wrong.

    So the program. I create 2 window with GUI builder, so the 2 window is a Dialog. A call CreateWin1 and I get the handler number 3 back. When I call WM_GetFocussed or WM_GetActiveWindow function, they return with handler number 2. I dont know why. So this was the problem.