473,386 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

mimicking a Mac OS X Tiger Feature

VP
g'day folks,

I was just browsing through some of the features apple's new tiger
operating system. One of the features I found was the invocation of
the dictionary feature implemented in Tiger. Essentially, one would
place their mouse on top of a word they are interested in and they
simply hold down CTRL-COMMAND-D this fires the dictionary window
displaying the definition of the word in question.

This link gives a good description :
http://a1408.g.akamai.net/7/1408/778...efinitions.pdf

Being new to windows programming, I was wondering how could I go about
mimicking such a feature in windows. For starters the dictionary
application could listen for certain keypress event with a
keycombination such as CTRL-SHIFT-ATL-D. One thing I can't quite
figure out is that how is it possible to pass the selected text from
any application into the dictionary window.

Any feedback will be appreciated.
thanks
Vee
Nov 17 '05 #1
5 1229
> One thing I can't quite
figure out is that how is it possible to pass the selected text from
any application into the dictionary window.
Text rendered in the context of a "control" in a windows application will be in a window itself. If the underlying control is a
Label or Text-based control, the Win32 API should be enough to extract the text from the window using a few Interop calls:

[DllImport("user32.dll")]
private static extern int GetWindowText(IntPtr window, [In][Out] StringBuilder text, int copyCount);

[DllImport("user32.dll")]
private static extern int GetWindowTextLength(IntPtr window);

public void GetWindowText(IntPtr WindowHandle)
{

int length = GetWindowTextLength(WindowHandle);
StringBuilder sb = new StringBuilder(length + 1);
GetWindowText(WindowHandle, sb, sb.Capacity);
return sb.ToString();
}

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"VP" <ve*****@gmail.com> wrote in message news:b1**************************@posting.google.c om... g'day folks,

I was just browsing through some of the features apple's new tiger
operating system. One of the features I found was the invocation of
the dictionary feature implemented in Tiger. Essentially, one would
place their mouse on top of a word they are interested in and they
simply hold down CTRL-COMMAND-D this fires the dictionary window
displaying the definition of the word in question.

This link gives a good description :
http://a1408.g.akamai.net/7/1408/778...efinitions.pdf

Being new to windows programming, I was wondering how could I go about
mimicking such a feature in windows. For starters the dictionary
application could listen for certain keypress event with a
keycombination such as CTRL-SHIFT-ATL-D. One thing I can't quite
figure out is that how is it possible to pass the selected text from
any application into the dictionary window.

Any feedback will be appreciated.
thanks
Vee

Nov 17 '05 #2
VP
thanks Dave for your post. Another suggestion made to me was to write
my own application as a service application. So thats another thing i
will look into. Couple of ideas I had before I read your reply was to
actually, assign a hotkey to my application then upon selecting the
text in the active application say notepad, the hotkey would copy the
selected text to clipboard then paste it into my dictionary
application. Its a wild idea but I will give it a shot.

One other question I had for you was that, how does one get information
about the opportunities Win32API can offer in windows application
development.. I have only started learning c# since March. I dont know
my current manner of learning is by searching for c# articles
understanding the code and dissecting the relavant bits to be used for
my own purpose.

once again thanks

Nov 17 '05 #3
Here's a few great links on MSDN that provide a portal to more in-depth articles and SDKs

Win32 and COM:

http://msdn.microsoft.com/library/de...n_styles32.asp

Windows Intefaces:

http://msdn.microsoft.com/library/de...e/windowui.asp

Shell:

http://msdn.microsoft.com/library/de.../extending.asp

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"VP" <ve*****@gmail.com> wrote in message news:11**********************@f14g2000cwb.googlegr oups.com...
thanks Dave for your post. Another suggestion made to me was to write
my own application as a service application. So thats another thing i
will look into. Couple of ideas I had before I read your reply was to
actually, assign a hotkey to my application then upon selecting the
text in the active application say notepad, the hotkey would copy the
selected text to clipboard then paste it into my dictionary
application. Its a wild idea but I will give it a shot.

One other question I had for you was that, how does one get information
about the opportunities Win32API can offer in windows application
development.. I have only started learning c# since March. I dont know
my current manner of learning is by searching for c# articles
understanding the code and dissecting the relavant bits to be used for
my own purpose.

