Re: Dark gray, blank screen when app opens via vb script.



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
.



Relevant Pages

  • Re: f0dder, the agony and the ecstacy. :)
    ... but it doesn't affect the timing in any way... ... I assume you're now talking about the CircleSieve and not the sort... ... than hand coded assembler from a superior compiler. ... and has to "call comparefunc" for each ...
    (alt.lang.asm)
  • Re: Archers Moonlighting
    ...    I'm assuming it does some sort of timing ... but that's morefor people out at work all day, ... Like a timer ...
    (uk.media.radio.archers)
  • Re: Why Default Monitor?
    ... every different brand uses different timing? ... WRONG and totally pointless. ... > compatible devices' box. ... Seems sort of counter-intuitive to me, ...
    (microsoft.public.windowsxp.hardware)
  • Re: Pictures of Sierra
    ... Didn't mean to steal your thunder, Crystal, w/ my photo of Brad and ... Angelina's kid. ... Just bad timing. ... Nothing personal, nor any sort of slight intended, I assure you. ...
    (alt.support.stop-smoking)