CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    Feb 2008
    Posts
    138

    Resizing Dialog Box..

    Hello All...

    I've one dialog box. And i need to display my dialog box on bottom right of task-bar.. It must be just above task-bar.. In a single machine one can achieve this by calculating coordinates... But if someone drag the task-bar how can i know that task-bar position has changed and i need to change my dialog box position???

    Thanks..

  2. #2
    Join Date
    Feb 2008
    Posts
    138

    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.

  3. #3
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Resizing Dialog Box..

    Try SystemParametersInfo and SPI_GETWORKAREA.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  4. #4
    Join Date
    Feb 2008
    Posts
    138

    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?

  5. #5
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Resizing Dialog Box..

    That's much more difficult. I don't immediately have an idea for that problem...
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  6. #6
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Resizing Dialog Box..

    Perhaps this would be of interest to you ?
    Customizable Alert Window

  7. #7
    Join Date
    Jun 2008
    Posts
    1

    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.

  8. #8
    Join Date
    Feb 2008
    Posts
    138

    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.

  9. #9
    Join Date
    Feb 2008
    Posts
    138

    Re: Resizing Dialog Box..

    Marc did you got any idea how to overcome this tool-tip problem..

  10. #10
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    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 ...
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  11. #11
    Join Date
    Feb 2008
    Posts
    138

    Re: Resizing Dialog Box..

    Alright Marc...

    I'll try now and get back to you with results..

    Thanks.

  12. #12
    Join Date
    Feb 2008
    Posts
    138

    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??

  13. #13
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    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.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  14. #14
    Join Date
    Feb 2008
    Posts
    138

    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..

  15. #15
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    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.
    Best regards,
    Igor

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured