Hi, is there a way to go about getting the current running application list into a drop-down and/or text box menu.
What I want to do is make it so you can pick a running application and set it as a label value.
Thanks
Printable View
Hi, is there a way to go about getting the current running application list into a drop-down and/or text box menu.
What I want to do is make it so you can pick a running application and set it as a label value.
Thanks
Welcome to the forums. :wave:
Try thisvb Code:
'in a module Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, _ ByVal lParam As Long) As Long Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, _ ByVal lpString As String, ByVal cch As Long) As Long Public Const MAX_LEN = 260 Public Function EnumWinProc(ByVal hwnd As Long, ByVal lParam As Long) As Long Dim lRet As Long Dim strBuffer As String If IsWindowVisible(hwnd) Then strBuffer = Space(MAX_LEN) lRet = GetWindowText(hwnd, strBuffer, Len(strBuffer)) If lRet Then Form1.List1.AddItem Left(strBuffer & " " & hwnd, lRet) End If End If EnumWinProc = 1 End Function 'on a form Private Sub Command1_Click() Call EnumWindows(AddressOf EnumWinProc, 0) End Sub
Thanks so much, Big help
One more question how would I make it so when you click on an application in the list it sets the value of app.text to the application name?
Thanks again.
:)
Which app.name do you want ot change, the one from your application or the one from the application clicked in the list?
first one would be easy:
Code:app.name = Form1.List1.List(Form1.List1.ListIndex)
I usedto set a text box value as an item I selected from the list.Code:app.Text = Form1.List1.List(Form1.List1.ListIndex)
Thanks for all the help.