|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 11/07/2009 at 07:14AM PST, ID: 24880460 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: |
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetNextWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Long, ByVal wFlag As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public hWndArray() As Long
Private Const GW_HWNDNEXT = 2
Sub xlInstances()
Dim hwnd As Long, lRet As Long
'Dim hWndArray() As Long
Dim i As Integer
Dim sClassBuffer As String
i = 0
hwnd = FindWindow("XLMAIN", vbNullString)
If hwnd <> 0 Then
ReDim hWndArray(i)
hWndArray(i) = hwnd
Do
hwnd = GetNextWindow(hwnd, GW_HWNDNEXT)
If hwnd = 0 Then Exit Sub
sClassBuffer = String(255, 0)
lRet = GetClassName(hwnd, sClassBuffer, Len(sClassBuffer))
sClassBuffer = Left(sClassBuffer, InStr(1, sClassBuffer, Chr(0), vbTextCompare) - 1)
If UCase(sClassBuffer) = "XLMAIN" Then
i = i + 1
ReDim Preserve hWndArray(i)
hWndArray(i) = hwnd
End If
Loop
End If
End Sub
|
Advertisement