#PB_Event_MaximizeWindow not received

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

#PB_Event_MaximizeWindow not received

Post by IdeasVacuum »

Has anyone else found this? Running some PB4.61 code in PB5.11 (x86).
In a loop or callback, WaitWindowEvent(), #PB_Event_MaximizeWindow is never received?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: #PB_Event_MaximizeWindow not received

Post by netmaestro »

I hacked up this little test, it seems to show that in PB 5.11 x86 running under Windows 7 SP1 the events are being sent correctly:

Code: Select all

OpenWindow(0,0,0,320,240,"",#PB_Window_MaximizeGadget)
Repeat
  ev = WaitWindowEvent()
  Select ev 
    Case #PB_Event_MaximizeWindow
      Debug "I just maximized"
      
    Case #PB_Event_RestoreWindow
      Debug "I just restored"
  EndSelect
Until ev = #PB_Event_CloseWindow
BERESHEIT
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: #PB_Event_MaximizeWindow not received

Post by IdeasVacuum »

Hi Netmaestro

That is very similar to my own test. It does work without issue 99.9% of the time, but for some unknown reason, at sometime, it will fail. I wondering if a multi-monitor setup has something to do with it, but since it is very rare I don't think I'm going to track-down the cause of the fault.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: #PB_Event_MaximizeWindow not received

Post by luis »

So in the first post you say a PB event is never received and after you get a reply based on that assumption you say it does actually work without issues 99.9% of the time.
"Have you tried turning it off and on again ?"
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: #PB_Event_MaximizeWindow not received

Post by MachineCode »

I think his second post is referring to NM's code, not his own code from his first post. That's how I read it, anyway.

IdeasVacuum has been here long enough to know to post some snippet code showing the problem, too. :twisted:
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: #PB_Event_MaximizeWindow not received

Post by luis »

MachineCode wrote:I think his second post is referring to NM's code, not his own code from his first post. That's how I read it, anyway.
I understand, thank you. I interpreted the other way but I could be wrong, probably it's the constant influx of wrong stimulus from the coding questions section.

On a second thought I still have some doubts on your interpretation though....
IdeasVacuum wrote: ... since it is very rare I don't think I'm going to track-down the cause of the fault.
uhmm... I don't think he will be so dismissive if it's very rare with netmaestro's code but happens everytime in his own code :)

But again the "very rare" could be referred not to the problem but to the availability of a multi monitor configuration.

And in that case would be okay to NEVER get the pb event ?

Anyway, IF I was wrong my apologies to ideasvacuum about this. If not ...

In general I think a guide on how to make a question the proper way could be nice, even if it will be end up probably unread like the other stickies (or the manual itself), as demonstrated here daily. It's so depressing, for me at least, how people often make questions showing a total disregard for other people time and a blatant lack of efforts on their part.
Or maybe it's just plain ignorance on the matter and a lack of experience, in that case a guide would help and fill the void where common sense should be.
At least showing you are doing your best instead of being lazy would be enough. After that, anyone can make an honest mistake or simply being tired. That's not the point.
"Have you tried turning it off and on again ?"
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: #PB_Event_MaximizeWindow not received

Post by IdeasVacuum »

To be clear:

The occurence of the issue is very rare. I can't post a code snippet that demonstrates a fault that occurs once in a blue moon, so I posed the question to see if anyone else, by chance, had noticed the same thing. That's it, nothing more nothing less, because you never know, someone may have discovered that it only occurs on days that end in 'y'.

Edit: Once the problem occurs, it requires the app to be re-launched to get things back to normal.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: #PB_Event_MaximizeWindow not received

Post by MachineCode »

IdeasVacuum wrote:I can't post a code snippet that demonstrates a fault that occurs once in a blue moon
Therefore, it sounds like a program flow or coding issue. Sorry!
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: #PB_Event_MaximizeWindow not received

Post by IdeasVacuum »

Therefore, it sounds like a program flow or coding issue. Sorry!
Why would you think that? The code snippet (netmaestro) could not be much more simple. I think it might be that the events are being interrupted by something 'external'. I have checked my machine as thoroughly as possible for a virus (though of course, an Anti-virus app could equally be the culprit). It could be another app that is running at the same time, including one of a handful of my own apps. It could be CachemanXP. There are a lot of possibilities but the fault does not occur often enough to narrow things down.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: #PB_Event_MaximizeWindow not received

Post by BorisTheOld »

IdeasVacuum wrote:Edit: Once the problem occurs, it requires the app to be re-launched to get things back to normal.
And that's the clue!

Something, most likely the OS, but it could be PB, has got its control blocks out of sync with reality.

I'm currently running Linux Mint 14, and once every few days a tab on a Firefox panel will sometimes render with a dark background. And then, just as mysteriously, it will render correctly a few minutes later. I've also had an application, unchanged for many years, sometimes lock up during the spring on a particular machine.

In large imperfectly written systems, with many hardware and software elements running asynchronously, its guaranteed that these sort of things will happen. Some people attribute strange happenings to Chaos Theory, but in reality there is some small detail in the Universe that someone overlooked.

Ignore it and it will eventually go away when something gets upgraded or replaced, or when a butterfly in the Amazon flaps its wings.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: #PB_Event_MaximizeWindow not received

Post by IdeasVacuum »

when a butterfly in the Amazon flaps its wings
Wait a minute - instead of being the cure, that butterfly could be the cause! I'm booking a flight to the Amazon.... :mrgreen:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply