The Daily Click ::. Downloads ::. Miscellaneous ::. Testers Required - Popup Alignment

Testers Required - Popup Alignment
Author: DeadmanDines Submitted: 14th January, 2008 Favourites:0
Genre: Miscellaneous Downloads: 92

Please test this application

Open Source MFA - Uses Subapp and Window Control Objects
Compiled EXE for those who don't have MMF2

What it does
This is a VERY basic application, designed to calculate the coordinates of the inside top left corner of the window.

This is because I need to use a popup subapp in an application (to make it appear on top of any Rich Text controls), but it also has to stay relative to the window. It'll function like a custom tooltip.

It works fine on Windows Classic, but I want to know how it fares with XP Themes and possibly any older versions of Windows, like 98. I'm not bothered with 95 or lower.

If you could quickly run it and wiggle the window around the screen a bit, just to see if the purple box remains aligned properly. You will see some lag while it moves.

The box should always realign itself to INSIDE the border, just BELOW the menu, as shown in the screenshot.

It currently works by testing the difference between window size and client size.

Thanks in advance Please help. It's for science.

Review This Download (348 kb )

Posted by Pixelthief 14th January, 2008

It has a choppy 1 frame delay in drawing the box behind moving the window, but I highly doubt there are any workarounds viable INSIDE of MMF2. On my XP machine it always draws it in the right place; top left corner of the window, like in the screenshot.

I don't have MMF2 to see your open source, but I hope you're aware theres several extensions for TGF and MMF (and presumably MMF2) that can easily give you the location of the window relative to the desktop.
Posted by DeadmanDines 14th January, 2008

Yeah, this uses Window Control Object to get the coordinates of the window. The problem is knowing how big the menu bar and borders are, so you can get the popup window not to overlap these. Otherwise it just clips to the edge of the window.

That's the problem that this example's supposed to handle.
Posted by viva/volt 15th January, 2008

If you use the ClientHeight and ClientWidth variables from the window object and subtract your window width and height you set you get the size of the menu bar etc.
Posted by DeadmanDines 15th January, 2008

Yeah, that's what it does. My concern was in case there can be XP themes that have irregular sized borders (left, right, top or bottom being different sizes). I dunno if that can happen with XP Themes or not, but it'd mess this up if it did.
Posted by Hempuli 15th January, 2008

Works fine for me





Worth A Click