GadgetX & GadgetY Bug?

BlitzPlus Forums/BlitzPlus Programming/GadgetX & GadgetY Bug?

VIP3R(Posted 2004) [#1]
I've just dealt with a support query for one of our applications. The user said after a number of uses the application window wouldn't appear on the desktop when started, but the taskbar did show the application tab. Clicking the application tab didn't have any effect.

I asked the user to send over the config file for the application to see if that would shed any light on the problem. Sure enough when I examined the file the problem was obvious, the application window X & Y positions were both set at -32000.

When the application saves the config data, it records the current window position using GadgetX() and GadgetY(). There is no way of setting these positions to -32000 by dragging the window around the desktop, it's impossible.

The application does have a status bar, could this be related to the status bar handle bug?

Anyone else experienced this?


soja(Posted 2004) [#2]
I have occasionally seen something like this happen where the program is in the taskbar but the window is nowhere in sight. I remember it distinctly with Outlook, for example. What I have to do is:
1) Click the program's taskbar button
2) Press ALT+SPACE, M
3) Press an arrow key (any will do)
4) Move the mouse

The window generally then is attached to and movable via the mouse pointer. Also, the window generally ends up being minimized to where all you can see is is the upper-left inch of the title bar, or so (but it can be resized from there).

It's kind of weird, but I think it's either a Windows thing, something that happens when games change resolution (and then crash, perhaps?) or both. It doesn't happen that often, but often enough to where I know what to do about it.

A similar thing may have happened to your customer, who then logged off, at which time your program saved its state.

So, I can't tell you what the problem is, but I can tell you that it might not be a Blitz bug.

Anyway, I would just suggest "autocorrecting" obviously bad values after you read them in your config file to workaround the issue.


skidracer(Posted 2004) [#3]
Try exitting your application with the window minimized to reproduce the bug (using the right button menu on the window's task bar icon).


VIP3R(Posted 2004) [#4]
Cheers for the info soja, yeah I'm planning on adding a routine to detect and correct the bad positioning values.

I tried what you suggested skidracer, you're spot on. Closing the program when minimized caused the values -32000 to be recorded in the config. It makes perfect sense now, a minimized window is simply moved to -32000 and not 'removed' from the desktop like I imagined.

Thanks again both.