API常量申明的有关问题,多谢
API常量申明的问题,谢谢!VB codegetwindwo是取得句柄,一个参数为窗口名,第2个为寻找窗口的所有者(这里定
API常量申明的问题,谢谢!
VB code'getwindwo是取得句柄,一个参数为窗口名,第2个为寻找窗口的所有者(这里定义的4还不懂)Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long'SHOWWINDOW是说一个窗口在任务管理器的运行方式,SW HIDE是隐藏Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As LongPrivate Const GW_OWNER = 4Private Const SW_HIDE = 0Private Sub Form_Load() Dim lphWnd As Long lphWnd = GetWindow(Me.hwnd, GW_OWNER) ShowWindow lphWnd, SW_HIDEEnd Sub 想问的是: Private Const GW_OWNER = 4 Private Const SW_HIDE = 0 这两句的常量分别等于4和0我怎么知道4和0是什么意思呢?=2或=3可以不?那又是什么意思呢?哪里可以查找到帮助信息呢。谢谢 [解决办法] 用这个查阅
[解决办法] 探讨 Private Const GW_OWNER = 4 Private Const SW_HIDE = 0 这两句的常量分别等于4和0我怎么知道4和0是什么意思呢?[解决办法] http://www.vbgood.com/api-getwindow.html
[解决办法] 这些全在MSDN中啊.
使用某个API,这个API的参数有多少,是什么类型,需要哪些常量,全都写得明明白白.
例如你上面调用的GetWindow函数:
引用 MSDN 中的内容: GetWindow The GetWindow function retrieves a handle to a window that has the specified relationship (Z order or owner) to the specified window. HWND GetWindow( HWND hWnd, // handle to original window UINT uCmd // relationship flag ); Parameters hWnd Handle to a window. The window handle retrieved is relative to this window, based on the value of the uCmd parameter. uCmd Specifies the relationship between the specified window and the window whose handle is to be retrieved. This parameter can be one of the following values: Value Meaning GW_CHILD The retrieved handle identifies the child window at the top of the Z order, if the specified window is a parent window; otherwise, the retrieved handle is NULL. The function examines only child windows of the specified window. It does not examine descendant windows. GW_ENABLEDPOPUP Windows NT 5.0 and later: The retrieved handle identifies the enabled popup window owned by the specified window (the search uses the first such window found using GW_HWNDNEXT); otherwise, if there are no enabled popup windows, the retrieved handle is that of the specified window. GW_HWNDFIRST The retrieved handle identifies the window of the same type that is highest in the Z order. If the specified window is a topmost window, the handle identifies the topmost window that is highest in the Z order. If the specified window is a top-level window, the handle identifies the top-level window that is highest in the Z order. If the specified window is a child window, the handle identifies the sibling window that is highest in the Z order. GW_HWNDLAST The retrieved handle identifies the window of the same type that is lowest in the Z order. If the specified window is a topmost window, the handle identifies the topmost window that is lowest in the Z order. If the specified window is a top-level window, the handle identifies the top-level window that is lowest in the Z order. If the specified window is a child window, the handle identifies the sibling window that is lowest in the Z order. GW_HWNDNEXT The retrieved handle identifies the window below the specified window in the Z order. If the specified window is a topmost window, the handle identifies the topmost window below the specified window. If the specified window is a top-level window, the handle identifies the top-level window below the specified window. If the specified window is a child window, the handle identifies the sibling window below the specified window. GW_HWNDPREV The retrieved handle identifies the window above the specified window in the Z order. If the specified window is a topmost window, the handle identifies the topmost window above the specified window. If the specified window is a top-level window, the handle identifies the top-level window above the specified window. If the specified window is a child window, the handle identifies the sibling window above the specified window. GW_OWNER The retrieved handle identifies the specified window's owner window, if any. Return Values If the function succeeds, the return value is a window handle. If no window exists with the specified relationship to the specified window, the return value is NULL. To get extended error information, callGetLastError. Remarks The EnumChildWindows function is more reliable than calling GetWindow in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or referencing a handle to a window that has been destroyed. Windows CE: In Windows CE version 1.0, the GW_OWNER flag value for the uCmd parameter is only supported for dialog boxes. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Requires version 1.0 or later. Header: Declared in winuser.h. Import Library: Use user32.lib. See Also Windows Overview, Window Functions, EnumChildWindows
[解决办法] 探讨 引用: http://www.vbgood.com/api-getwindow.html 有些信息还是查不到啊,比如 SendMessage 它的wMsg Long,消息的标识符 有哪些,还是不知道啥!![解决办法] 探讨 引用: http://www.vbgood.com/api-getwindow.html 有些信息还是查不到啊,比如 SendMessage 它的wMsg Long,消息的标识符 有哪些,还是不知道啥!!