vbnet 句柄解决创建大于分辨率的窗体

因项目需要,要创建个窗体大于分辨率,几经折腾,实现,现记录于此;

   Declare Auto Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32, ByVal dwNewLong As Int32) As Int32

   Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32) As Int32

   Declare Function MoveWindow Lib "user32" Alias "MoveWindow" (ByVal hwnd As Int32, ByVal x As Int32, ByVal y As Int32,ByVal nWidth As Int32, ByVal nHeight As Int32, ByVal bRepaint As Int32) As Int32

Private Const WS_THICKFRAME As Int32 = &H40000
Private Const WS_POPUP As Int32 = &H80000000

Dim hwnd = FindWindow("目标类", vbNullString)   ‘注:目标类可通过VS-工具-Spy++(+) 查看

Dim style = GetWindowLong(hwnd, GWL_STYLE)

            style = style And (Not WS_THICKFRAME)

            style = style Or WS_POPUP

            SetWindowLong(hwnd, GWL_STYLE, style)

            MoveWindow(hwnd, “point x”,“point y”, "form.width", “form.height", 1)



大学的时候就注册了CSDN,但我这第一次在CSDN上面写博客时工作已经快3年,因经常得益于此,现也将自己遇到的问题及解决的方法记录下来,供交流与参考;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值