今天写代码时属性说明窗口不知咋的又被拉下去了,以往都是小心找准边界拉上来的,可今天试了十几分钟总是拉不起来,气的差点摔鼠标。这时我想到可以用API来收拾它,于是打开spy++拖到属性窗口,找到“说明窗格“,OK,获取到了窗口句柄和矩形信息
新开一个控制台项目,复制代码:
<DllImport("user32.dll", SetLastError:=True)> _ Public Function SetWindowPos( _ ByVal hwnd As IntPtr, _ <[Optional]> ByVal hwndInsertAfter As IntPtr, _ ByVal x As Integer, _ ByVal y As Integer, _ ByVal cx As Integer, _ ByVal cy As Integer, _ ByVal uFlags As UInteger _ ) As Boolean End Function
Main函数内:SetWindowPos(New IntPtr(句柄值), 0, 0, 400, 296, 100, &H4).搞定
最后再吐槽一下边界拉的人想吐