Fensterrahmen
-
- Beiträge: 80
- Registriert: Mo 3. Nov 2014, 13:13
- OS, Lazarus, FPC: Winux (L 0.9.xy FPC 2.2.z)
- CPU-Target: xxBit
Fensterrahmen
Geht es mit Lazarus, dass ich den Fensterrahmen oben etwas höher mache und einige Controls in ihn setze?
Bei vielen Anwendungen, z.B. Browsern ist es auch oft so.
Bei vielen Anwendungen, z.B. Browsern ist es auch oft so.
Sorry, ich habe das Forum verlassen!
Re: Fensterrahmen
otisoft hat geschrieben:Bei vielen Anwendungen, z.B. Browsern ist es auch oft so.
Kannst du mal einen Screenshot von so einer Anwendung anhängen, damit man sieht, was du meinst?
-
- Beiträge: 152
- Registriert: Mo 3. Feb 2014, 14:07
- OS, Lazarus, FPC: Winux (L 0.9.xy FPC 2.2.z)
- CPU-Target: xxBit
Re: Fensterrahmen
Ja, beim IE scheint das tatsächlich so zu sein, denn das Menü sitzt drunter. Aber wie das programmiert ist, weiß ich auch nicht.
.
-
- Beiträge: 80
- Registriert: Mo 3. Nov 2014, 13:13
- OS, Lazarus, FPC: Winux (L 0.9.xy FPC 2.2.z)
- CPU-Target: xxBit
-
- Beiträge: 80
- Registriert: Mo 3. Nov 2014, 13:13
- OS, Lazarus, FPC: Winux (L 0.9.xy FPC 2.2.z)
- CPU-Target: xxBit
Re: Fensterrahmen
Denkt ihr, dass das auch unter Laz tut?
https://delphihaven.wordpress.com/2010/ ... r-reprise/
https://delphihaven.wordpress.com/2010/ ... -titlebar/
https://delphihaven.wordpress.com/2010/ ... r-reprise/
https://delphihaven.wordpress.com/2010/ ... -titlebar/
Sorry, ich habe das Forum verlassen!
-
- Beiträge: 80
- Registriert: Mo 3. Nov 2014, 13:13
- OS, Lazarus, FPC: Winux (L 0.9.xy FPC 2.2.z)
- CPU-Target: xxBit
Re: Fensterrahmen
Wenn ich es versuche bekomme ich:
unit1.pas(37,28) Error: Identifier not found "DwmCompositionEnabled"
unit1.pas(39,17) Error: Identifier not found "SetRectEmpty"
unit1.pas(40,23) Error: Identifier not found "AdjustWindowRectEx"
unit1.pas(40,40) Error: Identifier not found "GetWindowLong"
unit1.pas(40,58) Error: Identifier not found "GWL_STYLE"
unit1.pas(41,20) Error: Identifier not found "GetWindowLong"
unit1.pas(41,40) Error: Identifier not found "GWL_EXSTYLE"
unit1.pas(42,19) Error: Identifier not found "FWndFrameSize"
unit1.pas(43,15) Error: Identifier not found "GlassFrame"
unit1.pas(44,15) Error: Identifier not found "GlassFrame"
unit1.pas(45,17) Error: Identifier not found "SetWindowPos"
unit1.pas(45,71) Error: Identifier not found "SWP_FRAMECHANGED"
unit1.pas(52) Fatal: There were 12 errors compiling module, stopping
unit1.pas(37,28) Error: Identifier not found "DwmCompositionEnabled"
unit1.pas(39,17) Error: Identifier not found "SetRectEmpty"
unit1.pas(40,23) Error: Identifier not found "AdjustWindowRectEx"
unit1.pas(40,40) Error: Identifier not found "GetWindowLong"
unit1.pas(40,58) Error: Identifier not found "GWL_STYLE"
unit1.pas(41,20) Error: Identifier not found "GetWindowLong"
unit1.pas(41,40) Error: Identifier not found "GWL_EXSTYLE"
unit1.pas(42,19) Error: Identifier not found "FWndFrameSize"
unit1.pas(43,15) Error: Identifier not found "GlassFrame"
unit1.pas(44,15) Error: Identifier not found "GlassFrame"
unit1.pas(45,17) Error: Identifier not found "SetWindowPos"
unit1.pas(45,71) Error: Identifier not found "SWP_FRAMECHANGED"
unit1.pas(52) Fatal: There were 12 errors compiling module, stopping
Sorry, ich habe das Forum verlassen!
Re: Fensterrahmen
Wenn es nur um den Glass-Effekt geht, so wie in dem Screenshot von 12:00, kann ich dir die Unit "glass" anbieten. Einfach mit "uses" einbinden und im OnActivate
per "GlassForm(self, clBlue);" aktivieren. (EDIT: Anbei ein Screenshot.)
Aber: Ob das ganze mit Windows 8+, wo ja "glass" wieder abgeschafft ist, noch geht, weiß ich nicht.
per "GlassForm(self, clBlue);" aktivieren. (EDIT: Anbei ein Screenshot.)
Aber: Ob das ganze mit Windows 8+, wo ja "glass" wieder abgeschafft ist, noch geht, weiß ich nicht.
Code: Alles auswählen
// Aero Glass Effekt für Delphi-Forms
//
// Mit der Methode GlassForm kann für eine Form der
// Aero Glass Effekt unter Vista aktiviert werden.
// Der erste Parameter ist die Form-Klasse, der zweite
// optionale Parameter ist der BlurColorKey. Mit dem
// BlurColorKey wird eine Farbe festgelegt, auf dem
// der Effekt wirken soll, d.h. benutzt eine Komponente,
// auf der Form, für visuelle Darstellungen (Linien, Punkte,
// Bilder, ...), diese Farbe, so wird an dieser Stelle der
// Effekt wirksam. Der Standardwert für BlurColorKey ist
// clFuchsia.
//
// Hinweis: Für die Aktivierung wird zusätzlich TXPManifest
// bzw. eine RES-Datei die die Manifest-Daten
// enthält benötigt.
//
//
// Delphi-Unit von Daniel Mitte (2006)
//
//
// Beispiel:
//
// uses glass;
//
// [...]
//
// procedure TForm1.FormActivate(Sender: TObject);
// begin
// GlassForm(Form1);
// // oder mit anderem BlurColorKey
// // GlassForm(Form1, clBlue)
// end;
unit glass;
interface
{$mode delphi}{$H+}
uses
Windows,
Forms,
Graphics;
procedure GlassForm(frm: TForm; cBlurColorKey: TColor = clFuchsia);
implementation
procedure GlassForm(frm: TForm; cBlurColorKey: TColor = clFuchsia);
const
WS_EX_LAYERED = $80000;
LWA_COLORKEY = 1;
type
_MARGINS = packed record
cxLeftWidth: Integer;
cxRightWidth: Integer;
cyTopHeight: Integer;
cyBottomHeight: Integer;
end;
PMargins = ^_MARGINS;
TMargins = _MARGINS;
DwmIsCompositionEnabledFunc = function(pfEnabled: PBoolean): HRESULT; stdcall;
DwmExtendFrameIntoClientAreaFunc = function(destWnd: HWND; const pMarInset: PMargins): HRESULT; stdcall;
SetLayeredWindowAttributesFunc = function(destWnd: HWND; cKey: TColor; bAlpha: Byte; dwFlags: DWord): BOOL; stdcall;
var
hDWMDLL: Cardinal;
osVinfo: TOSVERSIONINFO;
fDwmIsCompositionEnabled: DwmIsCompositionEnabledFunc;
fDwmExtendFrameIntoClientArea: DwmExtendFrameIntoClientAreaFunc;
fSetLayeredWindowAttributesFunc: SetLayeredWindowAttributesFunc;
bCmpEnable: Boolean;
mgn: TMargins;
begin
ZeroMemory(@osVinfo, SizeOf(osVinfo));
OsVinfo.dwOSVersionInfoSize := SizeOf(TOSVERSIONINFO);
if ((GetVersionEx(osVInfo) = True) and (osVinfo.dwPlatformId = VER_PLATFORM_WIN32_NT) and (osVinfo.dwMajorVersion >= 6)) then
begin
hDWMDLL := LoadLibrary('dwmapi.dll');
if hDWMDLL <> 0 then
begin
@fDwmIsCompositionEnabled := GetProcAddress(hDWMDLL, 'DwmIsCompositionEnabled');
@fDwmExtendFrameIntoClientArea := GetProcAddress(hDWMDLL, 'DwmExtendFrameIntoClientArea');
@fSetLayeredWindowAttributesFunc := GetProcAddress(GetModulehandle(user32), 'SetLayeredWindowAttributes');
if ((@fDwmIsCompositionEnabled <> nil) and (@fDwmExtendFrameIntoClientArea <> nil) and (@fSetLayeredWindowAttributesFunc <> nil)) then
begin
fDwmIsCompositionEnabled(@bCmpEnable);
if bCmpEnable = True then
begin
frm.Color := cBlurColorKey;
SetWindowLong(frm.Handle, GWL_EXSTYLE, GetWindowLong(frm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
fSetLayeredWindowAttributesFunc(frm.Handle, cBlurColorKey, 0, LWA_COLORKEY);
ZeroMemory(@mgn, SizeOf(mgn));
mgn.cxLeftWidth := -1;
mgn.cxRightWidth := -1;
mgn.cyTopHeight := -1;
mgn.cyBottomHeight := -1;
fDwmExtendFrameIntoClientArea(frm.Handle, @mgn);
end;
end;
FreeLibrary(hDWMDLL);
end;
end;
end;
end.
Zuletzt geändert von wp_xyz am Mo 29. Jun 2015, 12:52, insgesamt 1-mal geändert.
-
- Beiträge: 80
- Registriert: Mo 3. Nov 2014, 13:13
- OS, Lazarus, FPC: Winux (L 0.9.xy FPC 2.2.z)
- CPU-Target: xxBit
Re: Fensterrahmen
Danke. Ich habe jetzt etwas gefunden, bin mir nicht ganz sicher, aber es kann sein, dass das was du hast das gleiche ist...
Sieht auf den ersten blick so aus.
Sieht auf den ersten blick so aus.
Sorry, ich habe das Forum verlassen!