Recent

Author Topic: False positive Windows10 message  (Read 1654 times)

user5

  • Sr. Member
  • ****
  • Posts: 357
False positive Windows10 message
« on: July 22, 2018, 09:07:32 pm »
    Just thought I'd pass along an anecdote about a program problem that I recently had and what fixed it in case someone finds it interesting. I just finished phase 1 of a Lazarus prototype demonstrator program but one thing that had bothered me for a long time was that often when this WindowsXP based program was run on Windows10 in non-compatibility mode a brief message would sometimes appear at the top of the opening form which read "(Program Not Responding)". I believe that that this message was a false positive message and it gives a false impression that the program may have problems, which it doesn't.
    The opening form didn't do anything that would justify that unflattering message.
    To fix it I made a copy of all the buttons, text and everything else on that opening page as well as a copy of the code which runs that page and then I destroyed that opening page and removed it from the program entirely. I recreated it, added the copies of the code and page contents, reconnected them and put it all back into the VirtualU program.
    I didn't change the code or anything else in any way. The new opening page was an exact duplicate of the previous opening page.
    The result is that now this program never appears with a Windows (Program Not Responding) message.
    Not ever.
    I'll probably never know what caused this anomaly.
    Whatever was causing this message to appear was fortunately removed somehow during the destruction and subsequent resurrection of that form. Sort of what happened to Lazarus, hah, hah. Best wishes.

user5

  • Sr. Member
  • ****
  • Posts: 357
Re: False positive Windows10 message
« Reply #1 on: July 22, 2018, 09:52:26 pm »
    I should have mentioned that the program I talked about in my previous post is no longer WindowsXP based. Now I use an old version of Lazarus on my Windows10 machine to compile the program but it runs fine on WindowsXP. Well, since all the code and components were created mostly on WindowsXP then the program is still WindowsXP based I guess.
    I should also mention that when the Windows (Program Not Responding) appeared in the previous program version, an outline of the form would first appear, the message might appear and then the rest of the page's content would appear. Now that page appears all at once, with no preliminary outline so that message may well still be trying to appear though it's never actually seen. Good riddance, I say. That page merely initials some variables, does some text reading and several other simple tasks with no loops or anything else like that but something caused it to appear though I don't know what it was or is.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: False positive Windows10 message
« Reply #2 on: July 22, 2018, 10:40:56 pm »
I assume by what you did actually removed the UNIT out of the uses list in the main file?

if that is case by reinserting it, it is now at the end of the list of USES and thus gets executed first.

 The initialize or BEGIN of each unit gets executed in reverse order from what you see when the main program
starts up...

 This all takes place before the Application.AddForm, Run etc takes place.

Some times it is important to make sure some units get initialized first before others.

Just my two cents worth..
The only true wisdom is knowing you know nothing

Akira1364

  • Hero Member
  • *****
  • Posts: 561
Re: False positive Windows10 message
« Reply #3 on: July 23, 2018, 02:32:54 am »
Uh, there's nothing even slightly mysterious about "Program not responding." It's an operating-system-level message from Windows, that means your program is not, in fact, responding. That's all. There's no other possible cause.

Presumably you had some kind of corruption going on between what the LFM said and what was declared in the Pascal file, that got remedied when you replaced everything. Pretty simple.

 

TinyPortal © 2005-2018