问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

屏保如何透明?

发布网友 发布时间:2022-04-24 02:39

我来回答

1个回答

热心网友 时间:2023-10-22 12:03

把窗体设置为透明的 再去掉标题栏 再最大化 不过这样的屏保因该没有作用

代码如下:

Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn _
As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, _
ByVal nCombineMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As _
Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) _
As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd _
As Long, lpPoint As POINTAPI) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As _
Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Const RGN_XOR = 3

Private Type POINTAPI
x As Long
Y As Long
End Type

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private rctClient As RECT, rctFrame As RECT
Private hClient As Long, hFrame As Long

Public Sub MakeTransparent(frm As Form)
GetFrameClientRgn frm
SetWindowRgn frm.hWnd, hFrame, True
End Sub

Private Sub GetFrameClientRgn(frm As Form)
GetWindowRect frm.hWnd, rctFrame
GetClientRect frm.hWnd, rctClient

'将窗口矩形坐标转换为屏幕坐标
Dim lpTL As POINTAPI, lpBR As POINTAPI
lpTL.x = rctFrame.Left
lpTL.Y = rctFrame.Top
lpBR.x = rctFrame.Right
lpBR.Y = rctFrame.Bottom
ScreenToClient frm.hWnd, lpTL
ScreenToClient frm.hWnd, lpBR
rctFrame.Left = lpTL.x
rctFrame.Top = lpTL.Y
rctFrame.Right = lpBR.x
rctFrame.Bottom = lpBR.Y
rctClient.Left = Abs(rctFrame.Left)
rctClient.Top = Abs(rctFrame.Top)
rctClient.Right = rctClient.Right + Abs(rctFrame.Left)
rctClient.Bottom = rctClient.Bottom + Abs(rctFrame.Top)
rctFrame.Right = rctFrame.Right + Abs(rctFrame.Left)
rctFrame.Bottom = rctFrame.Bottom + Abs(rctFrame.Top)
rctFrame.Top = 0
rctFrame.Left = 0

hClient = CreateRectRgn(rctClient.Left, rctClient.Top, _
rctClient.Right, rctClient.Bottom)
hFrame = CreateRectRgn(rctFrame.Left, rctFrame.Top, _
rctFrame.Right, rctFrame.Bottom)

CombineRgn hFrame, hClient, hFrame, RGN_XOR
End Sub

Private Sub Form_Resize()
MakeTransparent Me
End Sub

热心网友 时间:2023-10-22 12:03

把窗体设置为透明的 再去掉标题栏 再最大化 不过这样的屏保因该没有作用

代码如下:

Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn _
As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, _
ByVal nCombineMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As _
Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) _
As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd _
As Long, lpPoint As POINTAPI) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As _
Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Const RGN_XOR = 3

Private Type POINTAPI
x As Long
Y As Long
End Type

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private rctClient As RECT, rctFrame As RECT
Private hClient As Long, hFrame As Long

Public Sub MakeTransparent(frm As Form)
GetFrameClientRgn frm
SetWindowRgn frm.hWnd, hFrame, True
End Sub

Private Sub GetFrameClientRgn(frm As Form)
GetWindowRect frm.hWnd, rctFrame
GetClientRect frm.hWnd, rctClient

'将窗口矩形坐标转换为屏幕坐标
Dim lpTL As POINTAPI, lpBR As POINTAPI
lpTL.x = rctFrame.Left
lpTL.Y = rctFrame.Top
lpBR.x = rctFrame.Right
lpBR.Y = rctFrame.Bottom
ScreenToClient frm.hWnd, lpTL
ScreenToClient frm.hWnd, lpBR
rctFrame.Left = lpTL.x
rctFrame.Top = lpTL.Y
rctFrame.Right = lpBR.x
rctFrame.Bottom = lpBR.Y
rctClient.Left = Abs(rctFrame.Left)
rctClient.Top = Abs(rctFrame.Top)
rctClient.Right = rctClient.Right + Abs(rctFrame.Left)
rctClient.Bottom = rctClient.Bottom + Abs(rctFrame.Top)
rctFrame.Right = rctFrame.Right + Abs(rctFrame.Left)
rctFrame.Bottom = rctFrame.Bottom + Abs(rctFrame.Top)
rctFrame.Top = 0
rctFrame.Left = 0

hClient = CreateRectRgn(rctClient.Left, rctClient.Top, _
rctClient.Right, rctClient.Bottom)
hFrame = CreateRectRgn(rctFrame.Left, rctFrame.Top, _
rctFrame.Right, rctFrame.Bottom)

CombineRgn hFrame, hClient, hFrame, RGN_XOR
End Sub

Private Sub Form_Resize()
MakeTransparent Me
End Sub

热心网友 时间:2023-10-22 12:03

把窗体设置为透明的 再去掉标题栏 再最大化 不过这样的屏保因该没有作用

代码如下:

Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn _
As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, _
ByVal nCombineMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As _
Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) _
As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd _
As Long, lpPoint As POINTAPI) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As _
Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Const RGN_XOR = 3

Private Type POINTAPI
x As Long
Y As Long
End Type

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private rctClient As RECT, rctFrame As RECT
Private hClient As Long, hFrame As Long

Public Sub MakeTransparent(frm As Form)
GetFrameClientRgn frm
SetWindowRgn frm.hWnd, hFrame, True
End Sub

Private Sub GetFrameClientRgn(frm As Form)
GetWindowRect frm.hWnd, rctFrame
GetClientRect frm.hWnd, rctClient

'将窗口矩形坐标转换为屏幕坐标
Dim lpTL As POINTAPI, lpBR As POINTAPI
lpTL.x = rctFrame.Left
lpTL.Y = rctFrame.Top
lpBR.x = rctFrame.Right
lpBR.Y = rctFrame.Bottom
ScreenToClient frm.hWnd, lpTL
ScreenToClient frm.hWnd, lpBR
rctFrame.Left = lpTL.x
rctFrame.Top = lpTL.Y
rctFrame.Right = lpBR.x
rctFrame.Bottom = lpBR.Y
rctClient.Left = Abs(rctFrame.Left)
rctClient.Top = Abs(rctFrame.Top)
rctClient.Right = rctClient.Right + Abs(rctFrame.Left)
rctClient.Bottom = rctClient.Bottom + Abs(rctFrame.Top)
rctFrame.Right = rctFrame.Right + Abs(rctFrame.Left)
rctFrame.Bottom = rctFrame.Bottom + Abs(rctFrame.Top)
rctFrame.Top = 0
rctFrame.Left = 0

hClient = CreateRectRgn(rctClient.Left, rctClient.Top, _
rctClient.Right, rctClient.Bottom)
hFrame = CreateRectRgn(rctFrame.Left, rctFrame.Top, _
rctFrame.Right, rctFrame.Bottom)

CombineRgn hFrame, hClient, hFrame, RGN_XOR
End Sub

Private Sub Form_Resize()
MakeTransparent Me
End Sub

热心网友 时间:2023-10-22 12:03

把窗体设置为透明的 再去掉标题栏 再最大化 不过这样的屏保因该没有作用

代码如下:

Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hWnd _
As Long, lpRECT As RECT) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn _
As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, _
ByVal nCombineMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As _
Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) _
As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd _
As Long, lpPoint As POINTAPI) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As _
Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Const RGN_XOR = 3

Private Type POINTAPI
x As Long
Y As Long
End Type

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private rctClient As RECT, rctFrame As RECT
Private hClient As Long, hFrame As Long

Public Sub MakeTransparent(frm As Form)
GetFrameClientRgn frm
SetWindowRgn frm.hWnd, hFrame, True
End Sub

Private Sub GetFrameClientRgn(frm As Form)
GetWindowRect frm.hWnd, rctFrame
GetClientRect frm.hWnd, rctClient

