Hi.
I need to launch a windows application and then send keyboard event to this
process to run certain commands. I've created a COM+ appplication to spawn
and talk to the application which works well however the launched
application always shows the UI where-as I need this to be hidden, even
calling the windowhidden on the process strart info does not work. Does this
somehow need to spawned under a different account process ?
_ProcessInfo = New ProcessStartInfo
_ProcessInfo.WorkingDirectory = node.Item("ProgramDirectory").InnerText
_ProcessInfo.FileName = node.Item("ProgramName").InnerText
_ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText
_ProcessInfo.CreateNoWindow = True
_ProcessInfo.UseShellExecute = False
_ProcessInfo.RedirectStandardOutput = True
Thanks
Paul 7 2609
have you tried to compile it as an exe rather than a winexe
--
Regards
John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------
"Paul" <ma********@hotmail.com.nospam> wrote in message
news:eg**************@TK2MSFTNGP09.phx.gbl... Hi.
I need to launch a windows application and then send keyboard event to
this process to run certain commands. I've created a COM+ appplication to spawn and talk to the application which works well however the launched application always shows the UI where-as I need this to be hidden, even calling the windowhidden on the process strart info does not work. Does
this somehow need to spawned under a different account process ?
_ProcessInfo = New ProcessStartInfo _ProcessInfo.WorkingDirectory = node.Item("ProgramDirectory").InnerText _ProcessInfo.FileName = node.Item("ProgramName").InnerText _ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText _ProcessInfo.CreateNoWindow = True _ProcessInfo.UseShellExecute = False _ProcessInfo.RedirectStandardOutput = True Thanks
Paul
The application we are spawning is not ours, so we cannot do any recompile.
"John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... have you tried to compile it as an exe rather than a winexe
-- Regards
John Timney (Microsoft ASP.NET MVP) ---------------------------------------------- <shameless_author_plug> Professional .NET for Java Developers with C# ISBN:1-861007-91-4 Professional Windows Forms ISBN: 1861005547 Professional JSP 2nd Edition ISBN: 1861004958 Professional JSP ISBN: 1861003625 Beginning JSP Web Development ISBN: 1861002092 </shameless_author_plug> ----------------------------------------------
"Paul" <ma********@hotmail.com.nospam> wrote in message news:eg**************@TK2MSFTNGP09.phx.gbl... Hi.
I need to launch a windows application and then send keyboard event to this process to run certain commands. I've created a COM+ appplication to
spawn and talk to the application which works well however the launched application always shows the UI where-as I need this to be hidden, even calling the windowhidden on the process strart info does not work. Does this somehow need to spawned under a different account process ?
_ProcessInfo = New ProcessStartInfo _ProcessInfo.WorkingDirectory = node.Item("ProgramDirectory").InnerText _ProcessInfo.FileName = node.Item("ProgramName").InnerText _ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText _ProcessInfo.CreateNoWindow = True _ProcessInfo.UseShellExecute = False _ProcessInfo.RedirectStandardOutput = True Thanks
Paul
as you are spawing a windows app, it needs to create its window for it to
work (also to implement its window loop logic). you are stuck with this
behavior. you can remove the create window permission (default with asp.net
and sevices) but then the app probably won't run. you will probably need to
a logon on the server so there is a valid desktop. all in all not a good
solution - you should replaces this app with a server based version as soon
as possible.
note: in ProcessStartInfo, the CreateNoWindow is used for console apps and
shell execute, to determine if a new command window should be created.
-- bruce (sqlwork.com)
"Paul" <ma********@hotmail.com.nospam> wrote in message
news:#i**************@tk2msftngp13.phx.gbl... The application we are spawning is not ours, so we cannot do any
recompile. "John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... have you tried to compile it as an exe rather than a winexe
-- Regards
John Timney (Microsoft ASP.NET MVP) ---------------------------------------------- <shameless_author_plug> Professional .NET for Java Developers with C# ISBN:1-861007-91-4 Professional Windows Forms ISBN: 1861005547 Professional JSP 2nd Edition ISBN: 1861004958 Professional JSP ISBN: 1861003625 Beginning JSP Web Development ISBN: 1861002092 </shameless_author_plug> ----------------------------------------------
"Paul" <ma********@hotmail.com.nospam> wrote in message news:eg**************@TK2MSFTNGP09.phx.gbl... Hi.
I need to launch a windows application and then send keyboard event to this process to run certain commands. I've created a COM+ appplication to spawn and talk to the application which works well however the launched application always shows the UI where-as I need this to be hidden,
even calling the windowhidden on the process strart info does not work.
Does this somehow need to spawned under a different account process ?
_ProcessInfo = New ProcessStartInfo _ProcessInfo.WorkingDirectory =
node.Item("ProgramDirectory").InnerText _ProcessInfo.FileName = node.Item("ProgramName").InnerText _ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText _ProcessInfo.CreateNoWindow = True _ProcessInfo.UseShellExecute = False _ProcessInfo.RedirectStandardOutput = True Thanks
Paul
You might want to try also HWND_MESSAGE parameter in SetParent Win32 API.
I never tried it with separate applications though, but it might work. If
you would test this, please notify about results
HTH
Alex
"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... as you are spawing a windows app, it needs to create its window for it to work (also to implement its window loop logic). you are stuck with this behavior. you can remove the create window permission (default with
asp.net and sevices) but then the app probably won't run. you will probably need
to a logon on the server so there is a valid desktop. all in all not a good solution - you should replaces this app with a server based version as
soon as possible.
note: in ProcessStartInfo, the CreateNoWindow is used for console apps and shell execute, to determine if a new command window should be created.
-- bruce (sqlwork.com)
"Paul" <ma********@hotmail.com.nospam> wrote in message news:#i**************@tk2msftngp13.phx.gbl... The application we are spawning is not ours, so we cannot do any recompile. "John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... have you tried to compile it as an exe rather than a winexe
-- Regards
John Timney (Microsoft ASP.NET MVP) ---------------------------------------------- <shameless_author_plug> Professional .NET for Java Developers with C# ISBN:1-861007-91-4 Professional Windows Forms ISBN: 1861005547 Professional JSP 2nd Edition ISBN: 1861004958 Professional JSP ISBN: 1861003625 Beginning JSP Web Development ISBN: 1861002092 </shameless_author_plug> ----------------------------------------------
"Paul" <ma********@hotmail.com.nospam> wrote in message news:eg**************@TK2MSFTNGP09.phx.gbl... > Hi. > > I need to launch a windows application and then send keyboard event
to this > process to run certain commands. I've created a COM+ appplication to spawn > and talk to the application which works well however the launched > application always shows the UI where-as I need this to be hidden, even > calling the windowhidden on the process strart info does not work. Does this > somehow need to spawned under a different account process ? > > _ProcessInfo = New ProcessStartInfo > _ProcessInfo.WorkingDirectory = node.Item("ProgramDirectory").InnerText > _ProcessInfo.FileName = node.Item("ProgramName").InnerText > _ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText > _ProcessInfo.CreateNoWindow = True > _ProcessInfo.UseShellExecute = False > _ProcessInfo.RedirectStandardOutput = True > > > > Thanks > > Paul > >
The company who write the software already has a package with uses the same
technology so they somehow have managed to hide the window with the same
executable we are using. Is there any way we can hook into the process
launch and find out what the command parameter was when the app was
launched, for example the users, arguments and window details ?
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:uq*************@TK2MSFTNGP11.phx.gbl... You might want to try also HWND_MESSAGE parameter in SetParent Win32 API. I never tried it with separate applications though, but it might work. If you would test this, please notify about results
HTH Alex
"bruce barker" <no***********@safeco.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... as you are spawing a windows app, it needs to create its window for it
to work (also to implement its window loop logic). you are stuck with this behavior. you can remove the create window permission (default with asp.net and sevices) but then the app probably won't run. you will probably need to a logon on the server so there is a valid desktop. all in all not a good solution - you should replaces this app with a server based version as soon as possible.
note: in ProcessStartInfo, the CreateNoWindow is used for console apps
and shell execute, to determine if a new command window should be created.
-- bruce (sqlwork.com)
"Paul" <ma********@hotmail.com.nospam> wrote in message news:#i**************@tk2msftngp13.phx.gbl... The application we are spawning is not ours, so we cannot do any recompile. "John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... > have you tried to compile it as an exe rather than a winexe > > -- > Regards > > John Timney (Microsoft ASP.NET MVP) > ---------------------------------------------- > <shameless_author_plug> > Professional .NET for Java Developers with C# > ISBN:1-861007-91-4 > Professional Windows Forms > ISBN: 1861005547 > Professional JSP 2nd Edition > ISBN: 1861004958 > Professional JSP > ISBN: 1861003625 > Beginning JSP Web Development > ISBN: 1861002092 > </shameless_author_plug> > ---------------------------------------------- > > "Paul" <ma********@hotmail.com.nospam> wrote in message > news:eg**************@TK2MSFTNGP09.phx.gbl... > > Hi. > > > > I need to launch a windows application and then send keyboard
event to > this > > process to run certain commands. I've created a COM+ appplication
to spawn > > and talk to the application which works well however the launched > > application always shows the UI where-as I need this to be hidden,
even > > calling the windowhidden on the process strart info does not work. Does > this > > somehow need to spawned under a different account process ? > > > > _ProcessInfo = New ProcessStartInfo > > _ProcessInfo.WorkingDirectory = node.Item("ProgramDirectory").InnerText > > _ProcessInfo.FileName = node.Item("ProgramName").InnerText > > _ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText > > _ProcessInfo.CreateNoWindow = True > > _ProcessInfo.UseShellExecute = False > > _ProcessInfo.RedirectStandardOutput = True > > > > > > > > Thanks > > > > Paul > > > > > >
After a day of trying to find some code, I've managed to find the code for
using the CreateProcessWithLogonW to launch the process as a different user,
this works launching the program as a given user but the UI output is still
sent back to the windows application, surely this should effectly run in the
new users desktop process. Once it is spawned I need to be able to use the
SendMessage functions to the app to control the keyboard input, so any ideas
would be great
"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... as you are spawing a windows app, it needs to create its window for it to work (also to implement its window loop logic). you are stuck with this behavior. you can remove the create window permission (default with
asp.net and sevices) but then the app probably won't run. you will probably need
to a logon on the server so there is a valid desktop. all in all not a good solution - you should replaces this app with a server based version as
soon as possible.
note: in ProcessStartInfo, the CreateNoWindow is used for console apps and shell execute, to determine if a new command window should be created.
-- bruce (sqlwork.com)
"Paul" <ma********@hotmail.com.nospam> wrote in message news:#i**************@tk2msftngp13.phx.gbl... The application we are spawning is not ours, so we cannot do any recompile. "John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... have you tried to compile it as an exe rather than a winexe
-- Regards
John Timney (Microsoft ASP.NET MVP) ---------------------------------------------- <shameless_author_plug> Professional .NET for Java Developers with C# ISBN:1-861007-91-4 Professional Windows Forms ISBN: 1861005547 Professional JSP 2nd Edition ISBN: 1861004958 Professional JSP ISBN: 1861003625 Beginning JSP Web Development ISBN: 1861002092 </shameless_author_plug> ----------------------------------------------
"Paul" <ma********@hotmail.com.nospam> wrote in message news:eg**************@TK2MSFTNGP09.phx.gbl... > Hi. > > I need to launch a windows application and then send keyboard event
to this > process to run certain commands. I've created a COM+ appplication to spawn > and talk to the application which works well however the launched > application always shows the UI where-as I need this to be hidden, even > calling the windowhidden on the process strart info does not work. Does this > somehow need to spawned under a different account process ? > > _ProcessInfo = New ProcessStartInfo > _ProcessInfo.WorkingDirectory = node.Item("ProgramDirectory").InnerText > _ProcessInfo.FileName = node.Item("ProgramName").InnerText > _ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText > _ProcessInfo.CreateNoWindow = True > _ProcessInfo.UseShellExecute = False > _ProcessInfo.RedirectStandardOutput = True > > > > Thanks > > Paul > >
It's not clear to me that this will work. The process will run under that other
account in its own window station with a hidden UI, but your program has to be
in the same window station to have a SendMessage work (let alone get a handle to
a window in another window station). Use the Task Scheduler to fire off
notepad.exe under another user account; it will run invisibly, see if you can
get a window handle to do a SendMessage with.
Phil Wilson [MVP Windows Installer]
----
"Paul" <ma********@hotmail.com.nospam> wrote in message
news:uG**************@TK2MSFTNGP09.phx.gbl... After a day of trying to find some code, I've managed to find the code for using the CreateProcessWithLogonW to launch the process as a different user, this works launching the program as a given user but the UI output is still sent back to the windows application, surely this should effectly run in the new users desktop process. Once it is spawned I need to be able to use the SendMessage functions to the app to control the keyboard input, so any ideas would be great
"bruce barker" <no***********@safeco.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... as you are spawing a windows app, it needs to create its window for it to work (also to implement its window loop logic). you are stuck with this behavior. you can remove the create window permission (default with asp.net and sevices) but then the app probably won't run. you will probably need to a logon on the server so there is a valid desktop. all in all not a good solution - you should replaces this app with a server based version as soon as possible.
note: in ProcessStartInfo, the CreateNoWindow is used for console apps and shell execute, to determine if a new command window should be created.
-- bruce (sqlwork.com)
"Paul" <ma********@hotmail.com.nospam> wrote in message news:#i**************@tk2msftngp13.phx.gbl... The application we are spawning is not ours, so we cannot do any recompile. "John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... > have you tried to compile it as an exe rather than a winexe > > -- > Regards > > John Timney (Microsoft ASP.NET MVP) > ---------------------------------------------- > <shameless_author_plug> > Professional .NET for Java Developers with C# > ISBN:1-861007-91-4 > Professional Windows Forms > ISBN: 1861005547 > Professional JSP 2nd Edition > ISBN: 1861004958 > Professional JSP > ISBN: 1861003625 > Beginning JSP Web Development > ISBN: 1861002092 > </shameless_author_plug> > ---------------------------------------------- > > "Paul" <ma********@hotmail.com.nospam> wrote in message > news:eg**************@TK2MSFTNGP09.phx.gbl... > > Hi. > > > > I need to launch a windows application and then send keyboard event to > this > > process to run certain commands. I've created a COM+ appplication to spawn > > and talk to the application which works well however the launched > > application always shows the UI where-as I need this to be hidden,
even > > calling the windowhidden on the process strart info does not work. Does > this > > somehow need to spawned under a different account process ? > > > > _ProcessInfo = New ProcessStartInfo > > _ProcessInfo.WorkingDirectory = node.Item("ProgramDirectory").InnerText > > _ProcessInfo.FileName = node.Item("ProgramName").InnerText > > _ProcessInfo.Arguments = node.Item("ProgramArguments").InnerText > > _ProcessInfo.CreateNoWindow = True > > _ProcessInfo.UseShellExecute = False > > _ProcessInfo.RedirectStandardOutput = True > > > > > > > > Thanks > > > > Paul > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Caroline |
last post by:
I'd like to launch an executable file from a web page. Basically, the user
enters seven parameters and then clicks a button to generate a graph. The
input is written to a file and then read by...
|
by: Michel H |
last post by:
Hello everyone,
While it seems simple to me, I just want to have a URL in my windows
application that people can click and then launch the URL in the default
browser. Same thing with a mailto:...
|
by: Michael Howes |
last post by:
I have a c# windows form that talks to a web service on a server that then
can talk to multiple "agents" on different machines using web service calls.
I want to be able to launch an application...
|
by: Paul |
last post by:
I have looked and looked for this info. All the I/O
examples I've found either explicity use a file name or use
the OpenFileDialog. When you drag a MS Word document over
MS Word, it launches and...
|
by: Joe |
last post by:
I created a CustomAction for this but I don't think I have it in the right
place. I tried both Install and Commit but neither allow it to get to the
final screen.
Are there any examples of this...
| |
by: Francois Bonzon |
last post by:
Any idea how I can launch a background task from a PHP script?
For example, when a user posts on my message board, it may fire many
e-mail notifications to other users, and other tasks. I want...
|
by: stef mientki |
last post by:
hello,
I'm trying to launch a windows application,
but as many others on this list, I've some trouble.
I read some other threads about this topic,
but sorry, I still don't understand all this...
|
by: =?Utf-8?B?YmVubnlnaQ==?= |
last post by:
I can't launch iTunes 7.6 using Windows Vista Ultimate. I was using it and
it was working fine until it froze up. I ended the task and now it won't
launch at all.
Things I have tried:
1. ...
|
by: tempnode |
last post by:
I have a problem that I can't seem to solve:
I need to write a C++ app that will run off of a floppy.
Basically, I will boot into DOS (from a floppy), and run my
executable
from the floppy. ...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |