mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:00:27 +02:00
win32: add IsProcessDPIAware function
git-svn-id: trunk@28171 -
This commit is contained in:
parent
e8dc95ab80
commit
61ed016376
@ -84,6 +84,7 @@ var
|
|||||||
SetLayeredWindowAttributes: function (HWND: hwnd; crKey: COLORREF; bAlpha: byte; dwFlags: DWORD): BOOL; stdcall;
|
SetLayeredWindowAttributes: function (HWND: hwnd; crKey: COLORREF; bAlpha: byte; dwFlags: DWORD): BOOL; stdcall;
|
||||||
UpdateLayeredWindow: function(hWnd: HWND; hdcDst: HDC; pptDst: PPoint; psize: PSize;
|
UpdateLayeredWindow: function(hWnd: HWND; hdcDst: HDC; pptDst: PPoint; psize: PSize;
|
||||||
hdcSrc: HDC; pptSrc: PPoint; crKey: COLORREF; pblend: PBlendFunction; dwFlags: DWORD): BOOL; stdcall;
|
hdcSrc: HDC; pptSrc: PPoint; crKey: COLORREF; pblend: PBlendFunction; dwFlags: DWORD): BOOL; stdcall;
|
||||||
|
IsProcessDPIAware: function: BOOL; stdcall;
|
||||||
|
|
||||||
const
|
const
|
||||||
// ComCtlVersions
|
// ComCtlVersions
|
||||||
@ -561,6 +562,11 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function _IsProcessDPIAware: BOOL; stdcall;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
msimg32lib = 'msimg32.dll';
|
msimg32lib = 'msimg32.dll';
|
||||||
user32lib = 'user32.dll';
|
user32lib = 'user32.dll';
|
||||||
@ -613,6 +619,7 @@ begin
|
|||||||
Pointer(GetWindowInfo) := @_GetWindowInfo;
|
Pointer(GetWindowInfo) := @_GetWindowInfo;
|
||||||
Pointer(SetLayeredWindowAttributes) := @_SetLayeredWindowAttributes;
|
Pointer(SetLayeredWindowAttributes) := @_SetLayeredWindowAttributes;
|
||||||
Pointer(UpdateLayeredWindow) := @_UpdateLayeredWindow;
|
Pointer(UpdateLayeredWindow) := @_UpdateLayeredWindow;
|
||||||
|
Pointer(IsProcessDPIAware) := @_IsProcessDPIAware;
|
||||||
|
|
||||||
user32handle := LoadLibrary(user32lib);
|
user32handle := LoadLibrary(user32lib);
|
||||||
if user32handle <> 0 then
|
if user32handle <> 0 then
|
||||||
@ -636,6 +643,10 @@ begin
|
|||||||
p := GetProcAddress(user32handle, 'UpdateLayeredWindow');
|
p := GetProcAddress(user32handle, 'UpdateLayeredWindow');
|
||||||
if p <> nil
|
if p <> nil
|
||||||
then Pointer(UpdateLayeredWindow) := p;
|
then Pointer(UpdateLayeredWindow) := p;
|
||||||
|
|
||||||
|
p := GetProcAddress(user32handle, 'IsProcessDPIAware');
|
||||||
|
if p <> nil
|
||||||
|
then Pointer(IsProcessDPIAware) := p;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
|
Loading…
Reference in New Issue
Block a user