Running multiple executables in one window [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am a mechanical engineer and only have basic understanding of programming so I am looking for somebody to guide me in the right direction. My question is that I have a bunch of flow meters that connect to the computer via RS232 connection. The flowmeters came with an application software(an executable file) that is used to display the flow going through it. Anyhow, when I am using multiple flowmeters at the same time, I have to open multiple instances of the same application.
I know I can create a batch file and specify the path to open all the executables in one shot but I was wondering if there is a way I can create some kind of desktop app or a user interface which I could link to the already existing .exe files and have them open and display everything in one window.
I will appreciate any help regarding where I can start to look or find resources to do such a thing.
Thanks

It would be non-trivial programming-wise to have a bunch of instances of an EXE all display their output in the window of another program.
What would be much easier would be to create a script to start all the instances of the EXE and position and size each window to achieve the look you want. The main difference between this and all EXEs within a Window is that they won't all go to foreground/background when you click a flow app or another (non-flow app). If you can live with that difference then...
I suggest using Powershell (PS) if you don't know a suitable scripting language already. Here is a PS script that set the size/position of a window. Another possibility is WASP which has a lot more GUI automation capabilities (which might make it more daunting).
After selecting and learning how to use one of the scripts above you'd then write a script that starts each instance of the flow app, using the right serial port, and other other appropriate command line arguments. Then you'd position and size the window of the flow instance you just created. You'd do that once for each instance. So the script you write is just a straight list of instructions: no loops, no data structures, etc. Which means you'd have a minimal amount of PS to learn.
You can create another script to terminate all the instances of the flow app, if you want. Similarly you could create a third script to minimize the windows of each instance. And another to restore the windows. Etc. In essence your controller app is a set of PS scripts. Which, if you got ambitious, could be turned into a GUI app, again using PS.

Related

c# - Forcing a Window to open in full screen [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Short version:
New to writing code.
Need to have every window that is restored or opened to go full screen.
What functions do this? Don't need it fully coded out just the functions and syntax.
Long version for those that want more information:
Ok this is my first post so small bit of background. I am new to coding. The last time I was in a coding class they were showing me Visual Basic 6, and it was new. When I was taking that class I never thought I would need to use it. Now I find myself in a place were I need to learn, so I am learning by doing. I have been using code pieces people post up; then modifying them to do what I want and then deconstructing them to make them work. Because of that I have found out how to make a simple register application for me to use at an art table I setup every few months, and even force the numlock to stay on even if someone turns it off.
I now have a new problem, and this is where I need the help. I need to create a program that runs in the background that will force all windows that are opened after it starts up and all windows that are restored from the task bar to open in full screen.
I have found a power shell script that was posted up to cause all windows to restore in a previous state and I got it to restore to full screen.
I need to know how can I see what application was just opened and then have it force it to open as full.
If you can point me to example of the various pieces I can slap them together and modify them to work for what I need.
I am working in Microsoft Visual Studio 2015.
Hope this is better for you than the first post.
As far as I know, this functionality isn't directly exposed in the .net libraries. You'll have to use these 3 (at least) pinvoke functions: EnumDesktopWindows, IsWindowVisible, and ShowWindow. You need the IsWindowVisible function because there are lots of Windows API hwnds that aren't what you normally think of as windows.

Building an Interactive Map using C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a small simple project on building a clickable interactive map of our school.
The challenge is to create a clickable parcel of map and add an animation
directing the user from point A to B using the given roads/hallways on the map. Moreover, I would like to create a database that allows the user to view the information for that specific parcel of map when clicked.
I'm using C# to program this one. My application is Visual Studio 2010
Example Links:
https://www.youtube.com/watch?v=tbinL2pg5Hs
http://www.wayfinderkiosk.com/
QUESTIONS:
What are the processes(step-by-step) on creating this project?
What applications should I need for programming, database, animating, drawing etc.?
Decide on the platform you will be using: WinForms, WPF, WinRT, ASP... If your project description includes the platform then you know; if not keep the question in mind!
Get your resources. Get the map and a list of all the places you will work with. Also all the extras like the descriptions and photos etc. Get this chore out of the way now. It'll help you to get a feeling for the amount of things you will put into the project.
Know your clients. An older kiosk system runs only only a few kiosks. Today maybe you need/want to have it run on the web and on portable devices. This will make a difference in not just for screen sizes but also in the number of possible routes..
Define user input controls. Keyboard? Mouse? Touch? Which buttons? You need a complete list!
Define the user interactions. Completely. Try to make tables of states the system can go through.
Try to decide on how the path finding should work. This anything but trivial, as soon as you want to include more than a few points.. You can have a set of ready made paths or try to find them or build them from a list of partial paths. This may well be the toughest part of it. Some folks believe in 'Hardest First' other in 'Hardest Last'. I believe that the first thing is to understand the hard parts well enough to get a feeling for them and to decide then.
Well that is really just a start, off the top of my head.
Good luck and have fun!!

Developing a program that serves as a web program in C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm not sure if I'm going to be able to explain it right since I'm quite sure I don't know the correct terminology involved with it, which is also why I'm having a difficult time Googling for answers.
Essentially, I'm looking to develop a program that serves as a web site. It'll run constantly (like a service) and will return HTML when an outside user sends an HTTP request thru a browser or similar to a specific port on the computer this program runs on. Basically, this program will perform various background errands throughout the day but I want to be able to expose a web front end (almost like how you would with standard WinForms, but I want to be able to access it remotely) to be able to configure it, check the status of tasks, and otherwise interact with it.
I'm looking to use .Net, but I'm open to using something more universal like Java too. Someone with experience in this area would be helpful to explain any pain points you've encountered and suggestions on how to get started.
You can do it in C# with the HttpListener class.
I published an example some time back. See A Simple Http Server.
Although you might consider whether you really want to operate at that low level. I have written a fairly complex server based on HttpListener, and if I had it to do over again I'd probably just bite the bullet and use ASP.NET. There is a bit of a learning curve, but unless your server is incredibly small and simple, an ASP.NET application will be a lot easier to write and will likely be more robust.
Here is a simple example on how to do it in C# using the HttpServer class:
http://www.codeproject.com/Articles/137979/Simple-HTTP-Server-in-C
You are doing at least 2 different things, so you should probably create a Solution in Visual Studio.NET with one project for each purpose (You can have many projects in a solution), probably with at least one Data Access project as well (of type Class Library). If the solution does things at certain times of the day, then those can be Console Applications that run through task scheduler, rather than one of more services. Services are better suited to things other than simple scheduled tasks. A Web Application project can serve up your html.

Best way to design distributed simulation [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm designing a program that uses a third party electrical solver.
I want to perform monte carlo simulations on large electrical grids and most of the times the program (mine) takes hours.
Because of this I thought that if I create a client in other computer I could call from my computer (and vice versa) I would have a nice distributed simulator.
Since I lack the knowlwdge, I would like to know what is the best way (if even possible) to "invoque" a program installed in another computer in the local network to do a specific task: simulate a file that I send and return the results back. The idea is to call the solver in lets say 10 computers at a time and gather the results asynchronically.
The language I use is C#.
I hope that my question is clear enough.
The easiest is to have a shared drive on the network, to which all computers have access. Then your app saves the input file (or one input file per machine, depends how you want to do it) on the shared drive, and your app starts another app remotely on each client. It monitors each one it starts for the exit status. After all of them have exited, it takes the output files and combines them and processes the data. Job done. The simplest "remote process" invocation is probably through psexec which you can download from technet, we have used it very successfully and very simple to use. The top two answers of How to execute process on remote machine, in C# have other good ideas: I think you will find them more overhead (longer to implement) but will give you more power in the long run.

Adding external callable api to program C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to create a simple application that is only supposed to be called by other applications. I've taken the concept from linux where you often have a application that depends on another, and then it does api-calls to that other application. The example I'm thinking about is libnotify which enables for notification of messages with or without image and title (this can for instance be found in ubuntu linux > 9.04). And then somebody created a plugin for pidgin that when you receive a message call the libnotify-"program" to display the notification, instead of building it's own notification-method.
Well, this is more or less what I want to create myself, but on windows. I've created a application that displays notifications (sort of like msn does on new message), and then I want to create for instance facebook-notifications that whenever it need to notify anything it will just call my notification-program. I've thought about making the all the specific parts as plugins (like a facebook plugin, and a twitter plugin), but then I have to load the external dlls into my already running program, and I rather like that the other programs can just call on the first one.
Any help or thoughts on the subject would be appreciated.
This is what DLLs are meant for.
Make your notification code into a DLL with a public class that displays the notification. You can then make other programs that reference the DLL and use the class.
You can use:
WCF
COM
Web Services
Run separate Process
Sockets
Named Pipes
Basically any inter-process communication.
But the easiest would be to simply reference a dll.
You can make a Web Service and have it reside on a central server while all your applications have access to it.
Here is a sample web service: http://www.codeproject.com/KB/webservices/myservice.aspx

Categories