Re: Interapplication communication help

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



First dump all that .NET crap, you don't need it

Next read up on MUTEX, this will let you identify processes.

You will need to be clever here because the MUTEX is just that "MUTually
EXclusive", but you could easily modify the MUTEX string to incorporate the
app name by appending it to a distinct string to identify your app, then all
you have to do is enumerate each property on each enumerated window and
compare the common part, then the app part, if the first bits match but not
the second you have the same app with different names. If both parts match
you have the same app with the same name so you need to unload the new copy.

Reading or writing to textboxes remotely is very simple, just use
SendMessage with the correct parameters (which I cannot recall all off the
top of my head). You will need the handle of the text box (which is why you
cannot use a label for this). You could put the handle in a property, or you
could put some known text into the text box, search for that on an
enumeration, then remotely change the content, perhaps with the handle of a
text box in the other app, then in the text box Change event you can deal
with whatever you need to do.

Dave O.

"pslitty" <jasonplasencia@xxxxxxxxx> wrote in message
news:c98a283b-8a9f-4d21-af5c-663aa55af79e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a vb app that uses a .net wrapper that exposes the Process
object. I use this object to loop through all of the system running
processes and look for other instances of the same application. If I
find one, i want to be able to read either a (label or text box from a
form or module within that app) from that process or the processes
main window text. I have tried using some different API calls and the
MainWindowHandle but the MainWindowHandle does not seem to point me to
anything usefull with that process. Any ideas of what i might be
doing wrong or another way of doing what i am trying to do.

Basically, on start up of my application i want to be able to
determine if there are any other instances of me running, if so, check
the name because i allow seperate instances to run as long as the name
is different.


.



Relevant Pages

  • Re: Interapplication communication help
    ... Next read up on MUTEX, this will let you identify processes. ... app name by appending it to a distinct string to identify your app, ... you have to do is enumerate each property on each enumerated window and ... MainWindowHandle but the MainWindowHandle does not seem to point me to ...
    (microsoft.public.vb.general.discussion)
  • Re: IOCP critical sections and mutexes
    ... then there is some bug in your ... routines but I recently started some preliminary stress test on a new server ... then pushes it in a queue that will be later processed by my main app ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: IOCP critical sections and mutexes
    ... those are pulled from the queue via GetQueuedCompletionStatus ... BTW, for the record, both the user mode accessible mutex and critical ... My packets never go over 2k in size. ... then pushes it in a queue that will be later processed by my main app ...
    (microsoft.public.win32.programmer.kernel)
  • Re: IOCP critical sections and mutexes
    ... mismatch and invalid 'this' pointer). ... instance) and I get pretty much the same crash. ... I mush have done something stupid in my main thread app. ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Mutex Problem
    ... the slave can) then yes, you can use CreateMutex in the master and OpenMutex ... Note, however, that if the slave app starts earlier, then it ... would not get the mutex. ... shared memory, and for this reason each of these applications tries to create ...
    (microsoft.public.platformsdk.security)