您的位置:首页 > 其它

椭圆形的窗体

2016-02-08 12:49 267 查看
// 新视窗类

with wc do begin

style := CS_VREDRAW or CS_HREDRAW;

lpfnWndProc := @GdiProc1;

cbClsExtra := 0;

cbWndExtra := 0;

hCursor := LoadCursor(0, IDC_ARROW);// ;

hbrBackground := GetSysColorBrush( windows.COLOR_INFOBK );//HBRUSH(GetStockObject(windows.GRAY_BRUSH));

hInstance := HInstance;

lpszMenuName := nil;

lpszClassName := szAppName;

//hIcon := ficon1;

end;

windows.RegisterClass(wc);

// 建窗体

Main := CreateWindowExA(WS_EX_OVERLAPPEDWINDOW, szAppName, szAppName, WS_VISIBLE or WS_SYSMENU or WS_SizeBox or WS_GROUP,

Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), 800, 600, HWND_DESKTOP, 0, 0, nil);

// 获取窗口尺寸

GetWindowRect(Main, re1);

main_DC := GetWindowDC(Main);

rg1 := CreateEllipticRgnIndirect( re1 ); // 创建一个内切于特定矩形的椭圆区域

FillRect(main_DC, re1, 15 + 5 );

Rectangle(main_DC, re1.Left, re1.Top, re1.Right, re1.Bottom);

SetWindowRgn(Main, rg1, true); // 用SetWindowRgn实现程序窗体变形



注:所有源程序下载,请訪问下载频道-我的资源。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: