mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 13:19:21 +02:00
win32 interfaces: fixed openfiledialogs on windows 98 and earlier
git-svn-id: trunk@10528 -
This commit is contained in:
parent
edabd1fe1f
commit
711de596e8
@ -113,6 +113,11 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
// The size of the OPENFILENAME record depends on the windows version
|
||||
// In the initialization section the correct size is determined.
|
||||
var
|
||||
OpenFileNameSize: integer = 0;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: GetOwnerHandle
|
||||
Params: ADialog - dialog to get 'guiding parent' window handle for
|
||||
@ -387,7 +392,7 @@ begin
|
||||
ZeroMemory(@OpenFile, sizeof(OpenFileName));
|
||||
with OpenFile Do
|
||||
begin
|
||||
lStructSize := sizeof(OpenFileName);
|
||||
lStructSize := OpenFileNameSize;
|
||||
hWndOwner := GetOwnerHandle(AOpenDialog);
|
||||
hInstance := System.hInstance;
|
||||
lpStrFilter := StrAlloc(Length(Filter)+1);
|
||||
@ -601,6 +606,11 @@ end;
|
||||
|
||||
initialization
|
||||
|
||||
if (Win32MajorVersion=4) then
|
||||
OpenFileNameSize := sizeof(OPENFILENAME_NT4)
|
||||
else
|
||||
OpenFileNameSize:=sizeof(OPENFILENAME);
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// I M P O R T A N T
|
||||
////////////////////////////////////////////////////
|
||||
@ -616,4 +626,5 @@ initialization
|
||||
// RegisterWSComponent(TColorButton, TWin32WSColorButton);
|
||||
RegisterWSComponent(TFontDialog, TWin32WSFontDialog);
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
end.
|
||||
|
@ -274,6 +274,8 @@ type
|
||||
LPOPENFILENAME = ^OPENFILENAME;
|
||||
TOPENFILENAME = OPENFILENAME;
|
||||
POPENFILENAME = ^OPENFILENAME;
|
||||
|
||||
OPENFILENAME_NT4 = Windows.OPENFILENAME;
|
||||
|
||||
|
||||
Implementation
|
||||
|
Loading…
Reference in New Issue
Block a user