| View previous topic :: View next topic |
| Author |
Message |
David Saracini Guest
|
Posted: Fri Jan 05, 2007 5:46 am Post subject: Cool idea, but not sure how to do it... |
|
|
I recently started a new job. The company's existing application is very large (well over a 100 forms) and I'm having a problems navigating around it (just finding the correct form is difficult sometimes). I was thinking that it would be really nice if I could embed in the base form class some code to possibly broadcast a custom message on a given key stroke (eg. Ctrl+Alt+B) and have Delphi (note: I'm using BDS2006) open and display the form.
Has anyone ever done anything like this? I've written a few little OTA things before but never anything that was responding to another process.
TIA,
David Saracini |
|
| Back to top |
|
 |
Hannes Danzl[NDD] Guest
|
Posted: Fri Jan 05, 2007 9:35 am Post subject: Re: Cool idea, but not sure how to do it... |
|
|
David Saracini wrote:
| Quote: |
I recently started a new job. The company's existing application is very
large (well over a 100 forms) and I'm having a problems navigating around it
(just finding the correct form is difficult sometimes). I was thinking that
it would be really nice if I could embed in the base form class some code to
possibly broadcast a custom message on a given key stroke (eg. Ctrl+Alt+B)
and have Delphi (note: I'm using BDS2006) open and display the form.
Has anyone ever done anything like this? I've written a few little OTA
things before but never anything that was responding to another process.
|
You can get the unitname via rtti so all you need is to add a small unit that
installs a global keyboard hook in the initialization. the hook then looks for
the key combination if found check that Screen.ActiveCustomForm<>nil and then
use GetTypeData(Screen.ActiveCustomForm.ClassInfo)^.UnitName) to get the
unitname which you can broadcast. Write a small plugin for the IDE that
listens for the broadcast if it occurs iterate through the current projects
path (and env path) and look for the unit. open it. probably a matter of 30
minutes to write :)
--
Hannes Danzl [NexusDB Developer]
Newsgroup archive at http://www.tamaracka.com/search.htm |
|
| Back to top |
|
 |
JED Guest
|
|
| Back to top |
|
 |
David Saracini Guest
|
Posted: Fri Jan 05, 2007 11:29 pm Post subject: Re: Cool idea, but not sure how to do it... |
|
|
Yep... this is pretty much exactly what I'm thinking about doing. My main questions are related to the "listening" part. Well I be able to receive custom windows messages? Or will I need to do something else?
| Quote: | You can get the unitname via rtti so all you need is to add a small unit that
installs a global keyboard hook in the initialization. the hook then looks for
the key combination if found check that Screen.ActiveCustomForm<>nil and then
use GetTypeData(Screen.ActiveCustomForm.ClassInfo)^.UnitName) to get the
unitname which you can broadcast. Write a small plugin for the IDE that
listens for the broadcast if it occurs iterate through the current projects
path (and env path) and look for the unit. open it. probably a matter of 30
minutes to write :)
--
Hannes Danzl [NexusDB Developer]
Newsgroup archive at http://www.tamaracka.com/search.htm |
|
|
| Back to top |
|
 |
Thomas Mueller Guest
|
Posted: Sat Jan 06, 2007 1:52 am Post subject: Re: Cool idea, but not sure how to do it... |
|
|
Hi,
David Saracini wrote:
| Quote: | Yep... this is pretty much exactly what I'm thinking about doing. My
main questions are related to the "listening" part. Well I be able to
receive custom windows messages? Or will I need to do something else?
|
I would try a very simplistic approach first: Write the filename to a file
and have an IDE plugin check for this file periodically (or maybe better
when you click its menu) and open the form if it can find it. If that works
you can try to improve the communication.
MfG
twm |
|
| Back to top |
|
 |
David Saracini Guest
|
Posted: Sat Jan 06, 2007 3:03 am Post subject: Re: Cool idea, but not sure how to do it... |
|
|
Hi Thomas... Thanks for the reply. Simplier is always better! Actually, you gave me an idea. I think I might do what you are saying, but with a memory mapped file. That would make it a little nicer.
Thanks.
Dave
| Quote: | I would try a very simplistic approach first: Write the filename to a file
and have an IDE plugin check for this file periodically (or maybe better
when you click its menu) and open the form if it can find it. If that works
you can try to improve the communication.
MfG
twm
|
|
|
| Back to top |
|
 |
|