mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:39: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
|
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
|
Method: GetOwnerHandle
|
||||||
Params: ADialog - dialog to get 'guiding parent' window handle for
|
Params: ADialog - dialog to get 'guiding parent' window handle for
|
||||||
@ -387,7 +392,7 @@ begin
|
|||||||
ZeroMemory(@OpenFile, sizeof(OpenFileName));
|
ZeroMemory(@OpenFile, sizeof(OpenFileName));
|
||||||
with OpenFile Do
|
with OpenFile Do
|
||||||
begin
|
begin
|
||||||
lStructSize := sizeof(OpenFileName);
|
lStructSize := OpenFileNameSize;
|
||||||
hWndOwner := GetOwnerHandle(AOpenDialog);
|
hWndOwner := GetOwnerHandle(AOpenDialog);
|
||||||
hInstance := System.hInstance;
|
hInstance := System.hInstance;
|
||||||
lpStrFilter := StrAlloc(Length(Filter)+1);
|
lpStrFilter := StrAlloc(Length(Filter)+1);
|
||||||
@ -601,6 +606,11 @@ end;
|
|||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
|
if (Win32MajorVersion=4) then
|
||||||
|
OpenFileNameSize := sizeof(OPENFILENAME_NT4)
|
||||||
|
else
|
||||||
|
OpenFileNameSize:=sizeof(OPENFILENAME);
|
||||||
|
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
// I M P O R T A N T
|
// I M P O R T A N T
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
@ -616,4 +626,5 @@ initialization
|
|||||||
// RegisterWSComponent(TColorButton, TWin32WSColorButton);
|
// RegisterWSComponent(TColorButton, TWin32WSColorButton);
|
||||||
RegisterWSComponent(TFontDialog, TWin32WSFontDialog);
|
RegisterWSComponent(TFontDialog, TWin32WSFontDialog);
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -275,6 +275,8 @@ type
|
|||||||
TOPENFILENAME = OPENFILENAME;
|
TOPENFILENAME = OPENFILENAME;
|
||||||
POPENFILENAME = ^OPENFILENAME;
|
POPENFILENAME = ^OPENFILENAME;
|
||||||
|
|
||||||
|
OPENFILENAME_NT4 = Windows.OPENFILENAME;
|
||||||
|
|
||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user