User Tools

Site Tools


replacing_20the_20message_20pump

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
replacing_20the_20message_20pump [2018/03/31 14:19]
127.0.0.1 external edit
replacing_20the_20message_20pump [2018/04/13 12:48]
richardrussell
Line 13: Line 13:
            }            }
        }        }
-Very occasionally there may be a requirement to use a different message pump. For example, in order for **keyboard navigation** to work in a dialogue box, the message pump must include a call to the [[http://​msdn.microsoft.com/​en-us/​library/​windows/​desktop/​ms645498(v=vs.85).aspx|IsDialogMessage]] API.\\ \\  Until very recently I believed that it was impossible to //replace// the existing BB4W message pump, and that therefore the only way to provide a different one was to start a new thread (each thread has its own message pump). This is the principal reason why the **WINLIB2** library creates a new thread for every new dialogue box created.\\ \\  However I have discovered that in fact there is a way of replacing the '​main'​ message pump, and the procedure listed below does exactly that:\\ +Very occasionally there may be a requirement to use a different message pump. For example, in order for **keyboard navigation** to work in a dialogue box, the message pump must include a call to the [[http://​msdn.microsoft.com/​en-us/​library/​windows/​desktop/​ms645498(v=vs.85).aspx|IsDialogMessage]] API.\\ \\  Until very recently I believed that it was impossible to //replace// the existing BB4W message pump, and that therefore the only way to provide a different one was to start a new thread (each thread has its own message pump). This is the principal reason why the **WINLIB2** library creates a new thread for every new dialogue box created.\\ \\  However I have discovered that in fact there is a way of replacing the '​main'​ message pump, and the procedure listed below does exactly that: 
 + 
 +<code bb4w> ​
         DEF PROCnewmessagepump         DEF PROCnewmessagepump
         LOCAL K%, L%, M%, N%, O%, P%, S%, U%, code%, pass%         LOCAL K%, L%, M%, N%, O%, P%, S%, U%, code%, pass%
Line 52: Line 54:
         SYS "​SendMessage",​ @hwnd%, 0, 0, 0         SYS "​SendMessage",​ @hwnd%, 0, 0, 0
         ENDPROC         ENDPROC
 +</​code>​
 +
replacing_20the_20message_20pump.txt · Last modified: 2018/04/17 19:32 by tbest3112