ISIGest
asked on
Draw or anchor a panel (or other TWinControl) over external window
Hi, waht is the best way (if exist) to anchor over an external window a custom panel?
I need to add my custom control on a form...can I do it?
With ParentWindow, the draw of the control undergoes distortion :(
I need to add my custom control on a form...can I do it?
With ParentWindow, the draw of the control undergoes distortion :(
can you precise (with images) what you are trying to do, what do you mean by "the draw of the control undergoes distortion", and what code you have tried so far ?
ASKER
I try to set the ParentWindow handle with the window (destination) handle.
I need to add a custom controls (like a plugin) to a specified window in an external process.
This control (panel) must be interactive using a textbox or other controls.
I need to add a custom controls (like a plugin) to a specified window in an external process.
This control (panel) must be interactive using a textbox or other controls.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I actually have been able to put that panel in all applications I tried : Word, Firefox, Delphi, the desktop even.. And the button code I place in that panel is executing fine each time I click it.
BUT : Once I clicked once on the button, it messes with the origin application message loop : this one will not react to my user interaction until I closed the destination application.
I knew it would not go so smoothly to do such "uncommon" things, to say the least. But I suppose your application, once launch and having setup the panel in the destination app, will hide itself and not require interaction
BUT : Once I clicked once on the button, it messes with the origin application message loop : this one will not react to my user interaction until I closed the destination application.
I knew it would not go so smoothly to do such "uncommon" things, to say the least. But I suppose your application, once launch and having setup the panel in the destination app, will hide itself and not require interaction
ASKER
Ok it work but there are some problem:
1. The control a painter correctlly when the own form is repainted.
2. The focus of an TEdit on the panel is linked to the main window (if you tr to add a TEdit on the panel and when you are with the focus on this control and you press the tab if on the MAIN FORM there is anhoter TEdit the focus jump to it)
1. The control a painter correctlly when the own form is repainted.
2. The focus of an TEdit on the panel is linked to the main window (if you tr to add a TEdit on the panel and when you are with the focus on this control and you press the tab if on the MAIN FORM there is anhoter TEdit the focus jump to it)
> 1. The control a painter correctlly when the own form is repainted.
?? can you rephrase that ?
I have no problems or repaint neither in the origin application, nor in the target application. If you have problems in the target application, then it is probably specific to this application. There have to be some problems in the edges of this technique, we are really messing with the applications...
2> yes, and that is expected, it is up to you to code onEnter/onExit, or keypress events on some elements to control the focus moves in your form. For example, in the last element in your panel, if you move out from it and the focus get immediately in a control in your main form, then in the onEnter event of this control you call SetFocus on the first control in your panel.
Same for the last control of the main form, if you hit tab and enter in a control that is in the panel, you go back to a precise control of the main form.
In fact, you will then create 2 different loops of components. But surely Delphi designers did not have that kind of application in mind when they coded their tab behaviour.
?? can you rephrase that ?
I have no problems or repaint neither in the origin application, nor in the target application. If you have problems in the target application, then it is probably specific to this application. There have to be some problems in the edges of this technique, we are really messing with the applications...
2> yes, and that is expected, it is up to you to code onEnter/onExit, or keypress events on some elements to control the focus moves in your form. For example, in the last element in your panel, if you move out from it and the focus get immediately in a control in your main form, then in the onEnter event of this control you call SetFocus on the first control in your panel.
Same for the last control of the main form, if you hit tab and enter in a control that is in the panel, you go back to a precise control of the main form.
In fact, you will then create 2 different loops of components. But surely Delphi designers did not have that kind of application in mind when they coded their tab behaviour.