level 6
SetWindowPos(Me.hwnd, -1, Me.Left / Screen.TwipsPerPixelX, Me.Top \ Screen.TwipsPerPixelY, Me.Width \ Screen.TwipsPerPixelX, Me.Height \ Screen.TwipsPerPixelY, 0)
2013年05月19日 11点05分
2
SetWindowPos就是用Declare拉进来的那个系统函数,负责改变窗口位置。hwnd是窗口句柄
2013年05月20日 05点05分
level 6
Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
2013年05月19日 11点05分
6
Declare可以加载一个dll文件中的函数。user32是windows中负责用户交互的
2013年05月20日 05点05分
level 3
调用的api吧,SetWindowPos是user32.dll文件里面的一个函数,功能应该是设置窗体位置
Declare xxxxx,这语句是声明调用api函数,只有声明后才能使用api函数
2013年05月20日 14点05分
11
level 6
①Declare Function GetDC Lib "user32" (ByVal hwnd
As Long) As Long
‘获得窗口句柄用于抓图
②Declare Function ReleaseDC Lib "user32" (ByVal
hwnd As Long, ByVal hdc As Long) As Long
‘释放窗口句柄
③Declare Function BitBlt Lib "gdi32" (ByVal
hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal
nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long,
ByVal dwRop As Long) As Long
‘绘图到某个句柄上
④Declare Function SetWindowPos Lib "user32" (ByVal
hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long,
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
‘将窗体置在所有窗体最前面,即置顶函数
以上是声明调用api函数
实现窗口置顶的代码如下
SetWindowPos(Me.hwnd, -1, Me.Left / Screen.TwipsPerPixelX, Me.Top \ Screen.TwipsPerPixelY, Me.Width \ Screen.TwipsPerPixelX, Me.Height \ Screen.TwipsPerPixelY, 0)
为什么还会出错 Me.hwnd Screen.TwipsPerPixelX Screen.TwipsPerPixelY的下面都会画线
2013年05月21日 08点05分
12
level 3
vb.net中对api申明和调用时,要将所有long改为integer
因为在vb中的long为32位整数,而在vb.net中long为64位,integer才是32位
2013年05月21日 10点05分
15
level 13
hwnd改为handle,screen具体在哪我不记得了,在visualbasic.dll里面找找。
2013年05月21日 12点05分
16