![]() |
Re: Hexstring vb to Delphi
Liste der Anhänge anzeigen (Anzahl: 2)
@Muetze1
Danke für die Infos.. Deine lösung ist interessant .. Wenn es jetzt wirklich um die ganzen Windowstyle gehen würde wie oben aufgeführt würde ich meinen source nochmal ändern aber bei den fünf zeilen macht es eigentlich keinen großen unterschied. Ich habs jetzt so gelößt. Ich fülle die Liste!
Delphi-Quellcode:
dann überprüfe ich die WindowStyle!
procedure FillList;
Var P : Integer; X : Integer; begin WStyleList.Clear; WValue.Clear; with WStyleList do begin Add('WS_BORDER' + ',' + format('$%8.8x', [WS_BORDER])); Add('WS_DLGFRAME' + ',' + format('$%8.8x', [WS_DLGFRAME])); Add('WS_EX_TOOLWINDOW' + ',' + format('$%8.8x', [WS_EX_TOOLWINDOW])); Add('WS_THICKFRAME' + ',' + format('$%8.8x', [WS_THICKFRAME])); Add('WS_SIZEBOX' + ',' + format('$%8.8x', [WS_SIZEBOX])); end; For P := 0 To WStyleList.Count - 1 do begin X := pos(',',WStyleList.Strings[P]); WValue.Add(AnsiMidStr(WStyleList.Strings[P], X + 1, strlen(PChar(WStyleList.Strings[P])))); WStyleList.Strings[P] := AnsiMidStr(WStyleList.Strings[P], 1, X - 1); end; end;
Delphi-Quellcode:
anschließend wird das Fenster wenn die einträge vom Fenster existieren verändert.
procedure GetStyle(handle: HWND);
Var P : Integer; nIndex : integer; Ivalue : integer; Style : integer; begin LBStyle.Clear; For P := 0 To WValue.Count - 1 do begin nIndex := GWL_STYLE; If Pos('_EX_', WStyleList.Strings[P]) <> 0 Then nIndex := GWL_EXSTYLE; Style := GetWindowLongA(handle, nIndex); Ivalue := StrToInt(WValue.Strings[P]); If (Style <> 0) And (Ivalue <> 0) Then LBStyle.Add(WStyleList.Strings[P]); ChangeWindowStyle(handle, nIndex, Style); end; end;
Delphi-Quellcode:
Habe jetzt nur noch ein problem das ich nicht schnell genug an das Window handle des Plugins komme
procedure ChangeWindowStyle(handle: HWND; nIndex: Integer; Style: Integer);
Var lngStyle : integer; Rect : TRECT ; begin lngStyle := GetWindowLong(handle, nIndex); If (lngStyle <> 0) And (Style <> 0) Then lngStyle := lngStyle - Style Else lngStyle := lngStyle Or Style; GetWindowRect(handle, Rect); SetWindowLong(handle, nIndex, lngStyle); SetWindowPos(handle, 0, Rect.Left, Rect.Top, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, SWP_FRAMECHANGED); End; muss mir da noch was einfallen lassen. Einen Thread stoppen geht ja schlecht oder ? So dass man eventuell schneller an das Windowhandle gelangen kann. Man könnte das Window auch unverändert in den Container schieben nur dann könnte man einfluss auf das Window nehmen das sollte man dann besser vermeiden. Sicherlich kann man das noch verbessern ;) Das ganze sieht dann geändert so aus! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:04 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