Solved

TMemo, Occasionally not accepting Keypress events in a DLL. (D5)

Posted on 2001-07-04
4
197 Views
Last Modified: 2010-04-06
I have put together a program that works / looks much the same as the Windows 2000 Manage option.
the program has a tree menu, and a panel on the other side that depending on which option you select opens that form / page.
now these pages are all in different DLL's, and are created useing the form CreateParented procedure giving me the required result of a simple menu with different option screens all on one page.
Another reason i did this was some of the screens are also available as programs in there own right, a simple DPR that calls the dll, pops up the form and it just acts like a normal program. simple.

now on one of the screens i have a memo, just a standard TMemo, and if it is running as a single program, or as a popup form from the main menu program, or the first time you run the individual form as a parented window it works fine. BUT if when the form is parented i move to another application and then back again, all navigation keys( up, down, left, right, Alt, CTLR ) do not work.

i have tried setting an on keypress and keydown event and they are just not being called at all. WHY.
if i close the dll form and reopen it again its fine.
If the form is in popup mode rather than parented mode it will allways work fine, only when parented does this happen.
i have checked through out the entire source code and i am not accessing any keypress / keydowns any where ( apart from my own TMyEdit in my package). but that obviously does not have an impact on a TMemo miles away.

im absolutely baffled.

any advice / thoughts / work arounds / fudges / fixs welcome.

Cheers Kristian.
0
Comment
Question by:Kristian
  • 2
4 Comments
 
LVL 9

Expert Comment

by:ITugay
Comment Utility
Hi Kristian,

this behaviour looks like loosing a focus. Seems it looses focus and can't get it back. Try to set focus manually via windows API windows.SetFocus(Handle); Not sure, may it help.

------
Igor.
0
 
LVL 1

Author Comment

by:Kristian
Comment Utility
I was with you then, as i also have a status bar that needed some subtle setting of focus to always work when i posted a message to it.

BUT

i tried:

windows.setfocus(QueryMO.handle);
&
SetFocusedControl(QueryMO);
&
QueryMO.Setfocus;

in the OnEnter event of the memo ( ive steped through each time and its doing the call ).

but no luck.

BUT by doing this it did make the problem start straight away rather than after i loose focus and come back so i think were on the right track.

Kristian
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 50 total points
Comment Utility
Have you compiled the DLLs and the main project with runtime packages?
0
 
LVL 1

Author Comment

by:Kristian
Comment Utility
I cant beleive you've hit the nail on the head !!

I have a design + runtime package ( well theres no design time parts so it makes sence to have just the one package).

When im developing i compile including the packages so that it saves me compiling all programs / Dll's if i change the package ( good time saver ).

But as part of the software there is a release unit that compiles and releases itself, and this does not include runtime packages as i wanted to utilize the decrease in network traffic as it is a big suit ETC.

and when compiled with out the package it works absolutely fine ( well i havnt seen any problems yet anyway )..

I dont understand why, and i think its probably not worth trying to find out, ( as its ok on site i can live with it )..

anyway nice one,
Kristian
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now