• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang win.GetWindowLong函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/lxn/win.GetWindowLong函数的典型用法代码示例。如果您正苦于以下问题:Golang GetWindowLong函数的具体用法?Golang GetWindowLong怎么用?Golang GetWindowLong使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetWindowLong函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: ColumnsSizable

// ColumnsSizable returns if the user can change column widths by dragging
// dividers in the header.
func (tv *TableView) ColumnsSizable() bool {
	headerHWnd := win.HWND(tv.SendMessage(win.LVM_GETHEADER, 0, 0))

	style := win.GetWindowLong(headerHWnd, win.GWL_STYLE)

	return style&win.HDS_NOSIZING == 0
}
开发者ID:cautonwong,项目名称:walk,代码行数:9,代码来源:tableview.go


示例2: SingleItemSelection

// SingleItemSelection returns if only a single item can be selected at once.
//
// By default multiple items can be selected at once.
func (tv *TableView) SingleItemSelection() bool {
	style := uint(win.GetWindowLong(tv.hWnd, win.GWL_STYLE))
	if style == 0 {
		lastError("GetWindowLong")
		return false
	}

	return style&win.LVS_SINGLESEL > 0
}
开发者ID:cautonwong,项目名称:walk,代码行数:12,代码来源:tableview.go


示例3: LayoutFlags

func (tb *ToolBar) LayoutFlags() LayoutFlags {
	style := win.GetWindowLong(tb.hWnd, win.GWL_STYLE)

	if style&win.CCS_VERT > 0 {
		return ShrinkableVert | GrowableVert | GreedyVert
	}

	// FIXME: Since reimplementation of BoxLayout we must return 0 here,
	// otherwise the ToolBar contained in MainWindow will eat half the space.
	return 0 //ShrinkableHorz | GrowableHorz
}
开发者ID:Fruchtgummi,项目名称:walk,代码行数:11,代码来源:toolbar.go


示例4: CaseMode

func (le *LineEdit) CaseMode() CaseMode {
	style := uint32(win.GetWindowLong(le.hWnd, win.GWL_STYLE))

	if style&win.ES_UPPERCASE != 0 {
		return CaseModeUpper
	} else if style&win.ES_LOWERCASE != 0 {
		return CaseModeLower
	} else {
		return CaseModeMixed
	}
}
开发者ID:Fruchtgummi,项目名称:walk,代码行数:11,代码来源:lineedit.go


示例5: setAndClearStyleBits

func (wb *WindowBase) setAndClearStyleBits(set, clear uint32) error {
	style := uint32(win.GetWindowLong(wb.hWnd, win.GWL_STYLE))
	if style == 0 {
		return lastError("GetWindowLong")
	}

	if newStyle := style&^clear | set; newStyle != style {
		win.SetLastError(0)
		if win.SetWindowLong(wb.hWnd, win.GWL_STYLE, int32(newStyle)) == 0 {
			return lastError("SetWindowLong")
		}
	}

	return nil
}
开发者ID:henrylee2cn,项目名称:walk,代码行数:15,代码来源:window.go


示例6: firstFocusableDescendantCallback

func firstFocusableDescendantCallback(hwnd win.HWND, lParam uintptr) uintptr {
	widget := windowFromHandle(hwnd)

	if widget == nil || !widget.Visible() || !widget.Enabled() {
		return 1
	}

	style := uint(win.GetWindowLong(hwnd, win.GWL_STYLE))
	// FIXME: Ugly workaround for NumberEdit
	_, isTextSelectable := widget.(textSelectable)
	if style&win.WS_TABSTOP > 0 || isTextSelectable {
		hwndPtr := (*win.HWND)(unsafe.Pointer(lParam))
		*hwndPtr = hwnd
		return 0
	}

	return 1
}
开发者ID:JSchwehn,项目名称:walk,代码行数:18,代码来源:dialog.go


示例7: SetColumnsSizable

// SetColumnsSizable sets if the user can change column widths by dragging
// dividers in the header.
func (tv *TableView) SetColumnsSizable(b bool) error {
	headerHWnd := win.HWND(tv.SendMessage(win.LVM_GETHEADER, 0, 0))

	style := win.GetWindowLong(headerHWnd, win.GWL_STYLE)

	if b {
		style &^= win.HDS_NOSIZING
	} else {
		style |= win.HDS_NOSIZING
	}

	if 0 == win.SetWindowLong(headerHWnd, win.GWL_STYLE, style) {
		return lastError("SetWindowLong(GWL_STYLE)")
	}

	tv.columnsSizableChangedPublisher.Publish()

	return nil
}
开发者ID:cautonwong,项目名称:walk,代码行数:21,代码来源:tableview.go


示例8: removePage

