|
What about capturing whatever is below the mouse and trying to OCR it? I think it would be a much more viable solution for an application like this.
[EDIT: I don't think it would be an awfully complex solution, and yet it would work on browsers (text and images), Word, Paint, Excel, Media Player and any application. But I probably would write that in plain Win32 API.
Good idea, I think I could make that a spare project of mine (for those rare situations when I have nothing to do.)]
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
in response to your post dave,
i didnt think about the loosing focus part. Your suggestion of running it as a service is pretty cool, I never thought of it How does one go about emulating the Ctrl-C mechanism inside the keypress events of the service application if the correct keycombo was pressed ?
I was wrong in say that it is my first windows applications. I should say that I have been learning C# since march and most of my information comes from this very website, scouring through the numerous articles. So far I can disect the code from the articles and understand it well. My background was in embedded systems, mainly writing ANSI C. So this is a big switch over for me. However, I am enjoying it since its answering my own questions of how windows applications interact with windows. Though I am not sure if my approach to learning c# is correct?
At this stage I am not too worried about implementing the dictionary funtionality because I would be just happy getting the of copying of selected text through a service application without stealing focus.
in response to your post Luis,
OCR, now thats going beyond the call of duty . It is an interesting spin to this same problem, however, where would one get a OCR class from ? I think I was reading somewhere that one of the ms packages has a OCR dll that can be used correct ?
If anyone else can spin other ideas, I am sure others including myself would interested in reading them
cheers
Vee
|
|
|
|
|
ekynox wrote:
where would one get a OCR class from ?
I have no idea... maybe searching here you could find some leads.
I believe this is the only practical way of doing it, basically for the following reasons:
* First of all, not all text you see on screen belongs to a control. For example, you can't easily get what's in an IE window because it's drawn by the browser, instead of Label controls (or a rich text box or whatever.) Or images, or toolbar buttons... they are not controls in the Windows way. And what about Word? If I were writing this dictionary, the most important apps to support would be the browser and Word.
* Some controls contain text, and it cannot be selected. You can't select a single word in a ListView or in a TreeView . The caption of a window, a combo box item.
* And finally, you might not know controls that support selection which expose it's text in a different way (other that casting to a Control and getting its Text property.)
With OCR you can get the screen under the mouse (a screen capture program does it.) and identify the text under it, which, since not being handwritten, can be identified with almost 100% of success.
That's my idea, but I don't know I would implement it. I would have to research a bit, specially on the OCR part. That's why I liked it as a project for my spare time.
Good luck!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Luis,
Finally found that OCR article on this website,
http://www.codeproject.com/csharp/MODI.asp
Well this should give you some start on your new project
I did some searching on this website and found couple of tutorials that could help me out:
http://www.thecodeproject.com/csharp/popupkiller.asp#hotkey
http://www.codeproject.com/csharp/clipboard01.asp
The way I will approach my problem is to create a service application which has a unique hotkey assigned to it then use the clipboard tutorial to help me figure out how to copy text to memory. I will based my application to work with notepad to start with then see how things fold.
cheers
Vee
|
|
|
|
|
Hi,
I was wondering what operating system is everyone using to develop on? And have you created web services on that platform with any problems. I am having big problems trying to get web services to work on my win xp pro box and am wondering if I should just reinstall op?
Thanks,
JJ
|
|
|
|
|
There are no problems doing it on XP. All you need is IIS installed. What kind of problems are you having? Supply EXACT error messages and codes, please.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
This is the exact Error in my web proxy:
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll
Additional information: This is an unexpected token. The expected token is 'NAME'. Line 4, position 36.
I have a web service thats local and created a web ref called lh1.
At the top of my win form where I call the web ref is this:
using EMS.lh1;
private static lh1.EMS1 wsHrs = new lh1.EMS1();
When I enter win form that has the call to the web service it bombs as soon as I enter the proxy at:
public EMS1() {<-- This line
this.Url = "http://localhost/WSEMS1/EMS1.asmx";
}
This is what the top of my proxy file code looks like, I added nothing to
it:
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="EMS1Soap",
Namespace="http://tempuri.org/")]
public class EMS1 : System.Web.Services.Protocols.SoapHttpClientProtocol {
/// <remarks>
public EMS1() {
this.Url = "http://localhost/WSEMS1/EMS1.asmx";
}
Following Error is: This is an unexpected token. The expected token is
'NAME'
What am I doing wrong?
public EMS1() {
this.Url = "http://localhost/WSEMS1/EMS1.asmx";
}
This line is located in the proxy file generated by my web reference.
Thanks,
JJ
|
|
|
|
|
Hi,
I have a pictureBox, in which I load a picture bigger than the size of the pictureBox. I therefore have a horizontal and vertical scroll bar. In this picture box I draw lines using GDI+, g.DrawLine(..).
In order to draw a line I use the MouseDown event of the picture box to draw a line from a point clicked on the picBox to another point clicked on the picBox. The problem is that when I scroll the picture, and click at any other point ( x and y of the newly clicked point being bigger than the size of the picture box), I get redirected to a point which is in the picture-box rather than on the new point I clicked? Can anyone tell me how can I solve this problem?
Thanks...
C.N.
|
|
|
|
|
Have just managed....thanks the same...
Cheers
C.N.
|
|
|
|
|
Hi,
I am using StreamReader to read a file. I have to 2 tasks in a function;1st if of reading total lines in the file and 2nd is to do manipulation with the contents of the file.
Now when i read the total lines in the file .. the pointer reaches to the end of file and then when i call second function for manipulation with the contents, it says no line to read.
Is there any method of StreamReader which i could use before calling my second funtion so that i could start reading file from start.
Please help!
Ashu Sharma
Web Analyst
|
|
|
|
|
Hi!
Just set the underlying Stream 's Position property to 0.
mav
|
|
|
|
|
I've created an image in photoshop, with a transparant background, saved it as a tga file, and when I tried to display it in DirectX (2D graphics using Direct3D) there's a white rectangle around the image.
I've used the AlphaBlend flag with the Sprite.Begin function..
How can I make the background transparent?
Should I change something in the code, or in photoshop..?
thanks
|
|
|
|
|
Hi I have written a web service in C#. A web method in this web service returns a response object which contains an attribute with the name "code". For some reason this attribute does not appear in the response.
Response looks like this:
... <transcribeDictationResult>
<status xmlns="http://...">Job Allocated</status>...
If I change the attribute "code" to "codes" or any thing else, the attribute appears in the response:
...<transcribeDictationResult>
<status codes="0" xmlns="http://...">Job Allocated</status> ...
I am really stumped why this is happening. Can anyone give me some insight into this?
Is this because of some keywords or something that .Net uses making their use restricted? But I didn't come across any documentation indicating this.
|
|
|
|
|
How do i find out what is running in the system tray and use that information to clone it? (trying to write my own start bar type application) basically i want to grab everything in the tray, and use that data to produce my own.
|
|
|
|
|
Can anyone tell me:
1. how to interface usb(1.1/2.0)in c#.net.
2. for intercing the usb whether i have to write the driver for that device or use dll
3. how to write driver in c#.net.
thanks in advance
@hs@n
|
|
|
|
|
I've successfully completed a C# project using USB 2.0.
You should look at QuickUSB from Bitwise systems. But not really 'cause it sucks! The other company... um... what is it?... um... CYPRESS is probably better. Bitwise's documentation == cat poop. Also, they have bad coding ethics.
/\ |_ E X E GG
|
|
|
|
|
HI i m new to .Net and doing a project in C# related to Finger Print Recognition. Though at the moment doing research and gathering info abt how to acess Usb Device or Scanner in C# if any of u have some helping matelial plz share it to me thnx
I M new in .net and doing project on Thumb Scaning or" Finger Print Recognition"
|
|
|
|
|
To interact with the device, your going to need to get information on it's API. Maybe there's an SDK available, or else your doing it blindly.
I hope I make sense. Somebody correct me if I'm not.
/\ |_ E X E GG
|
|
|
|
|
You might want to try using Windows Image Acquisition (WIA). It's pretty generic and doesn't give you great deal of control over the image, but it might suit your needs. Search the articles for WIA an example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I just sent an order for DigitalPersona's SDK and figerprint readers. I expect to get it in about 10 days. It's expensive, but a client of mine is paying for it. I've seen sample code and the docs, and it looks realatively easy to use.
See http://www.digitalpersona.com/[^]
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I'm trying to bind my socket to any local network address and to port 1337 to listen to incomming broadcasts on that port.
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
socket.Bind(new IPEndPoint(IPAddress.Any, 1337));
MSDN says:
"Before calling Bind, you must first create the local IPEndPoint from which you intend to communicate data. If you do not care which local address is assigned, you can create an IPEndPoint using IPAddress.Any as the address parameter, and the underlying service provider will assign the most appropriate network address. This might help simplify your application if you have multiple network interfaces. If you do not care which local port is used, you can create an IPEndPoint using 0 for the port number. In this case, the service provider will assign an available port number between 1024 and 5000.
If you use the above approach, you can discover what local network address and port number has been assigned by calling the LocalEndPoint. If you are using a connection-oriented protocol, LocalEndPoint will not return the locally assigned network address until after you have made a call to the Connect or EndConnect method. If you are using a connectionless protocol, you will not have access to this information until you have completed a send or receive."
IPEndPoint localhost = (IPEndPoint) socket.LocalEndPoint;
Console.WriteLine("LocalEndPoint: {0}", localhost.Address);
Prints: "LocalEndPoint: 0.0.0.0" but by sniffing the NIC (using Ethereal) I can see that packets sent using socket.SendTo(sendBuf, new IPEndPoint(IPAddress.Broadcast, 1337)); originates from the IP 192.168.0.100 (my machine's WLAN NIC). Why isn't this IP address reported by socket.LocalEndPoint ? I need to know the address assigned!
|
|
|
|
|
The thing is, 0.0.0.0 is in fact the endpoint it is assigned to.
0.0.0.0 means "any" and it chooses which actual interface to use at send-time, separately for each packet. So if you are sending to the internet it will use the modem's IP and if to the LAN it'll use the NICs IP.
|
|
|
|
|
I do want to be assigned a network interface to listen for broadcasts. How to do that?
|
|
|
|
|
Well, you should still be able to listen on *all* the interfaces. If you want to assign only a specific one, you will have to find out what interfaces there are beforehand. I don't really know how to do that.
|
|
|
|
|
And pretty frustrating, I am trying to take a screenshot of my c# application, using BitBlt of the whole screen. For some reason the screenshot is taken and saved, but the application window is not part of it.
I tried doing it using Windows Media Encoder, same thing. Even the cursor changes are visible on the video, but the window is simply not there, completely transparent on the video.
Whats going on? Any ideas?
|
|
|
|