|
after re-reading the thread i guess i need a system hook...
the application need to catch changes to the cap/num/scroll locks from anywhere within windows
currently i poll the keyboard state every few seconds... to verify their values
|
|
|
|
|
I am trying to implement a piece of code in our app where a MouseHover event will trigger my code to construct a ToolTip object and populate it for display with the fields' value. (thanks for the tips, Heath!!!)
When nothing happened I went to the Mouse Event section of Help, copied the Mouse Event sample project, and pasted into a new solution. I hacked it to display all events and show a counter so I know when multiple events stack, thinking that the MouseMove was blocking the MouseHover from occuring.
What I found was that except for a rare instance where my keyboard tray was bumped, the events were very low to non-existant and it took about 1 minute 15 seconds to actually fire the MouseHover event on my corporate-managed machine!!!!
I could not find any setting anywhere that would actually affect this setting. Yet I've seen other posts here in my search for MouseHover discussions that people complained about it firing too frequently (5 ms) and wanting to slow it down.
Anyone have any ideas as to why my machine is so slow?
Suggestions welcome.
Thanks!!!
___________________
Forgoing antagonism and separation, one enters into the harmonious oneness of all things. Lao Tzu
|
|
|
|
|
You can change the setting with the tweakui powertoy.
top secret
|
|
|
|
|
leppie,
That was my first stop. Mouse tab exposes alot of things but not a timing for hover! Activation delay is the only setting that comes close, and that controls the xmouse hover behavior, not the normal mouse hover behavior.
Michael
___________________
Forgoing antagonism and separation, one enters into the harmonious oneness of all things. Lao Tzu
|
|
|
|
|
As leppie said, there are registry hacks you can perform and TeakUI is an easy way to do it.
I wanted to add that when you start outputing so much "junk" to the console or a TraceListener (like the DefaultTraceListener which is added by default), you incur serious performance penalties. Now, I doubt they would slow your system down THAT much (alone), but it's definitely not an accurate assessment. All that occurs synchronously. If you did it asynchronously, you'll incur a negligible performance hit but in enterprise applications this added logging feature is often worth it (see the Enterprise Application Instrumentation block on http://msdn.microsoft.com[^]).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I wan't doing any tracing nor was I outputing "junk".
___________________
Forgoing antagonism and separation, one enters into the harmonious oneness of all things. Lao Tzu
|
|
|
|
|
I have recently built an application that does Active Directory searches using DirectorySearcher. I have been asked to make it only search through a few, select OUs. is it possible to specify multiple OU's for a single DirectoryEntry? If so, How?
Yes, I am the highly suggestable type.
|
|
|
|
|
basically, i have 4 directory entries, each with a different ou, and i want to use them all in the same searchroot. is this possible?
|
|
|
|
|
hi people,
I have the following code in a web form page:
<br />
private static string CreateSalt(int size)<br />
{<br />
<br />
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();<br />
byte[] buff = new byte[size];<br />
rng.GetBytes(buff);<br />
return Convert.ToBase64String(buff);<br />
}<br />
<br />
private static string CreatePasswordHash(string pwd,string salt)<br />
{<br />
string saltAndPwd = String.Concat(pwd,salt);<br />
string hashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(saltAndPwd,"sha1");<br />
return hashedPassword;<br />
}<br />
I would like to be able to use these two function in a windows form program, the only problem is that i use System.Web.Security which is not available in windows forms applications. Could anyone tell me how I might get around this problem?
thanks,
talal
"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."
--Rich Cook
|
|
|
|
|
It is available. Just add it to your project references. Of course, it's not really necessary. Use the MD5CryptoServiceProvider :
private string ComputeMD5(string value)
{
MD5 md5 = new MD5CryptoServiceProvider();
byte[] buffer = Encoding.UTF8.GetBytes(value);
byte[] cipher = md5.ComputeHash(buffer);
StringBuilder sb = new StringBuilder(cipher.Length * 2);
for (int i=0; i<cipher.Length; i++)
sb.Append(cipher[i].ToString("x2"));
return sb.ToString();
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanks, I will try that
"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."
--Rich Cook
|
|
|
|
|
i'm sorry but i'm a bit lost here, the function you sent me sends back a hash of the password, but it doesn't use the salt value I give in the functions I posted...my situation is that I am building a web application but I would like to have a windows form to be able to change the admin password in the database and then in the web site, I use the functions I posted to check the username and password of the admin by hashing the password given using the SALT key.
thanks
"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."
--Rich Cook
|
|
|
|
|
It's sample code, not a complete solution. Just concatenate the salt as you did before calling the FormsAuthentication.HashPasswordForStoringInConfigFile method.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
yes I'm sorry, how stupid of me...it's nearing 11pm here, ok I got it to compile now, I will test that tomorrow and see if it works in parallel with the web form and gives the same results. thanks again
"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."
--Rich Cook
|
|
|
|
|
It's MD5, a hashing standard. So long as you're salting the value and use the same characters (case-sensitive) for the value to hash, it will work. If you're taking this from user input, you might consider trimming the strings on either side before hashing, unless you wanted to accept beginning and trailing whitespace.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
ok, done
I have one question about this:
<br />
StringBuilder sb = new StringBuilder(cipher.Length * 2);
for (int i=0; i < cipher.Length; i++)
sb.Append(cipher[i].ToString("x2")); <br />
what does it do exactly? I am mainly asking about this ToString("x2")
"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."
--Rich Cook
|
|
|
|
|
See the documentation for Byte.ToString(String) . It formats the byte as hex using 2 characters (so that a byte is always formatted as two chars, even if less than 127). If you don't, your MD5 is invalid since the hash must be 128 bits, or 32 hex characters (representing 16 bytes).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
oh ok, I understand now, thanks.
by the way, great Dusk at Sea World photo, I love photography and this picture is very good
"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."
--Rich Cook
|
|
|
|
|
i want to built a socket program like a chating program in yahoo messanger.I want to know how i treat both modules(means is there are two threads reading & writing thread at both modules or something else?if u have some article about this ,tell me or give me some hints.
mughalali
|
|
|
|
|
There are hundreds if not thousands of examples of chat applications out there and even right here on CodeProject. Just http://www.google.com[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i want to built a socket program like a chating program in yahoo messanger.I want to know how i treat both modules(means is there are two threads reading & writing thread at both modules or something else?if u have some article about this ,tell me or give me some hints.
mughalali
|
|
|
|
|
I have a problem stopping the server process. Everything seems fine when i stop my multithreaded server, no exceptions when i shut down the application. But the server program wont stop executing. I cant find any more threads that i have forgot to abort. Still if i try to abort the CurrentThread in the end of the program i get an AbortException that cant be handled by the application. Is there something else i can try?
Michelangelo
|
|
|
|
|
Without seeing any code, all I can tell you is that to handle the seemingly uncatchable ThreadAbortException , handle the current AppDomain's AppDomain.UnhandledException event to catch ThreadAbortException s (or any others you might want caught).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I presume your server is using a thread which continually listens on a port by running it on a thread.
Currently when you close your program down the lightweight process (the thread) continues to be executed.
In the applications "closing" event you need to ensure all threads running are interrupted and cleaned up.
Dont use the STOP method as it is very bad.. you could end up with part written data for the instance of the program.
Theres a pretty complete guide here on threads:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchusingthreads.asp[^]
Which is worth a glance, but for the quick solution do this in the closing event for the main form/application:
threadinstance.Interrupt();
|
|
|
|
|
The threads you have created may be foreground threads. These threads will keep the process running until they stop. Try setting the Thread.IsBackground property to true. Once all foreground threads have stopped executing the runtime will abort all background threads automatically.
|
|
|
|