以下是引用ldhyob在2004-3-15 11:40:00的发言:
呵呵,不错,不过窗体在显示时必须要考虑到初始位置,一般在当前鼠标的右下角,如果当前鼠标位置不能使窗体菜单完全显示时,还必须要考虑到移动调整的问题,这些代码在楼顶帖里已有。
谢谢版主的提醒,但是您帖子中的好多代码我还看不懂,请问一下:
Option Explicit Private Declare Function GetCursor Lib "user32" () As Long Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private 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 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, _ ByVal hdc As Long) As Long
Private Const HWND_DESKTOP = 0
Private Const SM_CXSCREEN = 0 Private Const SM_CYSCREEN = 1 Private Type POINTAPI X As Long Y As Long End Type
上面的代码是干什么用的,是什么意思啊! |