Results 1 to 13 of 13

Thread: Application is running but main window never appears. Ideas please

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    434

    Question Application is running but main window never appears. Ideas please

    Hi Guys,

    One of my customers is having a problem which I am unable to solve. Maybe one of you has some ideas?

    Here's the deal:
    The user launches my app. A window flashes for a moment and then nothing appears. When he tries to launch it again he receives a message that the application is already running. (This is my code to prevent the user from launching multiple instances.) When he checks Task Manager, it also shows my app as running.

    Other curious details:
    1. The app icon in Task Manager shows a generic VB form icon rather than my app's icon (which is obtained from the main form)
    2. I sent him a utility I created which attempts to Show a window for a running app using the App's title (FindWindow->ShowWindow APIs) or the Process Name (proc name->proc ID->hwnd). Both fail when trying to get the window handle. The process is found but no handle can be obtained to the window.

    Things I've done with the user:
    1. Restart into Safe Mode and try again to see if some other software is blocking/preventing my software's main form from displaying. No difference in Safe Mode however.
    2. Ask him to turn off security/AV software to see if that is blocking my software (though I would think that this would be turned off in Safe Mode?)

    Have any of you seen anything like this where the app is loading/running but not the main form's window? 99.9% of my users do not experience this issue so there's something unique in the user's system I would imagine...


    TIA for any thoughts you can share as to how you would approach this.
    Last edited by AAraya; Feb 12th, 2019 at 10:11 AM.

  2. #2
    gibra
    Guest

    Re: Application is running but main window never appears. Ideas please

    There may be several reasons:
    - Do you use a routine that stores and retrieves the position and size of the window?
    - Perhaps the user has changed the screen resolution before closing the program and is now off screen.
    - May be that the window is 'exit' from the screen. There is, but it is not seen.

    I suggest to connect to the user using a program of Remote Assistance (like TeamViewer, Ammyy, ...)

  3. #3
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: Application is running but main window never appears. Ideas please

    The O/S might be good to know. Also any debugging logs would help.
    What bitness is the form's icon. What are the dependencies.

  4. #4
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,451

    Re: Application is running but main window never appears. Ideas please

    Quote Originally Posted by gibra View Post
    There may be several reasons:
    - Do you use a routine that stores and retrieves the position and size of the window?
    - Perhaps the user has changed the screen resolution before closing the program and is now off screen.
    - May be that the window is 'exit' from the screen. There is, but it is not seen.
    +1 I've had this happen when a user disconnected a second monitor and the program wasn't considering that possibility so the window was appearing off-screen. If your program doesn't move the window until it is already visible, that might explain the "flashing".

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    434

    Re: Application is running but main window never appears. Ideas please

    Quote Originally Posted by gibra View Post
    There may be several reasons:
    - Do you use a routine that stores and retrieves the position and size of the window?
    - Perhaps the user has changed the screen resolution before closing the program and is now off screen.
    - May be that the window is 'exit' from the screen. There is, but it is not seen.

    I suggest to connect to the user using a program of Remote Assistance (like TeamViewer, Ammyy, ...)

    1. I do not store or set the window positions/size for this app.
    2. If the window is off screen or on a different monitor, etc... I would not expect the APIs which obtain a handle to the Window to fail. The window location/position/size should not prevent me from obtaining an hWnd should it?

    3. Remote Assistance is an option but before doing so I'd love to get some ideas of things to check. Right now I'm just scratching my head unsure of what to check.

  6. #6
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,451

    Re: Application is running but main window never appears. Ideas please

    Quote Originally Posted by AAraya View Post
    2. If the window is off screen or on a different monitor, etc... I would not expect the APIs which obtain a handle to the Window to fail. The window location/position/size should not prevent me from obtaining an hWnd should it?
    You are right, getting the hWnd wouldn't be a problem assuming the test app is working correctly...

    Here's another thought - do you try to create a late bound object after the window appears? Maybe that is failing if the referenced object type isn't registered, or perhaps there is some other unhandled error shortly after startup that is causing a crash? I've seen zombie processes hanging around after some crashes.

  7. #7
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,451

    Re: Application is running but main window never appears. Ideas please

    Maybe you could post the contents of your Form_Load and Form_Activate events?

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    434

    Re: Application is running but main window never appears. Ideas please

    Quote Originally Posted by DEXWERX View Post
    The O/S might be good to know. Also any debugging logs would help.
    What bitness is the form's icon. What are the dependencies.
    1. Windows 7 Pro

    2. No debugging log. If I have to, I'll create a new executable for this user to run. The problem is that this is a very low cost product, and this is a very uncommon problem. The curious programmer in me wants to create a debug version to see if I can find the cause. The business man in me says it's not worth the effort/makes no sense financially. This person is not even a customer yet, it's a trial version of the software.

    3. Icon bitness is an interesting line of thought... I believe that the generic icon shown in Task Manager is because the form window is not loaded. Do you suspect the reverse - the window is not loaded due to an issue with the icon? And again, this works on my machine and 99.9% of all other users. If the bitness of the icon was an issue I wouldn't expect it to only turn up for a few users?

    I checked the icon and I'm using a multiple size RGBA ICO. I'm going to change that to a single size and 256 color format to remove this as a possible cause.

    4. Dependencies list is standard VB plus some third party controls:

    MyCommandButton
    MyFramePanel
    Xceed SmartUI
    several TimoSoft controls (edit controls, combo, explorelistview)

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    434

    Re: Application is running but main window never appears. Ideas please

    Quote Originally Posted by jpbro View Post
    Here's another thought - do you try to create a late bound object after the window appears? Maybe that is failing if the referenced object type isn't registered, or perhaps there is some other unhandled error shortly after startup that is causing a crash? I've seen zombie processes hanging around after some crashes.
    That's an interesting thought.. maybe the main form loads and then the app crashes? If this happens, does the app remain in Task Manager? I've not experienced that before - normally a crash removes my app from the running programs list in Task Manager.

  10. #10
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: Application is running but main window never appears. Ideas please

    Ah windows 7. Does he have microsoft office installed? It's possible not.

  11. #11
    Member
    Join Date
    Jul 2008
    Posts
    41

    Re: Application is running but main window never appears. Ideas please

    I've had this happen to my apps when a 3rd party control that is used is not installed or registered properly on the users pc and the app loads, but the form never appears. Typically it is a control that is used on the main form that does not appear. I would check that all controls you use are on the PC and registered correctly.

  12. #12
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,156

    Re: Application is running but main window never appears. Ideas please

    Quote Originally Posted by AAraya View Post
    Other curious details:
    1. The app icon in Task Manager shows a generic VB form icon rather than my app's icon (which is obtained from the main form)
    When a VB6 app shows a form w/ icon assigned at design-time the runtime writes this icon temporary to a temp file and loads it from there (very weird behavior). The trouble starts when the %TMP% location have run out of disk space, so the form loads but does not show. . . Ouch!

    I'm always starting from Sub Main just to be able to handle errors on main form load/show and display/log Err.Description to be able to debug what's going on.

    cheers,
    </wqw>

  13. #13
    Lively Member
    Join Date
    May 2017
    Posts
    81

    Re: Application is running but main window never appears. Ideas please

    Anything relevant in the Windows Event Viewer?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width