Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Active Programs

Posted on 1999-06-24
Medium Priority
Last Modified: 2010-05-02
how can i retrieve a list of Active Programs? This includes programs that are invisable and such
Question by:Hanky368
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1519617
 I think this answer deserves more points...
LVL 10

Accepted Solution

viktornet earned 400 total points
ID: 1519618
you should use EnumWindows() which is a Win32 API and it needs a callback function which you need to write yourself.... in that callback function you simply get the name of the program, and put the name you get in a listbox or something... if you need some code or something please let me know so i can give you an example how to do it :)


Author Comment

ID: 1519619
code would be nice thanks
LVL 10

Expert Comment

ID: 1519620
Hello Hanky!!

Here is some code that works just fine...

Simply place a command button, and a listbox on your form without changing any of the controls' names... then add a module and place the following code in there...

Const MAX_PATH = 260

Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lparam As Long) As Long

Function GetWins(ByVal handle As Long, ByVal lparam As Long) As Long
    Dim title As String
    GetWins = 1
    title = Space$(MAX_PATH)
    GetWindowText handle, title, MAX_PATH
    Form1.List1.AddItem title
End Function

'When you're done with that simply place the following code in button's OnClick()


Private Sub Command1_Click()
    EnumWindows AddressOf GetWins, 0
End Sub

That's about it...

Please let me know if you need any more help!!


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question