Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.06.25;
Скачать: CL | DM;

Вниз

Полупрозрачный MessageBox   Найти похожие ветки 

 
Sorcerer   (2006-03-27 16:51) [0]

Здравствуйте! Как средствами Win API вывести полупрозрачный MessageBox?


 
Sorcerer   (2006-03-27 16:52) [1]

OS win XP.


 
easy ©   (2006-03-27 21:11) [2]

unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls;
const
 WM_MSGBOX  = WM_USER + 1;
type
 TForm1 = class(TForm)
   Button1: TButton;
   procedure Button1Click(Sender: TObject);
 private
   { Private declarations }
   procedure msgBoxShow(var msg: TMessage); message WM_MSGBOX;
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure make50transp(winHWND: HWND);
var
 exStyle: Longint;
begin
 exStyle := GetWindowLong(winHWND, GWL_EXSTYLE);
 if (exStyle and WS_EX_LAYERED = 0) then begin
   exStyle := exStyle or WS_EX_LAYERED;
   SetwindowLong(winHWND, GWL_EXSTYLE, exStyle);
 end;
 SetLayeredWindowAttributes(winHWND, 0, 128, LWA_ALPHA);
end;

procedure TForm1.msgBoxShow(var msg: TMessage);
var
 msgbHandle: HWND;
begin
 msgbHandle := GetActiveWindow;
 if msgbHandle <> 0 then
   make50transp(msgbHandle);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
 PostMessage(handle, WM_USER + 1, 0, 0);
 MessageBox(handle, "This Is A Transparent Message Box", "50% MessageBox.", MB_OK or MB_ICONWARNING);
end;

end.


 
Sorcerer   (2006-03-28 16:31) [3]

> easy ©   (27.03.06 21:11) [2]

Спасибо огромное!



Страницы: 1 вся ветка

Текущий архив: 2006.06.25;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.039 c
5-1134398300
Domkrat
2005-12-12 17:38
2006.06.25
ScrollBar width


2-1149512127
VitV
2006-06-05 16:55
2006.06.25
interbase+delphi удаление блоб


4-1142613185
AndreyRus
2006-03-17 19:33
2006.06.25
Аналог IOCTL_SCSI_RESCAN_BUS в Windows 2003


15-1149154067
Александр Б.
2006-06-01 13:27
2006.06.25
Шаблоны


3-1146593736
nopox
2006-05-02 22:15
2006.06.25
Помогите разобраться с выборкой из БД