Skip to content

Commit

Permalink
U: demo 增加指定平台的构建指令
Browse files Browse the repository at this point in the history
  • Loading branch information
sxmxta committed Dec 7, 2023
1 parent d0e18e8 commit 0399a8b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 2 additions & 0 deletions example/macos/touchbar/touchbar.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build darwin

package main

import (
Expand Down
15 changes: 5 additions & 10 deletions example/windows/custom-browser-create/custom_browser_create.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Apache License Version 2.0, January 2004
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//----------------------------------------
//go:build windows

package main

Expand All @@ -30,7 +22,10 @@ type MainWindowDemo struct {
//示例演示将CEF做为一个LCL组件使用
//在适当的情况动态创建一个或多个浏览器,实际可做为子组件使用或弹出窗口,根据需求而定
//需要自己正确处理关闭流程
//可以自己定制出CEF的使用
//可以自己定制出CEF的使用, 不同平台有些区别.
//MacOS下使用方式和Windows基本一至
//Linux目前需要在Gtk2下并且使用CEF106版本, 默认Linux大于CEF106版本使用的是GTK3,
//Linux可以使用VF窗口来自定义创建

func main() {
cef.GlobalInit(nil, nil)
Expand Down
2 changes: 2 additions & 0 deletions example/windows/notintaskbar/notintaskbar.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build windows

package main

import (
Expand Down
8 changes: 5 additions & 3 deletions example/windows/transparent/transparen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build windows

package main

import (
Expand Down Expand Up @@ -37,16 +39,16 @@ func main() {
cef.Run(cefApp)
}

//WindowTransparent 窗口透明组件不透明设置
// WindowTransparent 窗口透明组件不透明设置
func WindowTransparent(hWnd types.HWND) {
//SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED)
//SetLayeredWindowAttributes(Handle,clWhite,255,LWA_COLORKEY);
exStyle := winapi.GetWindowLong(hWnd, win.GWL_EXSTYLE)
exStyle = exStyle | win.WS_EX_LAYERED //win.WS_EX_LAYERED&^win.WS_EX_TRANSPARENT // or WS_EX_TRANSPARENT;
winapi.SetWindowLong(hWnd, win.GWL_EXSTYLE, exStyle)
win.SetLayeredWindowAttributes(hWnd.ToPtr(), //指定分层窗口句柄
colors.ClWhite, //crKey指定需要透明的背景颜色值,可用RGB()宏 0-255
255, //bAlpha设置透明度,0表示完全透明,255表示不透明
colors.ClWhite, //crKey指定需要透明的背景颜色值,可用RGB()宏 0-255
255, //bAlpha设置透明度,0表示完全透明,255表示不透明
win.LWA_COLORKEY) //LWA_ALPHA: crKey无效,bAlpha有效;
//win.LWA_ALPHA|win.LWA_COLORKEY) //LWA_ALPHA: crKey无效,bAlpha有效;
//LWA_COLORKEY:窗体中的所有颜色为crKey的地方全透明,bAlpha无效。
Expand Down

0 comments on commit 0399a8b

Please sign in to comment.