Re: Resizing Dialog Box..
May be i ask in another way... How can i get coordinates of taskbar.. If i get those i'll able to calculate my dialog box position according to taskbar's coordinates.. And then i can show my dialog just above taskbar.
Re: Resizing Dialog Box..
Try SystemParametersInfo and SPI_GETWORKAREA.
Re: Resizing Dialog Box..
Thanks Marc..
SystemParametersInfo works...
Well i've another problem..Sort of... Say if some tool tip occurs from taskbar and then my popup dialog comes just above taskbar then it'll overshadow that previous tool tip.. Which is i believe wrong... It should then come above that tool tip.. Is there any way to handle this kind of problem?
Re: Resizing Dialog Box..
That's much more difficult. I don't immediately have an idea for that problem...
Re: Resizing Dialog Box..
Perhaps this would be of interest to you ?
Customizable Alert Window
Re: Resizing Dialog Box..
i'm just starting with C+ and just wanted to add that i've been finding this forum very helpful with the different problems i've been facing.
Marc G ... thanks for the SystemParametersInfo link. It's appreciated.
Re: Resizing Dialog Box..
Thanks Kirants for the link... but i believe i forgot to tell you guys that i'm working on Non MFC...
But i'll see what i can extract from the link you provided..
Thanks.
Re: Resizing Dialog Box..
Marc did you got any idea how to overcome this tool-tip problem..
Re: Resizing Dialog Box..
Well ... you could try to use spy++ to find out if those balloons have any special class name or something. Then when you would like to show your box, you could search for windows with that balloon classname and use that to offset the position of your box... but that's just a wild idea ...
Re: Resizing Dialog Box..
Alright Marc...
I'll try now and get back to you with results..
Thanks.
Re: Resizing Dialog Box..
Right... Here what i found using spy++. It's "tooltips_class32". Is this the toop tip class??
Well then i did this.
Code:
HWND hTool = ::FindWindow("tooltips_class32",NULL);
GetWindowRect(hTool,&ToolTipWindow);
Hoping to get the coordinates of tool-tip.. I got some coordinates. But the prob is that it also shows the coordinates when there's no tool tip..
Am i missing something??
Re: Resizing Dialog Box..
Unfortunately, tooltips_class32 is the generic name used by almost all tooltips in windows. However, maybe we can still use it. But, you'll need to loop over all windows with that class name, check the coordinates and use all of them to position your dialog.
Use IsWindowVisible to check if a certain tooltip is currently being displayed ot not.
Re: Resizing Dialog Box..
Alright marc...
IsWindowVisible did the trick.. Manage to display my window above the tool tip..But now there is pne obvious problem..If tool tip occur anyway on the window my dialog pop's up just above the tool - tip.. No matter where it is :)
So is there any way to know that tool tip generates from taskbar only..
Thanks..
Re: Resizing Dialog Box..
Quote:
Originally Posted by techie.ashish
Well i've another problem..Sort of... Say if some tool tip occurs from taskbar and then my popup dialog comes just above taskbar then it'll overshadow that previous tool tip.. Which is i believe wrong... It should then come above that tool tip.. Is there any way to handle this kind of problem?
I ran once into the problem with my dialog window overlaying tray tooltips, in XP/2003. In fact, sometimes those tooltips never got topmost while popping up. The reason of the behavior remained undiscovered.
And I came to nothing more reliable than making my window semitransparent. :)
Re: Resizing Dialog Box..
Quote:
Originally Posted by Igor Vartanov
And I came to nothing more reliable than making my window semitransparent
Well i guess i've to do same thing :)
Anyways thanks all for your replies.. If by any chance something strikes on your mind please let me know..
Thanks all...
Re: Resizing Dialog Box..
You could change your algorithm to not just display your dialog above any tooltip.
When calculating the position of your window, start in the lower right hand corner as if there are no tooltips visible.
Then iterate over all tooltips (using the class name), check which ones are visible and get the coordinates for the visible tooltips. For each visible tooltip check if it overlaps with your dialog position. If it does overlap, move your dialog up until it doesn't overlap anymore.
Re: Resizing Dialog Box..
Hm.. I think you are needlessly complicating things. The tooltip notifications ( balloons ) are probably what you see coming from the system tray icons , isn't it ? All these tray balloons normally just come and go , so, why would you add some logic in your application to rely on what is happening on other applications. Just let windows do what it needs to do.. You would then just do the necessary to popup your dialogs. If you start thinking about what other windows are there, then you are getting into deciding which other popup is more important and which ones are not. Also, then what happens when , when you invoke your dialog above some tooltip, the tooltip then goes away and is replaced by an even bigger tooltip ? Also, what happens if the taskbar itself is aligned to the top-egde or the right /left edges ?
Re: Resizing Dialog Box..
I was just trying to help the OP solve his/her problem. Sometimes people want strange things ;)
Re: Resizing Dialog Box..
OOps.. sorry for coming across as suggesting you, MarcG. I was infact suggesting OP ;) I know sometimes it does happen that there are strange requirements and in quite a few cases, the effort to "fix" something isn't really worth the value it adds. In case of UI behaviors, people come to expect things to behave the standard way.
Re: Resizing Dialog Box..
Well thanks Kirants and Marc.. There will be so many complication if i implement that...
I believe i should go for Igor idea or drop this idea :)
Anyways thanks for your support...
Re: Resizing Dialog Box..
Quote:
Originally Posted by kirants
OOps.. sorry for coming across as suggesting you, MarcG. I was infact suggesting OP ;) I know sometimes it does happen that there are strange requirements and in quite a few cases, the effort to "fix" something isn't really worth the value it adds. In case of UI behaviors, people come to expect things to behave the standard way.
That is so true and often I also tell the person asking strange things that, but you know how it goes, they often don't want to listen and require a solution anyway ;)