Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 770 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: DirectX : 3d Hardware Reset Failure [Re: jumpman] #481992
12/01/20 18:23
12/01/20 18:23
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you for your time and help guys!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: DirectX : 3d Hardware Reset Failure [Re: jumpman] #484934
12/31/21 21:24
12/31/21 21:24
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
I don't know if this will help anyone else, but it seems to be the best option for my game.

Code
foreground = GetForegroundWindow();

		if(foreground!=hWnd)
		{
			beep();
			proc_mode = PROC_NOFREEZE;
			freeze_mode = 2;
			while(1)
			{
				foreground = GetForegroundWindow();
				if(foreground==hWnd)
				{
					freeze_mode = 0;
					proc_mode = PROC_GLOBAL;
					break;
				}
				wait(1);
			}
			
			wait(1);
			beep();
		}


Since my game does not need to run in the background, I just froze it whenever it was not the foreground window. It's based on Emri's code, but adjusted slightly. This is all in another while loop that I use for other things, like calculating fps and some other general purpose scripts.

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1