CreateWindowEx 创建无边框窗体,以下代码怎么改

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CreateWindowEx 创建无边框窗体,以下代码怎么改相关的知识,希望对你有一定的参考价值。

Dim wc As WNDCLASS
Dim uMsg As MSG
Dim rtOwner As RECT, ptOwner As POINTAPI

'注册窗口类
wc.style = CS_VREDRAW Or CS_HREDRAW
wc.lpfnWndProc = GetFuncAddr(AddressOf WindowProc)
wc.hInstance = App.hInstance
wc.hCursor = LoadCursor(0, IDC_ARROW)
wc.hbrBackground = COLOR_WINDOW
wc.lpszClassName = "MyWindowClass"

If RegisterClass(wc) = 0 Then Exit Sub

'创建所有者窗口
m_hOwner = CreateWindowEx(0, wc.lpszClassName, "OwnerWindow", _
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, App.hInstance, ByVal 0&)
UpdateWindow m_hOwner
ShowWindow m_hOwner, SW_SHOWNORMAL

'代码不变,只增加一行代码,请自行定义所需的变量。
Dim wc As WNDCLASS
Dim uMsg As MSG
Dim rtOwner As RECT, ptOwner As POINTAPI

'注册窗口类
wc.style = CS_VREDRAW Or CS_HREDRAW
wc.lpfnWndProc = GetFuncAddr(AddressOf WindowProc)
wc.hInstance = App.hInstance
wc.hCursor = LoadCursor(0, IDC_ARROW)
wc.hbrBackground = COLOR_WINDOW
wc.lpszClassName = "MyWindowClass"

If RegisterClass(wc) = 0 Then Exit Sub

'创建所有者窗口
m_hOwner = CreateWindowEx(0, wc.lpszClassName, "OwnerWindow", _
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, App.hInstance, ByVal 0&)
'去掉边框
Call SetWindowLong(hOwner, GWL_STYLE, GetWindowLong(hOwner, GWL_STYLE) And Not WS_CAPTION And WS_CLIPCHILDREN And WS_CLIPSIBLINGS)
UpdateWindow m_hOwner
ShowWindow m_hOwner, SW_SHOWNORMAL
参考技术A select a.fromstepid,
case a.isauto when 1 then b.tostepid else a.tostepid end as tostepid
from step a
left join step b on a.tostepid=b.fromstepid
where a.fromstepid not in
(select tostepid from step where isauto=1)
SQL Server2005,测试通过

以上是关于CreateWindowEx 创建无边框窗体,以下代码怎么改的主要内容,如果未能解决你的问题,请参考以下文章

无边框窗体和后台创建控件

无边框窗体后台创建控件简单通讯

CreateWindow创建无边框 可拉伸窗体

WPF无边框可拖动窗体

win32(全屏)无边框窗口重叠任务栏

移动无边框窗体