티스토리 뷰

Programming/Delphi

Delphi - 투명 윈도우 만들기

파란크리스마스 2008. 3. 23. 01:55
728x90

출처
http://kurapa.com/content-a411_%25ED%2588%25AC%25EB%25AA%2585%25EC%259C%2588%25EB%258F%2584%25EC%259A%25B0

http://careerblog.scout.co.kr/home/?pSeq=665762&blogURL=http://neodreamer.tistory.com/39
http://careerblog.scout.co.kr/search/?searchtype=4&searchtext=CodeGear

// 투명 윈도우 만들기
procedure TfmMain.Button1Click(Sender: TObject);
begin
  SetWindowLong(handle, GWL_EXSTYLE, GetWindowLong(handle, GWL_EXSTYLE) or WS_EX_LAYERED);
  SetLayeredWindowAttributes(handle, 0, Round((255 * 70 ) / 100), LWA_ALPHA);
end;

// 투명 윈도우 만들기 + 최상위 윈도우 + 이벤트 활성화
procedure TfmMain.Button2Click(Sender: TObject);
begin
   Self.Color := RGB(1, 1, 1);
   SetWindowLong(handle, GWL_EXSTYLE, GetWindowLong(handle, GWL_EXSTYLE) or WS_EX_LAYERED);
   SetLayeredWindowAttributes( handle, RGB(1, 1, 1), 127, LWA_COLORKEY or LWA_ALPHA);
  Self.FormStyle := fsStayOnTop;
end;

댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함