Please try this on Vista 32bit

Everything else that doesn't fall into one of the other PB categories.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Please try this on Vista 32bit

Post by netmaestro »

I have a program using a windowedscreen compiled in PB 4.30b3 (x86) and running on Vista 64. I recently discovered that if I hit ctrl-alt-delete to bring up the task manager while my code is running the fullscreen menu that Vista shows kills my screen dead. The window is still functional and processing messages but the screen is DOA. DX7 or DX9, it makes no difference.

If you have 32bit Vista, could you test it on that and see if it's the same? All is fine on XP. I doubt that it's a bug in PureBasic but it could be a compatibility issue of 64bit Windows running 32bit software, or possibly a bug in Vista. I just don't know, but it would be helpful to know if 32bit Vista did the same.

Here is a small code to test with, it just displays a visual feedback to show the screen is alive. If the screen gets killed it will stop.

Code: Select all

OpenWindow(0,0,0,128,128,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget) 

InitSprite() : OpenWindowedScreen(WindowID(0),0,0,128,128,0,0,0)

t=ElapsedMilliseconds()
Repeat
  If c : ClearScreen(#Gray) : Else : ClearScreen(#Black) : EndIf
  If ElapsedMilliseconds()-t >= 300 : c=1-c : t=ElapsedMilliseconds() : EndIf
  FlipBuffers()
Until WaitWindowEvent(1) = #PB_Event_CloseWindow
I should mention that PB 4.20 does the same, making it less likely that PB is at fault.
BERESHEIT
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Just tested and the same happens with the 32 bit version.
I like logic, hence I dislike humans but love computers.
User avatar
Raybarg
User
User
Posts: 54
Joined: Mon Apr 30, 2007 7:02 am

Post by Raybarg »

Tested and confirmed it happening here aswell.
User avatar
Blue
Addict
Addict
Posts: 973
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Post by Blue »

I tested it on Vista 32, and as the others did before me, i can confirm the behaviour you mention.

I noticed that Google's Chrome windowbar (i.e. the area where the close, minimize and expand buttons appear) gets disabled when your app runs. But I suppose that's normal since Vista's Aero gets disabled when using OpenWindowedScreen().

i then tried the 2 examples from PB's Help file under OpenWindowedScreen().
Pressing Control+Alt+Delete kills their screens also. Plus, it creates an invalid mem acces in the example with a boucing box (on my machine, Windows reports that the problem appears in nvd3dum.dll)

In fact, simply locking the computer (Winkey + L), which also brings up the special menu screen, has the same deadening effect on all three apps.

Hope that helps.
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I just did it on Vista Ultimate 32 bit, seems to work fine here. Unless i'm not understanding what youv'e posted as an issue.


EDIT: Never mind. Just tried it again, your correct. If I do a ctrl-alt-del to start up task manager i get the behavior you describe, but if I start up the task manager from a shortcut I have on the desktop it continues to function as coded. Anything that switches to the special menu screen does it.

I think what you might be seeing is a little bit of the Aero interaction, when you start the taskman from ctrl-alt-del it switches to or from Aero. Your example turns off Aero and switches to a Vista Basic theme. When you ctrl-alt-del Vista switches back, which kills your example because it runs in Vista Basic. Maybe, just guessing, but if it is Aero interaction then its not a Vista bug because thats how Vista was designed to operate. Even if your in Vista basic to begin with Vista still tries to switch when it receives notification that something wants to change, might not change it but it still tries until it realizes its not needed. The special menu screen that comes up is actually an entirely different theme not associated with the desktop theme. So maybe the issue is more along the lines of being compliant with the needed theme Vista is in at the moment...so its possible that your app didn't get the news that its supposed to switch along with Vista (which I personally tend to think is a PureBasic limitation with Vista in that its not Vista theme change aware?) - Yes, I know this sounds confused.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Using DX9 subsystem there is no theme change, yet it still kills the screen.
BERESHEIT
User avatar
idle
Always Here
Always Here
Posts: 6240
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

are you using Aero ?

try turning it off perhaps

Code: Select all

Procedure DWMEnableDisable(onoff.l)

Lib = LoadLibrary_("dwmapi.dll")

  If Lib
    
     *pAfunc = GetProcAddress_(Lib, "DwmEnableComposition") ; get pointer to function
      CallFunctionFast(*pAfunc, onoff) ; call the function to enable DWM composition
      FreeLibrary_(Lib) ; free up the library
    
  EndIf

EndProcedure 
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I tried it with Aero on and off, no difference.
BERESHEIT
Post Reply