Results 1 to 8 of 8

Thread: FindWindow vs Mutex vs Atom

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2009
    Location
    Cayman
    Posts
    3,349

    Default Re: FindWindow vs Mutex vs Atom

    Enum_ProcessesDR.zip

    Another variation is by modifying the Enum_Processes contributed by Ian Smith, but I'm darned if I can get a fairly simple change to work.

    my changes in blue, replacing the line in red
    Code:
            Procedure OnClick
                Integer iLoop iMax iCount
                String[] saProcesses
                String sProgram sProc
                Move (trim(lowercase(Module_Name(Self)-".exe"))) to sProgram
                
                //Get the process list
                Get Running_Processes of oEnum_Processes to saProcesses
                Move (SizeOfArray(saProcesses) - 1) to iMax
                
                //Update the list control
                Send delete_data of oList1
                Showln sProgram
                For iLoop from 0 to iMax
                    //previously Send Add_Item of oList1 Msg_None (saProcesses[iLoop]
                    Move (trim(lowercase(saProcesses[iLoop]))) to sProc
                    Send Add_Item of oList1 Msg_None sProc
                    If (sProc=sProgram) Begin //<<<<< this never gets to be true
                        Increment icount
                        Showln "*" sProc "*" sProgram "*"
                    End
                Loop
                Showln iCount
            End_Procedure
    running this, enum_processes.exe it fills the list nicely but never matches the 'enum_processes.exe' string. This is 19.1, I originally thought the issue was confined to DF20.

    Anything visibly wrong with this code?
    Last edited by DaveR; 3-Aug-2021 at 11:06 AM.
    test? it compiles doesn't it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •