Pop ups

Blitz3D Forums/Blitz3D Beginners Area/Pop ups

Nate the Great(Posted 2008) [#1]
Is there a way to make a program in B3d that runs itself only when it reaches a certain time, like a reminder program.


chwaga(Posted 2008) [#2]
I don't believe so, however, perhaps you could create a program in C++ to do this? There's the ExecFile command in blitz3d that will run a file, but I don't think there is a way to make a program that runs without a window, and just as a process.


Nate the Great(Posted 2008) [#3]
Ok. I'm kinda new to B3d, so I don't know all of the commands yet. Thanks.


Ginger Tea(Posted 2008) [#4]
even in c i think the program would have to be TSR (terminate stay resident) or whatever they call em these days
it has to be manually launched (even if thats just putting it in the start up folder) and it just sits there waiting
i dont know blitz's memory footprint in this regard but its probably not as efficient as a simple .com


chwaga(Posted 2008) [#5]
You can make programs launch at startup by adding it to msconfig. If you make it a process, but never create a window (I'm unsure how you do this), it will be a process.


GfK(Posted 2008) [#6]
Create a window, then call EndGraphics.


Yahfree(Posted 2008) [#7]
as the others said, I'd make a program in C++ or C# that starts up and runs in the background that would keep track of time and when the time is right it would launch the b3d program.

If you need assistance making such a program, I can help :). As I'm currently learning C#.


chwaga(Posted 2008) [#8]
I didn't know there was an EndGraphics command...the internal help files need to be updated, they're missing over a hundred commands.

I suppose that if there's an endgraphics command, you could put into MSConfig your program. The program would start, call endgraphics, and run in the background, and keep a timer going, as soon as the timer is reached, it could call ExecFile on a simple VC++ window (or initialize graphics on itself, and have to do what you need)....

I must experiment with this...


Yahfree(Posted 2008) [#9]
here's the C# code for a time based program launcher... it runs silently in the background (you'll have to have an installer add it to the startup processes for users)

using System; // easyer to access time and stuff

// main class
class Program {
	
	//CHANGABLE --------
	const string executetime = "3:22 PM"; // place wanted time here
	const string exepath = "mspaint.exe"; //place wanted exe path here
	//---------
	
	// main program
	public static void Main(){
		
		bool notdisabled = true;//to prevent mass spawning
		string dt;// current time holder
		
		
		// infinite loop
		while(1 < 2){
			dt = DateTime.Now.ToString("t"); // get time
			
			// if its not the right time
			// and the mass spawning preventer is on
			// set the mass spawning prevent off
			if(dt != executetime && notdisabled == false){
				notdisabled = true;
			}// end if
	
			//if the current time equals the set time and
			//the mass spawning preventer is ok
			//run the picked application
			if(dt == executetime && notdisabled){
				System.Diagnostics.Process.Start(exepath);
				notdisabled = false;
			}//end if
			

		}// wend
		
	}// end
	
} // end class



chwaga(Posted 2008) [#10]
endgraphics doesn't work, it just returns it to the default graphics mode.


Yahfree(Posted 2008) [#11]
So the only option would be a different language.

I'm not so sure how to do this in C++ without the .net library. I'm sure theres a way, but it'll require alot more code than the C# version I made.


Beaker(Posted 2008) [#12]
Use AutoHotKey?


H. T. U.(Posted 2008) [#13]
Start Button > control panel > performance and maintenence > scheduled tasks. Can't do it every few hours, and somewhat inconvenient for the client if the software is marketed, but good for personal use.


Nate the Great(Posted 2008) [#14]
I guess there isn't a way to do this in blitz, but thank's for the help and the C code. Maybe I'll start learning C when I get done learning Blitz.


H. T. U.(Posted 2008) [#15]
C++ isn't that difficult for simple functions like this.


Nate the Great(Posted 2008) [#16]
I'm just going to learn programming one language at a time.