Community
Showing results for 
Search instead for 
Do you mean 
Reply

ACT stealing foucus?

New Member
Posts: 19
Country: USA

ACT stealing foucus?

Hi Everyone, I have developed a widows form based plug in for ACT to integrate with an in house ticketing system at my company. The plug in is working fine, but it seems to suffer from an annoying issue where ACT will steal the focus away from the form and it will be dropped behind the main application window. I have tried all of the usual placement actions to activate the form and give it focus, but as of right now I have had to set the "Topmost" attribute to keep it from being thrown behind ACT. Does anyone have any thoughts on what may be causing this behavior? Thanks for your time, Everett
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: ACT stealing foucus?

Hi Everett,
 
Have you tried Form1.ShowDialog(); ?
Otherwise yeah, its a real bugger! I had to re-write a lot of my code so that I started using custom control wizard-type forms since I think ShowDialog() behaves a bit "funny" with multiple forms....but I think I am showing my own ignorance in writing good quality code more then anything! Smiley Very Happy
 
HTH
 
Vivek
Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Employee
Posts: 236
Country: USA

Re: ACT stealing foucus?

Hi Everett,
 
What's likely going on is that some of the ACT! views are being background loaded for faster access, which may cause non-modal windows to lose focus.  You can, of course, make your form modal, but if that's not desired, you can turn off or control timing of this background loading in the ACT! configuration file, ActSage.exe.config.  Look for this block in that file, you can change the values which are in seconds, or set them all to 0 if you wish to turn off all background loading:
 

<!-- Number of seconds after contact detail view is shown to background load other views

for faster view switching performance (note: 0 seconds means don't background load view)-->

<add key="BackgroundLoadTaskView" value="15"/>

<add key="BackgroundLoadCalendarView" value="30"/>

<add key="BackgroundLoadGroupView" value="45"/>

<add key="BackgroundLoadCompanyView" value="60"/>

<add key="BackgroundLoadOpportunityView" value="75"/>

<add key="BackgroundLoadActivityNotification" value="20"/>

New Member
Posts: 19
Country: USA

Re: ACT stealing foucus?

Thanks for the reply Vivek. I have tried a couple of different possibilities, but decided to go with implementing the IWin32Window interface. That seems to have given me the most reliable and appropriate behavior for my situation. Thanks again, ...and cool avatar! Everett
New Member
Posts: 19
Country: USA

Re: ACT stealing foucus?

Hi Xavier, I bet that is the case with my focus issue. I will try changing the Act configuration per your post. Just an FYI for any other user out there; after implementing the IWin32Window interface, my plugin window is no longer hidden by the main Act program. However, the plugin now likes to randomly hi-jack other open windows, so I think I may ultimately go with Xavier's solution. Thanks everyone, Everett
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: ACT stealing foucus?

Xavier,
Thanks for the post! This one thing has had me confounded for ages and has really wound me up! The background refresh explains everything, thanks for clearing it up for all of us!
 
Everett,
Hehe! I'm glad you found that problem since I got had that issue but presumed it my lacklustre coding, I feel much happier now someone else has had that problem! Hahaha! The avatar- it was a tech room consensus I should declare myself as a baboon!
 
Vivek
Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog