Hello all,
In my opinion, the message will be posted from child to parent via default callback.
Is it right? To make it clear, I wrote the test code as followed:
|
C/C++ Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
static TEXT_Handle _hText;
static WM_HWIN _hDialog;
static void _cbText(WM_MESSAGE * pMsg) {
/* Handle the message(s) needed */
switch (pMsg->MsgId) {
case 1100:
printf("TXT::1100\n");
break; //no return here ... let parent do something
}
/* Default message handler */
TEXT_Callback(pMsg);
}
static void _cbDialog(WM_MESSAGE * pMsg) {
/* Handle the message(s) needed */
switch (pMsg->MsgId) {
case 1100:
printf("DLG::1100\n");
return;
}
/* Default message handler */
WM_DefaultProc(pMsg);
}
void Test(void) {
WM_HWIN hClient = WM_GetClientWindow(_hDialog);
_hText = TEXT_CreateEx(0, 0, 80, 40, hClient, WM_CF_SHOW, 0x0, GUI_ID_TEXT0, 0);
WM_SetCallback(_hText, _cbText);
GUI_Delay(50);
WM_SendMessageNoPara(_hText, 1100);
}
|
The test result is, the message cannot be posted from child to parent via default callback?!!
Did I do something wrong? If not, then some strange issues in my project do make sense...
My emWin version is: v5.44b
Thanks,
Kenmux