Re: Dark gray, blank screen when app opens via vb script.
- From: "Rick Wannall" <wannall@xxxxxxxxxxxxx>
- Date: Fri, 02 Jun 2006 22:59:40 GMT
OK. Got the answer, sort of. I know the code it's related to, and I know
that it has something to do with timing, and that's probably as far as I'll
chase it.
It all started when I moved this line of code:
Call MaximizeApplicationIfNotAlready
That line of code was previously called only in two places, activated when
the user's mouse moved over an area on a form. I was so convinced that
moving and positioning forms (which I also added) and maximizing a window
were such vanilla, absolutely uninteresting actions that I sort of
overlooked them in my mental checklist. Looks like I'm learning this
lesson, yet again: Never, ever overlook anything.
I inserted that line additionally into my opening stream of code. That's
what caused the problem. My startup form does some login validation and
link checking, then it opens 3 forms. I was thinking that I might go ahead
and maximize after opening the forms. Wrong. I could not find any place in
that stream of activity that I could leave that line of code and wind up
with forms visible when the application opened.
I yield to the intransigence of the immutable unknown, so I removed the line
and copied it to the MouseMove event of the detail section of the 4 forms
that could possibly wind up open, depending on user preference settings.
Works like a charm.
For those who care, the functions invoked by the offending line are shown
below.
I guess that in programming, as in comedy, timing is everything.
======================================================
Public Function MaximizeApplicationIfNotAlready()
If IsAccessMaximized = False Then
Call AccessMaximize
End If
End Function
Function IsAccessMaximized() As Boolean
If apiIsZoomed(GetAccesshWnd()) = 0 Then
IsAccessMaximized = False
Else
IsAccessMaximized = True
End If
End Function
Function AccessMaximize()
AccessMaximize = apiShowWindow(GetAccesshWnd(), SW_MAXIMIZE)
End Function
Declare Function apiIsZoomed Lib "user32" Alias "IsZoomed" (ByVal Hwnd As
Long) As Long
Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal Hwnd
As Long, ByVal nCmdShow As Long) As Long
.
- References:
- Dark gray, blank screen when app opens via vb script.
- From: Rick Wannall
- Re: Dark gray, blank screen when app opens via vb script.
- From: Tom van Stiphout
- Re: Dark gray, blank screen when app opens via vb script.
- From: Rick Wannall
- Re: Dark gray, blank screen when app opens via vb script.
- From: salad
- Dark gray, blank screen when app opens via vb script.
- Prev by Date: Re: Converting an Access app from Jet database to MySql
- Next by Date: Re: Converting an Access app from Jet database to MySql
- Previous by thread: Re: Dark gray, blank screen when app opens via vb script.
- Next by thread: Newbie---Use of AfterUpdate to date and time stamp edited records
- Index(es):
Relevant Pages
|