Hi, How can I create modal windows, i.e. windows that are always in foreground of your application (application modal). Thank you
Posted on 2001-05-11 08:49:00 by w116
W116, a modal dialog box/window should be a pop-up window having a System menu, a title bar, and a thick border; that is, the dialog box template should specify the WS_POPUP, WS_SYSMENU, WS_CAPTION, and DS_MODALFRAME styles. Hope it help Angelo
Posted on 2001-05-11 13:18:00 by ANGELO
You can easly:
invoke SetWindowPos, hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
where hWnd is the handle to the window you create, if you want to make it "always-on-top" after you created the window, or use the WS_EX_TOPMOST flag when you invoke the CreateWindowEx to create your window (is the first parameter)

        invoke CreateWindowEx,WS_EX_TOPMOST,
                              ADDR szClassName,
                              ADDR szDisplayName,
                              WS_OVERLAPPEDWINDOW,
                              CW_USEDEFAULT, 0,
                              CW_USEDEFAULT, 0, 
                              NULL, NULL,
                              hInst, NULL
This message was edited by Cip, on 5/11/2001 1:19:01 PM
Posted on 2001-05-11 13:18:00 by Cip
Thank you for your help! But what I want is an application modal window, not a system modal one. Please help!
Posted on 2001-05-12 09:13:00 by w116
Create dialog, or normal window and fill hParent. It'll block access to main window untill closed.
Posted on 2001-05-12 09:36:00 by The Svin