diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 63afcdbb21..8f1a3394a6 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -654,7 +654,7 @@ begin Result := ExtractFileName(GetExeName); Ext := ExtractFileExt(Result); If Ext <> '' then - Delete(Result, Length(Result) - Length(Ext) - 1, Length(Ext) + 1); + Delete(Result, Length(Result) - Length(Ext) + 1, Length(Ext)); end else Result := FTitle; @@ -1098,6 +1098,9 @@ end; { ============================================================================= $Log$ + Revision 1.60 2003/08/09 16:30:33 mattias + fixed LM_ShowModal for win32 intf from Karl + Revision 1.59 2003/07/16 16:53:59 mattias added TApplication.CaptureExceptions diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index 52152af325..806417fd2e 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -22,6 +22,35 @@ { callback routines } {*************************************************************} +{----------------------------------------------------------------------------- + Function: DisableWindowsProc + Params: Window - handle of toplevel windows to be disabled + Data - handle of current window + Returns: Whether the enumeration should continue + + Used in LM_SHOWMODAL to disable the windows of applicaion thread except the current + -----------------------------------------------------------------------------} +Function DisableWindowsProc(Window: Hwnd; Data: LParam): LongBool; StdCall; +Begin + Result:=true; + If Data <> Window Then + EnableWindow(Window,False); +End; + +{----------------------------------------------------------------------------- + Function: EnableWindowsProc + Params: Window - handle of toplevel windows to be enabled + Data - nothing + Returns: Whether the enumeration should continue + + Used in LM_SHOWMODAL to enable the windows of applicaion thread + -----------------------------------------------------------------------------} +Function EnableWindowsProc(Window: Hwnd; Data: LParam): LongBool; StdCall; +Begin + Result:=true; + EnableWindow(Window,True); +End; + {----------------------------------------------------------------------------- Function: PropEnumProc Params: Window - The window with the property @@ -609,6 +638,9 @@ end; { $Log$ + Revision 1.46 2003/08/09 16:30:33 mattias + fixed LM_ShowModal for win32 intf from Karl + Revision 1.45 2003/07/31 19:56:50 mattias fixed double messages SETLabel diff --git a/lcl/interfaces/win32/win32object.inc b/lcl/interfaces/win32/win32object.inc index ce1015b93d..06f6082923 100644 --- a/lcl/interfaces/win32/win32object.inc +++ b/lcl/interfaces/win32/win32object.inc @@ -666,9 +666,11 @@ activate_time : the time at which the activation event occurred. Finally StrDispose(PStr); End; - End; - SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_Style) Or WS_DLGFRAME); - ShowWindow(Handle, SW_Show); + End + Else begin + EnumThreadWindows(GetWindowThreadProcessId(Handle,nil),@DisableWindowsProc, Handle); + ShowWindow(Handle, SW_Show); + end; End; LM_TB_BUTTONCOUNT: Begin @@ -2194,6 +2196,9 @@ Begin Else Begin Assert(False, 'TRACE: [TWin32Object.ShowHide] Hiding the window'); + If Sender Is TCustomForm then + If fsModal in TCustomForm(Sender).FormState then + EnumThreadWindows(GetWindowThreadProcessId(Handle,nil),@EnableWindowsProc, Handle); ShowWindow(Handle, SW_HIDE); End; End; @@ -2729,6 +2734,9 @@ End; { $Log$ + Revision 1.81 2003/08/09 16:30:34 mattias + fixed LM_ShowModal for win32 intf from Karl + Revision 1.80 2003/07/30 21:56:32 marc * Fixed LM_APPENDTEXT buffer overrun