|
Hello
You can do that using the TextBox.Cursor property.
Regards
|
|
|
|
|
When mouse move over webpage on the screen and stop on a word that is URL,how could I catch the URL from my program?
I hope you got my meaning.Thanks
August 12,2006,Rhythm of The Rain.
|
|
|
|
|
Hello
If you can access the source of the page, this is easy using javascript, or ASP.
On the other hand -which I think is your case-, if you can't do that, then the only thing I could think of is OCR (Optical Character Recognition). Yes, I guess I've gone too far, but some trnslation programs do that. When you point the cursor to a word and press the HotKey, the recognize the characters off the screen and tranlate them -if possible of course-.
This is way, way too advanced topic. You can get an image of the link easily using Graphics class methods, but interpreting the image to text will certainly need a library.
Regards
|
|
|
|
|
Hello,
I'm wondering how it's possible to create an application wide event that's fired when any keyboard or mouse key is pressed and mouse move?
Please help. Thanks
|
|
|
|
|
Look at the KeyPress and MouseMove events in the System.Windows.Forms namespace.
Deus caritas est
|
|
|
|
|
Hi
There are usually two ways to handle user inputs (keyboard/mouse).
If you like to hanlde those events in a form you can turn its keypreview property to true and override its OnKeyDown,OnKeyUp,OnMouseDown and etc. metohds to do what you want to do (or you can add a handler using event handlers)
But if you like to handle those events in an application rather than a form you can handle messages that are being send to your application by windows.
Regards
|
|
|
|
|
If you want system-wide event notification then you'll have to have a Windows hook me thinks. There is an article on System-wide keyboard hooks here on CP, can't remember what it's called but search for "system wide hotkey" and you should find it.
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
Hi,
I am having problem refreshing the list box after I'd added an item to it.
The situation is like this, from form1, I click Add button to open a new form, let say form2 for me to fill in some details to the textbox, when I click on Add, form2 close and supposingly the list box in form1 should refresh and show the changes but it don't.
From form 1:
private void btnAdd_Click(object sender, EventArgs e)
{
form2.ShowDialog();
}
then form2 opens and it do whatever needed and pass the value using this:
form1.clientName = txtName.Text;
form1.AddToList();
then back to form1:
public void AddToList()
{
lstClientList.Items.Add(this.clientName);
}
usually if lstClientList.Items.Add(this.clientName); is done directly on the btnAdd_Click, it will add and show the changes on the list box but it don't work when I use another form to add.
Would appreciate for your help
Jie Liang
|
|
|
|
|
As you are using ShowDialog, form1 isn't doing anything until form2 closes.
Add the item after the call to ShowDialog, instead of calling a method from form2.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa,
Thanks for the advice, it really does work
Jie Liang
|
|
|
|
|
Hi folks!
I've just observed a behaviour I cannot understand - perhaps someone can shed some light on it...
For demonstration purpose I wrote a little program where two threads are incrementing a value, just to show someone the need for synchronization.
Everything works as expected, but then I wondered if I could measure any performance differences between using lock(this) and lock(someLockingObject) when I'm not using 2 threads running the same loop but using 4 threads with the same loop for every two of them.
When I execute the application run on my Athlon64 X2 and assign it to just one core, it's running faster than when I assign it to both cores!?
How can that be?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Probably scheduling between threads and procesors. It you modified your program to execute either loop depending on a command-line argument / button / whatever and load the two copies onto different processors then you'll probably get a faster output. But I don't know if this is what you want to accomplish.
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
Thanks, but the program isn't meant to do anything productive, it's just to show the need for synchronization.
The timing test was just a test to find out what to expect when I run my multithreading applications on a dual-core machine and I was quite surprised that the test doesn't run as fast on a dual-core as it would on a single core...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Locking a static object mite help...
|
|
|
|
|
Thanks, leppie, I'll try this.
Initially I had 2 objects for locking (non-static), one for each loop.
Then I locked both loops with the same object and then with this .
The strange thing was that using 2 objects also slowed down the program, while using a single locking object or this yielded equal (and better) results.
I'll post an update here as soon as I tried the static object for locking...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi!
The update I promised earlier:
Using a static object vs. an instance object doesn't show any difference.
Still letting the application run on both cores is slower than when limiting it to just one core...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
You are probaby not doing enough work per thread to justify multi threading it. IOW the lock construct is alot more expensive than say an increment statement.
|
|
|
|
|
Could be, yes. I'll try adding a little workload to the locked area...
Thanks,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Final update:
You were right. As soon as I let the critical section perform something more demanding the execution times with 2 cores became better than with just one core.
I was really starting to get worried, you know?
Thanks!
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hello Every 1, I have a problem where I have to pass a delegate as a parameter to a Method Call (method is simply a caller for an API method). I have decelared and initilized the delegate globally, given it my own method that should be called. I even assigned the delegate to the GCHandle and Pinned it (GCHanle.KeepAlive(....))
Now the problem the delegate is called as a parameter in a method call
The delgate signature is
public delegate void delegateCallBackFunction(); (global 4 namespace)<br />
<br />
public delegateCallBackFunction CallBackFunction; (global 4 class)
..............Now the function where the delgate is called........
public bool wrg303_CodecStart(int hRadio, FileStream ifFileStream, GCHandle targetHandle)<br />
{<br />
ifFileWriter = new StreamWriter(CallbackContextObject.ccifFile);<br />
bool status = true; <br />
status = (CodecStart(hRadio, CallBackFunction(GCHandle.ToIntPtr( targetHandle)),GCHandle.ToIntPtr( targetHandle)));<br />
return status; <br />
targetHandle)));<br />
}
If i use this code the error is that The second parameter is void where it should be a delegate.
I can't use new delegateCallBackFunction(.....)
How the hell I am going to pass the delegate as a prameter.
Thanks
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
Hello
Your code is a bit mixed up. You should have posted the prototype of CodecStart() and CallBackFunction() functions. Anyway, I've revised the sample code in MSDN writen in the GCHandle class example. Did you revise it?
Also you gave targetHandle twice, to the API and to your method, why?
Also Why can't you use new delegateCallBackFunction??
Regards
|
|
|
|
|
hello, How can i let the web page to be updated automatically every 10 seconds without forcing the user to press F5 or click refresh button.
I want it as you can see on the gmail page
Thanks alot
Hamody
|
|
|
|
|
or
Or use one as a backup for the other, at 15 seconds or so.
-- modified at 10:10 Sunday 27th August, 2006
---
b { font-weight: normal; }
|
|
|
|
|
hi, thanks a lot for your reply,...
may u tell me please how i can use the code the u replied me, and where i have to put it??
Thanks alot
Hamody
|
|
|
|
|
The meta tag goes inside the head tag.
The body tag, well... where do think that goes?
---
b { font-weight: normal; }
|
|
|
|