Black startup window thingy
Blitz3D Forums/Blitz3D Programming/Black startup window thingy| 
 | ||
| Hey i was wonder if theres a way to get rid of that ugly start up flicker thingy that B3d makes when you start the app... i saw this: http://www.blitzbasic.com/Community/posts.php?topic=37093 but its 2 years old, and most likely works with the wrong version of Blitz... anyone have any ideas to get rid of this? | 
| 
 | ||
| ..flicker thingy ? Can you be more specific, I have no experiance like that with B3D (flickering) | 
| 
 | ||
| you know, when you start a Blitz3D application, it starts with this wierd black window, then it flickers off and starts the program.. please don't tell me its just me.. | 
| 
 | ||
| No, I get it too. I don't know if you can get rid of it, but I think that the sooner you set the graphics mode, the sooner it'll disappear. If you have it compute lots of things before you call the Graphics or Graphics3D command, I'm pretty sure it'll take longer. But I'd also love to get rid of it. I think it's just that Blitz needs to be an actual application to run all of the commands you use... and applications have windows. Still, it'd be nice if Blitz3D could just start in the Graphics mode that the programmer specifies. | 
| 
 | ||
| i think the problem is that Blitz has a standard graphics mode to set: if you don't call Graphics/Graphics3D you'll see what i mean, so it starts with this standard graphics mode then it goes on to the real one, i wonder if theres a way to get rid of the standard graphics call.. | 
| 
 | ||
| Yahfree, use this on your created .exe to remove the black startup screen. this was posted sometime back by Filax. 
;
; WB3D_CreateWindow example
;	By Kevin Poole.
; were using external winapi styles
Include "../../../WB3DStyles.bb"
; setup gfx mode.
Graphics3D 640,480,16,2
; install winblitz3d.
Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,500,500)
WB3D_SetQuitMessage "WinBlitz3D 3D/GUI","Sure To Quit" 
WB3D_HideGadget RuntimeWindow_hWnd
; create winapi window, setting its title, and position on screen. use default style creation.
MyWindow = WB3D_CreateWindow("WB3D_CreateWindow Example",200,100,275,275,0,WS_VISIBLE Or WS_SYSMENU Or WS_CAPTION)
; cleanup any old creation events, its better to do this before we enter the main
; event loop, when some gadgets are created they generate events.
WB3D_FlushEvents 
LoadExe = WB3D_CreateButton("Open blitz exe to hack",10,10,250,25,MyWindow,0)
WB3D_DefaultGadgetFont LoadExe
Listbox = WB3D_CreateListBox(10,40,250,190,MyWindow,0)
; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1
	; generate an internal blitz event
	Flip
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	Select event
		Case WB3D_EVENT_GADGET
			selected = WB3D_EventSource()
			Select selected
			Case LoadExe
				Filename$ = WB3D_OpenFileRequest("Open file","",example_file_ext$,WB3D_GetGadgetText(example_init_filename))
				WB3D_ClearGadgetItems Listbox
				
				If Filename$<> "" Then
					fil=OpenFile(Filename$)
					WB3D_AddGadgetItem Listbox,"Opening executable file",0,0
					If fil
						siz=FileSize(Filename$)
						For i=0 To siz
							byt=ReadByte(fil)
							If Frst
								If scnd
									If byt=$8B
										pos=i-1
										Exit	
									Else
										scnd=False
										If byt<>$CA frst=False
									EndIf
								ElseIf byt=$10
									scnd=True
								Else
									If byt<>$CA Frst=False
							EndIf
						ElseIf byt=$CA
							Frst=True
						EndIf	
					Next
					WB3D_AddGadgetItem Listbox,"Patching executable file",0,0
					
					SeekFile fil,pos
					WriteByte fil,$00
					WB3D_AddGadgetItem Listbox,"Process completed",0,0
					
					CloseFile fil
					WB3D_AddGadgetItem Listbox,"Close file",0,0
					EndIf
				EndIf
			End Select
			
		
		Case WB3D_EVENT_KEYPRESS
		
			; wb_eventdata holds the key code that was pressed.
			keypressed = WB3D_EventData()
			Select keypressed
				
				Case WB3D_KEY_ESCAPE	
					
					; set the flag to leave the loop.
					QUIT = 1
					
			End Select
				
		Case WB3D_EVENT_WINDOW_CLOSE
		
			; wb3d_eventsource hold the handle to the window that close button was selected
			window = WB3D_EventSource()
			Select window
			
				Case MyWindow
					
					; set the flag to leave the loop.
					QUIT = 1
					
			End Select
	End Select
	
Wend
; use notify using external winapi constants. 
WB3D_EndGUI()
EndGraphics
End
kev | 
| 
 | ||
| Woah!, this needs to go in the code archives!! looks very "Real" now. you'd never know it was created with b3d.. Edit: It worked on one of my blitz files, didnt work on the other one, it made the other one "Invisible" it was playing, in my processes ect, i had to end it that way ... any ideas? | 
| 
 | ||
| Any other ideas kev? it seems to not work on some .exes but works on others, any other methods? | 
| 
 | ||
| You want to disable the annoying startupwindow? I fixed Bot Builderīs code and it now works even with runtime_beta2.dll check it out: http://Lunamedia.heim.at/files/B3D_WindowHack.zip (fixed it a while ago and lost?!? the source... thats why itīs only the .exe, sorry) cheers, chi | 
| 
 | ||
| Yes, this works nicely, but unfortunately when my full screen app closes down I have a totally black desktop and startbar. Could be just my graphics card of course. | 
| 
 | ||
| Go with the flow... We first place our company logo in the startup window after that we start/initialize the application 
Function Main()
	; splash
		Graphics 400,300,16,2
		SetBuffer BackBuffer()
		splash = LoadImage_("data/images/intro_splash.jpg")
		DrawBlock splash,0,0 : Flip : FreeImage splash
		Delay 3000
	; general
		SeedRnd (MilliSecs()) 
		HidePointer 
        etc..etc..
Works very well, even looks semi-pro | 
| 
 | ||
| hmm, must be your graphiccard... works nice here ! |