Article View: borland.public.cppbuilder.nativeapi
Article #4031Re: How to get a window's coordinates?
From: Helmut Giese
Date: Wed, 05 Apr 2006 16:01
Date: Wed, 05 Apr 2006 16:01
44 lines
2903 bytes
2903 bytes
On Tue, 4 Apr 2006 14:55:13 -0700, "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote: Hi Gambit, >What EXACTLY are you trying to accomplish in the first place? > As I said, I want to add some kind of tooltip to any menu a user selects. My users don't read manuals and they don't know to look at the status bar (which is where normally this kind of help is dsplayed). So I thought it would be a cool idea to provide this kind of help - sort of pushing some information onto the user (ok, they'll get the option of turning it off). >Menus don't have tooltips. They only have hints, which are not the same >thing. Yes I know, I just thought it would be worth a try. > >> I'd better find out where the currently active menu is situated on the >screen. > >There are no API functions for finding the active menu. The only way to >know which menu is active is if you are displaying the menu yourself to >begin with. If you are not, then there is nothing available to tell you >which menu of which external application is active, if any. Well, maybe the situation is not as hopeless then. Some background info: The app is written in Tcl/Tk and _Tk_ is handling the menus itself (playing around with GetMenuItemInfo I found the style 'owner drawn'). I can attach a (Tcl) callback function which gets activated whenever a menu is posted, and there I can even retrieve the active item's index - all on the Tcl level. I just cannot get the coordinates. Now, if you cannot do something from the Tcl level, you always have the option of implementing the missing functionality in C (on the Tcl side this is called an extension) and then call it like any other command. So, in my (Tcl) callback function I have access to a - in Tcl speak - a widget: something I can obtain a hWnd of. I just don't get the needed positional information from there. Well, needs some more experiments :( Thanks and best regards Helmut Giese
Technical Details
Message-ID:
<4433e164.1830859@forums.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44319b6a.32745546@forums.borland.com> <4431a703$1@newsgroups.borland.com> <44323f3e.1124992@forums.borland.com> <4432b151@newsgroups.borland.com> <4432cef6.24197000@forums.borland.com> <4432eb44@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4578913d357812e3 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: hgiese@ratiosoft.com (Helmut Giese) Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: How to get a window's coordinates? Date: Wed, 05 Apr 2006 16:01:18 GMT Message-ID: <4433e164.1830859@forums.borland.com> References: <44319b6a.32745546@forums.borland.com> <4431a703$1@newsgroups.borland.com> <44323f3e.1124992@forums.borland.com> <4432b151@newsgroups.borland.com> <4432cef6.24197000@forums.borland.com> <4432eb44@newsgroups.borland.com> X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Host: 141.51.159.134 X-Trace: newsgroups.borland.com 1144252769 141.51.159.134 (5 Apr 2006 08:59:29 -0700) Lines: 44 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail