Got Focus Event for Modeless forms using AcFocusCtrl
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Got Focus Event for Modeless forms using AcFocusCtrl
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Terry W. Dotson
Guest





Posted: Fri Apr 01, 2005 8:19 pm    Post subject: Re: Got Focus Event for Modeless forms using AcFocusCtrl Reply with quote

Mike Tuersley wrote:

Quote:
There is a way around it but it might require a lot of time for you.
Switch your app to a .net assembly. You can then use a custom tool
palette in 2k5-2k6 which has plenty of events.

Thats on the to-do list, but was hoping to eak out one last project that
would be 2002/2004 compatible also.

Thanks, Terry

Terry

Back to top
GTVic
Guest





Posted: Sat Apr 02, 2005 2:08 am    Post subject: Re: Got Focus Event for Modeless forms using AcFocusCtrl Reply with quote

An accurate statement - it doesn't have the property. You need a workaround API call to get the value.
Back to top
GTVic
Guest





Posted: Sun Apr 03, 2005 12:58 pm    Post subject: Re: Got Focus Event for Modeless forms using AcFocusCtrl Reply with quote

I have a solution that is fairly simple, uses a few API calls and a callback function to intercept windows messages.

The only problem is that it hangs occasionally. I'm not sure why. When it hangs I usually hit Ctrl-Break and go to debug mode and then F5 to continue.

Maybe this solution is not too compatible with VBA or maybe someone can suggest an improvement.

The idea came from here:

http://www.developerfusion.com/show/49/2/

Back to top
Terry W. Dotson
Guest





Posted: Sun Apr 03, 2005 5:34 pm    Post subject: Re: Got Focus Event for Modeless forms using AcFocusCtrl Reply with quote

GTVic wrote:

Quote:
The only problem is that it hangs occasionally.

Looks dangerous. I'd rather use a refresh button than introduce
instability.

Thanks, Terry
Back to top
GTVic
Guest





Posted: Mon Apr 04, 2005 1:02 am    Post subject: Re: Got Focus Event for Modeless forms using AcFocusCtrl Reply with quote

Well, the code is very simple so maybe the solution is simple. I am curious to know if you tried it and saw what I was talking about.

I think the instability only comes when you click on the titlebar to activate the form. So if the reason for that can be determined you would have an excellent solution.

Also, its possible that expanding the subclassing procedure could be used to completely replace the AcFocusCtrl16.dll component.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB