怎样实现透明窗口?类似360那个健康精灵那样的程序?
怎样实现透明窗口?类似360那个健康精灵那样的程序?
想做类似于360那个健康精灵的程序,该怎样实现窗口的透明? (bcb开发)
[解决办法]
SetWindowPos(Handle,HWND_TOPMOST,0,0,Screen-> Width,Screen-> Height,SWP_SHOWWINDOW); SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_TRANSPARENT | //忽略一切消息(WM_PAINT除外) WS_EX_LAYERED); //层风格,有他才能支持半透明 SetLayeredWindowAttributes(Handle, Color, 100, LWA_ALPHA | LWA_COLORKEY);
[解决办法]
有难度啊
[解决办法]
没试验图片,这样行不
C/C++ code
void __fastcall TForm1::FormCreate(TObject *Sender)
{
BorderStyle = bsNone;
Brush->Style = bsClear;
}
[解决办法]
看考此贴
http://topic.csdn.net/t/20021217/13/1269057.html
[解决办法]
void __fastcall TForm1::FormCreate(TObject *Sender){ BorderStyle = bsNone; Brush->Style = bsClear;}
[解决办法]
第二种改的cb
头文件
#ifndef Unit1H#define Unit1H#include <Classes.hpp>#include <Controls.hpp>#include <StdCtrls.hpp>#include <Forms.hpp>#include <ExtCtrls.hpp>class TForm1 : public TForm{__published: // IDE-managed Components TButton *Button1; TButton *Button2; TPanel *Panel1; void __fastcall Button2Click(TObject *Sender); void __fastcall Button1Click(TObject *Sender); void __fastcall FormCreate(TObject *Sender); void __fastcall FormDestroy(TObject *Sender);private: // User declarations void __fastcall DoVisible() ; void __fastcall DoInvisible(); HRGN FullRgn,ClientRgn,CtlRgn;// THandle FullRgn, ClientRgn, CtlRgn ;// THandle CtlRgn ; public: // User declarations __fastcall TForm1(TComponent* Owner);};extern PACKAGE TForm1 *Form1;#endif