Again another strange problem. I don't know what's going on.
The problem is the following:
I get an unlimited number of WM_NOTIFY messages.
wParam and idFrom are both 0. hwndFrom is some large number (this window doesn't even seem to exist, my spy program at least couldn't find it). the code is 0xFFFFFFF4.
So, since i didn't know what this code means, i searched all my include files on my hd for this value. the only thing i found was:
But i don't think that's it. it seems to be some kind of id code but not a notification code. So what is that all about?

I receive all these WM_NOTIFY messages, when i do the following:
Open a dialog of my program using DialogBox, then change to another window so that my program is completely covered by other windows (or just minimize my window). When i bring my program back into foreground, i receive all these WM_NOTIFY messages. I have no idea what the problem is.
It doesn't even matter which dialog i open, it always happens. So it is probably not a problem of the dialog itself (if yes, all these dialog would have to be "corrupted", but i even tried it with a dialog doing completely nothing but displaying some static text, and it happened again).
And again: the problem only occurs when i put my window into background and bring it into foreground again. plus, a dialog must have been opened.
i can open as many dialogs as i want and as often as i want...if i don't bring my window into the background and then into foreground again, it doesn't happen.
otherwise it also doesn't happen if i bring my window into background and then into foreground again, but haven't opened a dialog yet.

I could really need some help on this one please. I'd greatly appreciate it.

Thanks in advance.
Posted on 2002-01-19 12:46:09 by darester
Why is it a problem? Just ignore messages you don't handle :).
Posted on 2002-01-19 12:48:18 by f0dder
look, these messages are sent unlimited times, it doesn't stop. and when my programs receives a 100000 messages, my program can't do anything anymore. all it does is responding to these messages, but it never ever stops. so my program gets frozen. i need to know what causes all these messages, so that i can avoid that message flow. if i can't avoid it, i'm stuck...
Posted on 2002-01-19 14:10:25 by darester
Ok, that *is* weird... wish I knew why :/
Posted on 2002-01-19 14:15:52 by f0dder
In what context are you processing the WM_NOTIFY message and for what reason are you processing it.

There are many default windows messages that are automatically handled by the system, usually you only process this message if you have some reason to do so.


Posted on 2002-01-19 14:21:30 by hutch--
i process WM_NOTIFY for:
- TTN_NEEDTEXT (Tooltiptext)

TTN_NEEDTEXT should be clear. i process it to set the tooltip texts
I use TTN_POP and TBN_HOTITEMCHANGE for my toolbar to change the statusbar text. If a new item is selected (TBN_HOTITEMCHANGE), i will set a special statusbar text for that item and a tooltip text will popup. the only reason i use TTN_POP is, because when you move the cursor from a hilited item to a grayed item, there won't be a TBN_HOTITEMCHANGE notification. But the tooltiptext will be destroyed, so all i can do is use TTN_POP to update the statusbar text (or are there other possibilites?).
Well, but that doesn't have to do much with my problem, does it?

BTW: I always use a break in WM_NOTIFY, so all notifications i handle myself will also be sent to DefWindowProc (oh well, in my case, it's DefFrameProc, since i use MDI in my program).

So when the program gets flooded with all these messages, they are all passed to DefFrameProc immediately, since i don't process this notification code.
But since the hwndFrom member of the nmhdr structure is more or less invalid (as i said, my window spying tool didn't find that window), DefFrameProc will not be able to respond. That's probably why it gets flooded with more and more messages. the other side is probably waiting for a response, but the respone will never arrive because of the invalid hwndFrom.
But how can there be a notification code from an invalid window? isn't this impossible? i mean a window that does not exist can't send any notifications, can it?
And that the idFrom member is 0 is also a bit strange, isn't it?
I don't know what's going on there.
Posted on 2002-01-19 15:18:22 by darester
i'll post the program real quick so you can check it out. maybe you'll see what is going on there.
(the functions in the program are not implemented yet and the buttons are just put together somehow, so don't wonder about the interface, it's not gonna be like that in the end :))
just open the Create New Project Dialog 1 or 2 times, and bring the main window 1 or 2 times into background and into the foreground again, and then almost nothing works anymore (menus and dialogs are not shown if you don't activate them explicitly and so on...). if you then use a window spying tool and check the messages that are sent to the main window, you'll see WM_NOTIFY ... a few times per second.
Posted on 2002-01-19 15:38:19 by Unregistered
the above poster was me...
well, i have found out something:
if i make my dialog systemmodal, there will be no problems, everything works just fine.
but i don't want to make them systemmodal...
maybe someone knows whats going on now.
Posted on 2002-01-20 02:03:49 by darester
A stab in the dark. Message recursion?

Make sure that when you're updating the tooltips or toolbar, you're not triggering another WM_NOTIFY.
Posted on 2002-01-21 17:22:00 by tank
oh well, i've finally found the problem. i was allocating some memory, but couldn't free it properly. that caused these strange problems somehow. i have no idea why, but well, you all know that windows can be very strange sometimes.

thanks for your help anyways!
Posted on 2002-01-22 05:54:13 by darester