injecting text to process without injecting dll [duplicate] - c#

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is there a way to overlay an application over a full-screened program?
Is it possible in C# to inject a text to process (like fraps for example), but without using any .dll injections?
Thanks in advance for responses.
#update
"A text" means some fast refreshing labels or something, which will show informations e.g.:
Name:Test
Pos: x=123,y=456,z=0
Level: Unknown
Something.....

You can use automation to send keyboard actions and suchlike to another program. Otherwise if there is no exposed API then things look bleak. See this question for an overview on the methods you use to send keystrokes.
EDIT: What you're asking for is not injection, it's an overlay. What you're looking to do is take control of the display buffer so that your overlay always has a higher z-index than whatever is being rendered. Take a look at this answer

Related

What should I use to open windows explorer in different positions? [duplicate]

This question already has answers here:
Opening process and changing window position
(3 answers)
Closed 3 years ago.
I recently posted this question but didn't get any response on it:
Need help opening 2 windows explorer windows to two different spots
I still would like any help that can be given in this case. One thing that I thought might have been confusing about my previous post is that both of the examples I noted were using SetWindowPos. I really don't care about the method used to solve this problem only that A) it uses c# and B) that it meets the desired criteria as posted in my previous post. Please, if there is further clarification needed please ask me. Thanks!
Use a mouse. Click the corner of the window and drag it until it is the desired size.

Create new/Reuse an instance of an application (Windows, .NET, WPF) [duplicate]

This question already has answers here:
What is the correct way to create a single-instance WPF application?
(39 answers)
Closed 6 years ago.
I've been struggling with this for more than several hours and cannot think of a solution.
I have an application that can be started in this way:
TestApplication.exe ID={GUID} filename={filename}
If there is not an instance of the application with the same GUID, a new instance should be started with ID={GUID} and the specified file should be loaded in it.
If there is an instance of the application with the same GUID, the user should be asked if he wants to close the file he is working on and if he confirms it - then the new file specified should be opened in the running instance.
Any ideas how to implement this?
Use a Mutex. See the first answer of this question:
What is the correct way to create a single-instance application?
Any ideas how to implement this?
Yes. Question answered. You never ask us to show us our ideas.
Let's get real.
One way is by window title, but having the GUID there is seriously not optimal.
As such, read up on NAMED MUTEXES. You can use that one to identify a program already running.
Alternatively - and better given you must actually send a signal - named pipes. You can register a named pipe with the GUID. Fails: Already exists. THAT allows the new application to actually signal the old one and or send a shutdown command.

Detect when user writes/deletes file in specific folder [duplicate]

This question already has answers here:
Notification when a file changes?
(3 answers)
Closed 8 years ago.
I have inherited application that, among many other things, has to watch if user writes/deletes text file into specific folder.
Currently, the application uses timer and polls after 5 seconds. I find this ineffective, and wish to improve this part of code.
My question is about existence of the .NET function that monitors changes in directory. Is there such function I can use to detect when a file is written/deleted in a specified folder?
Thank you.
Yes, you have the FileSystemWatcher class. It does exactly what you're looking for
Yes there is. I would suggest you take a look at the FileSystemWatcher class:
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.110%29.aspx
It's quite easy to set up, and it monitors for Win32 events, so is relatively inexpensive to use.

How can I change application's image when it is in fast-app-switching in Windows Phone? [duplicate]

This question already has an answer here:
windows phone change deactivated app image
(1 answer)
Closed 9 years ago.
I want to change image that my application's screenshot when it is in background.
I don't want to show my application's screenshot when it is in app-switching. I want to change it and put an image, how can I do it?
Thanks.
There is no way to do this.
The purpose of using a screen shot of the app when the use left it is to provide appropriate context to the user.
If the data being displayed for potentially extended periods of time would impact the application (as is common with some games) then the appropriate action to take would be to take appropriate action within the app/game when the user returns to the app.

Silverlight: Is it possible to syntax-colour XML in a textBox? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Silverlight XML editor / syntax highlighting
Hello,
I have some XML in my Silverlight Application that I store in a String and wish to output to the user. The xml is already "pretty printed" in the sense that it is formatted with indentations, but it would make it much clearer to read if I could also add syntax colouring to it.
Can this be done? How do I go about doing it? (please suggest a library or something)
Come to think of it, I'm not even sure if it's at all possible to output coloured text in a .NET interface...
Thank you for any insight!
(PS: I don't care which version of Silverlight)
I looked and did not find a control that would do XML syntax highlighting for a WinForms RichTextBox. This was for an XPath evaluator tool I built. The WinForms RichTextBox has the capability to display colors of course, but I couldn't find one smart enough to highlight XML syntax.
I ended up building one. The approach I used would probably work for WPF as well.
This is the explanation for how I got there:
WinForms RichTextBox : how to reformat asynchronously, without firing TextChanged event

Categories