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

x
?
Solved

Active Programs

Posted on 1999-06-24
4
Medium Priority
?
168 Views
Last Modified: 2010-05-02
how can i retrieve a list of Active Programs? This includes programs that are invisable and such
0
Comment
Question by:Hanky368
[X]
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
4 Comments
 
LVL 1

Expert Comment

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

Accepted Solution

by:
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 :)

..-=ViKtOr=-..
0
 

Author Comment

by:Hanky368
ID: 1519619
code would be nice thanks
0
 
LVL 10

Expert Comment

by:viktornet
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...

============MODULE1.BAS===========
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()

=========FORM1.FRM==========

Private Sub Command1_Click()
    List1.Clear
    EnumWindows AddressOf GetWins, 0
End Sub


That's about it...

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

..-=ViKtOr=-..
0

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