TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Nick Knight
from: Dean Roddey
date: 1994-11-17 05:37:30
subject: Wincreatedlg

Thanks Nick for your msg about Wincreatedlg, on 13 11-13-1994

NK> dialog box is not actually a working "window" until 
NK> sometime just before the WM_INITDLG message is called 
NK> within your dBoxDlgProc.  This is where you need to do your 
NK> field queries and text setting.
NK> 
NK> You're trying to query a window handle and set its text 
NK> before it's accepting messages.  Its message loop doesn't 
NK> start until WinProcessDlg is called.
NK> 
NK> I still do this kind of thing regularly (try to manipulate 
NK> a window before it's really a window :).  That's one of the 
NK> first things I check my own code for!
NK> 

Actually that is not true. When WinLoadDialog() comes back, it
has already completed the WM_INITDLG message (which is really just
an echo of WM_CREATE that the underlying frame window got. So
(assuming that dialog was correctly created), the window handle
will be value. The thing that you have to watch out for is this:


HWND       hwndMyWin;

{
    case WM_CREATE        :
    //
    // Doing something here with hwndMyWin is wrong, because the call
to     // WinCreateWindow() below will not return until WM_CREATE is
done.     //

}

hwndMyWin = WinCreateWindow(....);


But once the WM_CREATE (or WM_INITDLG) completes, control returns
to the caller of WinCreateWindow() or WinLoadDialog() with the
handle.

___
 X KWQ/2 1.2b X "640K ought to be enough for anybody." - Bill Gates, 1981

--- Maximus/2 2.02

* Origin: Fernwood - your source for OS/2 files! (1:141/209)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1
@PATH: 141/209 270/101 396/1 3615/50 229/2 12/2442 711/409 54/54 711/808 809
@PATH: 711/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™.