|
hi,
I have a form with this.FormBorderStyle = FormBorderStyle.None; and I would like to display the standard shortcut menu that usually pops up when the user right clicks on a application button in the taskbar.
How can I do this? Any suggestion is highly appreciated
It would be cool to add some custom entries to the menu (as winamp does, see sceenshot[^]) but maybe I'm asking too much.
Thanks in advance
Jocker
_______
JeniuS - the file Organizer
|
|
|
|
|
private const int WS_CHILD = 0x40000000;
private const int WS_CLIPCHILDREN = 0x2000000;
private const int WS_MINIMIZEBOX = 0x20000;
private const int WS_MAXIMIZEBOX = 0x10000;
private const int WS_SYSMENU = 0x80000;
private const int CS_DBLCLKS = 0x8;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style = WS_CLIPCHILDREN | WS_MINIMIZEBOX | WS_SYSMENU;
cp.ClassStyle = CS_DBLCLKS;
return cp;
}
}
|
|
|
|
|
Hi all, i'm looking for a way to create a windows shortcut using C#.
I know about the COM library, IWshRuntimeLibrary but i'm having problems
using that on a windows 2000 machine
Is there a way of doing this without using a com object, just using .Net
libraries? It seems like a massive oversight if this functionality
has been missed from the .Net framework as shortcuts play a huge part
in the way windows is used by end users.
Any help / advice on this would really be apreciated.
Cheers
Kev
|
|
|
|
|
Hi,
take a look at this:
ShellLink
it uses some COM interfaces, but it does this automatically
I found it very useful in a couple of projects
Jocker
_______
JeniuS - the file Organizer
|
|
|
|
|
That works great, thanks.
Kev
|
|
|
|
|
Does anyone know how to write strings into VS_VERSION_INFO?
For example i would like to change the InternalName of an executeable?
Not just version number...
any help would be much appreciated
Mepho
|
|
|
|
|
How can I make the GUI of my application transparent when I develope that in C#? Any idea guys?
Regards
|
|
|
|
|
It depends on what parts of your GUI you want to make transparent, windows forms have a Transparency Key property and an Opacity property. Try playing with these to get the effect that you are after.
Kev
|
|
|
|
|
Hi!
I'm having a problem with the AppSettingsReader class. What I want to do is to retreive a value based on a key from a "App.config" file in my application.
The problem is that when I compile the code everything is ok (no errors, no warnings), but when I run the method (see below) I get an ConfigurationException (see below) that I don't understand. The exception occurs when the code tries to instantiate the "confReader" variable:
//code snippet:
System.Configuration.AppSettingsReader confReader =
new System.Configuration.AppSettingsReader();
The method is in a System.Windows.Forms.Form class.
Can anyone help me?
Thanks in advance!
//The Exception:
"An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll
Additional information: This is an unexpected token. The expected token is 'EQUALS'. Line 4, position 12."
//The method:
private string GetConfigurationValue(string key)
{
string confValue="";
System.Configuration.AppSettingsReader confReader =
new System.Configuration.AppSettingsReader();
if(key=="")
{
throw new Exception("key is empty");
}
try
{
confValue = (string)confReader.GetValue(key,typeof(System.String)).ToString();
}
catch(InvalidOperationException ex)
{
MessageBox.Show(ex.Message);
}
catch(ConfigurationException ex2)
{
MessageBox.Show(ex2.Message);
}
catch(Exception ex3)
{
MessageBox.Show(ex3.Message);
}
return confValue;
}
|
|
|
|
|
The error says that there is a problem with your config file, not the code.
What does your config file look like? Remember to check the "Do not treat <'s as HTML tags" at the bottom of the message window before you click Submit.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes!
Thank You!
I spotted the error in my config file. I forgot a '=', just as the exception message said. The code works now!
Wow... Sometimes I even impress myself when I do that kind of mistakes...
Thanks again!
OKB
|
|
|
|
|
I have written a class called Call in c# using serial comms to retrieve certain data from a remote device. The class includes methods like InitializePort(), MakeCall() etc. It also includes events like GotData and CallTerminated. These events are picked up by the calling class Device and are passed on to the GUI that is calling the Device class and the GUI responds accordingly.
The Device class has events like GetData which the GUI calls.
So far all these methods do not return values. Each caller (GUI and Device) call methods and terminate exceution; they just respond to events.
Each GetData function execution takes a different time since the amount of data to be retrieved is arbitrary.
I now need to execute a number of GetData calls in sequence (as part of a loop) from the GUI (or some other class calling the Device
class methods) and therefore need to wait until each call returns a value back to me before I proceed with the next execution.
How do I do that? I am new in .Net and have no experience in multi threading or asynchrnonous programming.
Thanks in advance
Regards
Chris
Thanks and Brgds
|
|
|
|
|
Hy there,
How can I check if the ASP.NET is installed on a server machine.
Thanks,
AdoSun
|
|
|
|
|
Do you mean if the .NET runtime is installed, or if it is installed AND IIS knows about it ?
You can check the folder in the windows subdirectory for the .NET folders, and while I don't know of a way to know if IIS knows about .NET, it's fair to assume it does, and if not, you can run aspnet_regiis once you have found the folder. There are also registry keys you can use, a quick google will tell you about those. I suggest the folder thing first only because I was thinking about if you can't tell that ASP.NET is registered with IIS.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Actually is important if the IIS knows about it.
I want to check this from a C# code.
|
|
|
|
|
IIS would never KNOW about .NET being installed as IIS has nothing to do with that. You may be able to some sort of SystemInformation check as to find that information, but IIS is not the way to go about that.
|
|
|
|
|
ExpertComing wrote:
IIS would never KNOW about .NET being installed as IIS has nothing to do with that.
Very wrong. ASP.NET is registered with IIS as an ISAPI filter. Therefore, it's registered with IIS, and IIS knows about it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There is one dirty dirty trick... Open C:\{windir}\system32\inetsrv\MetaBase.bin and look for e.g. "X - P o w e r e d - B y : A S P . N E T" string in it. Actually there are all the mappings as well, but file format is unfriendly. (okay, that's because I view it in notepad )
Idea look for it in MetaBase is from this article: http://www.codeproject.com/aspnet/teniistips.asp[^].
David
|
|
|
|
|
Hi, how can I load and unload a .dll file at runtime in my C# project. I need urgent reply plz help me. thankx
|
|
|
|
|
How do you need to load it? Do you need to read it or use it, if you need to use the .dll then there would be no point in unloading it.
|
|
|
|
|
http://www.c-sharpcorner.com/2/pr12.asp
does this help?
|
|
|
|
|
thanks for u r help, actually i am doing the same thing as mentioned in www.c-sharpcorner.com/2/pr12.asp, through this way i have to explicitly add the .dll file (component)to my project(using add reference),but i want to add(load) that component at runtime. as we do in VC++.
|
|
|
|
|
pakfari:
Use Assembly to load the dll, like so:
Assembly SampleAssembly;
string fullp = ((Full Path to the dll))
SampleAssembly = Assembly.LoadFrom(fullp);
//In order to create an Instance of it you have to grab the type of this class
//use Namespace.ClassName
Type ObjType = SampleAssembly.GetType(Namespace.ClassName);
//Create an instance of your dll here
Activator.CreateInstance(ObjType);
As far as running the Dll, there are a few ways to do it.
but this is how you would/could load it at runtime.
Hope his helps
Steve Welborn
Software Architect
|
|
|
|
|
I will just say Great!!!
It is working ok, can u tell me one more thing. How we can invoke the member functions of the Component using objType.
|
|
|
|
|
Well, this is where it can get tricky..at least for me. Because there are a few ways to do this, depending on if you want to call the function right then, or place that object in a Collections class and call it later. Hopefully someone will be able to explain it better than I can, but here goes.
This is how I executed a .dll after loading it.
Remember that when you created the Instance it passed back an object
object instance; //what Assembly.CreateInstance returns
object[] args; //Parameters to pass the function
MethodInfo method = type.GetMethod(functionname);
object returnval = method.Invoke(instance, args);
I hope this helps.
Steve Welborn
Software Architect
|
|
|
|