VB.NET使用API的问题 20
在vb.net里面使用enablewindow不行,请问用什么类可以代替enablewindow这个API函数(system什么什么的去代替)...
在vb.net里面使用enablewindow不行,请问用什么类可以代替enablewindow这个API函数(system什么什么的去代替)
展开
1个回答
展开全部
'VB.NET 可以用的,但要委托一下
Private Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As EW_Function, ByVal lParam As Long) As Long
Private Delegate Function EW_Function(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Sub CallEW()
EnumWindows(AddressOf EW_AddressSub, 0)
End Sub
Function EW_AddressSub(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
'True表示继续枚举,False则表示不枚举了
EW_AddressSub = True
End Function
Private Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As EW_Function, ByVal lParam As Long) As Long
Private Delegate Function EW_Function(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Sub CallEW()
EnumWindows(AddressOf EW_AddressSub, 0)
End Sub
Function EW_AddressSub(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
'True表示继续枚举,False则表示不枚举了
EW_AddressSub = True
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询