本文整理汇总了Golang中github.com/AllenDang/w32.WNDCLASSEX类的典型用法代码示例。如果您正苦于以下问题:Golang WNDCLASSEX类的具体用法?Golang WNDCLASSEX怎么用?Golang WNDCLASSEX使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WNDCLASSEX类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: registerWindowClass
// Register a new window class for the current process. A window with the specified
// class name will use the given WndProc callback function.
func registerWindowClass(className string, callback _WindowProc) error {
classNamePtr, _ := syscall.UTF16PtrFromString(className)
var winClass w32.WNDCLASSEX
winClass.Size = uint32(unsafe.Sizeof(winClass))
winClass.Instance = w32.GetModuleHandle("")
winClass.ClassName = classNamePtr
winClass.WndProc = syscall.NewCallback(callback)
if w32.RegisterClassEx(&winClass) == 0 {
return syscall.GetLastError()
}
return nil
}
开发者ID:danieljoos,项目名称:keyfwd,代码行数:15,代码来源:notifyicon_win.go
示例2: RegisterClass
func RegisterClass(className string, wndproc uintptr) error {
icon := w32.LoadIcon(gAppInstance, w32.MakeIntResource(w32.IDI_APPLICATION))
var wc w32.WNDCLASSEX
wc.Size = uint32(unsafe.Sizeof(wc))
wc.Style = w32.CS_HREDRAW | w32.CS_VREDRAW
wc.WndProc = wndproc
wc.Instance = gAppInstance
wc.Background = w32.COLOR_BTNFACE + 1
wc.Icon = icon
wc.ClassName = syscall.StringToUTF16Ptr(className)
wc.MenuName = nil
wc.IconSm = icon
if ret := w32.RegisterClassEx(&wc); ret == 0 {
return syscall.GetLastError()
}
return nil
}
开发者ID:a1305315624,项目名称:go.wde,代码行数:20,代码来源:utils_windows.go
示例3: RegisterClass
func RegisterClass(className string, wndproc uintptr) {
instance := GetAppInstance()
icon := w32.LoadIcon(instance, w32.MakeIntResource(w32.IDI_APPLICATION))
var wc w32.WNDCLASSEX
wc.Size = uint(unsafe.Sizeof(wc))
wc.Style = w32.CS_HREDRAW | w32.CS_VREDRAW
wc.WndProc = wndproc
wc.Instance = instance
wc.Background = w32.COLOR_BTNFACE + 1
wc.Icon = icon
wc.Cursor = w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_ARROW))
wc.ClassName = syscall.StringToUTF16Ptr(className)
wc.MenuName = nil
wc.IconSm = icon
if ret := w32.RegisterClassEx(&wc); ret == 0 {
panic(syscall.GetLastError())
}
}
开发者ID:hoperuin,项目名称:gform,代码行数:20,代码来源:utils.go
注:本文中的github.com/AllenDang/w32.WNDCLASSEX类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论