'将窗口矩形坐标转换为屏幕坐标
Dim lpTL As POINTAPI, lpBR As POINTAPI
lpTL.x = rctFrame.Left
lpTL.Y = rctFrame.Top
lpBR.x = rctFrame.Right
lpBR.Y = rctFrame.Bottom
ScreenToClient frm.hWnd, lpTL
ScreenToClient frm.hWnd, lpBR
rctFrame.Left = lpTL.x
rctFrame.Top = lpTL.Y
rctFrame.Right = lpBR.x
rctFrame.Bottom = lpBR.Y
rctClient.Left = Abs(rctFrame.Left)
rctClient.Top = Abs(rctFrame.Top)
rctClient.Right = rctClient.Right + Abs(rctFrame.Left)
rctClient.Bottom = rctClient.Bottom + Abs(rctFrame.Top)
rctFrame.Right = rctFrame.Right + Abs(rctFrame.Left)
rctFrame.Bottom = rctFrame.Bottom + Abs(rctFrame.Top)
rctFrame.Top = 0
rctFrame.Left = 0

hClient = CreateRectRgn(rctClient.Left, rctClient.Top, _
rctClient.Right, rctClient.Bottom)
hFrame = CreateRectRgn(rctFrame.Left, rctFrame.Top, _
rctFrame.Right, rctFrame.Bottom)

CombineRgn hFrame, hClient, hFrame, RGN_XOR
End Sub

Private Sub Form_Resize()
MakeTransparent Me
End Sub
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
如何使用 macOS Monterey 和 iOS 15 从 iPhone 到 Mac 进行 AirPlay... 丑小鸭简笔画怎么画 好先生更新了几集 企业微信如何直播电脑桌面/电脑屏幕 元旦假期3天 一般店面上班的人放假吗 我太累的很了 希望他放假_百度知 ... 手机的通话记录删除了怎么找回来谢谢大家了 有哪些适合幼儿园的篮球热身操呢? 幼儿园面试体育游戏热身操有哪些 幼儿园玩沙包之前的热身运动 幼儿园幼儿午休起床后有什么热身运动 摩托罗拉MT810的外观 HD高清的HD RED ONE direct2d 透明背景如何显示 HR.HDTV 是什么意思?谢谢 用迅雷搜索影片时有时显示出的HD是什么意思 安卓4.0系统手机如何设置透明锁屏壁纸 三星s8+透明的屏幕是怎么弄的? oppor11透明屏幕代码 “高清”、“蓝光”、“720p” 、“1080p”、“HD”分别是什么概念?具 ... 为什么企业留不住人? 为什么员工辞职时,单位里的领导明知员工留不住,却还要象征性的挽留一下? 为什么给了高工资,依然留不住好员工 优秀员工往往最先离职,为什么企业留不住人? 一个公司留不住员工,里面有何原因??? 为什么有的公司留不住 90 后新员工? 有些工厂现在越来越留不住人了,这是为什么? 为什么很多公司留不住有能力的员工 年底了,员工总是留不住,离职员工越来越多,怎么办啊? 老板招的员工总留不住的原因? “二流”公司留不住优秀员工,这是为什么? 液晶屏电视硬屏的好还是软屏的好 柔性屏幕的研发历程 如何评价Sony Xperia Z5 Premium使用4K屏幕 720P、1080i、1080P的区别是什么? 屏幕材质Super AMOLED比较好还是LCD好? 假如你是班长或者副班长,你会如何策划一次以 端午节 为主题的班会,请列... 我们班要举行一个班会 主题是,“感受端午诗词魅力,沐浴中华经典芬芳” 端午节主题班会主持稿 急求!!端午节主题班会,想在教室做一些关于此次主题的小游戏,教室不是很大,内容要实际好玩。谢谢啦! 有关于中国传统节日主题班会的资料 学校组织了一个屈原与端午节的主题班会可是你的同桌认为这个没有儿童节那么好? 主题班会教案大全(共40个) 奥迪Q3轿跑 “撩功”了得,产品元年持续发力! 如何评价奥迪Q3轿跑? 奥迪Q3轿跑好不好? 试驾| 奥迪Q3轿跑就是那种比你好看还比你努力的车 Q3sport back和普通Q3有什么不一样? 奥迪Q3轿跑这车怎么样? 奥迪q3自动驾驶车多少钱 奥迪Q3轿跑和Q3普通版本到底有啥区别?怎么价格贵那么多,值不值的入手啊?