|
You can use the native calls ShellExecute or CreateProcess by using dllimport
In the class you wish to start another app use the following namespace
using System.Runtime.InteropServices;
then define from which dll to get the function and the function name with dllimport and on the immediately next line define the function with all the parameters
<br />
[DLLImport("Coredll.dll", EntryPoint="TheFunctin")]<br />
public static extern void TheFunction(... all your params...);<br />
In the above example replace the TheFunctin with the actuall function name you wish to import (in your case CreateProcess or ShellExecute, and replace the ...all your params... part with correct parameters -> depends on which function you^ll use...
I think CreateProcess is in the Coredll.dll lib and ShellExecute is in the CeShell.dll, but you`ll have to doublecheck that.
Friendly Regards,
Davy
|
|
|
|
|
Davy,
thanks a lot for your help!
I'm not quite familiar with the dll-import but I guess I'll figure that out.
Best regards,
Marco
|
|
|
|
|
Hi,
I've created a control which has a string field, accessed through a bindable property.
However, when the control is in a form, and the bindingsource has a null value in the binded property, the value of the string is never updated.
I've tried using the advanced databinding properties to set an empty string when the incoming value is null, but no luck so far.
Any ideas? thanks in advance
|
|
|
|
|
I hane an application where one of my dialogs is created when the program starts. I like to call Form.Show() and Form.Hide() to show and hide the form.
When the user presses the system-X button the form is per default disposed. How do I prevent that I just want a Form.Hide() when the user does that so that I can call Form.Show() again without making a new instance of it.
_____________________________
...and justice for all
APe
|
|
|
|
|
Handle the Closing event on the form and cancel the operation (see the event arguments, e ). You can then hide the form instead.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Perfect Thanks!!
protected override void OnClosing(CancelEventArgs e)<br />
{<br />
e.Cancel = true; <br />
Hide();<br />
}
_____________________________
...and justice for all
APe
|
|
|
|
|
Hello community.
I have a problem and cannot solve it:
How can I measure the query execution time from my C# application?
I need to get a number or a time class to my app. from my database server, but
not measure the time when I got the informations from db but the internal time in db server. So I will display something like "Execution time: 0.0015 ms" in Sybase Interacive SQL.
I'm using Adatptive Server Anywhere v8 and v9
thanx lot
|
|
|
|
|
Try using the preformance counter: [^]
|
|
|
|
|
How does one highlight or de-highlight an item in a listview programmatically
|
|
|
|
|
you can use
listView1.Items[rownumber].Selected=true;
listView1.Select();
rahul
|
|
|
|
|
int index = //your index
listView1.SelectedIndex = index;
|
|
|
|
|
Hi Folks,
I am opening a Folder Browser Dialog. It opens with a help button which I dont want. Any idea how to remove Help Button from this dialog.
Thanks in advance.
|
|
|
|
|
Read this article.
Author changes OK button text by sending message. You can remove help button by the same way.
Best regards, Alexey.
|
|
|
|
|
|
Hi
Can any one tell me how to check for the end of row condition in the data base table using c#.
Is there any function like Movenext() to fetch next row values from the table?
|
|
|
|
|
Ashraj1982 wrote: Can any one tell me how to check for the end of row condition in the data base table using c#.
Is there any function like Movenext() to fetch next row values from the table?
It all depends on how you are getting the data out of the database in the first place.
It sounds like you are using a DataReader. The DataReader.Read() pulls in the next row from the database. It returns true if a row was fetched or false if there are no more rows.
Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Use :
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.textbox.Text = resources.GetString("Key1");
In your resource file, you must add -> Key1 = HelloWorld (for example).
|
|
|
|
|
I added first line of code to form1.designer.cs and have the text control retrieve the string.
but when debugging, the string doesn't show on the form designer.
What am i missing?
|
|
|
|
|
If you can retrieve the string, that means your problem is not in ResourceManager.
That must be at another place in codes.
|
|
|
|
|
I want to create charts dynamically using excel template. How can I set default characteristic to all the charts creating in this way? Please help urgent.
|
|
|
|
|
Try start recording macro in excel, and do manualy all actions you want.
Then look at the code of macro - and convert this code to C#.
Best regards, Alexey.
|
|
|
|
|
1) Is there a method for counting number of .xls files in a directory?
2) What is the best way to check if excel is installed on system?
|
|
|
|
|
1 - Directory.GetFiles ( from memory )
2 - probably checking some registry key.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
1)
int num = Directory.GetFiles("directorypath", "*.xls").Length;
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|