|
the form is not active.
when get new message , how to make the form's icon light?
please give me directions, thanks.
|
|
|
|
|
bool bFlag = true;
private void timer1_Tick(object sender, EventArgs e)
{
if (bFlag)
{
this.Icon = Icon.ExtractAssociatedIcon(@"C:\FirstIcon.ico");
bFlag = false;
}
else
{
this.Icon = Icon.ExtractAssociatedIcon(@"C:\SecondIcon.ico");
bFlag = true;
}
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Maybe my depiction is blurry.
my meaning with the icon is the rectangle that it delegates a form
in the taskbar.
Are you sure the Icon class can make it glitter?
|
|
|
|
|
you have to attach some cool super-blue leds..
life is study!!!
|
|
|
|
|
I'm quite sure there is an easier method; something like this.focus() or this.activate() but it doesn't seem to work...
On the other side this does work. You'll need to allow unsafe code in your project
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(ref FLASHINFO fInfo);
private void timer1_Tick(object sender, EventArgs e)
{
unsafe
{
FLASHINFO fInfo = new FLASHINFO();
fInfo.cbSize = sizeof(FLASHINFO);
fInfo.dwFlags = 2;
fInfo.hwnd = this.Handle;
fInfo.uCount = 2;
fInfo.dwTimeout = 0;
bool result = FlashWindowEx(ref fInfo);
}
}
}
}
public struct FLASHINFO
{
public Int32 cbSize;
public IntPtr hwnd;
public int dwFlags;
public UInt32 uCount;
public int dwTimeout;
}
|
|
|
|
|
please tell me these variable's meaning, "cbSize","dwFlags","uCount"
,"dwTimeout".
Thanks very much.
|
|
|
|
|
cbSize --> just the size of the structure.
uCount --> how many times to flash.
dwTimeout --> the duration between flashes (0 is some kind of default value)
dwFlags --> it has something to do with customizing the parts of the application that flash. Just google for the FLASHINFO structure and you'll find all the possible values
|
|
|
|
|
This plugin article[^] by Redth is a good place to start since it seems to do something like what I need. The only problem I have with it is doesn't clearly explain the ability to communicate information between the host & the plugin. Well at least to me anyway.
So using that code as a base, perhaps someone can help clear this up for me.
Lets add a button to the host. It's job will be to display "Hello world" in the text box located in plugin1.
Lets also add a textbox to the host along with a button in plugin1. The button in plugin1 will display "hello world" in the newly created textbox on the host.
If anyone can figure out how to communicate between the host & plugin using that example I would be most grateful. I'm about running out of hair!!!!
Any other assistance would also be welcomed or references to other documentation. I've searched & searched, but there's not much around that explains what I need to know. All I can find is documentation on creating a plugin and loading it on a host. Nothing exists (that I know of) to demonstrates communication between the two.
THANKS!!!!!!!!!
|
|
|
|
|
I read your thread in the article. There isn't "one way" to do that. As in most designs, and a plug-in design is after all just another design, there are one or more interfaces that both the plug-in and the host know about and those interfaces are how you communicate from one to the other. Of course in .NET we also have delegates and events that can play a role in these interfaces. The bottom line is the developer must define these interfaces to satisfy the requirements of the project and in this case that means you.
led mike
|
|
|
|
|
Thanks for your reply...
I'm not particularly looking for 'one way' of doing it... Any way will be fine
I'm just looking more for direction as to how to go about doing it. The example I sited does achieve this somewhat by allowing 2 of the plugins to send feedback to the host which in turn launches a dialog box with the information sent to it.
What I am needing assistance with is how to get it to post that information to the host's main form (say a text box) rather than an independent dialog box. Further on down in the message section someone had asked something similar. They wanted to put some data sent from the plugin to the status bar. Someone had posted a reply saying they were able to do it and how, but the answer seemed incomplete so I was unable to duplicate it.
I guess my question really is this. I have 3 .cs files (pluginservices.cs which handles communication w/ host & plugin, my mainform.cs & mainform.designer.cs files) All of them belong to the same namespace (we'll call it 'host'). How can I access a button, textbox etc from my pluginservices.cs file. I thought that if I used a fully qualified name I would at least be able to access the object I want. Apparently this is not the case.
Please keep in mind that I am still rather new to C# so if there are any concepts that I may not be aware about that would make this seem trivial please point it out.
Thanks!
|
|
|
|
|
Paul Groetzner wrote: The example I sited does achieve this somewhat
Perhaps the plug-in design in the article is not suited to your requirements.
Paul Groetzner wrote: What I am needing assistance with is how to get it to post that information to the host's main form
Well if my first post didn't help you understand things more clearly I don't think I will be able to help. In my experience text messaging is not a great format for learning about design concepts, in contrast with a live session using white boards etc.
As a closing comment I would say you might be having a forest/tree problem. If you focus on trying to see "how to get object X to access object Y" rather than focusing on learning and understanding design principles and concepts you may always have this problem.
led mike
|
|
|
|
|
dasfasdfas
I love C# very much
|
|
|
|
|
|
Hi
I need to read a file in my PC in chunks,I should be able to read any chunk of file randomly.Is it possible?
Please advise me
Thanks
|
|
|
|
|
|
Hi,
I think you cannot write to XML using XMLReader or xmltextreader.
You, have to use DOM model for that.
use the XMLDocument class.
For Ex.
XMLDocument xdoc = new XMLDocument();
xdoc.Load(fileName);
now using xdoc with xpath you can navigate to the require node or you can create a new node.
I hope you got what u need.
ok bye.....
|
|
|
|
|
Hey guys, I'm sure this question will seem elementary to most of you.
There is a log file constantly being written to by an application I have no control over. It is a third party application. I do have access to a log file it writes to though. I want to open the file it's using and grab the data from it without having to do a lot of file.open .close stuff like I'm used to in c++. I'm fairly confident there is a way to do this, but I don't really know what it is. I'm still kind of a beginner in c# and am not familiar with all the tools available. I was also wondering if I could simply use that file as a stream and just update the stuff on my end whenever that file gets updated by the application.
If someone could point me in the right direction on this or give me a few tips as to which tools I might consider using, I'd appreciate it a lot.
|
|
|
|
|
Hi Kataric,
of course this is possible. I would use the FileSystemWatcher - element from the toolbox to watch the if the specific log file gets changed. Then just use the System.IO.Streamreader to read the content of the file.
Hope I could help you
|
|
|
|
|
I see, I was unaware of the FileSystemWatcher.
Anyone know how resource intensive that tool is?
|
|
|
|
|
Hello,
I have added a StatusStrip to my application. I am trying to change the Width of the status but for some reason I cannot change it from the defult value which is set to "22" in the properties windows!
Can someone tell me if it is possible to change the width of the StatusStrip and if it is, how I can do this?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Hi Khoramdin,
You can change the width of the StatusStrip to set the AutoSize property to false.
statusStrip1.AutoSize = false;
Thanks,
Gopal.S
|
|
|
|
|
hi to all
how can i order tables (data base) by defined feild , in CRYSTALL REPROT
for example , i want to use this query : select * from person order by age
where i must use from (order by age) clause?
thanks
|
|
|
|
|
So I have this app that has been creating some odd errors. Sadly, it has been throwing some odd and inexplicable error messages. No one I've sought help from has been able to help me with it. Mostly due to the fact that no one knows what's been causing the errors.
So after recoding many a thing and adding in some error handling, the errors are no longer occuring, but at the cost of reduced functionality. And then it donned on me...
What if I were to add some kind of error reporting that send me an error report through the email system we have in place...??? That way, I would know of the error as well as have an error dump of sorts. That way, I'll be able to find out what is causing the various errors that have been occuring.
Only 1 problem.
I don't know how to send mail through an Exchange server. I know you can make an email using SMTP, but that doesn't work here. I tried.
So where can I find some GOOD info on creating an app that will send an email through an exchange server? Unless someone knows how already. If you know how, could you bestow upon me such knowledge? Any and all help is always appreciated...
Thanks.
|
|
|
|
|
Sending an email programmatically through exchange is no big deal.
well .NET 2.0 has the ability create and send email via a specified SMTP server address. Have you tried looking at the System.Net.Mail namespace ?
Also here is a code snippet.
MailMessage mail = new MailMessage();
MailAddress ToMailAddress = new MailAddress("hello@helloworld.com");
MailAddress FromMailAddress = new MailAddress("goodbye@helloworld.com");
mail.From = FromMailAddress;
mail.To.Add(ToMailAddress);
mail.Subject = "Test Email";
mail.Body = "This is a test email";
System.Net.Mail.SmtpClient smtpServer = new System.Net.Mail.SmtpClient("192.168.0.1");
smtpServer.Send(mail);
Also you can try Lumisoft.NET dll which allows you to receive and send emails. You will need to google to get the Lumisoft .NET dll. Its free to use as well.
Hope this helps.
cheers
V
|
|
|
|
|
I took a look at the namespace, but 3/4 of it is just gibbersih to me...lol...
But I didn't know I could use the SMTP class to send VIA an Exchange server... I have need to try that. Thanks.
BTW... I *THINK* the exchange server has need of a username/password... Do you know how to use add that at all?
|
|
|
|