Can I open Notepad.exe from C# with "Find" option opened? - notepad

I created a Window form C# application which opens a Notepad.exe using command:
System.Diagnostics.Process.Start("notepad.exe", w_file);
But I want to open the Notepad with option "Edit-Find" and put some value into the "Find" field.
Is it possible?

Looks like you are trying to automate something...
Here is a sample from CodeProject which will help you to do what you are looking for in C#

Related

Forms 12c Open file and release Forms control

How can i open file in forms 12c.
I tried with following code but does not release control back to the forms instance until we close the file. I want file to be open and controls to be remain back with forms instance.
webutil_host.host('cmd /c C:\temp\test.txt');
Please can somebody help me.
Got it done it with following code
webutil_host.NonBlocking('cmd /c C:\temp\test.txt');
Note that you can achieve the same functionality with
web.show_document('file:\\C:\temp\test.txt');

Using a script to search google

I am new to Powershell and after having a few ideas and deciding to tinker around a bit I noticed that I can write a script in Poswershell that will make a search request on a search engine that I specify.
The issue is I am not sure exactly how it works. How is this script able to know how to open my web browser when all I did was specify a string filled with an address?
I have searched up other posts and have not found anything close to what I am asking (I believe).
Here is my source and I will also add an image.
[String]$SearchFor = "bing rewards"
$Query = "http://www.bing.com/search?q=$SearchFor"
Start $Query
Thank you all for your help.
Read help on start-process
https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.management/start-process
If you specify a non-executable file, Start-Process starts the program
that is associated with the file, similar to the Invoke-Item cmdlet.
So if I would have a TXT File in C:\test.txt and run
start-process c:\test.txt
It would open my default application assiociated with that file. On my PC it would open test.txt in notepad.
Hope that makes it clear now.
It simply uses the default application to open URLs on your desktop i.e. your default Internet browser.
Same behavior if you paste the URL (without variables) in your Start > Run box.

Open exe application wiith Arguments from Microsoft Word

I can easily open my application with arguments through RUN. But I'm having issues trying to start my application with arguments as a hyperlink inside of microsoft word. Is this possible? If not, How can I open my application from inside a word document?
Path to application
"C:\Users\antonioc\Documents\Visual Studio 2012\Projects\NV_Dev\ServerInventory\ServerInventory\bin\Debug\ServerInventory.exe" -SERVERNAME="test"
have you thought of running it from a macro button field? This would give users a clickable link, you could then shell launch application or any otherm,acro supported launch method through the macro.
http://office.microsoft.com/en-gb/word-help/field-codes-macrobutton-field-HP005186171.aspx

Display Message Box to copy code section from it using Powershell script

I am building install.ps1 script for Nuget pacakge and would like to open popup message at the end with some message , i have already achieved by following.
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[Windows.Forms.MessageBox]::Show("Test message ", "Test", [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
It will open popup message as per shown in below fig.
Instead of this i would like put some config code here that user can copy from box as per below fig
Please suggest me if anyone has done similar popup box before!
You won't be able to customize Windows.Forms.MessageBox to add what your looking for. In order to do what your looking for you'll need to create a custom form. An easy way of doing this is to use Primal Forms Community Edition which can be found here. You'll need to register for free to reach the download. There's a paid for version to so don't confuse that with the free CE edition. This tool gives you a Visual Studio like forms editor where you can drag and drop controls to a form and save the Powershell script. You'll need to create an event handler for the copy to text to clipboard button. After you saved the code generated by PrimalForms CE you will need to edit it to add the code for the event handlers. An example of how you can set the clip board with Powershell can be found here.
Users can copy the message box text simply by pressing the Ctrl+C key combination.

Custom read-host dialog for PowerShell 2 CTP3 ISE

Is it possible to hook a custom dialog into the new PowerShell ISE (Integrated Scripting Environment) that replaces the existing .NET WinForms dialog. I am talking about the dialog that the Read-Host cmdlet launches to request for user input.
For example, see this URL:
http://www.microsoft.com/technet/scriptcenter/resources/pstips/feb08/pstip0208.mspx
Drop the full code into Notepad.
Add the first line:
function read-host {
Add the last line:
}
Copy all the contents from Notepad.
Paste it all into your PowerShell console.
Now, if you call read-host, you're going to see a new Windows Form.
Now, if I open other windows, it remains on top, but it seems it is not the top-most because I see it over everything else, but still need to click on it to make it active.
What you CAN do is create a custom function that overrides Read-Host, so you're effectively usurping Read-Host and subbing your own functionality.
I don't believe you can, no. You'd need to write your own hosting application. The ISE does have its own object model - I'm asking if what you're after is possible.