once again thanks

Nov 17 '05 #4
Have you considered just installing Answers.com's "1-Click Answers" ?
http://www.answers.com/main/product_info.jsp

--
--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com

"VP" <ve*****@gmail.com> wrote in message
news:b1**************************@posting.google.c om...
g'day folks,

I was just browsing through some of the features apple's new tiger
operating system. One of the features I found was the invocation of
the dictionary feature implemented in Tiger. Essentially, one would
place their mouse on top of a word they are interested in and they
simply hold down CTRL-COMMAND-D this fires the dictionary window
displaying the definition of the word in question.

This link gives a good description :
http://a1408.g.akamai.net/7/1408/778...efinitions.pdf
Being new to windows programming, I was wondering how could I go about
mimicking such a feature in windows. For starters the dictionary
application could listen for certain keypress event with a
keycombination such as CTRL-SHIFT-ATL-D. One thing I can't quite
figure out is that how is it possible to pass the selected text from
any application into the dictionary window.

Any feedback will be appreciated.
thanks
Vee

Nov 17 '05 #5
VP
dave, thanks for the links they proved to be very useful.

james,
i could install the product you mentioned but the purpose for me to
venture into such a project is to teach myself writing code on a
windows platform :-)
i do appreciate the link because it makes me realise that my idea is
feasible.

thanks

James Curran wrote:
Have you considered just installing Answers.com's "1-Click Answers" ?
http://www.answers.com/main/product_info.jsp

--
--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com

"VP" <ve*****@gmail.com> wrote in message
news:b1**************************@posting.google.c om...
g'day folks,

I was just browsing through some of the features apple's new tiger
operating system. One of the features I found was the invocation of
the dictionary feature implemented in Tiger. Essentially, one would
place their mouse on top of a word they are interested in and they
simply hold down CTRL-COMMAND-D this fires the dictionary window
displaying the definition of the word in question.

This link gives a good description :

http://a1408.g.akamai.net/7/1408/778...efinitions.pdf

Being new to windows programming, I was wondering how could I go about mimicking such a feature in windows. For starters the dictionary
application could listen for certain keypress event with a
keycombination such as CTRL-SHIFT-ATL-D. One thing I can't quite
figure out is that how is it possible to pass the selected text from any application into the dictionary window.

Any feedback will be appreciated.
thanks
Vee


Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Carl S. in 't Veld | last post by:
I am trying to generate tiger tree hashes the same way as directconnect does, but I am failing. I checked the output from php with the reference vectors from...
1
by: xva | last post by:
Hi ! Does anybody know when Java 1.5 ("Tiger") will be available from Sun or at least when specs will be commmited for added features ? Sun loosely mentions "by end of 2003" in its site. ...
1
by: Asad Habib | last post by:
Hello. I am working on Tiger and wanted to find out how to compile a Python (.py) file into a .pyc file and then into a .pyo file. Can the compilation be achieved within the interpreter? Also, I am...
16
by: dario | last post by:
Hi, Im new on phyton programming. On my GPRS modem with embedded Phyton 1.5.2+ version, I have to receive a string from serial port and after send this one enclosed in an e-mail. All OK if the...
0
by: David T | last post by:
Has anyone run across this error? When calling any of several visualization routines from FiPy, Python quits with a Bus Error I'm using MacOS X Tiger 10.4.3, and I've tried several builds...
7
by: anne001 | last post by:
<?php phpinfo() ?> gives me 5.0.4 but at the terminal php-v gives me 4.3.11 even though I trashed the two php folders which had php_version.h of 4.3.11 in them and did a reboot. In the past,...
1
by: Mark Livingstone | last post by:
Hello! I am a Uni student and for a project in Information Systems Security due in just under two weeks, I have tried to make a Python version of the Biham / Anderson Tiger Hash function. I have...
0
by: majorcolletmkvu | last post by:
tiger woods 07 vista patch http://cracks.12w.net F R E E
11
by: Andreas Wollschlaeger | last post by:
Hi folks, as the subject says, i'm a poor Java programmer trying to transfer some of his wisdom into C++ world... here is what im trying to do this evening: Java has a nifty feature called a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.