'Cannot focus a disabled or invisible window' on Win98, not XP.
Posted on 2004-04-25
I use Delphi 7 Studio Enterprise on two machines (no network, just for comparison). The application I have runs on the XP machine flawlessly, but on the Windows 98 machine I keep getting "Project raised exception class EInvalidOperation with message 'Cannot focus a disabled or invisible window'. Process stopped. Use Step or Run to continue.
When I close the errormessage, the code that raised the exception turns out to be:
procedure TPropertyFrm.ShowContents(XObject : TObject);
m_Closing := FALSE;
if ED_Caption.Visible and ED_Caption.Enabled then
ActiveControl := ED_Caption; // <------- here is the hangup
I compared the installation settings on both standalone machines and made the as similar as possible. Yet the problem stays.
What do you make of this?