BBC BASIC for Windows
Programming >> Libraries >> WINLIB2B Notifications http://bb4w.conforums.com/index.cgi?board=libraries&action=display&num=1376342789 WINLIB2B Notifications
Post by Malvern on Aug 12th, 2013, 9:26pm
The WM_NOTIFY passes many, many, NM_CUSTOMDRAW events. A recent look saw some 65 such events just displaying a dialog with buttons and an edit control. How would it be possible to modify the dialog message loop to screen out this event type so that the ON SYS did not get overwhelmed. I don't mean all WM_NOTIFY, just those with a code of -12.
Vern
Re: WINLIB2B Notifications
Post by admin on Aug 13th, 2013, 05:04am
How would it be possible to modify the dialog message loop to screen out this event type so that the ON SYS did not get overwhelmed.
Are you specifying *SYS 1 in your program? If so I would recommend removing that command, or changing it to *SYS 0, to avoid the ON SYS getting flooded. Of course that would mean that you receive no WM_NOTIFY messages at all; can you live with that? Most 'important' notifications arrive as WM_COMMAND messages (which of course always activate ON SYS) rather than WM_NOTIFY messages.
To filter WM_NOTIFY messages selectively would require assembler code, unfortunately.
Richard.
Re: WINLIB2B Notifications
Post by Malvern on Aug 13th, 2013, 1:24pm
Quote:
To filter WM_NOTIFY messages selectively would require assembler code, unfortunately.
Yes I understand that and that was really what I was asking for, a modification to the message loop. I want some WM_NOTIFY events but this one code seems very common and unneeded for me and probably anyone writing an application in BASIC.
Re: WINLIB2B Notifications
Post by admin on Aug 13th, 2013, 1:59pm
The routine you need is PROCassemble (at the end of the listing). As it stands that intercepts HDN_ITEMCLICKA notifications and converts them to WM_COMMAND messages. You should be able to adapt it to intercept just the notification(s) you want to receive, and ignore the rest by not using *SYS 1.
The scomp and ncomp routines can be ignored or deleted, unless you need them for sorting.
Richard.
Re: WINLIB2B Notifications
Post by Malvern on Aug 14th, 2013, 02:56am
The DIRPRINT example did give me the clue I was after to modify WINLIB2B since I did want other WN_NOTIFY events. Thank you.