#WM_NOTIFY in callback failure

Windows specific forum
User avatar
mk-soft
Always Here
Always Here
Posts: 5333
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: #WM_NOTIFY in callback failure

Post 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.
Last edited by mk-soft on Tue May 23, 2023 8:22 am, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Fred
Administrator
Administrator
Posts: 16616
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: #WM_NOTIFY in callback failure

Post 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.
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: #WM_NOTIFY in callback failure

Post 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).
Fred
Administrator
Administrator
Posts: 16616
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: #WM_NOTIFY in callback failure

Post 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.
Post Reply