forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


DLL Developer Forum
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Dec 29, 2004 12:27 pm    Post subject: DLL Developer Forum Reply with quote

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Dec 29, 2004 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Thu Dec 30, 2004 3:56 am    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Dec 30, 2004 10:00 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Dec 30, 2004 3:05 pm    Post subject: Reply with quote

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
Arrow 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
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Dec 30, 2004 4:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Dec 31, 2004 4:22 pm    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri Dec 31, 2004 5:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Jan 01, 2005 4:50 am    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Sat Jan 01, 2005 11:55 am    Post subject: Reply with quote

That doesn't sound like what I am doing. Smile

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
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Jan 01, 2005 4:33 pm    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Jan 04, 2005 6:58 pm    Post subject: Reply with quote

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.

Stupid

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Jan 09, 2005 10:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Jan 11, 2005 4:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Jan 12, 2005 1:28 pm    Post subject: Reply with quote

Jules,
Have you had a chance to read me response on the DLL Developer Forum yet? http://developer.vdsworld.com/viewtopic.php?t=132

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group