|
You're probably not going to get an answer since you
1. Didn't ask a specific question
2. Didn't post what specific problem was occurring.
3. Posted a huge code snippet without any formatting. (you should only post relevant, concise code snippets, surrounded with the <pre> tag)
|
|
|
|
|
First, I'd try placing this code outside of a BHO, in a standard .NET Windows Forms application, so that you can verify that it's not Internet Explorer interfering.
Once you've done that, come back and tell us if it's still not working. There are several examples of installing hooks in C# on this website and around the web, so you should be able to get it working outside of the BHO.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I am googling around for a day, every site has method to deactivate screen saver, i dont want to deactivate screen saver i want to let it run and when my event triggers, i want to stop it from my program. my event is triggered by timer, so there is no interaction with keyboard or mouse. i did try this
SendMessage(GetDesktopWindow(),WM_SYSCOMMAND,SC_SCREENSAVE,1);
but it doesnt work.
Shajeel
|
|
|
|
|
Shajeel wrote: i dont want to deactivate screen saver i want to let it run and when my event triggers, i want to stop it from my program.
Couldn't you be a little more clear about what you're trying to do? I don't understand when you say you want to deactivate the screen saver, yet you don't want to stop it.
|
|
|
|
|
deactivating means to set either set screen saver to none from windows or from programming, this is easy and can be done by SendMessage from programming. whereas stopping means to stop screen saver from programming with out clicking a mouse or pressing keyboard.
Shajeel
|
|
|
|
|
hello everybody in this forum.
Iam creating a usercontrol that runs as an embedded object inside the html code page in internet explorer that uses system.Net.Sockets to connect to a server i ran it on my localhost . It connects successfully , But after halt time . The explorer at first it hangs on for some seconds (lot of seconds) then it connects successfully.
Iam asking why the explorer doesn't respond during this time till it connects ? is there anyway for me to overcome this problem of halting the explorer?
I don't need it to halt ? i need it to work immediately.
Thanks everybody in this forum.
Any help will be greatly appreciated.
Human knowledge belongs to the world.
|
|
|
|
|
Use a new thread to do the socket communication. If you're using the UI thread, it will lock up explorer while the connection is made. If you use a second thread, it shouldn't lock up explorer.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hallo,
I make a windows service that check new entry in a database table, if there are new entries the service show a notify icon in the system tray.
all works fine but when the system tray show my icon, some applications crashes and stop to work (e.g: cics)
Any suggest for me? Thanks a lot.
(I hope you understand me, me english is not so good.)
|
|
|
|
|
I can't sqy why while you don't show me your code...
|
|
|
|
|
I'm sorry!
This is the code:
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Diagnostics;<br />
using System.ServiceProcess;<br />
using System.Text;<br />
using System.Drawing;<br />
using System.Data.SqlClient;<br />
using System.Windows.Forms;<br />
<br />
<br />
<br />
namespace Warning<br />
{<br />
<br />
public partial class Warning: ServiceBase<br />
{<br />
private System.Timers.Timer m_tTimer;<br />
private SqlConnection sqlConn;<br />
private SqlCommand sqlCmd;<br />
private SqlDataReader sqlReader;<br />
private string strSql;<br />
<br />
<br />
public Waning()<br />
{<br />
InitializeComponent();<br />
<br />
}<br />
<br />
protected override void OnStart(string[] args)<br />
{<br />
m_tTimer.Enabled = true;<br />
m_oNotifyIcon.Visible = false;<br />
}<br />
<br />
protected override void OnStop()<br />
{<br />
m_tTimer.Enabled = false;<br />
<br />
}<br />
protected override void OnContinue()<br />
{<br />
<br />
}<br />
private int GetNewRequestes()<br />
{<br />
int newRequestes=0;<br />
<br />
sqlConn = new SqlConnection("DATABASE=DBNAME;SERVER=DBSERVER;user id=user;password=xxx;");<br />
strSql = "SELECT COUNT(*) FROM DBTable WHERE StatusID=5";<br />
try<br />
{<br />
sqlConn.Open();<br />
sqlCmd = new SqlCommand(strSql, sqlConn);<br />
sqlReader = sqlCmd.ExecuteReader();<br />
sqlReader.Read();<br />
newRequestes = sqlReader.GetInt32(0);<br />
sqlReader.Close();<br />
}<br />
catch (Exception err)<br />
{<br />
string msg = err.Message;<br />
}<br />
finally<br />
{<br />
sqlConn.Close();<br />
}<br />
return newRequestes;<br />
}<br />
private void m_tTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)<br />
{<br />
int newRequestes = 0;<br />
newRequestes = GetNewRequestes();<br />
if (newRequestes>0)<br />
{<br />
m_oNotifyIcon.Visible = true;<br />
m_oNotifyIcon.ShowBalloonTip(60, "There are "+newRequestes.ToString()+" new requestes!", " ", ToolTipIcon.Warning);<br />
}<br />
else<br />
{<br />
m_oNotifyIcon.Visible = false;<br />
}<br />
}<br />
}<br />
}
Any idea? Thanka a lot!
|
|
|
|
|
Hi
I have a SD card in a Pocket PC, and now I would like to get it's properties.
Total size, used space and free space to be exact.
How do I do that in C#?
|
|
|
|
|
|
Hello,
I'm a student to software developing and my problem is as following:
I have to create an xml which fills the tasks, ressources, etc. for MSProject2003. Now, after I could get the xml started proper in MSPj, i have to replace the Tasks where only numbers are defined to make it much better readable. I have to use enums but project doesn't have the enums i need, so i have to create my own!!
How can i create this enums and use them the right way???
Thanks for help!
-- modified at 5:18 Thursday 6th April, 2006
|
|
|
|
|
public enum enum_name<br />
{<br />
Element1 = 0,<br />
Element2 = 1,<br />
...<br />
ElementN = N<br />
}
Or I didn't understand what do you need?..
|
|
|
|
|
Thanks for the answer!
got the solutio for my problem by myself when i was trying about changing my code!
I didn`t know how to set the enums the right way to use it proper in my code!
the answer i needed was:
<br />
public enum MyEnum = 0;<br />
...<br />
i only had to set MyEnum into the code where i needed it:
<br />
(int)System.Enum.EnumUsing.MyEnum;
Like I said, I´m a student to programming and learning about how to use code in proper way to write a bugless programm.
However, thanks for the help!!!
|
|
|
|
|
Hello,
I've a problem connecting to a mysql Database.
My program gives an error when i try to use using ByteFX.Data.MySqlClient;
It gives this error with this code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ByteFX.Data.MySqlClient;
namespace UploadBatches
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
Error 1 The type or namespace name 'ByteFX' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\wvsighem\My Documents\Visual Studio 2005\Projects\UploadBatches\UploadBatches\Form1.cs 9 7 UploadBatches
Can someone help me please
Thx
wistiti 5
|
|
|
|
|
|
That was indeed the problem
Thx
wistiti 5
|
|
|
|
|
Hi.
I want to use in my application a thing like common task in windows XP that appear in left side of a window.
Can you help me?
Best wishes
|
|
|
|
|
Write more about your problem...
|
|
|
|
|
I hope that you understand my mean about common task:
A portion in left side of all windows(My Computer, My Documents , ...) in Windows XP that in My Computer window, For example have System Tasks, Other Places and Details, that with click on each of them closes and opens.
OK?
I want to use somthing like this.
How?
Best wishes
|
|
|
|
|
Is there possible for someone to open an existing assembly and modify it with the help of System.Reflection classes?
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
|
Hey all,
I've been trying to look for similar problems all around the net, but I didn't succee...
Anyway, my problem is like that:
I wrote a little command line mailer that tries to send a mail to me when certain events happen. The mail program worked wonderful until I actually tried to run at the server.
It stills sends mail, and I still receive them, but some of the mail just don't appear in my mailbox. The problem is that sometimes I do get those mails, and sometimes not (The same mails, with the same subject and message text etc.). In the past I've used a program called postie.exe which (until now), never missed a mail.
As you probably understand, I got no relay problem what so ever, and I also didn't get any exception (I finish the command "SmtpMail.Send(aMessage);", with no errors).
Here is a small part of the code:
aMessage = new MailMessage();
aMessage.From = from;
aMessage.To = to;
aMessage.Cc = cc;
aMessage.Bcc = bcc;
aMessage.Subject = subject;
aMessage.Body = text;
SmtpMail.SmtpServer = smtpServerName;
SmtpMail.Send(aMessage);
return(true);
I don't know if that will give any more info, but I did some checking in my Exchange server and I saw that the missing mails never reached it (I've used the message tracking sending program supplied with the exchange server).
Also, all mails are being sent from a user inside the LAN to a user inside the LAN
Any idea what may be the problem?
Thanks,
Guy
|
|
|
|
|
I have a MDI Application. When the application loads Modal dialog opens asking for login. After period of inactivity the same ModalDialog needs to be opened. It opens perfectly but this time it opens as Modaless dialog.Help on this would be much appreciated.
I am using the same method to show the dialog but whats the reason it open as modaless dialog after the inactivity period. Thanks in advance.
Sairam
|
|
|
|