<p>Hi, I am trying to make one of my windows always ontop that I have built using go-sciter.</p>
<p>I'm using this library <a href="https://github.com/AllenDang/w32/blob/master/user32.go#L213" rel="nofollow">https://github.com/AllenDang/w32/blob/master/user32.go#L213</a></p>
<p>and the function is</p>
<pre><code>func FindWindowW(className, windowName *uint16) HWND {
ret, _, _ := procFindWindowW.Call(
uintptr(unsafe.Pointer(className)),
uintptr(unsafe.Pointer(windowName)))
return HWND(ret)
}
</code></pre>
<p>I'm allowed to use nil as an argument for classname, am I supposed to cast a string to uint16 for the second argument? Or are there any better ways to make a window always-on-top?</p>
<hr/>**评论:**<br/><br/>SSoreil: <pre><p>syscall.StringToUTF16Ptr will do the job here. It seems this function is deprecated, the syscall package has a function with a very similar name that will return both the wide string and an error.</p>
<p>The syscall package is pretty dead for these types of functions, I recommend pulling from golang.org/x/sys/windows</p>
<p>That has UTF16PtrFromString.</p>
<p>As far as Windows specific stuff alike always on top I am not sure, only thing I ever did was open a window and draw in to it haha.</p></pre>69beards: <pre><p>MUCHOS GRACIAS</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传