Announcement

Collapse
No announcement yet.

Detecting a Windows process from within PB35

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

  • Joe Caverly
    replied
    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

    Leave a comment:


  • Michael Mattias
    replied
    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.

    Leave a comment:


  • Michael Mattias
    replied
    >> 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

    Leave a comment:


  • Scott Slater
    replied
    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.

    Leave a comment:


  • Michael Mattias
    replied
    > Maybe this....

    Whoo-ee. A 'debug' script. Don't hardly see those anymore!

    Leave a comment:


  • Arthur Gomide
    replied
    Maybe this help

    Leave a comment:


  • Jean Baque
    replied
    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

    Leave a comment:


  • Michael Mattias
    replied
    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.

    Leave a comment:


  • Jean Baque
    started a topic Detecting a Windows process from within PB35

    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.
Working...
X