TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Steffen Offermann
from: Mark Kimes
date: 1995-08-02 00:59:18
subject: Re: Q: WM_SETFOCUS

SO>I have a dialog window with an entry field in it. I do not want
 SO>the user to be able to change the content of that field directly.
 SO>What I want is a second dialog box that opens when the entry field
 SO>receives the focus, since the entry field only shows a part of the
 SO>actual data it stands for. However, when I intercept the WM_SETFOCUS
 SO>command to open that second dialog window, I get a problem. As the
 SO>PM reference says, I may not change the focus while processing
 SO>WM_SETFOCUS. But this is exactly what happens when I open a dialog
 SO>window. So, how can I do it? I need a method to open a dialog window
 SO>while processing WM_SETFOCUS, make it the currently focussed window
 SO>and return the focus to the window that received WM_SETFOCUS in the
 SO>first place _without_ having it receive that message again (because
 SO>this would result in an endless loop).

Post a message to yourself to start the dialog box, set a flag somewhere
in the window words indicating that you did so, and don't loop if you've
already done it (tweak depending on the exact behavior desired).  I
assume you subclassed the entry field for more than the WM_SETFOCUS
message (else you would use WM_CONTROL/EN_SETFOCUS).

--- XHEd-OS/2 1.22
* Origin: The Pit (1:380/16)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 515 628 704 713/888 800/1 7877/2809
@PATH: 380/25 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.