Click here to Skip to main content
15,879,535 members
Articles / Desktop Programming / Win32
Article

Desktop Dictionary

Rate me:
Please Sign up or sign in to vote.
3.94/5 (9 votes)
4 Jan 2008CPOL3 min read 49.5K   1.7K   33   3
Gets the meaning of a word in clipboard from Encarta/Cambridge online dictionaries

Introduction

I have been searching for a desktop English-English dictionary for the long time. I had found few, but most of them are licensed and need to buy. WordWeb is the one of the nice dictionary in the category of free desktop dictionaries. But I like Encarta and Cambridge online dictionaries. To check the meaning for a word in any of these dictionaries, I need to open the browser, type url, paste the word then click Search button... which was little but long process when I was reading an article and check the meaning of word without distracted.

So I thought of developing a small utility which sits in my windows tray and opens a window with Encarta or <city><place>Cambridge dictionary meaning for a word in clipboard or when I type a word.

Background

Technically there is not much challenging behind, but to give a brief background of development of the tool, it uses a WebBrowser control and WinAPI methods for hotkey selections (Alt+1 to open the textbox for typing the word, Alt+2 to open the window with meaning of the word in clipboard).

Using the code

When you unzip the folder, you can see the solution file of a windows application. This project has three windows forms and a lib folder with win32 methods for hotkey selections.

frmWordSearch – This contains a textbox to type the word to find the meaning and a context menu with the options for selecting Encarta or <city><place>Cambridge dictionaries and uses a normal thread to open the other window which will have a browser control on it.

frmFind – This is a very simple windows form with a web browser control on it. The web browser Navigate() method navigates to either Encarta or <city><place>Cambridge dictionaries with the selected word as a query string parameter.

frmHelp – which gives brief help for using this utility

How to use this utility

When you run the application, you can see a "binocular" image on the tray of your desktop with a small textbox on top of that. You can type the word to find the meaning in this text box. Press “Esc” to close either of windows.

When right clicked on tray icon, you can see a context menu with the options

<city><place>Cambridge – opens the meaning from <city><place>Cambridge online dictionary

Encarta – opens the meaning from Encarta online dictionary

Set Delay – A window will be popped with one of the previously searched word for an interval selected thru this option

Word Order – Specifies popup should get the previously searched word in sequential or random order.

Stop Rem – Stops showing the popup and when this option is selected, Set Delay and Word Order options will be disabled

Set Resolution – By default when this utility is loaded, resolution for the utility is set, but when the screen resolution is changed during this utility is running, you can use this option to adjust utility resolution based on the changed resolution

You can also use the hotkeys

Alt+1 – To show or hide the textbox

Alt+2 – To find the meaning of a word in clipboard. To find the meaning of a word, simply copy it to clipboard by Ctrl+C and use Alt+2 get the meaning of the word.

History

It could have been better pressing Alt+2 to openup the meaning of a selected word instead of copying the word into clipboard, but I have not yet implemented in this.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
I am Suresh Reddy B.V. Currently I am working on ASP.Net, C#.

Comments and Discussions

 
General2 suggestions which could enhance the usability Pin
Eran Levi7-Jan-08 20:31
Eran Levi7-Jan-08 20:31 
Thanks for the article.

2 suggestions:
- Allow to click any word/s in any application, and make the search in response to the click by reading the word at the clicked position, in a way similar to the (great!) commercial Bablyon tool:
This involves using global windows hooks to get the mouse / keyboard clicks and then the text at the position. It's very tricky to implement (at least grabbing the text), but there are a few free (but bugy...) libraries, and a very good commercial library called WordCapture, and both can do it for you.

- When pressing the clipboard hot key, you can send Ctrl+C to the active application using .NET's SendKeys.SendWait(). Most of the applications will copy their text as a result, and you won't have to press both Ctrl+C and then Alt+1 as it is now.

Cool | :cool:

Eran
GeneralRe: 2 suggestions which could enhance the usability [modified] Pin
Suresh Reddy B.V8-Jan-08 4:15
Suresh Reddy B.V8-Jan-08 4:15 
GeneralAt least everything in the article is spelled correctly! Pin
Ri Qen-Sin4-Jan-08 9:19
Ri Qen-Sin4-Jan-08 9:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.