C#, process, TPL tasks, following a process
-
I'm starting to plan out a project and I need some help with ideas. Situation: my company uses a software managed by a third party company. I do not know exactly how this works but the link to this program looks like "113.444.767.123/bin/some file". This is started though iexplorer then switches over from the iexplorer process to a different process (I have the name). We recently had then create a test company for training purposes. I can make two separate desktop icons easy enough. But once the program is running, if both the training and real companies are running at the same time, it is hard to determine the difference. I want to change the taskbat icon, and pop a message balloon when the user switches between the two. First problem, windows will use the desktop icon before the app icon, so I'm going to create a bootloader app that is launched from the desktop, it will open my real app and kill itself. Now I will have access to change the taskbar icon through code. Second problem, I can't just call the process the company program and follow the returned processId because the original iexplorer ID calls the other program, thus changing ID's. My thoughts: when I start the process from my program I start a loop the constantly calls getProcesses and loops through each one until the actual program process name is found. Once found I'll have the ID off the correct process and can match up icons based on that. Third problem monitoring what process is active to change the icons. My thoughts were to use TPL tasks, start a new async task that runs a loop to get the ForgroundWindowGetID and compare it to the list of IDs for the program I'm tracking. This is were in a little murky, can I send the ID back to my main program to handle the icons and balloons while still keeping the async task running, or do I need to stop the async task when the ID changes, then restart the task?
-
I'm starting to plan out a project and I need some help with ideas. Situation: my company uses a software managed by a third party company. I do not know exactly how this works but the link to this program looks like "113.444.767.123/bin/some file". This is started though iexplorer then switches over from the iexplorer process to a different process (I have the name). We recently had then create a test company for training purposes. I can make two separate desktop icons easy enough. But once the program is running, if both the training and real companies are running at the same time, it is hard to determine the difference. I want to change the taskbat icon, and pop a message balloon when the user switches between the two. First problem, windows will use the desktop icon before the app icon, so I'm going to create a bootloader app that is launched from the desktop, it will open my real app and kill itself. Now I will have access to change the taskbar icon through code. Second problem, I can't just call the process the company program and follow the returned processId because the original iexplorer ID calls the other program, thus changing ID's. My thoughts: when I start the process from my program I start a loop the constantly calls getProcesses and loops through each one until the actual program process name is found. Once found I'll have the ID off the correct process and can match up icons based on that. Third problem monitoring what process is active to change the icons. My thoughts were to use TPL tasks, start a new async task that runs a loop to get the ForgroundWindowGetID and compare it to the list of IDs for the program I'm tracking. This is were in a little murky, can I send the ID back to my main program to handle the icons and balloons while still keeping the async task running, or do I need to stop the async task when the ID changes, then restart the task?
Use virtual machines; or get another physical machine. None of this makes sense because what you're "planning" now is a throw-away. I can create simulators; but the "real" thing is often cheaper (and VM's are "real" enough).
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
-
I'm starting to plan out a project and I need some help with ideas. Situation: my company uses a software managed by a third party company. I do not know exactly how this works but the link to this program looks like "113.444.767.123/bin/some file". This is started though iexplorer then switches over from the iexplorer process to a different process (I have the name). We recently had then create a test company for training purposes. I can make two separate desktop icons easy enough. But once the program is running, if both the training and real companies are running at the same time, it is hard to determine the difference. I want to change the taskbat icon, and pop a message balloon when the user switches between the two. First problem, windows will use the desktop icon before the app icon, so I'm going to create a bootloader app that is launched from the desktop, it will open my real app and kill itself. Now I will have access to change the taskbar icon through code. Second problem, I can't just call the process the company program and follow the returned processId because the original iexplorer ID calls the other program, thus changing ID's. My thoughts: when I start the process from my program I start a loop the constantly calls getProcesses and loops through each one until the actual program process name is found. Once found I'll have the ID off the correct process and can match up icons based on that. Third problem monitoring what process is active to change the icons. My thoughts were to use TPL tasks, start a new async task that runs a loop to get the ForgroundWindowGetID and compare it to the list of IDs for the program I'm tracking. This is were in a little murky, can I send the ID back to my main program to handle the icons and balloons while still keeping the async task running, or do I need to stop the async task when the ID changes, then restart the task?
Couldn't you start your app with a parameter indicating whether it's the real company or the training company, and if it's the training company, change the icon of the main form in the app?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
Couldn't you start your app with a parameter indicating whether it's the real company or the training company, and if it's the training company, change the icon of the main form in the app?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013Not really, my app actually starts a 3rd party software. Once the 3rd party is running I want my app to be able to "watch" the 3rd party for which one was in focus. I was "hoping" and event would be thrown in Windows when a widow went in focus, but it doesn't look so. What I've done so far (have not had time to do much) was to create two projects in one solution, the first one being a simple command line app that just calls the GUI. Now, since windows is not using the desktop shortcut icon, I can change the app icon and it is reflected on the team bar. My plan for following windows is, on the open button event, the app calls the 3rd party program (actually a link to a server), starts a timer, on the tick event, loads all the precesses into a list and loops through list search for the process name to show up, once it finds it, adds the ID to a list and stops the timer, starts an async task that gets the ID number of the active window, if the active window is in the process list, displays the correct icon.
-
Not really, my app actually starts a 3rd party software. Once the 3rd party is running I want my app to be able to "watch" the 3rd party for which one was in focus. I was "hoping" and event would be thrown in Windows when a widow went in focus, but it doesn't look so. What I've done so far (have not had time to do much) was to create two projects in one solution, the first one being a simple command line app that just calls the GUI. Now, since windows is not using the desktop shortcut icon, I can change the app icon and it is reflected on the team bar. My plan for following windows is, on the open button event, the app calls the 3rd party program (actually a link to a server), starts a timer, on the tick event, loads all the precesses into a list and loops through list search for the process name to show up, once it finds it, adds the ID to a list and stops the timer, starts an async task that gets the ID number of the active window, if the active window is in the process list, displays the correct icon.
-
Prod vs test user decisons based on the color of a task bar icon. Sounds like Hawaii all over again. (Some people are color blind).
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
Gerry Schmitz wrote:
(Some people are color blind).
Actually, quite a few, including me. Roughly 1 in 10 males are red/green colorblind (US statistic). Females are rarely colorblind. (A sex-linked trait, recessive on X chromosome.)
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed." - G.K. Chesterton
-
Gerry Schmitz wrote:
(Some people are color blind).
Actually, quite a few, including me. Roughly 1 in 10 males are red/green colorblind (US statistic). Females are rarely colorblind. (A sex-linked trait, recessive on X chromosome.)
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed." - G.K. Chesterton
To me, "some" means one, all, or anything in between :) In this case, you plan for any number. (I think when I did have a "test" environment, I would change the entire background if there was any chance there would be any confusion).
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal