Hi

How can I send simple commands like GotoClient 10, GotoSupplier 53 etc to a
WinForm app?

Thanks

Regards

Re: Passing commands between apps by Gillard

Gillard
Sat Jul 26 05:22:05 CDT 2008

command line arguments ???
For Each argument As String In My.Application.CommandLineArgs
' do something
Next

or you can make your app read the clipboard



"John" <info@nospam.infovis.co.uk> wrote in message
news:##txjCw7IHA.5052@TK2MSFTNGP03.phx.gbl...
> Hi
>
> How can I send simple commands like GotoClient 10, GotoSupplier 53 etc to
> a WinForm app?
>
> Thanks
>
> Regards
>
>

Re: Passing commands between apps by John

John
Sat Jul 26 05:52:32 CDT 2008

The app is already running when command needs to be sent to it so command
line arguments are perhaps not workable here...

"Gillard" <gillard_georges@@@@@@@@@hotmail.com> wrote in message
news:ehgf1lw7IHA.3692@TK2MSFTNGP05.phx.gbl...
> command line arguments ???
> For Each argument As String In My.Application.CommandLineArgs
> ' do something
> Next
>
> or you can make your app read the clipboard
>
>
>
> "John" <info@nospam.infovis.co.uk> wrote in message
> news:##txjCw7IHA.5052@TK2MSFTNGP03.phx.gbl...
>> Hi
>>
>> How can I send simple commands like GotoClient 10, GotoSupplier 53 etc to
>> a WinForm app?
>>
>> Thanks
>>
>> Regards
>>
>>



Re: Passing commands between apps by John

John
Sat Jul 26 06:15:16 CDT 2008

Ideally app is not aware of incoming commands and is nudged when command is
available to avoid valuable app resources being used to monitor incoming
commands...

"Gillard" <gillard_georges@@@@@@@@@hotmail.com> wrote in message
news:ehgf1lw7IHA.3692@TK2MSFTNGP05.phx.gbl...
> command line arguments ???
> For Each argument As String In My.Application.CommandLineArgs
> ' do something
> Next
>
> or you can make your app read the clipboard
>
>
>
> "John" <info@nospam.infovis.co.uk> wrote in message
> news:##txjCw7IHA.5052@TK2MSFTNGP03.phx.gbl...
>> Hi
>>
>> How can I send simple commands like GotoClient 10, GotoSupplier 53 etc to
>> a WinForm app?
>>
>> Thanks
>>
>> Regards
>>
>>



Re: Passing commands between apps by Family

Family
Sat Jul 26 07:36:32 CDT 2008

Have you looked at Windows Communication Foundation?

http://msdn.microsoft.com/en-us/library/ms735119.aspx

"John" <info@nospam.infovis.co.uk> wrote in message
news:%23%23txjCw7IHA.5052@TK2MSFTNGP03.phx.gbl...
> Hi
>
> How can I send simple commands like GotoClient 10, GotoSupplier 53 etc to
> a WinForm app?
>
> Thanks
>
> Regards
>
>


Re: Passing commands between apps by Peter

Peter
Sat Jul 26 08:47:06 CDT 2008

You want to know how to automate your app :-) The answer is to use
remoting. I recently did this for an app I wrote, all I wanted was for it
to be a single-instance app, but when a 2nd instance started up with command
line arguments for it to pass those arguments to the existing instance.

http://mrpmorris.blogspot.com/2008/07/single-instance-application.html

You could easily add more interfaces in order to provide more functionality.
The channel type I used ensures that the app can only be automated from the
current machine, no remote connections.


Pete


Re: Passing commands between apps by John

John
Sat Jul 26 11:53:10 CDT 2008

Hi Peter

Many thanks. Is there a vb.net around? Trying to convert code to vb.net
using automatic converter hasn't worked.

Many thanks agian.

Regards

"Peter Morris" <mrpmorrisNO@SPAMgmail.com> wrote in message
news:eLY%23ZYy7IHA.4988@TK2MSFTNGP04.phx.gbl...
> You want to know how to automate your app :-) The answer is to use
> remoting. I recently did this for an app I wrote, all I wanted was for it
> to be a single-instance app, but when a 2nd instance started up with
> command line arguments for it to pass those arguments to the existing
> instance.
>
> http://mrpmorris.blogspot.com/2008/07/single-instance-application.html
>
> You could easily add more interfaces in order to provide more
> functionality. The channel type I used ensures that the app can only be
> automated from the current machine, no remote connections.
>
>
> Pete
>



Re: Passing commands between apps by Peter

Peter
Sun Jul 27 11:35:26 CDT 2008

> Many thanks. Is there a vb.net around? Trying to convert code to vb.net
> using automatic converter hasn't worked.

You could compile it in C# and then use Reflector to view the generated code
as VB.NET


Pete


Re: Passing commands between apps by surturz

surturz
Sun Jul 27 21:18:14 CDT 2008

Just out of interest, why didn't you tick the box in Project Properties "Make
single instance application"?

--
David Streeter
Synchrotech Software
Sydney Australia


"Peter Morris" wrote:

> You want to know how to automate your app :-) The answer is to use
> remoting. I recently did this for an app I wrote, all I wanted was for it
> to be a single-instance app, but when a 2nd instance started up with command
> line arguments for it to pass those arguments to the existing instance.
>
> http://mrpmorris.blogspot.com/2008/07/single-instance-application.html
>
> You could easily add more interfaces in order to provide more functionality.
> The channel type I used ensures that the app can only be automated from the
> current machine, no remote connections.
>
>
> Pete
>
>

Re: Passing commands between apps by Paul

Paul
Sun Jul 27 22:57:27 CDT 2008

Using remoting for this might be complete overkill. Sometimes I think a lot of .net programmers never did regular windows programming. If you just want to receive simple messages you can use WndProc. Register a custom windows message and send it to any window you want. Use win32 PostMessage to send it.

protected override void WndProc(ref Message m)
{
//calling the base first is important, otherwise the values you set later will be lost
base.WndProc(ref m);

//if the window message id equals the myCustomMessage message id
if((UInt32)m.Msg == myCustomMessage)
{
m.Result = (IntPtr)1;

// do something with the data
string text = m.WParam.ToInt32().ToString();
}
}
http://www.codeproject.com/KB/vb/Send_string_by_message.aspx

-------- Original Message --------

> Hi
>
> How can I send simple commands like GotoClient 10, GotoSupplier 53 etc to a
> WinForm app?
>
> Thanks
>
> Regards
>
>

Re: Passing commands between apps by Jeff

Jeff
Mon Jul 28 11:15:44 CDT 2008

"John" <info@nospam.infovis.co.uk> wrote in message
news:%23%23txjCw7IHA.5052@TK2MSFTNGP03.phx.gbl...

> How can I send simple commands like GotoClient 10, GotoSupplier 53 etc to
> a WinForm app?

To help you broaden your search, what you're looking for is technically
known as "interprocess communication."