How to call a "Windows Form Application" in a "Windows Service"?
-
Hi everybody, + I's 02 application: - application A : a windows service - application B : a windows form program (a .exe file) and my problem's: when call app B within A's code then B unable get window title of windows although it's working when run B alone. anybody resolve it?
-
Hi everybody, + I's 02 application: - application A : a windows service - application B : a windows form program (a .exe file) and my problem's: when call app B within A's code then B unable get window title of windows although it's working when run B alone. anybody resolve it?
Please don't do that. What are you really trying to accomplish?
-
Hi everybody, + I's 02 application: - application A : a windows service - application B : a windows form program (a .exe file) and my problem's: when call app B within A's code then B unable get window title of windows although it's working when run B alone. anybody resolve it?
You can't do that. There is no way to resolve it because a Windows Service runs under a completely seperate Desktop from the users desktop. UI applications do not ever get to show any windows so there is no window for your service code to find!
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hi everybody, + I's 02 application: - application A : a windows service - application B : a windows form program (a .exe file) and my problem's: when call app B within A's code then B unable get window title of windows although it's working when run B alone. anybody resolve it?
The question is what OS are you using? If you are using XP then you can allow the service to access the UI. If you are using Vista or later you will need to create middle-ware executable that the Service can access and the middle-ware then can touch and control the separate UI executable. There are numerous reasons why this is, but simple put a service should not touch the UI. A service runs independent of the active user and there can be multiple users. With that the service would not know which user's UI to touch. This creates security holes as well as functionality issues. Simply put, you should not do this.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
-
The question is what OS are you using? If you are using XP then you can allow the service to access the UI. If you are using Vista or later you will need to create middle-ware executable that the Service can access and the middle-ware then can touch and control the separate UI executable. There are numerous reasons why this is, but simple put a service should not touch the UI. A service runs independent of the active user and there can be multiple users. With that the service would not know which user's UI to touch. This creates security holes as well as functionality issues. Simply put, you should not do this.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
thank everybody... I'm sad...:confused::confused::confused: anybody's other solution? :^) :^) :^) :^)
-
thank everybody... I'm sad...:confused::confused::confused: anybody's other solution? :^) :^) :^) :^)
Think about the features you need, not how to implement it.
-
Hi everybody, + I's 02 application: - application A : a windows service - application B : a windows form program (a .exe file) and my problem's: when call app B within A's code then B unable get window title of windows although it's working when run B alone. anybody resolve it?
I found other solution: I created a Task Scheduler for app B (B recreate task in 10'). when app A can't find process of B it's call Task to run B. all done. thank everybody. :-O