Solved

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

Posted on 2001-07-04
4
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 6252725
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
ID: 6252790
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
ID: 6254433
Have you compiled the DLLs and the main project with runtime packages?
0
 
LVL 1

Author Comment

by:Kristian
ID: 6254724
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month6 days, 10 hours left to enroll

634 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