AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi 11 -GetSystemMetrics( SM_CXSIZEFRAME ) ermittelt andere Werte
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi 11 -GetSystemMetrics( SM_CXSIZEFRAME ) ermittelt andere Werte

Ein Thema von Michael II · begonnen am 24. Okt 2021 · letzter Beitrag vom 27. Okt 2021
 
Benutzerbild von ULIK
ULIK

Registriert seit: 25. Sep 2006
Ort: Regensburg
427 Beiträge
 
Delphi 11 Alexandria
 
#14

AW: Delphi 11 -GetSystemMetrics( SM_CXSIZEFRAME ) ermittelt andere Werte

  Alt 25. Okt 2021, 10:44
[QUOTE=venice2;1496562]
Zitat:
...
Code:
long dpi(IN long nPix) {
    static float ratio;
    if (ratio == 0) {
        HDC hDC = GetDC(0); ratio = (GetDeviceCaps(hDC, LOGPIXELSX) / 96.0f); ReleaseDC(0, hDC);
    }
    return (long)(nPix * ratio);
}
//...
SetRect(&rc, 0, 0, dpi(XXX), dpi(YYY));
Dafür benötige ich keine extra VS High DPI Programmierumgebung das macht man von Hand. Kann das niemand mehr?
Nur mal so bemerkt: Dir ist aber schon bewußt, daß auf einem Multimonitorsystem und DPI Awareness V2, GetDeviceCaps ebenfalls mit Vorsicht zu genießen ist? Hier einmal ein Auszug aus der MS-Doku:
Zitat:
On a multiple monitor system, if hdc is the desktop, GetDeviceCaps returns the capabilities of the primary monitor. If you want info for other monitors, you must use the multi-monitor APIs or CreateDC to get a HDC for the device context (DC) of a specific monitor.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:30 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz