Board index » delphi » Modal form Taskbar anomaly?

Modal form Taskbar anomaly?

Does anyone know why when I show a modal form from my MDI app
and switch to another app (NT 4.0 or Win95) and then swith back
to my app by clicking on the icon in the task bar my MDI mainform
appears and not the modal form.  My MDI form is not usable because
the modal form is waiting for a response.  The weird thing is if
I use ALT-TAB to switch to my app the modal form appears.
Any help would be appreciated
Thanks, Mark

 

Re:Modal form Taskbar anomaly?


Mr. Mark R Horan wrote:

Quote

> Does anyone know why when I show a modal form from my MDI app
> and switch to another app (NT 4.0 or Win95) and then swith back
> to my app by clicking on the icon in the task bar my MDI mainform
> appears and not the modal form.  My MDI form is not usable because
> the modal form is waiting for a response.  The weird thing is if
> I use ALT-TAB to switch to my app the modal form appears.
> Any help would be appreciated
> Thanks, Mark

To fix it, in your project source file
1) add WinTypes, WinProcs to the uses clause in your DPR
2) add var  WStyle: LongInt;
3) after the begin add:
    wStyle := GetWindowLong(Application.Handle, GWL_Style);
    wStyle := wStyle or ws_Caption;
    SetWindowLong(Application.Handle, GWL_Style, wStyle);

Other Threads