J
jhow
I'm writing a dictionary application in C#, similar to Trancreative's
Word Book.
Most of these dictionary apps have a concept of a "Word Picker", which
is a small floating window that stays Topmost even when other
applications are in the foreground. The idea is that, if you are using
a web browser for example, you simply highlight a word in the browser,
click on the Word Picker window, and it will automatically search for
this word for you in your dictionary application.
I have three problems with this:
1) I would like my Word Picker window to be able to cover the Start
Bar. This works ok with the correct Form properties set, but when the
user changes the foreground app, the Start Bar appears to refresh, and
sets itself to Topmost, thus covering my Word Picker. How can I avoid
this happening?
2) This problem is related to the first problem. How do I make my Word
Picker the Topmost of all Topmost windows even if it is deactivated.
Is it possible to always claim this No. 1 spot in the Z-order,
regardless of other applications that might want to bump me off the
top?
3) In order to "pick" the word off for example, the web browser, I
want to:
a) intercept the activate message my Picker Window receives when
it is clicked
b) examine the message to determine the last activated window
c) send this last activated window a WM_COPY message to determine
which word the user has just highlighted.
The problem here is that WndProc can't be overridden in the CF. I've
read up on the MessageWindow but figured out I can't use this to
capture my Word Picker Messages. The alternative is a several hundred
lines of code from the MS CF team blog, but I don't have the time and
energy to implement this. It also seems like an awfully long work
around for a very simple problem.
Can someone suggest a simpler way of doing this?
Thanks in advance.
Word Book.
Most of these dictionary apps have a concept of a "Word Picker", which
is a small floating window that stays Topmost even when other
applications are in the foreground. The idea is that, if you are using
a web browser for example, you simply highlight a word in the browser,
click on the Word Picker window, and it will automatically search for
this word for you in your dictionary application.
I have three problems with this:
1) I would like my Word Picker window to be able to cover the Start
Bar. This works ok with the correct Form properties set, but when the
user changes the foreground app, the Start Bar appears to refresh, and
sets itself to Topmost, thus covering my Word Picker. How can I avoid
this happening?
2) This problem is related to the first problem. How do I make my Word
Picker the Topmost of all Topmost windows even if it is deactivated.
Is it possible to always claim this No. 1 spot in the Z-order,
regardless of other applications that might want to bump me off the
top?
3) In order to "pick" the word off for example, the web browser, I
want to:
a) intercept the activate message my Picker Window receives when
it is clicked
b) examine the message to determine the last activated window
c) send this last activated window a WM_COPY message to determine
which word the user has just highlighted.
The problem here is that WndProc can't be overridden in the CF. I've
read up on the MessageWindow but figured out I can't use this to
capture my Word Picker Messages. The alternative is a several hundred
lines of code from the MS CF team blog, but I don't have the time and
energy to implement this. It also seems like an awfully long work
around for a very simple problem.
Can someone suggest a simpler way of doing this?
Thanks in advance.