From 8668735887490ba63cf9f90c6d64bc3e9311f4ac Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Sat, 19 Apr 2008 13:08:23 +0000 Subject: [PATCH] Fixes ShowModal on wince. git-svn-id: trunk@14888 - --- lcl/interfaces/wince/winceproc.pp | 26 ++++++++++++++++++-------- lcl/interfaces/wince/wincewsforms.pp | 7 +++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/lcl/interfaces/wince/winceproc.pp b/lcl/interfaces/wince/winceproc.pp index bbc7dd03c6..2d7b5427d8 100644 --- a/lcl/interfaces/wince/winceproc.pp +++ b/lcl/interfaces/wince/winceproc.pp @@ -82,7 +82,7 @@ function GetFileVersion(FileName: string): dword; function AllocWindowInfo(Window: HWND): PWindowInfo; function DisposeWindowInfo(Window: HWND): boolean; function GetWindowInfo(Window: HWND): PWindowInfo; -function DisableWindowsProc(Window: HWND; Data: LParam): LongBool; stdcall; +function DisableWindowsProc(Window: HWND; Data: LParam): LongBool; {$ifdef Win32}stdcall;{$else}cdecl;{$endif} procedure DisableApplicationWindows(Window: HWND); procedure EnableApplicationWindows(Window: HWND); procedure AddToChangedMenus(Window: HWnd); @@ -102,6 +102,7 @@ type PDisableWindowsInfo = ^TDisableWindowsInfo; TDisableWindowsInfo = record NewModalWindow: HWND; + ProcessID: DWORD; DisabledWindowList: TList; end; @@ -1182,14 +1183,19 @@ end; Used in LM_SHOWMODAL to disable the windows of application thread except the current form. -----------------------------------------------------------------------------} -function DisableWindowsProc(Window: HWND; Data: LParam): LongBool; stdcall; +function DisableWindowsProc(Window: HWND; Data: LParam): LongBool; {$ifdef Win32}stdcall;{$else}cdecl;{$endif} var Buffer: array[0..15] of Char; + DisableWindowsInfo: PDisableWindowsInfo absolute Data; begin Result:=true; + // Only disable windows from our application + if DisableWindowsInfo^.ProcessID <> GetWindowThreadProcessId(Window, nil) then + Exit; + // Don't disable the current window form - if Window = PDisableWindowsInfo(Data)^.NewModalWindow then exit; + if Window = DisableWindowsInfo^.NewModalWindow then exit; // Don't disable any ComboBox listboxes if (GetClassName(Window, @Buffer, sizeof(Buffer))