Removing Blitz 3D Startup Window

Blitz3D Forums/Blitz3D Programming/Removing Blitz 3D Startup Window

QuickSilva(Posted 2008) [#1]
When running a Blitz3D app you get a small window flash up first and then the program changes to the resolution that you have set in your code.

I remember someone posting a small app that removed this initial window. Can anyone find the post about this? I have looked but can no longer find it. It was quite some time ago, maybe a couple of years back now.

Any help would be greatly appreciated.
Jason.


Kev(Posted 2008) [#2]
heres one by Filax sometime back, it requires winblitz3d as it is but you could pull it apart for the patching code, not sure if it will work with the latest version of blitz3d.

;
; 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




markcw(Posted 2008) [#3]
Do you mean this?

http://www.blitzbasic.com/Community/posts.php?topic=74982
http://www.blitzforum.de/forum/viewtopic.php?t=24932