Page 2 of 2
Re: #WM_NOTIFY in callback failure
Posted: Tue May 23, 2023 8:21 am
by mk-soft
BarryG wrote: Tue May 23, 2023 1:09 am
Also, your SetGadgetCallback() is ProcedureReturning either 0 or CallWindowProc_(*lpPrevFunc, hWnd, uMsg, wParam, lParam), but my app needs to return 1 at times, so I can't use your code anyway. Thanks for posting it, though.
If anyone can show me a drop-in way to make ANY gadget get notified of #WM_NOTIFY, without having to code something for every gadget (I have hundreds), then I'm all ears. Even more so if it can just transfer that message to SetWindowCallback() instead so I can handle it there, like 6.01 does. But that still leaves the problem of lots of broken historic code on this forum now.
1.
The GadgetCallback works like WindowCallback.
So you can also determine the return value yourself, as for example with the parent of the ListIconGadget. Call ProcedureReturn or process with CallGadgetProc.
2.
I can look at automatically directing all existing gadgets to a GlobalCallback.
Re: #WM_NOTIFY in callback failure
Posted: Tue May 23, 2023 8:22 am
by Fred
mksoft's SetGadgetCallback() should work for any gadget, why do you think it would work only for ListIcon ? Also it can returns any value, as it's the called callback which returns the value. It basically just a replacement for SetWindowCallback(). I will probably add such a command in the next major version to ease the process.
The way SetWindowCallback() worked was broken because it didn't respect WinAPI and could cause other issues by recieving unexpected event from the callback. If you use WinAPI, you have the respect the rules and the fact it worked before isn't enough to leave this bug forever in PB.
Re: #WM_NOTIFY in callback failure
Posted: Tue May 23, 2023 10:04 am
by BarryG
I'm lost. Sorry, I can't concentrate and think at the moment over all this. I'll have to wait and see what happens in future. 6.01 will remain my current version for now. (But I will try mk-soft's new example).
Re: #WM_NOTIFY in callback failure
Posted: Tue May 23, 2023 1:31 pm
by Fred
There is no issue to stick to specific PB version to maintain your current software anyway, that's why there is a museum section.