//去掉边框
SetWindowLong(hWnd, GWL_STYLE,
GetWindowLong(hWnd, GWL_STYLE) - WS_CAPTION);
//指定位置 设置窗口置顶
SetWindowPos(hWnd, HWND_TOPMOST,//置顶
(GetSystemMetrics(SM_CXFULLSCREEN) - 800) / 2,
(GetSystemMetrics(SM_CYFULLSCREEN) - 800) / 2,//坐标
800, 800,//宽高
SWP_SHOWWINDOW);//方式
//设置窗口透明
SetWindowLong(hWnd, GWL_EXSTYLE,
GetWindowLong(hWnd, GWL_STYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(hWnd,
RGB(0, 0, 0), 0, LWA_COLORKEY);
window 调用api实现窗口居中、去标题栏、窗口背景透明
最新推荐文章于 2023-09-25 19:50:36 发布