Einzelnen Beitrag anzeigen

Popov
(Gast)

n/a Beiträge
 
#1

Transparent und TopMost Problem

  Alt 3. Mär 2012, 16:50
Was stimmt daran nicht? Mal funktioniert es, mal funktioniert es nicht. Und wenn es nicht funktioniert, dann richtig. Nicht nur, dass es dann nicht TopMost ist, das Ding ist so weit Bottom-Most, dass es sogar unter den Desktopicons verschwindet.

Delphi-Quellcode:
procedure MakeWndTransparent(AHandle: HWND; Value: Boolean);
var
  curWinStyle: Integer;
begin
  curWinStyle := GetWindowLong(AHandle, GWL_EXSTYLE);
  if Value then
    SetWindowLong(AHandle, GWL_EXSTYLE, curWinStyle or WS_EX_TRANSPARENT)
  else
    SetWindowLong(AHandle, GWL_EXSTYLE, curWinStyle and (not WS_EX_TRANSPARENT));
end;

procedure MakeWndTopMost(AHandle: HWND; Value: Boolean);
const
  WndInsertAfter: array[Boolean] of HWnd = (HWND_TOPMOST, HWND_NOTOPMOST);
begin
  SetWindowPos(AHandle, WndInsertAfter[Value], 0, 0, 0, 0,
    SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
end;

procedure MakeWndTransparentAndTopMost(AHandle: HWND; Value: Boolean);
begin
  MakeWndTransparent(AHandle, Value);
  MakeWndTopMost(AHandle, Value);
end;
  Mit Zitat antworten Zitat