func (tw *TabWidget) removePage(page *TabPage) (err error) {
	page.SetVisible(false)

	style := uint32(win.GetWindowLong(page.hWnd, win.GWL_STYLE))
	if style == 0 {
		return lastError("GetWindowLong")
	}

	style &^= win.WS_CHILD
	style |= win.WS_POPUP

	win.SetLastError(0)
	if win.SetWindowLong(page.hWnd, win.GWL_STYLE, int32(style)) == 0 {
		return lastError("SetWindowLong")
	}

	page.tabWidget = nil

	return page.SetParent(nil)
}
开发者ID:Ryanker,项目名称:walk,代码行数:20,代码来源:tabwidget.go


示例9: onInsertedPage

func (tw *TabWidget) onInsertedPage(index int, page *TabPage) (err error) {
	item := tw.tcitemFromPage(page)

	if idx := int(win.SendMessage(tw.hWndTab, win.TCM_INSERTITEM, uintptr(index), uintptr(unsafe.Pointer(item)))); idx == -1 {
		return newError("SendMessage(TCM_INSERTITEM) failed")
	}

	page.SetVisible(false)

	style := uint32(win.GetWindowLong(page.hWnd, win.GWL_STYLE))
	if style == 0 {
		return lastError("GetWindowLong")
	}

	style |= win.WS_CHILD
	style &^= win.WS_POPUP

	win.SetLastError(0)
	if win.SetWindowLong(page.hWnd, win.GWL_STYLE, int32(style)) == 0 {
		return lastError("SetWindowLong")
	}

	if win.SetParent(page.hWnd, tw.hWnd) == 0 {
		return lastError("SetParent")
	}

	if tw.pages.Len() == 1 {
		page.SetVisible(true)
		tw.SetCurrentIndex(0)
	}

	tw.resizePages()

	page.tabWidget = tw

	page.applyFont(tw.Font())

	return
}
开发者ID:Ryanker,项目名称:walk,代码行数:39,代码来源:tabwidget.go


示例10: SetParent

// SetParent sets the parent of the WidgetBase and adds the WidgetBase to the
// Children list of the Container.
func (wb *WidgetBase) SetParent(parent Container) (err error) {
	if parent == wb.parent {
		return nil
	}

	style := uint32(win.GetWindowLong(wb.hWnd, win.GWL_STYLE))
	if style == 0 {
		return lastError("GetWindowLong")
	}

	if parent == nil {
		style &^= win.WS_CHILD
		style |= win.WS_POPUP

		if win.SetParent(wb.hWnd, 0) == 0 {
			return lastError("SetParent")
		}
		win.SetLastError(0)
		if win.SetWindowLong(wb.hWnd, win.GWL_STYLE, int32(style)) == 0 {
			return lastError("SetWindowLong")
		}
	} else {
		style |= win.WS_CHILD
		style &^= win.WS_POPUP

		win.SetLastError(0)
		if win.SetWindowLong(wb.hWnd, win.GWL_STYLE, int32(style)) == 0 {
			return lastError("SetWindowLong")
		}
		if win.SetParent(wb.hWnd, parent.Handle()) == 0 {
			return lastError("SetParent")
		}
	}

	b := wb.Bounds()

	if !win.SetWindowPos(
		wb.hWnd,
		win.HWND_BOTTOM,
		int32(b.X),
		int32(b.Y),
		int32(b.Width),
		int32(b.Height),
		win.SWP_FRAMECHANGED) {

		return lastError("SetWindowPos")
	}

	oldParent := wb.parent

	wb.parent = parent

	var oldChildren, newChildren *WidgetList
	if oldParent != nil {
		oldChildren = oldParent.Children()
	}
	if parent != nil {
		newChildren = parent.Children()
	}

	if newChildren == oldChildren {
		return nil
	}

	widget := wb.window.(Widget)

	if oldChildren != nil {
		oldChildren.Remove(widget)
	}

	if newChildren != nil && !newChildren.containsHandle(wb.hWnd) {
		newChildren.Add(widget)
	}

	return nil
}
开发者ID:Archs,项目名称:walk,代码行数:78,代码来源:widget.go


示例11: Fullscreen

func (mw *MainWindow) Fullscreen() bool {
	return win.GetWindowLong(mw.hWnd, win.GWL_STYLE)&win.WS_OVERLAPPEDWINDOW == 0
}
开发者ID:linhua55,项目名称:walk,代码行数:3,代码来源:mainwindow.go


示例12: hasStyleBits

func (wb *WindowBase) hasStyleBits(bits uint) bool {
	style := uint(win.GetWindowLong(wb.hWnd, win.GWL_STYLE))

	return style&bits == bits
}
开发者ID:henrylee2cn,项目名称:walk,代码行数:5,代码来源:window.go



注:本文中的github.com/lxn/win.GetWindowLong函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang win.HGDIOBJ函数代码示例发布时间:2022-05-23
下一篇:
Golang win.GetTextExtentPoint32函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap