Announcement

Collapse
No announcement yet.

Detecting a Windows process from within PB35

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detecting a Windows process from within PB35

    Hallo,

    Is there a possibility to detect from within a little tool done with PB35 if a real program for Windows is always running or not ? I am using this tool on win9x and winXP.

    Is there a possibility to call a dll which can do the job ? I have never called a windows dll !

    Because of the time difference, I won't read your possible replies before several hours.

    Thank you very much !

    Jean-Roger
    Last edited by Jean Baque; 31 Oct 2009, 07:44 PM.
    Sorry for my poor english ! I am a Frenchman

  • #2
    AFAIK there is no way a DOS program can call functions in a DLL.

    However....
    You can create a Windows' program to list all running processes.
    From MS-DOS you can SHELL a Windows Program.
    Ergo, your DOS program can get a list of running processes.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Thank you, Michael !

      Since I am not capable of doing such a Windows Program, I continue using with the SHELL a little tool named "PV.EXE". It does the job !

      Jean-Roger
      Sorry for my poor english ! I am a Frenchman

      Comment


      • #4
        Maybe this help
        "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

        Comment


        • #5
          > Maybe this....

          Whoo-ee. A 'debug' script. Don't hardly see those anymore!
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            I know I have seen code that you can call an interrupt to see whether or not your ap is running under windows. I can't find it here at the moment, but if I do, I'll post it.
            Scott Slater
            Summit Computer Networks, Inc.
            www.summitcn.com

            Comment


            • #7
              >> Maybe this....
              >Whoo-ee. A 'debug' script. Don't hardly see those anymore!

              I suppose I should have mentioned...

              Assuming that script generates a COM file which will execute correctly from MS-DOS, it can be included in your PB/MS-DOS program and executed from code.

              It 'should' work by using inline assembly language wrapped in a SUB or FUNCTION and called normally. There might be some minor tweaking required, and I think a working knowledge of assembly language will be useful; but I have to believe this is very much in the realm of the do-able.

              MCM
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                OR,

                Find a friend with a Windows' compiler, and start here...
                http://www.powerbasic.com/support/pb...ad.php?t=14206

                That can generate a list of all running processes, and you can find the names of the modules (EXE and DLL files) linked to that process.

                Write the results out to a disk file; SHELL this program from your DOS program, and read the disk file when it's done.
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Originally posted by Jean Baque View Post
                  Hallo,

                  Is there a possibility to call a dll which can do the job ? I have never called a windows dll !

                  Thank you very much !

                  Jean-Roger
                  Hi,
                  You can call a 32-bit DLL from DOS using a DOS Extender.

                  I'm presently using the HX DOS Extender under MS-DOS 6.22.

                  You can make the calls from PB3.5, but it is a very messy process, which involves using LoadLibrary, GetProcAddress, FreeLibrary, etc. Mind you, these have to be translated into Interrupt Calls. For example, Int 21h, AX=4B00h (LoadModule/LoadLibrary) is what you would call to load a DLL from PB3.5.

                  Again, you require the HX DOS Extender in order for the Interrupt calls to work.

                  I find it much easier just to create the programs using PB/CC 5.02, and just run the resulting .EXE from DOS that has the HX DOS Extender installed.

                  Joe

                  Comment

                  Working...
                  X