Link to home
Start Free TrialLog in
Avatar of lmerrell
lmerrell

asked on

VB6 App loading as partial title bar only

I have an old VB6 application that is to be replaced in the coming year.  About a year ago we had one machine that suddenly failed to entirely open the app.  All that would open was a non-sizable window containing the title bar section of the of the app and the upper edge of the menu (about 1 inch by .25 inch).  The control box only has the minimize and close buttons activated.  After days of searching, uninstalling and reinstalling we gave up due to lack of time.  The machine was eventually replaced and the installed app worked fine.

Well, the same thing has popped up on another machine.  This machine can't be replaced.  Does anyone have a clue?

Help!!!
Avatar of lmerrell
lmerrell

ASKER

Operating system is XP with all updates.  Is there some DLL or registry setting that controls window size?
well something must of been changed if it works all the time and suddenly doesn't work.  Was there recent patches/updates applied to the computer just before this problem appeared?

Leo
No updates that haven't been applied to my machine and it works fine on mine.
I'm not sure how an application can suddenly stop working without ANY changes to the machine it is running on.

we're going to need more information.

Leo
Additional info.

Only the main form has the limited size.  You can still manuever through the menu and open any of the apps other forms at normal size.  The splash form also appears as normal size.  
so if you compare the properties of the main form to the other forms is there a difference?

Is the main form accessing some file that no longer exists?

Leo
No, the properties are the same.  And no, no missing file.  
The Form_Load event of the main form does have this in it:

Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
  Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
  Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 7365)
  Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 5600)

Could this be causing some problem on certain machines?
Bingo!  Found it.  The following registry settings were all wacko:

HKEY_CURRENT_USER\Software\VB and VBA Program Settings\GROUP CENTRAL

I was able to correct them so my short term problem is resolved.  But, I'll still award the points to anyone who can tell me what would alter these registry settings.
The settings were being saved (SaveSetting) on form unload as such:

If Me.WindowState <> vbMinimized Then
    SaveSetting App.Title, "Settings", "MainLeft", Me.Left
    SaveSetting App.Title, "Settings", "MainTop", Me.Top
    SaveSetting App.Title, "Settings", "MainWidth", Me.Width
    SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  End If

But, the form can't be resized so the settings should never have been set to a minimized size.  Wierd.
Is there somewhere in the problem where it sets the size of the window by the value from the registry?

Because it could be receiving null or 0 values when it initially tries to do this.

Leo


can you show the code that loads these settings?


also it is possible that the writing to the registry was interrupted
I assume if you are saving these settings then you are using a GetSetting function and not checking if the values are 0 before setting them to your window.

Leo
hi lmerrell

I had a similiar situation not long ago. The problem was i was trying to automatically put the form in the top left hand corner, for a while it done the same as what yours is doing, I traced it down to the fact that one of my variables was sitting at -1 instead of 0 when setting the position of the form via an API call

Maybe your is similiar in that one of the positioning variables has become -1. Has someone changed the desktop from xp to classic or something similiar, as there is a x, y difference between the two.

regards
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial