| View previous topic :: View next topic |
| Author |
Message |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Dec 29, 2004 12:27 pm Post subject: DLL Developer Forum |
|
|
Does anyone read the DLL Developer Forum? I posted about a problem with tooltips in external dialog elements just before Christmas, but I don't know if anyone has read it. This seems to be an insurmountable problem, so I would appreciate any help.
I have just added a reply to my post giving the source code of an example. Unfortunately it doesn't seem to be possible to upload attachments in that forum, otherwise I would have attached a zip file including a compiled version of the DLL. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Dec 29, 2004 2:04 pm Post subject: |
|
|
Hi Jules,
I'm not sure if people really check that much anymore. However, when
phpBB 2.2 comes out, due sometime in the first part of 2005, we will be
merging that forum with this one, and putting the DLL developing as a
subforum on this one. Everything including attachments will also work
then. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Thu Dec 30, 2004 3:56 am Post subject: |
|
|
I have not checked that forum in a long time. But if you are refering to external objects and using tooltips which cause the applicaition/form to totally freeze/hang - I've had this problem and have not been able to find a solution for vdsobj - which is why vdsobj does not support tooltips. It seems the parent window gets lost and the tooltip freezes up the application.
I never noticed any cpu or memory high loads either but unexpectedly it just freezes the app up. Sometimes it won't freeze instantly but mouse over it several times and eventually it will freeze up the app - halts the entire execution of the dll process too so the dll has no way to intercept and throw this out. It's so random too that you never know exactly how long you have to mouseover before the tooltip freezes the app  |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Dec 30, 2004 10:00 am Post subject: |
|
|
My experience is the same as yours, PG. I was hoping that some other DLL developer might have come up with a solution to the problem. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Dec 30, 2004 3:05 pm Post subject: |
|
|
Dunno why it occurs with Delphi __ may be the way it handles the subclassing of the tooltips for my VDSGUI dll seamlessly handles all kinds of tooltips for even dialog elements from other external dlls. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Sat Jan 01, 2005 4:56 am; edited 1 time in total |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Dec 30, 2004 4:28 pm Post subject: |
|
|
I assume that your DLL is not created using Delphi? I don't really understand what you mean by subclassing the tooltips. As far as I can see, Delphi tooltips are just small windows that are created when required, and destroyed after expiration of a timer. They are VCL (that's the Delphi class library) objects in their own right.
As I don't know the Windows API method of programming, I don't know if there is a native Windows tooltip, but if there is, I don't think Delphi uses it.
I have tried to find Delphi example code for a different way to make tooltips, but as tooltips seem to work OK in normal Delphi applications, I guess nobody has bothered reinventing the wheel. It's possible to plug in your own code to change the appearance of Delphi tooltips, but they still use the built-in method for creating and destroying them, and that's the bit that seems to cause the problems. I think the only solution would be to bypass Delphi completely as far as tooltips are concerned, but I have no idea how to do that. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Fri Dec 31, 2004 4:22 pm Post subject: |
|
|
Yeah Jules as U said It seems Delphi is using a seperate class to create it's own temporary windows as Tooltips.
Now when we use it for VDS since the parent of the objects is changed the windows messages of creating/destroying windows doesn't reach it causing it to hang.
The only way may be to implement a separate custom tooltips class for use with VDS. I have seen similar classes in C++.
BTW since my dll is not written in Delphi (it's C) and uses native tooltips this problem isn't there. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Dec 31, 2004 5:40 pm Post subject: |
|
|
It's making me crazy that I have had so much hassle over such a trivial function. Apart from this, I found that I had to disable the drop shadows because the shadows are randomly being left behind when the tips are destroyed, about 25% of the time. This is in the VDS 6 runtime that I've been working on, so I'm not talking specifically about external dialog elements here.
I found some code for creating native tooltips and this seemed like the solution but I found that if I click on the dialog element the tooltip never reappears. Your VDSGUI doesn't have this problem, but I can't figure out what I'm doing wrong.
Happy New Year to everyone! _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sat Jan 01, 2005 4:50 am Post subject: |
|
|
| jules wrote: | | It's making me crazy that I have had so much hassle over such a trivial function. |
Even I had a very hard time implementing tooltips in my dll. The main problem one enounters is to make it work consistently each time...
| jules wrote: | | I found some code for creating native tooltips and this seemed like the solution but I found that if I click on the dialog element the tooltip never reappears. Your VDSGUI doesn't have this problem, but I can't figure out what I'm doing wrong. |
Most likely your code seeks the active window and gets it's handle & shows the tip at the requested position on that window(main vds dialog)... And the active window changes (to say Edit box) when the user clicks the dialog element (say Edit etc) so the coordiantes U specified doesn't hold true & tip is not shown. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Sat Jan 01, 2005 11:55 am Post subject: |
|
|
That doesn't sound like what I am doing.
It seems that in VDSGUI you are creating a tip element and then using that to show tips for other elements on the window.
My code doesn't refer to the main window handle at all. I'm creating a tooltip whose parent is the control the tip belongs to. Here is the Delphi code:
| Code: | function CreateToolTip(Control: TWinControl; IconType: Integer;
Text, Title: PChar): hWnd;
var
Rect: TRect;
ti: TToolInfo;
begin
Result := 0;
if Control is TWinControl then
begin
Result := CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nil, TTS_BALLOON or WS_POPUP or TTS_NOPREFIX,
Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT),
Integer(CW_USEDEFAULT), Control.Handle, 0, hInstance, nil);
if Result <> 0 then
begin
SetWindowPos(Result, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
ti.cbSize := SizeOf(ti);
ti.uFlags := TTF_SUBCLASS;
ti.hwnd := Control.Handle;
GetClientRect(Control.Handle, ti.Rect);
ti.lpszText := Text;
SendMessage(Result, TTM_ADDTOOL, 0, Cardinal(@ti));
if Title <> '' then
begin
if (IconType > 3) or (IconType < 0) then IconType := 0;
SendMessage(Result, TTM_SETTITLE, IconType, Integer(Title));
end;
end;
end;
end;
|
"Control" is the object representing the window control. It is only used to get the window handle. So "Control.Handle" is the same handle that VDSGUI would receive from the @winexists(~Control) function. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sat Jan 01, 2005 4:33 pm Post subject: |
|
|
I think the culprit is here:
| Code: | | GetClientRect(Control.Handle, ti.Rect); |
Although I don't remember the exact details something amiss occured with this API. Check what it returns when the Edit is clicked and when it is not clicked. I think I used GetWindowRect Instead to reslove it... _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Jan 04, 2005 6:58 pm Post subject: |
|
|
I don't think it's that. GetWindowRect gave different results before and after I clicked it, but GetClientRect gave consistent results. Although the tooltips usually don't show after you click a control, sometimes they come back again. I haven't sussed what does it yet, but minimizing and restoring the window sometimes does it.
I'm really at a loss, but it seems to me possibly one of two things.
Clicking the control may somehow interfere with Windows seeing that the mouse is in the client area in future. I have a similar thing with radio groups - the tip only appears when the mouse is at the edges, because the buttons and their captions seem to block the detection.
Or else, it's a problem with the mechanism for stopping the tips from being re-shown. Because the same thing happens if I leave the mouse in the control until the timer expires, and the tip fades away. After that, the tip won't appear again.
 _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Jan 09, 2005 10:44 pm Post subject: |
|
|
Hi Jules,
| jules wrote: |
| Code: |
ti.uFlags := TTF_SUBCLASS;
ti.hwnd := Control.Handle;
|
|
If I'm not mistaken Jules, the ti.uFlags member should also be OR'ed
together with TTF_IDISHWND. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Jan 11, 2005 4:27 pm Post subject: |
|
|
Thanks for the suggestion, Bill, but it didn't seem to help with the problem. I'm not sure what that flag does, but I think it avoids the need to set the active rectangle for the tip. It can only be used for controls that have a window handle. Unfortunately, not all VDS dialog elements have a window handle, so the window itself has to own the tooltip, and for those, that flag make the tip appear when the pointer is anywhere over the window. It didn't make any difference to the tip refusing to appear after the control has been clicked or the timer has expired.
I don't have a problem with non-windowed controls tips disappearing, so I have a hunch it must be something to do with whether a control has the focus, or something like that. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
|
| Back to top |
|
 |
|