Help loop slow down

Blitz3D Forums/Blitz3D Programming/Help loop slow down

Can anyone help me fix this loop so it will stop lagging? Your help is GREATLY appreciated. It works, but the problem is, it repeats & repeats & repeats the function request() or notify() depending if a file is dragged to screen.
I need it to activate request() and notify() 1 time.

			Case WB3D_EVENT_DRAGDROP
			
			For do_files = 0 To WB3D_CountDroppedFiles()
		              	file1$ = WB3D_DroppedFileName(do_files)
		
 				If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" 
				request()
				Else
				notify()
				EndIf
			Next


~DarkShadowWing~

Now the problem is my whole select code. Any help is GREATLY appreciated =)

Can someone please help me fix this?

	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_MENU
		
		    Select WB3D_EventData()
					
				Case 1
				
					ext$ = "*.mid"+Chr$(0)+"*.mid"+Chr$(0)+"*.mp3"+Chr$(0)+"*.mp3"+Chr$(0)
					file1$ = WB3D_OpenFileRequest("..","..",ext$,"")

									
				 request()
										
				Case 2
					
				Case 3
					QUIT = 1
					
				Case 4
					WB3D_Notify "Menu",copyright$,0
				
				Case 5
				    Write_BB("Test", "Test.bb")
				
				Case 6
			
			Case WB3D_EVENT_DRAGDROP
			
			For do_files = 0 To WB3D_CountDroppedFiles()
		              	file1$ = WB3D_DroppedFileName(do_files)
		
 				If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" 
				request()
				Else
				notify()
				EndIf
			Next
			
			End Select
									
						
							Case tabber
					selectedtab = WB3D_EventData()
					
					Select selectedtab
					
						Case 0
							WB3D_ShowGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 1
							WB3D_ShowGadget panel1
							WB3D_HideGadget panel0
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 2
							WB3D_ShowGadget panel2
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel3
					
						Case 3
							WB3D_ShowGadget panel3
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
					
					Default
										
						WB3D_Notify "Tab Selected","Tab Selected "+selectedtab,0
	
						WB3D_HideGadget panel0
						WB3D_HideGadget panel1
						WB3D_HideGadget panel2
						WB3D_HideGadget panel3	
											
				End Select
				
		Case WB3D_EVENT_WINDOW_CLOSE
			;WB3D_ShowGadget RuntimeWindow_hWnd
	
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
					
				
			End Select
		End Select


~DarkShadowWing~

anyone?

Once you've been through once use WB3D_FlushEvents.

I don't see why you would need this - check the rest of your code, and use step by step debug.
I did something similar - but it was my code's fault that I kept calling the same routine.

thanks but it doesnt help if i dont see an example.

~DarkShadowWing~

ok, i know you guys have your own things to do. But seriously, if you can't answer, don't. otherwise, please show me examples. i can't learn if i don't have an example.

~DarkShadowWing~

Mmm... getting prickly. Perhaps not one's first choice of attitude to endear yourself to those you seek help from.

I'm sorry, but do you know how hard it is when all's you do all day is wait for an answer that you wont get on a forum? I've had a not so good day. Lets leave it at that. I apologize for any attitude I may have used.

Now. is there anything you can do to help fix this example?

If not, I understand

~DarkShadowWing~

Have you tried putting it all in a function and doing something like this:

myTimer=millisecs()

While myLoop  ; your main loop is here

    if millisecs()-MyTimer >= 1000 then 
       MyFunction()
       MyTimer=millisecs()
    end if

Wend


This above should call "MyFunction" once per second. Adjust for the time you want it to be called, and voila'.

Unfortunaly I never played with WB3D, so I can't help you there :(

I'll take a guess that the loop "For do_files = 0 To WB3D_CountDroppedFiles()" should start at 1 instead of 0.

well. unfortunately, i need the function to run ONCE per drag & drop. i also need the load music function to work but ONE time PER file request open. i think it's loading more than once. it like slows down. and i need the drag & drop to simply work. its not workin.. =/ also, kev used 0 in the for loop, so thats what i use.

~DarkShadowWing~

anyone? i really need a fix for this.

~DarkShadowWing~

You probably have to solve this yourself. Nobody else knows exactly what you are doing and what results you are getting.

It might be easier to set aside the real program and write a very simple test. This would respond to "drag and drop" events and ignore everyting else ( excect QUIT, of course ). Instead of doing any sort of processing it would simply display information: event IDs, the number of files dropped, the names of the files as it reads them etc.

i already told you what results i want.

well. unfortunately, i need the function to run ONCE per drag & drop. i also need the load music function to work but ONE time PER file request open. i think it's loading more than once. it like slows down. and i need the drag & drop to simply work. its not workin.. =/ also, kev used 0 in the for loop, so thats what i use.


~DarkShadowWing~

As Floyd said "It might be easier to set aside the real program and write a very simple test."

As I said start tracking through your code line by line to find out why the same code keeps being executed when it shouldn't.

In my case I probably spent 6 hours patiently executing the code line by line until I finally spotted the variable (in my surrounding code) that was causing the WB3D code to be called again and again. The variable that I had not set back to zero.

I can hear Kev laughing from here.

I know, but its not the lag i need fixed. its the code itself. the drag drop has YET to work.. Alls I need is a simple fix. thats all i ask. no offense intended.

~DarkShadowWing~

You didn't say it didn't work at all.
You said it worked multiple times.

Just a thought: have you applied WB3D_DragAcceptFiles(window,state) to your own window, so that it _can_ accept files?

actually, yes i did.

"Now the problem is my whole select code. Any help is GREATLY appreciated =)

Can someone please help me fix this?"

and yes, i did.

~DarkShadowWing~

i looked through the code, and i think 1 of the consts are doing it. when i didnt include the const.bb file then the drag drog SORTA worked. it keeps repeating itself, lagging my code b/c the song keeps loading and loading.

can anyone look through the code & say whats wrong?

Const WB3D_EVENT_GADGET						= $401
Const WB3D_EVENT_MENU						= $1001
Const WB3D_EVENT_MOUSEWHEEL					= $208
Const WB3D_EVENT_WINDOW_CLOSE				= $803
Const WB3D_EVENT_WINDOW_SIZE				= $802
Const WB3D_EVENT_WINDOW_SIZEING				= $805
Const WB3D_EVENT_WINDOW_MOVE				= $807
Const WB3D_EVENT_WINDOW_MOVING				= $806
Const WB3D_EVENT_MOUSE_MOVE					= $200
Const WB3D_EVENT_KEYPRESS					= $101
Const WB3D_EVENT_CONTEXTMENU				= $502
Const WB3D_EVENT_SYSTEMTRAY					= $503
Const WB3D_EVENT_DRAGDROP					= $504
Const WB3D_EVENT_MOUSE_DOWN 				= $201 
Const WB3D_EVENT_WINDOW_ACTIVATE			= $544
Const WB3D_EVENT_WINDOW_PAINT				= $594
Const WB3D_COLOR_GADGET 					= $514 
Const WINDOW_TITLEBAR                       = $10000000

; winblitz3d key press events, these are standard VK_ winapi constants.
Const WB3D_KEY_ENTER 						= $D
Const WB3D_KEY_TAB							= 9
Const WB3D_KEY_SHIFT 						= $10
Const WB3D_KEY_CONTROL 						= 17
Const WB3D_KEY_ESCAPE 						= 27
Const WB3D_KEY_SPACE 						= $20
Const WB3D_KEY_END 							= 35
Const WB3D_KEY_HOME 						= 36
Const WB3D_KEY_CURS_LEFT 					= 37
Const WB3D_KEY_CURS_UP 						= 38
Const WB3D_KEY_CURS_RIGHT 					= 39
Const WB3D_KEY_CURS_DOWN 					= 40
Const WB3D_KEY_INSERT 						= 45
Const WB3D_KEY_DELETE 						= 46
Const WB3D_KEY_NUMPAD0 						= 96
Const WB3D_KEY_NUMPAD1 						= 97
Const WB3D_KEY_NUMPAD2 						= 98
Const WB3D_KEY_NUMPAD3 						= 99
Const WB3D_KEY_NUMPAD4 						= 100
Const WB3D_KEY_NUMPAD5 						= 101
Const WB3D_KEY_NUMPAD6 						= 102
Const WB3D_KEY_NUMPAD7 						= 103
Const WB3D_KEY_NUMPAD8 						= 104
Const WB3D_KEY_NUMPAD9 						= 105
Const WB3D_KEY_F1 							= 112
Const WB3D_KEY_F2 							= 113
Const WB3D_KEY_F3 							= 114
Const WB3D_KEY_F4 							= 115
Const WB3D_KEY_F5 							= 116
Const WB3D_KEY_F6 							= 117
Const WB3D_KEY_F7 							= 118
Const WB3D_KEY_F8 							= 119
Const WB3D_KEY_F9 							= 120
Const WB3D_KEY_F10 							= 121
Const WB3D_KEY_F11 							= 122
Const WB3D_KEY_F12 							= 123
Const WB3D_KEY_NUMLOCK 						= 144
Const WB3D_KEY_SCROLL 						= 145


; default toolbar buttons
Const STD_COPY 								= 1
Const STD_CUT 								= 0
Const STD_DELETE 							= 5
Const STD_FILENEW 							= 6
Const STD_FILEOPEN 							= 7
Const STD_FILESAVE 							= 8
Const STD_FIND 								= 12
Const STD_HELP 								= 11
Const STD_PASTE 							= 2
Const STD_PRINT 							= 14
Const STD_PRINTPRE 							= 9
Const STD_PROPERTIES 						= 10

; standard window constants
Const WS_CHILD 								= $40000000
Const WS_VISIBLE 							= $10000000
Const WS_ACTIVECAPTION 						= 1
Const WS_BORDER 							= $800000
Const WS_CAPTION 							= $C00000
Const WS_CLIPCHILDREN 						= $2000000
Const WS_CLIPSIBLINGS 						= $4000000
Const WS_DISABLED 							= $8000000
Const WS_GROUP 								= $20000
Const WS_HSCROLL 							= $100000
Const WS_MAXIMIZE 							= $1000000
Const WS_MINIMIZE 							= $20000000
Const WS_MAXIMIZEBOX 						= $10000
Const WS_MINIMIZEBOX 						= $20000
Const WS_OVERLAPPED 						= 0
Const WS_POPUP 								= $80000000
Const WS_SYSMENU 							= $80000
Const WS_TABSTOP 							= $10000
Const WS_THICKFRAME 						= $40000
Const WS_VSCROLL 							= $200000
Const WS_ICONIC 							= WS_MINIMIZE
Const WS_TILED 								= WS_OVERLAPPED
Const WS_GT 								= WS_GROUP Or WS_TABSTOP
Const WS_SIZEBOX 							= WS_THICKFRAME
Const WS_POPUPWINDOW 						= WS_POPUP Or WS_BORDER Or WS_SYSMENU
Const WS_OVERLAPPEDWINDOW 					= WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Const WS_TILEDWINDOW 						= WS_OVERLAPPEDWINDOW
Const WS_DLGFRAME 							= $400000

; window extended winapi styles
;Const WS_EX_ACCEPTFILES 					= $10
;Const WS_EX_APPWINDOW 						= $40000
;Const WS_EX_CLIENTEDGE 						= $200
;Const WS_EX_CONTEXTHELP 					= $400
;Const WS_EX_CONTROLPARENT 					= $10000
;Const WS_EX_LAYERED 						= $80000
;Const WS_EX_LAYOUTRTL 						= $400000
;Const WS_EX_LEFT 							= 0
;Const WS_EX_LEFTSCROLLBAR 					= $4000
;Const WS_EX_LTRREADING 						= 0
;Const WS_EX_NOACTIVATE 						= $8000000
;Const WS_EX_NOINHERITLAYOUT 				= $100000
;Const WS_EX_NOPARENTNOTIFY					= $4
;Const WS_EX_RIGHT 							= $1000
;Const WS_EX_RIGHTSCROLLBAR 					= $0
;Const WS_EX_RTLREADING 						= $2000
;Const WS_EX_STATICEDGE 						= $20000
;Const WS_EX_TOOLWINDOW 						= $80
;Const WS_EX_TOPMOST 						= $8
;Const WS_EX_TRANSPARENT 					= $20
;Const WS_EX_WINDOWEDGE 						= $100
;Const WS_EX_DLGMODALFRAME 					= 1
;Const WS_EX_PALETTEWINDOW 					= WS_EX_WINDOWEDGE Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST
;Const WS_EX_OVERLAPPEDWINDOW 				= WS_EX_WINDOWEDGE Or WS_EX_CLIENTEDGE

; standard winapi button styles
Const BS_NULL 		 						= 1
Const BS_3STATE 							= 5
Const BS_AUTO3STATE  						= 6
Const BS_AUTOCHECKBOX 						= 3
Const BS_AUTORADIOBUTTON  					= $9
Const BS_BITMAP  							= $80
Const BS_BOTTOM  							= $800
Const BS_CENTER  							= $300
Const BS_CHECKBOX  							= 2
Const BS_DEFPUSHBUTTON  					= 1
Const BS_DIBPATTERN 						= 5
Const BS_DIBPATTERN8X8  					= 8
Const BS_DIBPATTERNPT  						= 6
Const BS_FLAT  								= $8000
Const BS_GROUPBOX  							= $7
Const BS_HOLLOW  							= BS_NULL
Const BS_ICON  								= $40
Const BS_INDEXED  							= 4
Const BS_LEFT  								= $100
Const BS_LEFTTEXT  							= $20
Const BS_MONOPATTERN  						= 9
Const BS_MULTILINE 							= $2000
Const BS_NOTIFY 							= $4000
Const BS_PUSHBUTTON 						= 0
Const BS_PUSHLIKE  							= $1000
Const BS_RADIOBUTTON  						= 4
Const BS_RIGHT 								= $200
Const BS_RIGHTBUTTON  						= BS_LEFTTEXT
Const BS_SOLID  							= 0
Const BS_TEXT  								= 0
Const BS_TOP  								= $400


; toolbar standard winapi styles
Const CCS_ADJUSTABLE 						= $20
Const CCS_BOTTOM 		 					= 3
Const CCS_TOP 								= 1
Const CCS_VERT 							 	= $80
Const CCS_LEFT 								= (CCS_VERT Or CCS_TOP)
Const CCS_NODIVIDER 						= $40
Const CCS_NOMOVEY 							= 2
Const CCS_NOMOVEX 							= (CCS_VERT Or CCS_NOMOVEY)
Const CCS_NOPARENTALIGN 					= 8
Const CCS_NORESIZE 							= 4
Const CCS_RIGHT 							= (CCS_VERT Or CCS_BOTTOM)
Const TBSTATE_CHECKED 						= 1
Const TBSTATE_ELLIPSES 						= $40
Const TBSTATE_ENABLED 						= 4
Const TBSTATE_HIDDEN  						= 8
Const TBSTATE_INDETERMINATE 				= $10
Const TBSTATE_MARKED  						= $80
Const TBSTATE_PRESSED 						= $2
Const TBSTATE_WRAP 							= $20
Const TBSTYLE_ALTDRAG 						= $400
Const TBSTYLE_AUTOSIZE 						= $10
Const TBSTYLE_BUTTON 						= 0
Const TBSTYLE_CHECK 						= 2
Const TBSTYLE_GROUP 						= 4
Const TBSTYLE_CHECKGROUP 					= (TBSTYLE_GROUP Or TBSTYLE_CHECK)
Const TBSTYLE_CUSTOMERASE 					= $2000
Const TBSTYLE_DROPDOWN 						= 8
Const TBSTYLE_FLAT 							= $800
Const TBSTYLE_LIST 							= $1000
Const TBSTYLE_NOPREFIX 						= $20
Const TBSTYLE_REGISTERDROP 					= $4000
Const TBSTYLE_SEP 							= 1
Const TBSTYLE_TOOLTIPS 						= $100
Const TBSTYLE_TRANSPARENT 					= $8000
Const TBSTYLE_WRAPABLE 		 				= $200

; toolbar extended winapi styles
Const TBSTYLE_EX_DOUBLEBUFFER 				= $80
Const TBSTYLE_EX_DRAWDDARROWS 				= $1
Const TBSTYLE_EX_HIDECLIPPEDBUTTONS 		= $10
Const TBSTYLE_EX_MIXEDBUTTONS 				= $8

; standard textarea/editfield winapi styles
Const ES_AUTOHSCROLL 		 				= $80
Const ES_AUTOVSCROLL 						= $40
Const ES_CENTER 							= 1
Const ES_CONTINUOUS 						= $80000000
Const ES_DISABLENOSCROLL 					= $2000
Const ES_DISPLAY_REQUIRED 					= 2
Const ES_EX_NOCALLOLEINIT 					= $1000000
Const ES_LEFT 								= 0
Const ES_LOWERCASE 							= $10
Const ES_MULTILINE 							= 4
Const ES_NOHIDESEL 							= $100
Const ES_NOIME 								= $80000
Const ES_NOOLEDRAGDROP 						= $8
Const ES_NUMBER 							= $2000
Const ES_OEMCONVERT 						= $400
Const ES_PASSWORD 							= $20
Const ES_READONLY 							= $800
Const ES_RIGHT 								= 2
Const ES_SAVESEL 							= $8000
Const ES_SELECTIONBAR 						= $1000000
Const ES_SELFIME 							= $40000
Const ES_SUNKEN 							= $4000
Const ES_SYSTEM_REQUIRED 					= 1
Const ES_UPPERCASE 							= $8
Const ES_USER_PRESENT 						= 4
Const ES_VERTICAL 							= $400000
Const ES_WANTRETURN 						= $1000

; standard textarea mask styles
Const CFM_BOLD = 1
Const CFM_COLOR = $40000000
Const CFM_ITALIC = 2
Const CFM_STRIKEOUT = $8

; standard combobox winapi styles
Const CBS_AUTOHSCROLL 						= $40
Const CBS_DISABLENOSCROLL 					= $800
Const CBS_DROPDOWN 							= 2
Const CBS_DROPDOWNLIST 						= 3
Const CBS_HASSTRINGS 						= $200
Const CBS_LOWERCASE 						= $4000
Const CBS_NOINTEGRALHEIGHT 					= $400
Const CBS_OEMCONVERT 						= $80
Const CBS_SIMPLE 							= 1
Const CBS_SORT 								= $100
Const CBS_UPPERCASE 						= $2000

; standard tabber winapi styles
Const TCS_MULTILINE 						= $200
Const TCS_SINGLELINE 						= $0
Const TCS_FLATBUTTONS 						= $8
Const TCS_BOTTOM 							= $2
Const TCS_HOTTRACK 							= $40
Const TCS_RAGGEDRIGHT 						= $800
Const TCS_VERTICAL 							= $80
Const TCS_FOCUSONBUTTONDOWN 				= $1000
Const TCS_BUTTONS 							= $100
Const TCS_FIXEDWIDTH 						= $400
Const TCS_FOCUSNEVER 						= $8000
Const TCS_FORCEICONLEFT 					= $10
Const TCS_FORCELABELLEFT 					= $20
Const TCS_MULTISELECT 						= 4
Const TCS_RIGHT 							= 2
Const TCS_RIGHTJUSTIFY 						= 0
Const TCS_SCROLLOPPOSITE 					= 1
Const TCS_TABS 								= 0
Const TCS_TOOLTIPS 							= $4000

; tabber extended styles
Const TCS_EX_FLATSEPARATORS 				= 1
Const TCS_EX_REGISTERDROP 					= 2

; standard listview/listbox winapi styles
Const LVS_ALIGNLEFT 						= $800
Const LVS_ALIGNMASK 						= $c00
Const LVS_ALIGNTOP 							= 0
Const LVS_AUTOARRANGE						= $100
Const LVS_EDITLABELS 						= $200
Const LVS_ICON 								= 0
Const LVS_LIST 								= 3
Const LVS_NOCOLUMNHEADER 					= $4000
Const LVS_NOLABELWRAP 						= $80
Const LVS_NOSCROLL 							= $2000
Const LVS_NOSORTHEADER 						= $8000
Const LVS_REPORT 							= 1
Const LVS_SHOWSELALWAYS 					= $8
Const LVS_SINGLESEL 						= 4
Const LVS_SMALLICON 						= 2
Const LVS_SORTASCENDING 					= $10
Const LVS_SORTDESCENDING 					= $20
Const LVS_TYPEMASK 							= 3
Const LVS_TYPESTYLEMASK 					= $fc00

; listview extended styles
Const LVS_EX_FULLROWSELECT 					= $20
Const LVS_EX_GRIDLINES 						= 1
Const LVS_EX_BORDERSELECT 					= $8000
Const LVS_EX_CHECKBOXES 					= 4
Const LVS_EX_DOUBLEBUFFER 					= $10000
Const LVS_EX_FLATSB 						= $100
Const LVS_EX_HEADERDRAGDROP 				= $10
Const LVS_EX_HIDELABELS 					= $20000
Const LVS_EX_INFOTIP 						= $400
Const LVS_EX_LABELTIP 						= $4000
Const LVS_EX_MULTIWORKAREAS 				= $2000
Const LVS_EX_ONECLICKACTIVATE 				= $40
Const LVS_EX_REGIONAL 						= $200
Const LVS_EX_SINGLEROW 						= $40000
Const LVS_EX_SNAPTOGRID 					= $80000
Const LVS_EX_SUBITEMIMAGES 					= 2
Const LVS_EX_TRACKSELECT 					= $8
Const LVS_EX_TWOCLICKACTIVATE 				= $80
Const LVS_EX_UNDERLINECOLD 					= $1000
Const LVS_EX_UNDERLINEHOT 					= $800

; standard progressbar winapi styles
Const PBS_SMOOTH 							= 1
Const PBS_VERTICAL 							= 4

; standard treeview winapi styles
Const TVS_CHECKBOXES 						= $100
Const TVS_DISABLEDRAGDROP 					= $0
Const TVS_EDITLABELS 						= $8
Const TVS_FULLROWSELECT 					= $1000
Const TVS_HASBUTTONS 						= 1
Const TVS_HASLINES 							= 2
Const TVS_INFOTIP 							= $800
Const TVS_LINESATROOT 						= 4
Const TVS_NOHSCROLL 						= $8000
Const TVS_NONEVENHEIGHT 					= $4000
Const TVS_NOSCROLL 							= $2000
Const TVS_NOTOOLTIPS 						= $80
Const TVS_RTLREADING 						= $40
Const TVS_SHOWSELALWAYS 					= $20
Const TVS_SINGLEEXPAND 						= $400
Const TVS_TRACKSELECT 						= $200

; standard label winapi styles
Const SS_BITMAP 							= $E
Const SS_BLACKFRAME 						= $7
Const SS_BLACKRECT 							= 4
Const SS_CENTER 							= 1
Const SS_CENTERIMAGE 						= $200
Const SS_ELLIPSISMASK 						= $C000
Const SS_ENDELLIPSIS 						= $4000
Const SS_ENHMETAFILE 						= $F
Const SS_ETCHEDFRAME 						= $12
Const SS_ETCHEDHORZ 						= $10
Const SS_ETCHEDVERT 						= $11
Const SS_GRAYFRAME 							= $8
Const SS_GRAYRECT 							= $5
Const SS_ICON 								= $3
Const SS_LEFT 								= 0
Const SS_LEFTNOWORDWRAP 					= $C
Const SS_SIMPLE 							= $B
Const SS_SUNKEN 							= $1000
Const SS_WHITEFRAME 						= $9
Const SS_WHITERECT 							= $6
Const SS_WORDELLIPSIS 						= $C000
Const SS_NOTIFY								= $100
Const SS_RIGHT 								= $2 

; standard trackbar winapi styles
Const TBS_AUTOTICKS 						= 1
Const TBS_BOTH 								= 8
Const TBS_BOTTOM 							= 0
Const TBS_ENABLESELRANGE 					= $20
Const TBS_FIXEDLENGTH 						= $40
Const TBS_HORZ 		 						= 0
Const TBS_LEFT 								= 4
Const TBS_NOTHUMB 							= $80
Const TBS_NOTICKS 							= $10
Const TBS_REVERSED 							= $200
Const TBS_RIGHT 							= 0
Const TBS_TOP 								= 4
Const TBS_VERT 								= 2

; standard spinner winapi styles, Aka up-down controls
Const UDS_ALIGNLEFT 						= $8
Const UDS_ALIGNRIGHT 						= 4
Const UDS_ARROWKEYS 						= $20
Const UDS_AUTOBUDDY 						= $10
Const UDS_HORZ 								= $40
Const UDS_HOTTRACK 							= $100
Const UDS_NOTHOUSANDS 						= $80
Const UDS_SETBUDDYINT 						= 2
Const UDS_WRAP 								= 1

; standard messagebox winapi styles, Aka Notify control
Const MB_ABORTRETRYIGNORE 					= $2
Const MB_APPLMODAL 							= $0
Const MB_CANCELTRYCONTINUE 					= $6
Const MB_COMPOSITE 							= $2
Const MB_DEFAULT_DESKTOP_ONLY 				= $20000
Const MB_DEFBUTTON1 						= 0
Const MB_DEFBUTTON2 						= $100
Const MB_DEFBUTTON3 						= $200
Const MB_DEFBUTTON4 						= $300
Const MB_DEFMASK 							= $F00
Const MB_HELP 								= $4000
Const MB_ICONASTERISK 						= $40
Const MB_ICONEXCLAMATION 					= $30
Const MB_ICONHAND 							= $10
Const MB_ICONERROR 							= MB_ICONHAND
Const MB_ICONINFORMATION 					= MB_ICONASTERISK
Const MB_ICONMASK 							= $F0
Const MB_ICONQUESTION 						= $20
Const MB_ICONSTOP 							= MB_ICONHAND
Const MB_ICONWARNING 						= MB_ICONEXCLAMATION
Const MB_MISCMASK 							= $C000
Const MB_MODEMASK 							= $3000
Const MB_NOFOCUS 							= $8000
Const MB_OK 								= $0
Const MB_OKCANCEL 							= $1
Const MB_PRECOMPOSED 						= $1
Const MB_RETRYCANCEL 						= $5
Const MB_RIGHT 								= $80000
Const MB_RTLREADING 						= $100000
Const MB_SETFOREGROUND 						= $10000
Const MB_SYSTEMMODAL 						= $1000
Const MB_TASKMODAL 							= $2000
Const MB_TOPMOST 							= $40000
Const MB_TYPEMASK 							= $F
Const MB_USERICON 							= $80
Const MB_YESNO 								= 4
Const MB_YESNOCANCEL 						= 3

; standard messagebox winapi return values
Const IDABORT								= 3				; Abort button was selected.
Const IDCANCEL								= 2				; Cancel button was selected.
Const IDIGNORE								= 5				; Ignore button was selected.
Const IDNO									= 7				; No button was selected.
Const IDOK									= 1				; OK button was selected.
Const IDRETRY								= 4				; Retry button was selected.
Const IDYES									= 6 			; Yes button was selected.
Const IDCONTINUE 							= 11			; Continue button selected.
Const IDCLOSE 								= 8				; Close button selected
Const IDHELP 								= 9				; Help button selected.
Const IDTRYAGAIN 							= 10			; Try again selected.

; standard cursor styles
Const IDC_APPSTARTING						= 1				; Standard arrow And small hourglass
Const IDC_ARROW								= 2 			; Standard arrow
Const IDC_CROSS								= 3 			; Crosshair
Const IDC_IBEAM								= 4 			; Text I-beam
Const IDC_ICON								= 5 			; Windows NT only: Empty icon
Const IDC_NO								= 6 			; Slashed circle
Const IDC_SIZE								= 7 			; Windows NT only: Four-pointed arrow
Const IDC_SIZEALL 							= 8 			; Same as IDC_SIZE
Const IDC_SIZENESW 							= 9 			; Double-pointed arrow pointing northeast And southwest
Const IDC_SIZENS							= 10 			; Double-pointed arrow pointing north And south
Const IDC_SIZENWSE 							= 11 			; Double-pointed arrow pointing northwest And southeast
Const IDC_SIZEWE  							= 12 			; Double-pointed arrow pointing west And east
Const IDC_UPARROW 							= 13 			; Vertical arrow
Const IDC_WAIT								= 14 			; Hourglass

; standard rebar styles
Const RBS_AUTOSIZE 							= $2000
Const RBS_BANDBORDERS 						= $400
Const RBS_DBLCLKTOGGLE 						= $8000
Const RBS_FIXEDORDER 						= $800
Const RBS_REGISTERDROP 						= $1000
Const RBS_TOOLTIPS 							= $100
Const RBS_VARHEIGHT 						= $200
Const RBS_VERTICALGRIPPER 					= $4000

; standard rebar band styles (containers)
Const RBBS_BREAK 							= $1
Const RBBS_CHILDEDGE 						= $4
Const RBBS_FIXEDBMP 						= $20
Const RBBS_FIXEDSIZE 						= $2
Const RBBS_GRIPPERALWAYS 					= $80
Const RBBS_HIDDEN 							= $8
Const RBBS_HIDETITLE 						= $400
Const RBBS_NOGRIPPER 						= $100
Const RBBS_NOVERT 							= $10
Const RBBS_TOPALIGN 						= $800
Const RBBS_USECHEVRON 						= $200
Const RBBS_VARIABLEHEIGHT 					= $40

; standard hotkey modifyers
Const MOD_ALT 								= $10
Const MOD_CONTROL 							= $8
Const MOD_SHIFT 							= $4

; standard winblitz3d defind menu tab size space
Const WB3D_HOTKEYSLASH$ 					= $220
Const WB3D_HOTKEYTAB$ 						= $9
Global WB3D_MENUHOTKEY_SPACER$ 				= Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYTAB)

;Win32 Constants

;Const Window_TITLEBAR = $10000000

Const window_maximize = $10000000

;#Region mouse_event
Const MOUSEEVENTF_MOVE =$1
Const MOUSEEVENTF_LEFTDOWN =$2
Const MOUSEEVENTF_LEFTUP =$4
Const MOUSEEVENTF_RIGHTDOWN =$8
Const MOUSEEVENTF_RIGHTUP =$10
Const MOUSEEVENTF_MIDDLEDOWN =$20
Const MOUSEEVENTF_MIDDLEUP =$40
Const MOUSEEVENTF_ABSOLUTE =$8000
;#End Region



;#region Peek Message Flags
Const PM_NOREMOVEConst = 0
Const PM_REMOVEConst = 1
Const PM_NOYIELDConst = 2
;#End Region

;#Region Windows Messages
Const WM_NULL                   = $0000
Const WM_CREATE                 = $0001
Const WM_DESTROY                = $0002
Const WM_MOVE                   = $0003
Const WM_SIZE                   = $0005
Const WM_ACTIVATE               = $0006
Const WM_SETFOCUS               = $0007
Const WM_KILLFOCUS              = $0008
Const WM_ENABLE                 = $000A
Const WM_SETREDRAW              = $000B
Const WM_SETTEXT                = $000C
Const WM_GETTEXT                = $000D
Const WM_GETTEXTLENGTH          = $000E
Const WM_PAINT                  = $000F
Const WM_CLOSE                  = $0010
Const WM_QUERYENDSESSION        = $0011
Const WM_QUIT                   = $0012
Const WM_QUERYOPEN              = $0013
Const WM_ERASEBKGND             = $0014
Const WM_SYSCOLORCHANGE         = $0015
Const WM_ENDSESSION             = $0016
Const WM_SHOWWINDOW             = $0018
Const WM_CTLCOLOR               = $0019
Const WM_WININICHANGE           = $001A
Const WM_SETTINGCHANGE          = $001A
Const WM_DEVMODECHANGE          = $001B
Const WM_ACTIVATEAPP            = $001C
Const WM_FONTCHANGE             = $001D
Const WM_TIMECHANGE             = $001E
Const WM_CANCELMODE             = $001F
Const WM_SETCURSOR              = $0020
Const WM_MOUSEACTIVATE          = $0021
Const WM_CHILDACTIVATE          = $0022
Const WM_QUEUESYNC              = $0023
Const WM_GETMINMAXINFO          = $0024
Const WM_PAINTICON              = $0026
Const WM_ICONERASEBKGND         = $0027
Const WM_NEXTDLGCTL             = $0028
Const WM_SPOOLERSTATUS          = $002A
Const WM_DRAWITEM               = $002B
Const WM_MEASUREITEM            = $002C
Const WM_DELETEITEM             = $002D
Const WM_VKEYTOITEM             = $002E
Const WM_CHARTOITEM             = $002F
Const WM_SETFONT                = $0030
Const WM_GETFONT                = $0031
Const WM_SETHOTKEY              = $0032
Const WM_GETHOTKEY              = $0033
Const WM_QUERYDRAGICON          = $0037
Const WM_COMPAREITEM            = $0039
Const WM_GETOBJECT              = $003D
Const WM_COMPACTING             = $0041
Const WM_COMMNOTIFY             = $0044
Const WM_WINDOWPOSCHANGING      = $0046
Const WM_WINDOWPOSCHANGED       = $0047
Const WM_POWER                  = $0048
Const WM_COPYDATA               = $004A
Const WM_CANCELJOURNAL          = $004B
Const WM_NOTIFY                 = $004E
Const WM_INPUTLANGCHANGEREQUEST = $0050
Const WM_INPUTLANGCHANGE        = $0051
Const WM_TCARD                  = $0052
Const WM_HELP                   = $0053
Const WM_USERCHANGED            = $0054
Const WM_NOTIFYFORMAT           = $0055
Const WM_CONTEXTMENU            = $007B
Const WM_STYLECHANGING          = $007C
Const WM_STYLECHANGED           = $007D
Const WM_DISPLAYCHANGE          = $007E
Const WM_GETICON                = $007F
Const WM_SETICON                = $0080
Const WM_NCCREATE               = $0081
Const WM_NCDESTROY              = $0082
Const WM_NCCALCSIZE             = $0083
Const WM_NCHITTEST              = $0084
Const WM_NCPAINT                = $0085
Const WM_NCACTIVATE             = $0086
Const WM_GETDLGCODE             = $0087
Const WM_SYNCPAINT              = $0088
Const WM_NCMOUSEMOVE            = $00A0
Const WM_NCLBUTTONDOWN          = $00A1
Const WM_NCLBUTTONUP            = $00A2
Const WM_NCLBUTTONDBLCLK        = $00A3
Const WM_NCRBUTTONDOWN          = $00A4
Const WM_NCRBUTTONUP            = $00A5
Const WM_NCRBUTTONDBLCLK        = $00A6
Const WM_NCMBUTTONDOWN          = $00A7
Const WM_NCMBUTTONUP            = $00A8
Const WM_NCMBUTTONDBLCLK        = $00A9
Const WM_KEYDOWN                = $0100
Const WM_KEYUP                  = $0101
Const WM_CHAR                   = $0102
Const WM_DEADCHAR               = $0103
Const WM_SYSKEYDOWN             = $0104
Const WM_SYSKEYUP               = $0105
Const WM_SYSCHAR                = $0106
Const WM_SYSDEADCHAR            = $0107
Const WM_KEYLAST                = $0108
Const WM_IME_STARTCOMPOSITION   = $010D
Const WM_IME_ENDCOMPOSITION     = $010E
Const WM_IME_COMPOSITION        = $010F
Const WM_IME_KEYLAST            = $010F
Const WM_INITDIALOG             = $0110
Const WM_COMMAND                = $0111
Const WM_SYSCOMMAND             = $0112
Const WM_TIMER                  = $0113
Const WM_HSCROLL                = $0114
Const WM_VSCROLL                = $0115
Const WM_INITMENU               = $0116
Const WM_INITMENUPOPUP          = $0117
Const WM_MENUSELECT             = $011F
Const WM_MENUCHAR               = $0120
Const WM_ENTERIDLE              = $0121
Const WM_MENURBUTTONUP          = $0122
Const WM_MENUDRAG               = $0123
Const WM_MENUGETOBJECT          = $0124
Const WM_UNINITMENUPOPUP        = $0125
Const WM_MENUCOMMAND            = $0126
Const WM_CTLCOLORMSGBOX         = $0132
Const WM_CTLCOLOREDIT           = $0133
Const WM_CTLCOLORLISTBOX        = $0134
Const WM_CTLCOLORBTN            = $0135
Const WM_CTLCOLORDLG            = $0136
Const WM_CTLCOLORSCROLLBAR      = $0137
Const WM_CTLCOLORSTATIC         = $0138
Const WM_MOUSEMOVE              = $0200
Const WM_LBUTTONDOWN            = $0201
Const WM_LBUTTONUP              = $0202
Const WM_LBUTTONDBLCLK          = $0203
Const WM_RBUTTONDOWN            = $0204
Const WM_RBUTTONUP              = $0205
Const WM_RBUTTONDBLCLK          = $0206
Const WM_MBUTTONDOWN            = $0207
Const WM_MBUTTONUP              = $0208
Const WM_MBUTTONDBLCLK          = $0209
Const WM_MOUSEWHEEL             = $020A
Const WM_PARENTNOTIFY           = $0210
Const WM_ENTERMENULOOP          = $0211
Const WM_EXITMENULOOP           = $0212
Const WM_NEXTMENU               = $0213
Const WM_SIZING                 = $0214
Const WM_CAPTURECHANGED         = $0215
Const WM_MOVING                 = $0216
Const WM_DEVICECHANGE           = $0219
Const WM_MDICREATE              = $0220
Const WM_MDIDESTROY             = $0221
Const WM_MDIACTIVATE            = $0222
Const WM_MDIRESTORE             = $0223
Const WM_MDINEXT                = $0224
Const WM_MDIMAXIMIZE            = $0225
Const WM_MDITILE                = $0226
Const WM_MDICASCADE             = $0227
Const WM_MDIICONARRANGE         = $0228
Const WM_MDIGETACTIVE           = $0229
Const WM_MDISETMENU             = $0230
Const WM_ENTERSIZEMOVE          = $0231
Const WM_EXITSIZEMOVE           = $0232
Const WM_DROPFILES              = $0233
Const WM_MDIREFRESHMENU         = $0234
Const WM_IME_SETCONTEXT         = $0281
Const WM_IME_NOTIFY             = $0282
Const WM_IME_CONTROL            = $0283
Const WM_IME_COMPOSITIONFULL    = $0284
Const WM_IME_SELECT             = $0285
Const WM_IME_CHAR               = $0286
Const WM_IME_REQUEST            = $0288
Const WM_IME_KEYDOWN            = $0290
Const WM_IME_KEYUP              = $0291
Const WM_MOUSEHOVER             = $02A1
Const WM_MOUSELEAVE             = $02A3
Const WM_CUT                    = $0300
Const WM_COPY                   = $0301
Const WM_PASTE                  = $0302
Const WM_CLEAR                  = $0303
Const WM_UNDO                   = $0304
Const WM_RENDERFORMAT           = $0305
Const WM_RENDERALLFORMATS       = $0306
Const WM_DESTROYCLIPBOARD       = $0307
Const WM_DRAWCLIPBOARD          = $0308
Const WM_PAINTCLIPBOARD         = $0309
Const WM_VSCROLLCLIPBOARD       = $030A
Const WM_SIZECLIPBOARD          = $030B
Const WM_ASKCBFORMATNAME        = $030C
Const WM_CHANGECBCHAIN          = $030D
Const WM_HSCROLLCLIPBOARD       = $030E
Const WM_QUERYNEWPALETTE        = $030F
Const WM_PALETTEISCHANGING      = $0310
Const WM_PALETTECHANGED         = $0311
Const WM_HOTKEY                 = $0312
Const WM_PRINT                  = $0317
Const WM_PRINTCLIENT            = $0318
Const WM_HANDHELDFIRST          = $0358
Const WM_HANDHELDLAST           = $035F
Const WM_AFXFIRST               = $0360
Const WM_AFXLAST                = $037F
Const WM_PENWINFIRST            = $0380
Const WM_PENWINLAST             = $038F
Const WM_APP                    = $8000
Const WM_USER                   = $0400
Const WM_REFLECT                = WM_USER + $1c00
;#End Region

;#Region Window Styles
;Const WS_OVERLAPPED       = $00000000
;Const WS_POPUP            = $80000000
;Const WS_CHILD            = $40000000
;Const WS_MINIMIZE         = $20000000
;Const WS_VISIBLE          = $10000000
;Const WS_DISABLED         = $08000000
;Const WS_CLIPSIBLINGS     = $04000000
;Const WS_CLIPCHILDREN     = $02000000
;Const WS_MAXIMIZE         = $01000000
;Const WS_CAPTION          = $00C00000
;Const WS_BORDER           = $00800000
;Const WS_DLGFRAME         = $00400000
;Const WS_VSCROLL          = $00200000
;Const WS_HSCROLL          = $00100000
;Const WS_SYSMENU          = $00080000
;Const WS_THICKFRAME       = $00040000
;Const WS_GROUP            = $00020000
;Const WS_TABSTOP          = $00010000
;Const WS_MINIMIZEBOX      = $00020000
;Const WS_MAXIMIZEBOX      = $00010000
;Const WS_TILED            = $00000000
;Const WS_ICONIC           = $20000000
;Const WS_SIZEBOX          = $00040000
;Const WS_POPUPWINDOW      = $80880000
;Const WS_OVERLAPPEDWINDOW = $00CF0000
;Const WS_TILEDWINDOW      = $00CF0000
;Const WS_CHILDWINDOW      = $40000000
;#End Region

;#Region Window Extended Styles
Const WS_EX_DLGMODALFRAME     = $00000001
Const WS_EX_NOPARENTNOTIFY    = $00000004
Const WS_EX_TOPMOST           = $00000008
Const WS_EX_ACCEPTFILES       = $00000010
Const WS_EX_TRANSPARENT       = $00000020
Const WS_EX_MDICHILD          = $00000040
Const WS_EX_TOOLWINDOW        = $00000080
Const WS_EX_WINDOWEDGE        = $00000100
Const WS_EX_CLIENTEDGE        = $00000200
Const WS_EX_CONTEXTHELP       = $00000400
Const WS_EX_RIGHT             = $00001000
Const WS_EX_LEFT              = $00000000
Const WS_EX_RTLREADING        = $00002000
Const WS_EX_LTRREADING        = $00000000
Const WS_EX_LEFTSCROLLBAR     = $00004000
Const WS_EX_RIGHTSCROLLBAR    = $00000000
Const WS_EX_CONTROLPARENT     = $00010000
Const WS_EX_STATICEDGE        = $00020000
Const WS_EX_APPWINDOW         = $00040000
Const WS_EX_OVERLAPPEDWINDOW  = $00000300
Const WS_EX_PALETTEWINDOW     = $00000188
Const WS_EX_LAYERED           = $00080000
;#End Region

;#Region ShowWindow Styles
Const SW_HIDE             = 0
Const SW_SHOWNORMAL       = 1
Const SW_NORMAL           = 1
Const SW_SHOWMINIMIZED    = 2
Const SW_SHOWMAXIMIZED    = 3
Const SW_MAXIMIZE         = 3
Const SW_SHOWNOACTIVATE   = 4
Const SW_SHOW             = 5
Const SW_MINIMIZE         = 6
Const SW_SHOWMINNOACTIVE  = 7
Const SW_SHOWNA           = 8
Const SW_RESTORE          = 9
Const SW_SHOWDEFAULT      = 10
Const SW_FORCEMINIMIZE    = 11
Const SW_MAX              = 11
;#End Region

;#Region SetWindowPos Z Order
Const HWND_TOP        = 0
Const HWND_BOTTOM     = 1
Const HWND_TOPMOST    = -1
Const HWND_NOTOPMOST  = -2
;#End Region

;#Region SetWindowPosFlags
Const SWP_NOSIZE          = $0001
Const SWP_NOMOVE          = $0002
Const SWP_NOZORDER        = $0004
Const SWP_NOREDRAW        = $0008
Const SWP_NOACTIVATE      = $0010
Const SWP_FRAMECHANGED    = $0020
Const SWP_SHOWWINDOW      = $0040
Const SWP_HIDEWINDOW      = $0080
Const SWP_NOCOPYBITS      = $0100
Const SWP_NOOWNERZORDER   = $0200
Const SWP_NOSENDCHANGING  = $0400
Const SWP_DRAWFRAME       = $0020
Const SWP_NOREPOSITION    = $0200
Const SWP_DEFERERASE      = $2000
Const SWP_ASYNCWINDOWPOS  = $4000
;#End Region

;#Region Virtual Keys
Const VK_LBUTTON     = $01
Const VK_CANCEL      = $03
Const VK_BACK        = $08
Const VK_TAB         = $09
Const VK_CLEAR       = $0C
Const VK_RETURN      = $0D
Const VK_SHIFT       = $10
Const VK_CONTROL     = $11
Const VK_MENU        = $12
Const VK_CAPITAL     = $14
Const VK_ESCAPE      = $1B
Const VK_SPACE       = $20
Const VK_PRIOR       = $21
Const VK_NEXT        = $22
Const VK_END         = $23
Const VK_HOME        = $24
Const VK_LEFT        = $25
Const VK_UP          = $26
Const VK_RIGHT       = $27
Const VK_DOWN        = $28
Const VK_SELECT      = $29
Const VK_EXECUTE     = $2B
Const VK_SNAPSHOT    = $2C
Const VK_HELP        = $2F
Const VK_0       = $30
Const VK_1       = $31
Const VK_2       = $32
Const VK_3       = $33
Const VK_4       = $34
Const VK_5       = $35
Const VK_6       = $36
Const VK_7       = $37
Const VK_8       = $38
Const VK_9       = $39
Const VK_A       = $41
Const VK_B       = $42
Const VK_C       = $43
Const VK_D       = $44
Const VK_E       = $45
Const VK_F       = $46
Const VK_G       = $47
Const VK_H       = $48
Const VK_I       = $49
Const VK_J       = $4A
Const VK_K       = $4B
Const VK_L       = $4C
Const VK_M       = $4D
Const VK_N       = $4E
Const VK_O       = $4F
Const VK_P       = $50
Const VK_Q       = $51
Const VK_R       = $52
Const VK_S       = $53
Const VK_T       = $54
Const VK_U       = $55
Const VK_V       = $56
Const VK_W       = $57
Const VK_X       = $58
Const VK_Y       = $59
Const VK_Z       = $5A
Const VK_NUMPAD0       = $60
Const VK_NUMPAD1       = $61
Const VK_NUMPAD2       = $62
Const VK_NUMPAD3       = $63
Const VK_NUMPAD4       = $64
Const VK_NUMPAD5       = $65
Const VK_NUMPAD6       = $66
Const VK_NUMPAD7       = $67
Const VK_NUMPAD8       = $68
Const VK_NUMPAD9       = $69
Const VK_MULTIPLY      = $6A
Const VK_ADD           = $6B
Const VK_SEPARATOR     = $6C
Const VK_SUBTRACT      = $6D
Const VK_DECIMAL       = $6E
Const VK_DIVIDE        = $6F
Const VK_ATTN          = $F6
Const VK_CRSEL         = $F7
Const VK_EXSEL         = $F8
Const VK_EREOF         = $F9
Const VK_PLAY          = $FA 
Const VK_ZOOM          = $FB
Const VK_NONAME        = $FC
Const VK_PA1           = $FD
Const VK_OEM_CLEAR     = $FE
Const VK_LWIN          = $5B
Const VK_RWIN          = $5C
Const VK_APPS          = $5D  
Const VK_LSHIFT        = $A0  
Const VK_RSHIFT        = $A1  
Const VK_LCONTROL      = $A2  
Const VK_RCONTROL      = $A3  
Const VK_LMENU         = $A4  
Const VK_RMENU         = $A5
;#End Region

;#Region PatBlt Types
Const SRCCOPY          =   $00CC0020
Const SRCPAINT         =   $00EE0086
Const SRCAND           =   $008800C6
Const SRCINVERT        =   $00660046
Const SRCERASE         =   $00440328
Const NOTSRCCOPY       =   $00330008
Const NOTSRCERASE      =   $001100A6
Const MERGECOPY        =   $00C000CA
Const MERGEPAINT       =   $00BB0226
Const PATCOPY          =   $00F00021
Const PATPAINT         =   $00FB0A09
Const PATINVERT        =   $005A0049
Const DSTINVERT        =   $00550009
Const BLACKNESS        =   $00000042
Const WHITENESS        =   $00FF0062
;const NOMIRRORBITMAP  =   ?
Const CAPTUREBLT       =   $40000000
;#End Region

;#Region Clipboard Formats
Const CF_TEXT             = 1
Const CF_BITMAP           = 2
Const CF_METAFILEPICT     = 3
Const CF_SYLK             = 4
Const CF_DIF              = 5
Const CF_TIFF             = 6
Const CF_OEMTEXT          = 7
Const CF_DIB              = 8
Const CF_PALETTE          = 9
Const CF_PENDATA          = 10
Const CF_RIFF             = 11
Const CF_WAVE             = 12
Const CF_UNICODETEXT      = 13
Const CF_ENHMETAFILE      = 14
Const CF_HDROP            = 15
Const CF_LOCALE           = 16
Const CF_MAX              = 17
Const CF_OWNERDISPLAY     = $0080
Const CF_DSPTEXT          = $0081
Const CF_DSPBITMAP        = $0082
Const CF_DSPMETAFILEPICT  = $0083
Const CF_DSPENHMETAFILE   = $008E
Const CF_PRIVATEFIRST     = $0200
Const CF_PRIVATELAST      = $02FF
Const CF_GDIOBJFIRST      = $0300
Const CF_GDIOBJLAST       = $03FF
;#End Region

;#Region Common Controls Initialization flags
Const ICC_LISTVIEW_CLASSES   = $00000001
Const ICC_TREEVIEW_CLASSES   = $00000002
Const ICC_BAR_CLASSES        = $00000004
Const ICC_TAB_CLASSES        = $00000008
Const ICC_UPDOWN_CLASS       = $00000010
Const ICC_PROGRESS_CLASS     = $00000020
Const ICC_HOTKEY_CLASS       = $00000040
Const ICC_ANIMATE_CLASS      = $00000080
Const ICC_WIN95_CLASSES      = $000000FF
Const ICC_DATE_CLASSES       = $00000100
Const ICC_USEREX_CLASSES     = $00000200
Const ICC_COOL_CLASSES       = $00000400
Const ICC_INTERNET_CLASSES   = $00000800
Const ICC_PAGESCROLLER_CLASS = $00001000
Const ICC_NATIVEFNTCTL_CLASS = $00002000
;#End Region

;#Region Common Controls Styles
;Const CCS_TOP                 = $00000001
;Const CCS_NOMOVEY             = $00000002
;Const CCS_BOTTOM              = $00000003
;Const CCS_NORESIZE            = $00000004
;Const CCS_NOPARENTALIGN       = $00000008
;Const CCS_ADJUSTABLE          = $00000020
;Const CCS_NODIVIDER           = $00000040
;Const CCS_VERT                = $00000080
;Const CCS_LEFT                = (CCS_VERT Or CCS_TOP)
;Const CCS_RIGHT               = (CCS_VERT Or CCS_BOTTOM)
;Const CCS_NOMOVEX             = (CCS_VERT Or CCS_NOMOVEY)
;#End Region

;#Region Toolbar button styles
;Const TBSTYLE_BUTTON          = $0000
;Const TBSTYLE_SEP             = $0001
;Const TBSTYLE_CHECK           = $0002
;Const TBSTYLE_GROUP           = $0004
;Const TBSTYLE_CHECKGROUP      = (TBSTYLE_GROUP Or TBSTYLE_CHECK)
;Const TBSTYLE_DROPDOWN        = $0008
;Const TBSTYLE_AUTOSIZE        = $0010
;Const TBSTYLE_NOPREFIX        = $0020
;Const TBSTYLE_TOOLTIPS        = $0100
;Const TBSTYLE_WRAPABLE        = $0200
;Const TBSTYLE_ALTDRAG         = $0400
;Const TBSTYLE_FLAT            = $0800
;Const TBSTYLE_LIST            = $1000
;Const TBSTYLE_CUSTOMERASE     = $2000
;Const TBSTYLE_REGISTERDROP    = $4000
;Const TBSTYLE_TRANSPARENT     = $8000
;Const TBSTYLE_DRAWDDARROWS = $00000001
;#End Region

;#Region ToolBar Ex Styles
;Const TBSTYLE_EX_DRAWDDARROWS        = $1
;Const TBSTYLE_EX_HIDECLIPPEDBUTTONS  = $10
;Const TBSTYLE_EX_DOUBLEBUFFER        = $80
;#End Region

;#Region ToolBar Messages
Const TB_ENABLEBUTTON         = (WM_USER + 1)
Const TB_CHECKBUTTON          = (WM_USER + 2)
Const TB_PRESSBUTTON          = (WM_USER + 3)
Const TB_HIDEBUTTON           = (WM_USER + 4)
Const TB_INDETERMINATE        = (WM_USER + 5)
Const TB_MARKBUTTON           = (WM_USER + 6)
Const TB_ISBUTTONENABLED      = (WM_USER + 9)
Const TB_ISBUTTONCHECKED      = (WM_USER + 10)
Const TB_ISBUTTONPRESSED      = (WM_USER + 11)
Const TB_ISBUTTONHIDDEN       = (WM_USER + 12)
Const TB_ISBUTTONINDETERMINATE= (WM_USER + 13)
Const TB_ISBUTTONHIGHLIGHTED  = (WM_USER + 14)
Const TB_SETSTATE             = (WM_USER + 17)
Const TB_GETSTATE             = (WM_USER + 18)
Const TB_ADDBITMAP            = (WM_USER + 19)
Const TB_ADDBUTTONSA          = (WM_USER + 20)
Const TB_INSERTBUTTONA        = (WM_USER + 21)
Const TB_ADDBUTTONS           = (WM_USER + 20)
Const TB_INSERTBUTTON         = (WM_USER + 21)
Const TB_DELETEBUTTON         = (WM_USER + 22)
Const TB_GETBUTTON            = (WM_USER + 23)
Const TB_BUTTONCOUNT          = (WM_USER + 24)
Const TB_COMMANDTOINDEX       = (WM_USER + 25)
Const TB_SAVERESTOREA         = (WM_USER + 26)
Const TB_CUSTOMIZE            = (WM_USER + 27)
Const TB_ADDSTRINGA           = (WM_USER + 28)
Const TB_GETITEMRECT          = (WM_USER + 29)
Const TB_BUTTONSTRUCTSIZE     = (WM_USER + 30)
Const TB_SETBUTTONSIZE        = (WM_USER + 31)
Const TB_SETBITMAPSIZE        = (WM_USER + 32)
Const TB_AUTOSIZE             = (WM_USER + 33)
Const TB_GETTOOLTIPS          = (WM_USER + 35)
Const TB_SETTOOLTIPS          = (WM_USER + 36)
Const TB_SETPARENT            = (WM_USER + 37)
Const TB_SETROWS              = (WM_USER + 39)
Const TB_GETROWS              = (WM_USER + 40)
Const TB_GETBITMAPFLAGS       = (WM_USER + 41)
Const TB_SETCMDID             = (WM_USER + 42)
Const TB_CHANGEBITMAP         = (WM_USER + 43)
Const TB_GETBITMAP            = (WM_USER + 44)
Const TB_GETBUTTONTEXTA       = (WM_USER + 45)
Const TB_GETBUTTONTEXTW       = (WM_USER + 75)
Const TB_REPLACEBITMAP        = (WM_USER + 46)
Const TB_SETINDENT            = (WM_USER + 47)
Const TB_SETIMAGELIST         = (WM_USER + 48)
Const TB_GETIMAGELIST         = (WM_USER + 49)
Const TB_LOADIMAGES           = (WM_USER + 50)
Const TB_GETRECT              = (WM_USER + 51)
Const TB_SETHOTIMAGELIST      = (WM_USER + 52)
Const TB_GETHOTIMAGELIST      = (WM_USER + 53)
Const TB_SETDISABLEDIMAGELIST = (WM_USER + 54)
Const TB_GETDISABLEDIMAGELIST = (WM_USER + 55)
Const TB_SETSTYLE             = (WM_USER + 56)
Const TB_GETSTYLE             = (WM_USER + 57)
Const TB_GETBUTTONSIZE        = (WM_USER + 58)
Const TB_SETBUTTONWIDTH       = (WM_USER + 59)
Const TB_SETMAXTEXTROWS       = (WM_USER + 60)
Const TB_GETTEXTROWS          = (WM_USER + 61)
Const TB_GETOBJECT            = (WM_USER + 62)
Const TB_GETBUTTONINFOW       = (WM_USER + 63)
Const TB_SETBUTTONINFOW       = (WM_USER + 64)
Const TB_GETBUTTONINFOA       = (WM_USER + 65)
Const TB_SETBUTTONINFOA       = (WM_USER + 66)
Const TB_INSERTBUTTONW        = (WM_USER + 67)
Const TB_ADDBUTTONSW          = (WM_USER + 68)
Const TB_HITTEST              = (WM_USER + 69)
Const TB_SETDRAWTEXTFLAGS     = (WM_USER + 70)
Const TB_GETHOTITEM           = (WM_USER + 71)
Const TB_SETHOTITEM           = (WM_USER + 72)
Const TB_SETANCHORHIGHLIGHT   = (WM_USER + 73)
Const TB_GETANCHORHIGHLIGHT   = (WM_USER + 74)
Const TB_SAVERESTOREW         = (WM_USER + 76)
Const TB_ADDSTRINGW           = (WM_USER + 77)
Const TB_MAPACCELERATORA      = (WM_USER + 78)
Const TB_GETINSERTMARK        = (WM_USER + 79)
Const TB_SETINSERTMARK        = (WM_USER + 80)
Const TB_INSERTMARKHITTEST    = (WM_USER + 81)
Const TB_MOVEBUTTON           = (WM_USER + 82)
Const TB_GETMAXSIZE           = (WM_USER + 83)
Const TB_SETEXTENDEDSTYLE     = (WM_USER + 84)
Const TB_GETEXTENDEDSTYLE     = (WM_USER + 85)
Const TB_GETPADDING           = (WM_USER + 86)
Const TB_SETPADDING           = (WM_USER + 87)
Const TB_SETINSERTMARKCOLOR   = (WM_USER + 88)
Const TB_GETINSERTMARKCOLOR   = (WM_USER + 89)
;#End Region

;#Region ToolBar Notifications
Const TTN_NEEDTEXTA           = ((0-520)-0)
Const TTN_NEEDTEXTW           = ((0-520)-10)
Const TBN_QUERYINSERT         = ((0-700)-6)
Const TBN_DROPDOWN            = ((0-700)-10)
Const TBN_HOTITEMCHANGE       = ((0 - 700) - 13)
;#End Region

;#Region Reflected Messages
Const OCM__BASE               = (WM_USER+$1c00)
Const OCM_COMMAND             = (OCM__BASE + WM_COMMAND)
Const OCM_CTLCOLORBTN         = (OCM__BASE + WM_CTLCOLORBTN)
Const OCM_CTLCOLOREDIT        = (OCM__BASE + WM_CTLCOLOREDIT)
Const OCM_CTLCOLORDLG         = (OCM__BASE + WM_CTLCOLORDLG)
Const OCM_CTLCOLORLISTBOX     = (OCM__BASE + WM_CTLCOLORLISTBOX)
Const OCM_CTLCOLORMSGBOX      = (OCM__BASE + WM_CTLCOLORMSGBOX)
Const OCM_CTLCOLORSCROLLBAR   = (OCM__BASE + WM_CTLCOLORSCROLLBAR)
Const OCM_CTLCOLORSTATIC      = (OCM__BASE + WM_CTLCOLORSTATIC)
Const OCM_CTLCOLOR            = (OCM__BASE + WM_CTLCOLOR)
Const OCM_DRAWITEM            = (OCM__BASE + WM_DRAWITEM)
Const OCM_MEASUREITEM         = (OCM__BASE + WM_MEASUREITEM)
Const OCM_DELETEITEM          = (OCM__BASE + WM_DELETEITEM)
Const OCM_VKEYTOITEM          = (OCM__BASE + WM_VKEYTOITEM)
Const OCM_CHARTOITEM          = (OCM__BASE + WM_CHARTOITEM)
Const OCM_COMPAREITEM         = (OCM__BASE + WM_COMPAREITEM)
Const OCM_HSCROLL             = (OCM__BASE + WM_HSCROLL)
Const OCM_VSCROLL             = (OCM__BASE + WM_VSCROLL)
Const OCM_PARENTNOTIFY        = (OCM__BASE + WM_PARENTNOTIFY)
Const OCM_NOTIFY              = (OCM__BASE + WM_NOTIFY)
;#End Region

;#Region Notification Messages
Const NM_FIRST      = (0-0)
Const NM_CUSTOMDRAW = (NM_FIRST-12)
Const NM_NCHITTEST  = (NM_FIRST-14)
;#End Region

;#Region ToolTip Flags
Const TTF_CENTERTIP           = $0002
Const TTF_RTLREADING          = $0004
Const TTF_SUBCLASS            = $0010
Const TTF_TRACK               = $0020
Const TTF_ABSOLUTE            = $0080
Const TTF_TRANSPARENT         = $0100
Const TTF_DI_SETITEM          = $8000
;#End Region

;#Region Custom Draw Return Flags
Const CDRF_DODEFAULT          = $00000000
Const CDRF_NEWFONT            = $00000002
Const CDRF_SKIPDEFAULT        = $00000004
Const CDRF_NOTIFYPOSTPAINT    = $00000010
Const CDRF_NOTIFYITEMDRAW     = $00000020
Const CDRF_NOTIFYSUBITEMDRAW  = $00000020
Const CDRF_NOTIFYPOSTERASE    = $00000040
;#End Region

;#Region Custom Draw Item State Flags
Const CDIS_SELECTED       = $0001
Const CDIS_GRAYED         = $0002
Const CDIS_DISABLED       = $0004
Const CDIS_CHECKED        = $0008
Const CDIS_FOCUS          = $0010
Const CDIS_DEFAULT        = $0020
Const CDIS_HOT            = $0040
Const CDIS_MARKED         = $0080
Const CDIS_INDETERMINATE  = $0100
;#End Region

;#Region Custom Draw Draw State Flags
Const CDDS_PREPAINT           = $00000001
Const CDDS_POSTPAINT          = $00000002
Const CDDS_PREERASE           = $00000003
Const CDDS_POSTERASE          = $00000004
Const CDDS_ITEM               = $00010000
Const CDDS_ITEMPREPAINT       = (CDDS_ITEM Or CDDS_PREPAINT)
Const CDDS_ITEMPOSTPAINT      = (CDDS_ITEM Or CDDS_POSTPAINT)
Const CDDS_ITEMPREERASE       = (CDDS_ITEM Or CDDS_PREERASE)
Const CDDS_ITEMPOSTERASE      = (CDDS_ITEM Or CDDS_POSTERASE)
Const CDDS_SUBITEM            = $00020000
;#End Region

;#Region Toolbar button info flags
Const TBIF_IMAGE             = $00000001
Const TBIF_TEXT              = $00000002
Const TBIF_STATE             = $00000004
Const TBIF_STYLE             = $00000008
Const TBIF_LPARAM            = $00000010
Const TBIF_COMMAND           = $00000020
Const TBIF_SIZE              = $00000040
Const I_IMAGECALLBACK        = -1
Const I_IMAGENONE            = -2
;#End Region

;#Region Toolbar button state
;Const TBSTATE_CHECKED         = $01
;Const TBSTATE_PRESSED         = $02
;Const TBSTATE_ENABLED         = $04
;Const TBSTATE_HIDDEN          = $08
;Const TBSTATE_INDETERMINATE   = $10
;Const TBSTATE_WRAP            = $20
;Const TBSTATE_ELLIPSES        = $40
;Const TBSTATE_MARKED          = $80
;#End Region

;#Region Windows Hook Codes
Const WH_MSGFILTER        = (-1)
Const WH_JOURNALRECORD    = 0
Const WH_JOURNALPLAYBACK  = 1
Const WH_KEYBOARD         = 2
Const WH_GETMESSAGE       = 3
Const WH_CALLWNDPROC      = 4
Const WH_CBT              = 5
Const WH_SYSMSGFILTER     = 6
Const WH_MOUSE            = 7
Const WH_HARDWARE         = 8
Const WH_DEBUG            = 9
Const WH_SHELL            = 10
Const WH_FOREGROUNDIDLE   = 11
Const WH_CALLWNDPROCRET   = 12
Const WH_KEYBOARD_LL      = 13
Const WH_MOUSE_LL         = 14
;#End Region

;#Region Mouse Hook Filters
Const MSGF_DIALOGBOX      = 0
Const MSGF_MESSAGEBOX     = 1
Const MSGF_MENU           = 2
Const MSGF_SCROLLBAR      = 5
Const MSGF_NEXTWINDOW     = 6
;#End Region

;#Region Draw Text format flags
Const DT_TOP              = $00000000
Const DT_LEFT             = $00000000
Const DT_CENTER           = $00000001
Const DT_RIGHT            = $00000002
Const DT_VCENTER          = $00000004
Const DT_BOTTOM           = $00000008
Const DT_WORDBREAK        = $00000010
Const DT_SINGLELINE       = $00000020
Const DT_EXPANDTABS       = $00000040
Const DT_TABSTOP          = $00000080
Const DT_NOCLIP           = $00000100
Const DT_EXTERNALLEADING  = $00000200
Const DT_CALCRECT         = $00000400
Const DT_NOPREFIX         = $00000800
Const DT_INTERNAL         = $00001000
Const DT_EDITCONTROL      = $00002000
Const DT_PATH_ELLIPSIS    = $00004000
Const DT_END_ELLIPSIS     = $00008000
Const DT_MODIFYSTRING     = $00010000
Const DT_RTLREADING       = $00020000
Const DT_WORD_ELLIPSIS    = $00040000
;#End Region

;#Region Rebar Styles
;Const RBS_TOOLTIPS        = $0100
;Const RBS_VARHEIGHT       = $0200
;Const RBS_BANDBORDERS     = $0400
;Const RBS_FIXEDORDER      = $0800
;Const RBS_REGISTERDROP    = $1000
;Const RBS_AUTOSIZE        = $2000
;Const RBS_VERTICALGRIPPER = $4000
;Const RBS_DBLCLKTOGGLE    = $8000
;#End Region

;#Region Rebar Notifications
Const RBN_FIRST           = (0-831)
Const RBN_HEIGHTCHANGE    = (RBN_FIRST - 0)
Const RBN_GETOBJECT       = (RBN_FIRST - 1)
Const RBN_LAYOUTCHANGED   = (RBN_FIRST - 2)
Const RBN_AUTOSIZE        = (RBN_FIRST - 3)
Const RBN_BEGINDRAG       = (RBN_FIRST - 4)
Const RBN_ENDDRAG         = (RBN_FIRST - 5)
Const RBN_DELETINGBAND    = (RBN_FIRST - 6)
Const RBN_DELETEDBAND     = (RBN_FIRST - 7)
Const RBN_CHILDSIZE       = (RBN_FIRST - 8)
Const RBN_CHEVRONPUSHED   = (RBN_FIRST - 10)
;#End Region

;#Region Rebar Messages
Const CCM_FIRST           =    $2000
Const RB_INSERTBANDA      =(WM_USER +  1)
Const RB_DELETEBAND       =(WM_USER +  2)
Const RB_GETBARINFO       =(WM_USER +  3)
Const RB_SETBARINFO       =(WM_USER +  4)
Const RB_GETBANDINFO      =(WM_USER +  5)
Const RB_SETBANDINFOA     =(WM_USER +  6)
Const RB_SETPARENT        =(WM_USER +  7)
Const RB_HITTEST          =(WM_USER +  8)
Const RB_GETRECT          =(WM_USER +  9)
Const RB_INSERTBANDW      =(WM_USER +  10)
Const RB_SETBANDINFOW     =(WM_USER +  11)
Const RB_GETBANDCOUNT     =(WM_USER +  12)
Const RB_GETROWCOUNT      =(WM_USER +  13)
Const RB_GETROWHEIGHT     =(WM_USER +  14)
Const RB_IDTOINDEX        =(WM_USER +  16)
Const RB_GETTOOLTIPS      =(WM_USER +  17)
Const RB_SETTOOLTIPS      =(WM_USER +  18)
Const RB_SETBKCOLOR       =(WM_USER +  19)
Const RB_GETBKCOLOR       =(WM_USER +  20)
Const RB_SETTEXTCOLOR     =(WM_USER +  21)
Const RB_GETTEXTCOLOR     =(WM_USER +  22)
Const RB_SIZETORECT       =(WM_USER +  23)
Const RB_SETCOLORSCHEME   =(CCM_FIRST + 2)
Const RB_GETCOLORSCHEME   =(CCM_FIRST + 3)
Const RB_BEGINDRAG        =(WM_USER + 24)
Const RB_ENDDRAG          =(WM_USER + 25)
Const RB_DRAGMOVE         =(WM_USER + 26)
Const RB_GETBARHEIGHT     =(WM_USER + 27)
Const RB_GETBANDINFOW     =(WM_USER + 28)
Const RB_GETBANDINFOA     =(WM_USER + 29)
Const RB_MINIMIZEBAND     =(WM_USER + 30)
Const RB_MAXIMIZEBAND     =(WM_USER + 31)
Const RB_GETDROPTARGET    =(CCM_FIRST + 4)
Const RB_GETBANDBORDERS   =(WM_USER + 34)
Const RB_SHOWBAND         =(WM_USER + 35)
Const RB_SETPALETTE       =(WM_USER + 37)
Const RB_GETPALETTE       =(WM_USER + 38)
Const RB_MOVEBAND         =(WM_USER + 39)
Const RB_SETUNICODEFORMAT =   (CCM_FIRST + 5)
Const RB_GETUNICODEFORMAT =   (CCM_FIRST + 6)
;#End Region

;#Region Rebar Info Mask
Const RBBIM_STYLE         = $00000001
Const RBBIM_COLORS        = $00000002
Const RBBIM_TEXT          = $00000004
Const RBBIM_IMAGE         = $00000008
Const RBBIM_CHILD         = $00000010
Const RBBIM_CHILDSIZE     = $00000020
Const RBBIM_SIZE          = $00000040
Const RBBIM_BACKGROUND    = $00000080
Const RBBIM_ID            = $00000100
Const RBBIM_IDEALSIZE     = $00000200
Const RBBIM_LPARAM        = $00000400
Const BBIM_HEADERSIZE     = $00000800
;#End Region

;#Region Rebar Styles
;Const RBBS_BREAK              = $1
;Const RBBS_CHILDEDGE          = $4
;Const RBBS_FIXEDBMP           = $20
;Const RBBS_GRIPPERALWAYS= $80
;Const RBBS_USECHEVRON         = $200
;#End Region

;#Region Object types
Const OBJ_PEN             = 1
Const OBJ_BRUSH           = 2
Const OBJ_DC              = 3
Const OBJ_METADC          = 4
Const OBJ_PAL             = 5
Const OBJ_FONT            = 6
Const OBJ_BITMAP          = 7
Const OBJ_REGION          = 8
Const OBJ_METAFILE        = 9
Const OBJ_MEMDC           = 10
Const OBJ_EXTPEN          = 11
Const OBJ_ENHMETADC       = 12
Const OBJ_ENHMETAFILE     = 13
;#End Region

;#Region WM_MENUCHAR Return values
Const MNC_IGNORE  = 0
Const MNC_CLOSE   = 1
Const MNC_EXECUTE = 2
Const MNC_SELECT  = 3
;#End Region

;#Region Background Mode
Const TRANSPARENT = 1
Const OPAQUE = 2
;#End Region

;#Region ListView Messages
Const LVM_FIRST           =    $1000
Const LVM_GETSUBITEMRECT  = (LVM_FIRST + 56)
Const LVM_GETITEMSTATE    = (LVM_FIRST + 44)
Const LVM_GETITEMTEXTW    = (LVM_FIRST + 115)
;#End Region

;#Region Header Control Messages
Const HDM_FIRST        =  $1200
Const HDM_GETITEMRECT  = (HDM_FIRST + 7)
Const HDM_HITTEST      = (HDM_FIRST + 6)
Const HDM_SETIMAGELIST = (HDM_FIRST + 8)
Const HDM_GETITEMW     = (HDM_FIRST + 11)
Const HDM_ORDERTOINDEX = (HDM_FIRST + 15)
;#End Region

;#Region Header Control Notifications
Const HDN_FIRST       = (0-300)
Const HDN_BEGINTRACKW = (HDN_FIRST-26)
Const HDN_ENDTRACKW   = (HDN_FIRST-27)
Const HDN_ITEMCLICKW  = (HDN_FIRST-22)
;#End Region

;#Region Header Control HitTest Flags
Const HHT_NOWHERE             = $0001
Const HHT_ONHEADER            = $0002
Const HHT_ONDIVIDER           = $0004
Const HHT_ONDIVOPEN           = $0008
Const HHT_ABOVE               = $0100
Const HHT_BELOW               = $0200
Const HHT_TORIGHT             = $0400
Const HHT_TOLEFT              = $0800
;#End Region

;#Region List View sub item portion
Const LVIR_BOUNDS = 0
Const LVIR_ICON   = 1
Const LVIR_LABEL  = 2
;#End Region

;#Region Cursor Type
;Const IDC_ARROW       = 32512
;Const IDC_IBEAM       = 32513
;Const IDC_WAIT        = 32514
;Const IDC_CROSS       = 32515
;Const IDC_UPARROW     = 32516
;Const IDC_SIZE        = 32640
;Const IDC_ICON        = 32641
;Const IDC_SIZENWSE    = 32642
;Const IDC_SIZENESW    = 32643
;Const IDC_SIZEWE      = 32644
;Const IDC_SIZENS      = 32645
;Const IDC_SIZEALL     = 32646
;Const IDC_NO          = 32648
;Const IDC_HAND        = 32649
;Const IDC_APPSTARTING = 32650
Const IDC_HELP        = 32651
;#End Region

;#Region Tracker Event Flags
Const TME_HOVER= $00000001
Const TME_LEAVE= $00000002
Const TME_QUERY= $40000000
Const TME_CANCEL= $80000000
;#End Region

;#Region Mouse Activate Flags
Const MA_ACTIVATE          = 1
Const MA_ACTIVATEANDEAT    = 2
Const MA_NOACTIVATE        = 3
Const MA_NOACTIVATEANDEAT  = 4
;#End Region

;#Region Dialog Codes
Const DLGC_WANTARROWS         = $0001
Const DLGC_WANTTAB            = $0002
Const DLGC_WANTALLKEYS        = $0004
Const DLGC_WANTMESSAGE        = $0004
Const DLGC_HASSETSEL          = $0008
Const DLGC_DEFPUSHBUTTON      = $0010
Const DLGC_UNDEFPUSHBUTTON= $0020
Const DLGC_RADIOBUTTON        = $0040
Const DLGC_WANTCHARS          = $0080
Const DLGC_STATIC             = $0100
Const DLGC_BUTTON             = $2000
;#End Region

;#Region Update Layered Windows Flags
Const ULW_COLORKEY = $00000001
Const ULW_ALPHA    = $00000002
Const ULW_OPAQUE   = $00000004
;#End Region

;#Region Blend Flags
Const AC_SRC_OVER  = $00
Const AC_SRC_ALPHA = $01
;#End Region

;#Region ComboBox messages
Const CB_GETDROPPEDSTATE = $0157
;#End Region

;#Region TreeView Messages
Const TV_FIRST            =  $1100
Const TVM_GETITEMRECT     = (TV_FIRST + 4)
Const TVM_SETIMAGELIST  = (TV_FIRST + 9)
Const TVM_HITTEST         = (TV_FIRST + 17)
Const TVM_SORTCHILDRENCB  = (TV_FIRST + 21)
Const TVM_GETITEMW        = (TV_FIRST + 62)
Const TVM_SETITEMW        = (TV_FIRST + 63)
Const TVM_INSERTITEMW     = (TV_FIRST + 50)
;#End Region

;#Region TreeViewImageListFlags
Const TVSIL_NORMAL  = 0
Const TVSIL_STATE   = 2
;#End Region

;#Region TreeViewItem Flags
Const TVIF_NONE               = $0000
Const TVIF_TEXT               = $0001
Const TVIF_IMAGE              = $0002
Const TVIF_PARAM              = $0004
Const TVIF_STATE              = $0008
Const TVIF_HANDLE             = $0010
Const TVIF_SELECTEDIMAGE      = $0020
Const TVIF_CHILDREN           = $0040
Const TVIF_INTEGRAL           = $0080
Const I_CHILDRENCALLBACK      = -1
Const LPSTR_TEXTCALLBACK      = -1
;Const I_IMAGECALLBACK   = -1
;Const I_IMAGENONE             = -2
;#End Region

;#Region ListViewItem flags
Const LVIF_TEXT               = $0001
Const LVIF_IMAGE              = $0002
Const LVIF_PARAM              = $0004
Const LVIF_STATE              = $0008
Const LVIF_INDENT             = $0010
Const LVIF_NORECOMPUTE        = $0800
;#End Region

;#Region HeaderItem flags
Const HDI_WIDTH               = $0001
Const HDI_HEIGHT              = HDI_WIDTH
Const HDI_TEXT                = $0002
Const HDI_FORMAT              = $0004
Const HDI_LPARAM              = $0008
Const HDI_BITMAP              = $0010
Const HDI_IMAGE               = $0020
Const HDI_DI_SETITEM          = $0040
Const HDI_ORDER               = $0080
;#End Region

;#Region GetDCExFlags
Const DCX_WINDOW           = $00000001
Const DCX_CACHE            = $00000002
Const DCX_NORESETATTRS     = $00000004
Const DCX_CLIPCHILDREN     = $00000008
Const DCX_CLIPSIBLINGS     = $00000010
Const DCX_PARENTCLIP       = $00000020
Const DCX_EXCLUDERGN       = $00000040
Const DCX_INTERSECTRGN     = $00000080
Const DCX_EXCLUDEUPDATE    = $00000100
Const DCX_INTERSECTUPDATE  = $00000200
Const DCX_LOCKWINDOWUPDATE = $00000400
Const DCX_VALIDATE         = $00200000
;#End Region

;#Region HitTest
Const HTERROR             = (-2)
Const HTTRANSPARENT       = (-1)
Const HTNOWHERE           =   0
Const HTCLIENT            =   1
Const HTCAPTION           =   2
Const HTSYSMENU           =   3
Const HTGROWBOX           =   4
Const HTSIZE              =   HTGROWBOX
Const HTMENU              =   5
Const HTHSCROLL           =   6
Const HTVSCROLL           =   7
Const HTMINBUTTON         =   8
Const HTMAXBUTTON         =   9
Const HTLEFT              =   10
Const HTRIGHT             =   11
Const HTTOP               =   12
Const HTTOPLEFT           =   13
Const HTTOPRIGHT          =   14
Const HTBOTTOM            =   15
Const HTBOTTOMLEFT        =   16
Const HTBOTTOMRIGHT       =   17
Const HTBORDER            =   18
Const HTREDUCE            =   HTMINBUTTON
Const HTZOOM              =   HTMAXBUTTON
Const HTSIZEFIRST         =   HTLEFT
Const HTSIZELAST          =   HTBOTTOMRIGHT
Const HTOBJECT            =   19
Const HTCLOSE             =   20
Const HTHELP              =   21
;#End Region

;#Region ActivateFlags
Const WA_INACTIVE     = 0
Const WA_ACTIVE       = 1
Const WA_CLICKACTIVE  = 2
;#End Region

;#Region StrechModeFlags
Const BLACKONWHITEConst   = 1
Const WHITEONBLACK        = 2
Const COLORONCOLOR        = 3
Const HALFTONE            = 4
Const MAXSTRETCHBLTMODE   = 4
;#End Region

;#Region ScrollBarFlags
Const SBS_HORZ                    = $0000
Const SBS_VERT                    = $0001
Const SBS_TOPALIGN                = $0002
Const SBS_LEFTALIGN               = $0002
Const SBS_BOTTOMALIGN             = $0004
Const SBS_RIGHTALIGN              = $0004
Const SBS_SIZEBOXTOPLEFTALIGN     = $0002
Const SBS_SIZEBOXBOTTOMRIGHTALIGN = $0004
Const SBS_SIZEBOX                 = $0008
Const SBS_SIZEGRIP                = $0010
;#End Region

;#Region System Metrics Codes
Const SM_CXSCREEN             = 0
Const SM_CYSCREEN             = 1
Const SM_CXVSCROLL            = 2
Const SM_CYHSCROLL            = 3
Const SM_CYCAPTION            = 4
Const SM_CXBORDER             = 5
Const SM_CYBORDER             = 6
Const SM_CXDLGFRAME           = 7
Const SM_CYDLGFRAME           = 8
Const SM_CYVTHUMB             = 9
Const SM_CXHTHUMB             = 10
Const SM_CXICON               = 11
Const SM_CYICON               = 12
Const SM_CXCURSOR             = 13
Const SM_CYCURSOR             = 14
Const SM_CYMENU               = 15
Const SM_CXFULLSCREEN         = 16
Const SM_CYFULLSCREEN         = 17
Const SM_CYKANJIWINDOW        = 18
Const SM_MOUSEPRESENT         = 19
Const SM_CYVSCROLL            = 20
Const SM_CXHSCROLL            = 21
Const SM_DEBUG                = 22
Const SM_SWAPBUTTON           = 23
Const SM_RESERVED1            = 24
Const SM_RESERVED2            = 25
Const SM_RESERVED3            = 26
Const SM_RESERVED4            = 27
Const SM_CXMIN                = 28
Const SM_CYMIN                = 29
Const SM_CXSIZE               = 30
Const SM_CYSIZE               = 31
Const SM_CXFRAME              = 32
Const SM_CYFRAME              = 33
Const SM_CXMINTRACK           = 34
Const SM_CYMINTRACK           = 35
Const SM_CXDOUBLECLK          = 36
Const SM_CYDOUBLECLK          = 37
Const SM_CXICONSPACING        = 38
Const SM_CYICONSPACING        = 39
Const SM_MENUDROPALIGNMENT    = 40
Const SM_PENWINDOWS           = 41
Const SM_DBCSENABLED          = 42
Const SM_CMOUSEBUTTONS        = 43
Const SM_CXFIXEDFRAME         = SM_CXDLGFRAME
Const SM_CYFIXEDFRAME         = SM_CYDLGFRAME
Const SM_CXSIZEFRAME          = SM_CXFRAME
Const SM_CYSIZEFRAME          = SM_CYFRAME
Const SM_SECURE               = 44
Const SM_CXEDGE               = 45
Const SM_CYEDGE               = 46
Const SM_CXMINSPACING         = 47
Const SM_CYMINSPACING         = 48
Const SM_CXSMICON             = 49
Const SM_CYSMICON             = 50
Const SM_CYSMCAPTION          = 51
Const SM_CXSMSIZE             = 52
Const SM_CYSMSIZE             = 53
Const SM_CXMENUSIZE           = 54
Const SM_CYMENUSIZE           = 55
Const SM_ARRANGE              = 56
Const SM_CXMINIMIZED          = 57
Const SM_CYMINIMIZED          = 58
Const SM_CXMAXTRACK           = 59
Const SM_CYMAXTRACK           = 60
Const SM_CXMAXIMIZED          = 61
Const SM_CYMAXIMIZED          = 62
Const SM_NETWORK              = 63
Const SM_CLEANBOOT            = 67
Const SM_CXDRAG               = 68
Const SM_CYDRAG               = 69
Const SM_SHOWSOUNDS           = 70
Const SM_CXMENUCHECK          = 71 
Const SM_CYMENUCHECK          = 72
Const SM_SLOWMACHINE          = 73
Const SM_MIDEASTENABLED       = 74
Const SM_MOUSEWHEELPRESENT    = 75
Const SM_XVIRTUALSCREEN       = 76
Const SM_YVIRTUALSCREEN       = 77
Const SM_CXVIRTUALSCREEN      = 78
Const SM_CYVIRTUALSCREEN      = 79
Const SM_CMONITORS            = 80
Const SM_SAMEDISPLAYFORMAT    = 81
Const SM_CMETRICS             = 83
;#End Region

;#Region ScrollBarTypes
Const SB_HORZ  = 0
Const SB_VERT  = 1
Const SB_CTL   = 2
Const SB_BOTH  = 3
;#End Region

;#Region SrollBarInfoFlags
Const SIF_RANGE           = $0001
Const SIF_PAGE            = $0002
Const SIF_POS             = $0004
Const SIF_DISABLENOSCROLL = $0008
Const SIF_TRACKPOS        = $0010
Const SIF_ALL             = (SIF_RANGE Or SIF_PAGE Or SIF_POS Or SIF_TRACKPOS)
;#End Region

;#Region Enable ScrollBar flags
Const ESB_ENABLE_BOTH     = $0000
Const ESB_DISABLE_BOTH    = $0003
Const ESB_DISABLE_LEFT    = $0001
Const ESB_DISABLE_RIGHT   = $0002
Const ESB_DISABLE_UP      = $0001
Const ESB_DISABLE_DOWN    = $0002
Const ESB_DISABLE_LTUP    = ESB_DISABLE_LEFT
Const ESB_DISABLE_RTDN    = ESB_DISABLE_RIGHT
;#End Region

;#Region Scroll Requests
Const SB_LINEUP           = 0
Const SB_LINELEFT         = 0
Const SB_LINEDOWN         = 1
Const SB_LINERIGHT        = 1
Const SB_PAGEUP           = 2
Const SB_PAGELEFT         = 2
Const SB_PAGEDOWN         = 3
Const SB_PAGERIGHT        = 3
Const SB_THUMBPOSITION    = 4
Const SB_THUMBTRACK       = 5
Const SB_TOP              = 6
Const SB_LEFT             = 6
Const SB_BOTTOM           = 7
Const SB_RIGHT            = 7
Const SB_ENDSCROLL        = 8
;#End Region

;#Region SrollWindowEx flags
Const SW_SCROLLCHILDREN   = $0001
Const SW_INVALIDATE       = $0002
Const SW_ERASE            = $0004
Const SW_SMOOTHSCROLL     = $0010
;#End Region

;#region ImageListFlags
Const ILC_MASK             = $0001
Const ILC_COLOR            = $0000
Const ILC_COLORDDB         = $00FE
Const ILC_COLOR4           = $0004
Const ILC_COLOR8           = $0008
Const ILC_COLOR16          = $0010
Const ILC_COLOR24          = $0018
Const ILC_COLOR32          = $0020
Const ILC_PALETTE          = $0800
;#end region

;#region ImageListDrawFlags
Const ILD_NORMAL              = $0000
Const ILD_TRANSPARENT         = $0001
Const ILD_MASK                = $0010
Const ILD_IMAGE               = $0020
Const ILD_ROP                 = $0040
Const ILD_BLEND25             = $0002
Const ILD_BLEND50             = $0004
Const ILD_OVERLAYMASK         = $0F00
;#end region

;#region List View Notifications
Const LVN_FIRST             = (0-100)
Const LVN_GETDISPINFOW      = (LVN_FIRST-77)
Const LVN_SETDISPINFOA      = (LVN_FIRST-51)
;#end region

;#region Drive Type
Const DRIVE_UNKNOWN     = 0
Const DRIVE_NO_ROOT_DIR = 1
Const DRIVE_REMOVABLE   = 2
Const DRIVE_FIXED       = 3
Const DRIVE_REMOTE      = 4
Const DRIVE_CDROM       = 5
Const DRIVE_RAMDISK     = 6
;#End region

;#region Shell File Info Flags
Const SHGFI_ICON              = $000000100
Const SHGFI_DISPLAYNAME       = $000000200
Const SHGFI_TYPENAME          = $000000400
Const SHGFI_ATTRIBUTES        = $000000800
Const SHGFI_ICONLOCATION      = $000001000 
Const SHGFI_EXETYPE           = $000002000
Const SHGFI_SYSICONINDEX      = $000004000
Const SHGFI_LINKOVERLAY       = $000008000  
Const SHGFI_SELECTED          = $000010000 
Const SHGFI_ATTR_SPECIFIED    = $000020000
Const SHGFI_LARGEICON         = $000000000
Const SHGFI_SMALLICON         = $000000001
Const SHGFI_OPENICON          = $000000002
Const SHGFI_SHELLICONSIZE     = $000000004
Const SHGFI_PIDL              = $000000008
Const SHGFI_USEFILEATTRIBUTES = $000000010
;#end region

;#region Shell Special Folder
Const CSIDL_DESKTOP                   = $0000
Const CSIDL_INTERNET                  = $0001
Const CSIDL_PROGRAMS                  = $0002
Const CSIDL_CONTROLS                  = $0003
Const CSIDL_PRINTERS                  = $0004
Const CSIDL_PERSONAL                  = $0005
Const CSIDL_FAVORITES                 = $0006
Const CSIDL_STARTUP                   = $0007
Const CSIDL_RECENT                    = $0008
Const CSIDL_SENDTO                    = $0009
Const CSIDL_BITBUCKET                 = $000a
Const CSIDL_STARTMENU                 = $000b
Const CSIDL_DESKTOPDIRECTORY          = $0010
Const CSIDL_DRIVES                    = $0011
Const CSIDL_NETWORK                   = $0012
Const CSIDL_NETHOOD                   = $0013
Const CSIDL_FONTS                     = $0014
Const CSIDL_TEMPLATES                 = $0015
Const CSIDL_COMMON_STARTMENU          = $0016
Const CSIDL_COMMON_PROGRAMS           = $0017
Const CSIDL_COMMON_STARTUP            = $0018
Const CSIDL_COMMON_DESKTOPDIRECTORY   = $0019
Const CSIDL_APPDATA                   = $001a
Const CSIDL_PRINTHOOD                 = $001b
Const CSIDL_ALTSTARTUP                = $001d        
Const CSIDL_COMMON_ALTSTARTUP         = $001e        
Const CSIDL_COMMON_FAVORITES          = $001f
Const CSIDL_INTERNET_CACHE            = $0020
Const CSIDL_COOKIES                   = $0021
Const CSIDL_HISTORY                   = $0022
;#end region

;#region ImageList Draw Colors
Const CLR_NONE= $FFFFFFFF
Const CLR_DEFAULT       = $FF000000
;#end region

;#region ShellEnumFlags
Const SHCONTF_FOLDERS         = 32      ;// For shell browser
Const SHCONTF_NONFOLDERS      = 64      ;// For Default view
Const SHCONTF_INCLUDEHIDDEN   = 128     ;// For hidden/system objects
;#end region


;#region ShellGetDisplayNameOfFlags
Const SHGDN_NORMALConst        = 0         ;// Default (display purpose)
Const SHGDN_INFOLDERConst      = 1         ;// displayed under a folder (relative)
Const SHGDN_INCLUDE_NONFILESYS = $2000;// If Not set display names For shell name space items that are Not in the file system will fail.
Const SHGDN_FORADDRESSBARConst = $4000     ;// For displaying in the address (drives dropdown) bar
Const SHGDN_FORPARSINGConst  = $8000     ;// For ParseDisplayName Or path
;#end region

;#region STRRETFlags
Const STRRET_WSTR     = $0000;// Use STRRET.pOleStr
Const STRRET_OFFSET   = $0001;// Use STRRET.uOffset To Ansi
Const STRRET_CSTR     = $0002;// Use STRRET.cStr
;#end region

;#region GetAttributeOfFlags
Const DROPEFFECT_NONE     = 0
Const DROPEFFECT_COPY     = 1
Const DROPEFFECT_MOVE     = 2
Const DROPEFFECT_LINK     = 4
Const DROPEFFECT_SCROLL     = $80000000
Const SFGAO_CANCOPY          = DROPEFFECT_COPY;// Objects can be copied
Const SFGAO_CANMOVE          = DROPEFFECT_MOVE;// Objects can be moved
Const SFGAO_CANLINK          = DROPEFFECT_LINK;// Objects can be linked
Const SFGAO_CANRENAME        = $00000010;// Objects can be renamed
Const SFGAO_CANDELETE        = $00000020;// Objects can be deleted
Const SFGAO_HASPROPSHEET     = $00000040;// Objects have property sheets
Const SFGAO_DROPTARGET       = $00000100;// Objects are drop target
Const SFGAO_CAPABILITYMASK   = $00000177
Const SFGAO_LINK             = $00010000;// Shortcut (link)
Const SFGAO_SHARE            = $00020000;// shared
Const SFGAO_READONLY         = $00040000;// Read-only
Const SFGAO_GHOSTED          = $00080000;// ghosted icon
Const SFGAO_HIDDEN           = $00080000;// hidden Object
Const SFGAO_DISPLAYATTRMASK  = $000F0000
Const SFGAO_FILESYSANCESTOR  = $10000000;// It contains file system folder
Const SFGAO_FOLDER           = $20000000;// It's a folder.
Const SFGAO_FILESYSTEM       = $40000000;// is a file system thing (file/folder/root)
Const SFGAO_HASSUBFOLDER     = $80000000;// Expandable in the map pane
Const SFGAO_CONTENTSMASK     = $80000000
Const SFGAO_VALIDATE         = $01000000;// invalidate cached information
Const SFGAO_REMOVABLE        = $02000000;// is this removeable media?
Const SFGAO_COMPRESSED       = $04000000;// Object is compressed (use alt Color)
Const SFGAO_BROWSABLE        = $08000000;// is in-place browsable
Const SFGAO_NONENUMERATED    = $00100000;// is a non-enumerated Object
Const SFGAO_NEWCONTENT       = $00200000;// should show bold in explorer tree
;#end region

;#region ListViewItemState
Const LVIS_FOCUSED            = $0001
Const LVIS_SELECTED           = $0002
Const LVIS_CUT                = $0004
Const LVIS_DROPHILITED        = $0008
Const LVIS_ACTIVATING         = $0020
Const LVIS_OVERLAYMASK        = $0F00
Const LVIS_STATEIMAGEMASK     = $F000
;#end region

;#region TreeViewItemInsertPosition
Const TVI_ROOT                = $FFFF0000
Const TVI_FIRST               = $FFFF0001
Const TVI_LAST                = $FFFF0002
Const TVI_SORT                = $FFFF0003
;#end region

;#region TreeViewNotifications
Const TVN_FIRST               =  -400
Const TVN_SELCHANGINGA        = (TVN_FIRST-1)
Const TVN_SELCHANGINGW        = (TVN_FIRST-50)
Const TVN_SELCHANGEDA         = (TVN_FIRST-2)
Const TVN_SELCHANGEDW         = (TVN_FIRST-51)
Const TVN_GETDISPINFOA        = (TVN_FIRST-3)
Const TVN_GETDISPINFOW        = (TVN_FIRST-52)
Const TVN_SETDISPINFOA        = (TVN_FIRST-4)
Const TVN_SETDISPINFOW        = (TVN_FIRST-53)
Const TVN_ITEMEXPANDINGA      = (TVN_FIRST-5)
Const TVN_ITEMEXPANDINGW      = (TVN_FIRST-54)
Const TVN_ITEMEXPANDEDA       = (TVN_FIRST-6)
Const TVN_ITEMEXPANDEDW       = (TVN_FIRST-55)
Const TVN_BEGINDRAGA          = (TVN_FIRST-7)
Const TVN_BEGINDRAGW          = (TVN_FIRST-56)
Const TVN_BEGINRDRAGA         = (TVN_FIRST-8)
Const TVN_BEGINRDRAGW         = (TVN_FIRST-57)
Const TVN_DELETEITEMA         = (TVN_FIRST-9)
Const TVN_DELETEITEMW         = (TVN_FIRST-58)
Const TVN_BEGINLABELEDITA     = (TVN_FIRST-10)
Const TVN_BEGINLABELEDITW     = (TVN_FIRST-59)
Const TVN_ENDLABELEDITA       = (TVN_FIRST-11)
Const TVN_ENDLABELEDITW       = (TVN_FIRST-60)
Const TVN_KEYDOWN             = (TVN_FIRST-12)
Const TVN_GETINFOTIPA         = (TVN_FIRST-13)
Const TVN_GETINFOTIPW         = (TVN_FIRST-14)
Const TVN_SINGLEEXPAND        = (TVN_FIRST-15)
;#end region

;#region TreeViewItemExpansion
Const TVE_COLLAPSE            = $0001
Const TVE_EXPAND              = $0002
Const TVE_TOGGLE              = $0003
Const TVE_EXPANDPARTIAL       = $4000
Const TVE_COLLAPSERESET       = $8000
;#end region

;#region WinErrors
Const NOERROR = $00000000
;#end region

;#region TreeViewHitTest
Const TVHT_NOWHERE           = $0001
Const TVHT_ONITEMICON        = $0002
Const TVHT_ONITEMLABEL       = $0004
Const TVHT_ONITEMINDENT      = $0008
Const TVHT_ONITEMBUTTON      = $0010
Const TVHT_ONITEMRIGHT       = $0020
Const TVHT_ONITEMSTATEICON   = $0040
Const TVHT_ABOVE             = $0100
Const TVHT_BELOW             = $0200
Const TVHT_TORIGHT           = $0400
Const TVHT_TOLEFT            = $0800
Const TVHT_ONITEM            = (TVHT_ONITEMICON Or TVHT_ONITEMLABEL Or TVHT_ONITEMSTATEICON)
;#End Region

;#Region TreeViewItemState
Const TVIS_SELECTED           = $0002
Const TVIS_CUT                = $0004
Const TVIS_DROPHILITED        = $0008
Const TVIS_BOLD               = $0010
Const TVIS_EXPANDED           = $0020
Const TVIS_EXPANDEDONCE       = $0040
Const TVIS_EXPANDPARTIAL      = $0080
Const TVIS_OVERLAYMASK        = $0F00
Const TVIS_STATEIMAGEMASK     = $F000
Const TVIS_USERMASK           = $F000
;#End Region

;#Region Windows System Objects
;// Reserved IDs For system objects
Const OBJID_WINDOW        = $00000000
Const OBJID_SYSMENU       = $FFFFFFFF
Const OBJID_TITLEBAR      = $FFFFFFFE
Const OBJID_MENU          = $FFFFFFFD
Const OBJID_CLIENT        = $FFFFFFFC
Const OBJID_VSCROLL       = $FFFFFFFB
Const OBJID_HSCROLL       = $FFFFFFFA
Const OBJID_SIZEGRIP      = $FFFFFFF9
Const OBJID_CARET         = $FFFFFFF8
Const OBJID_CURSOR        = $FFFFFFF7
Const OBJID_ALERT         = $FFFFFFF6
Const OBJID_SOUND         = $FFFFFFF5
;#End Region

;#Region SystemState

Const STATE_SYSTEM_UNAVAILABLE        = $00000001 ;// Disabled
Const STATE_SYSTEM_SELECTED           = $00000002
Const STATE_SYSTEM_FOCUSED            = $00000004
Const STATE_SYSTEM_PRESSED            = $00000008
Const STATE_SYSTEM_CHECKED            = $00000010
Const STATE_SYSTEM_MIXED              = $00000020 ;// 3-state checkbox Or toolbar button
Const STATE_SYSTEM_READONLY           = $00000040
Const STATE_SYSTEM_HOTTRACKED         = $00000080
Const STATE_SYSTEM_DEFAULT            = $00000100
Const STATE_SYSTEM_EXPANDED           = $00000200
Const STATE_SYSTEM_COLLAPSED          = $00000400
Const STATE_SYSTEM_BUSY               = $00000800
Const STATE_SYSTEM_FLOATING           = $00001000 ;// Children "owned" Not "contained" by parent
Const STATE_SYSTEM_MARQUEED           = $00002000
Const STATE_SYSTEM_ANIMATED           = $00004000
Const STATE_SYSTEM_INVISIBLE          = $00008000
Const STATE_SYSTEM_OFFSCREEN          = $00010000
Const STATE_SYSTEM_SIZEABLE           = $00020000
Const STATE_SYSTEM_MOVEABLE           = $00040000
Const STATE_SYSTEM_SELFVOICING        = $00080000
Const STATE_SYSTEM_FOCUSABLE          = $00100000
Const STATE_SYSTEM_SELECTABLE         = $00200000
Const STATE_SYSTEM_LINKED             = $00400000
Const STATE_SYSTEM_TRAVERSED          = $00800000
Const STATE_SYSTEM_MULTISELECTABLE    = $01000000  ;// Supports multiple selection
Const STATE_SYSTEM_EXTSELECTABLE      = $02000000  ;// Supports extended selection
Const STATE_SYSTEM_ALERT_LOW          = $04000000  ;// This information is of low priority
Const STATE_SYSTEM_ALERT_MEDIUM       = $08000000  ;// This information is of medium priority
Const STATE_SYSTEM_ALERT_HIGH         = $10000000  ;// This information is of high priority
Const STATE_SYSTEM_VALID              = $1FFFFFFF
;#End Region


;#Region QueryContextMenuFlags
Const CMF_NORMAL              = $00000000
Const CMF_DEFAULTONLY         = $00000001
Const CMF_VERBSONLY           = $00000002
Const CMF_EXPLORE             = $00000004
Const CMF_NOVERBS             = $00000008
Const CMF_CANRENAME           = $00000010
Const CMF_NODEFAULT           = $00000020
Const CMF_INCLUDESTATIC       = $00000040
Const CMF_RESERVED            = $ffff0000 
;#End Region

;#Region GetWindowLongFlags
Const GWL_WNDPROC         = (-4)
Const GWL_HINSTANCE       = (-6)
Const GWL_HWNDPARENT      = (-8)
Const GWL_STYLE           = (-16)
Const GWL_EXSTYLE         = (-20)
Const GWL_USERDATA        = (-21)
Const GWL_ID              = (-12)
;#End Region


You know. I have waited over 24 hours for an answer. I'm sorry if I sound snippy or incorrect, but all's I need help with is getting the select to work right. Right now, I don't CARE about lag. I provided the constants above because I think there is a constant that is disabling me from drag dropping a file.

If someone would PLEASE be kind enough to help me fix this, it would be GREATLY appreciated.

~DarkShadowWing~

If someone would PLEASE be kind enough to help me fix this...


We are trying to help, but you need to play a more active role.

You haven't shown us any code we can actually run. So the best anyone can do is read some code fragments and make educated guesses. And I guarantee nobody will examine two thousand arbitrary hex values looking for a bad one.

I still suggest you write a very simple test app. This would probably need about three constants out of the enormous list you posted. You could put them in the code directly, no need for any Includes.

There are two benefits to this. The main one is to clarify your understanding of how drag-drop and events are being handled. The other is that you will have some reasonably sized code to post here. There would then be a realistic chance of getting some help.

ok. well here's what ill do. do you have an email, or msn, or aim or yahoo? if so, may i please get it? ill send you a small example w/ few constants if you're willing to help me. =)

Thanks floyd =)

~DarkShadowWing~

floyd?..

ok. well here's what ill do.

Why don't you just do what he suggested instead of coming up with your own version? You're the one asking for help, but you never seem to want to actually do anything to make it any easier to help you.

i do. id just like to get his email so i can send him the code.

He didn't ask you to send him the code. He said

The other is that you will have some reasonably sized code to post here. There would then be a realistic chance of getting some help.


Post the code first. Worry about getting his email address later.

ok. ill post it. but its only to get debugged. its copyright. =)

i apologize for the inconvenience. i just don't like to post code b/c i know some n00bs out there try to steal it & claim it as theirs. thats why i only post portions.

but in this case, i REALLY need this fixed so ill post the whole thing.

itll be 2 posts, cuz it needs const.bb to run.

PLEASE feel free to do whatever it takes to fix it. take stuff out, i don't care. =)

Here's the main code:

Global debug
a1$ = CommandLine$()

If a1$="\debug" Then 
Print "Debug mode is on!"
debug=1
Else
Print "No debugging activated."
debug=0
End If

Delay 1000

Include "Const.bb"

;;Const WM_PAINT = $000F

Global x = -1

Global y = -1

Global z

AppTitle "Particlos"

Graphics3D 1024,768, 32, 2

Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),0,0,GraphicsWidth(),GraphicsHeight())

Global copyright$ = "Copyright (c) 2008 - 2009 Photo-Xtreme"+Chr$(13)+"          Created by: ~ZeldaX~"

Global w
 
Global FrameStart
Global DeltaTime# = 0.1
Global GameTime# = 0
Global framesrate#
Const FPS = 220
Global aFPS = 990
Global FPSCount = aFPS
Global timFPS
Global menus
Global req
Global snd
Global snd1


Global snd2

Global PlaySound1

Global playa

Global menu1

Global menuii

Global menuselect = 0
Global file1$

Global keypressed
Global menu

Const NUMCOMETS% = 4
Dim Comets%(NUMCOMETS)
Dim Xspeeds#(NUMCOMETS)
Dim Yspeeds#(NUMCOMETS)
Dim Zspeeds#(NUMCOMETS)

; CREATE AND FEED EMITTERS
Dim TrailEmitters%  (NUMCOMETS)
Dim ImpactEmitters% (NUMCOMETS)

Global CometTex   = LoadTexture("Media\fountain.jpg")
 
WB3D_HotKeyEvent MOD_CONTROL,65,1	; ctrl+a
WB3D_HotKeyEvent MOD_CONTROL,76,78	; ctrl+l

;WB3D_HotKeyEvent MOD_CONTROL,76,

; menus

menus = WB3D_WindowMenu(RuntimeWindow_hWnd)
file = WB3D_CreateMenu("&File",0,menus,0)
	OpenItem = WB3D_CreateMenu("Open",1,file,0) 
	
	SaveItem = WB3D_CreateMenu("Save",2,file,0)

	WB3D_CreateMenu("",0,file,0)
	QuitItem = WB3D_CreateMenu("Quit",3,file,0)

about = WB3D_CreateMenu("About",0,menus,1)

about1 = WB3D_CreateMenu("About...",4,about,0)

compile = WB3D_CreateMenu("Compile Code",5,menus,0)
		
u=WB3D_UpdateWindowMenu(RuntimeWindow_hWnd)


statusbar = WB3D_CreateStatusBar(RuntimeWindow_hWnd,"")
s1=WB3D_SetStatusParts(statusbar,5+1)

s2=WB3D_StatusPartWidth(statusbar,0,150)
s3=WB3D_StatusPartWidth(statusbar,1,150)
s4=WB3D_StatusPartWidth(statusbar,2,150)
s5=WB3D_StatusPartWidth(statusbar,3,150)
s6=WB3D_StatusPartWidth(statusbar,4,150)
s7=WB3D_StatusPartWidth(statusbar,5,150)
s8=WB3D_StatusPartWidth(statusbar,6,150)

WB3D_UpdateStatusbar(statusbar)

WB3D_FlushEvents()

; setup out quit flag, and loop until the flag is set.
QUIT = 0

Light  = CreateLight()

Listener = CreateListener(Cam, .005, 1, 1)

Include "particle candy.bb"
Include "particle types.bb"

cam = CreateCamera()

PositionEntity cam, 0, 1, 0

Global test

;snd=LoadSound(file1$)

p1=InitParticles(cam,"Media\particles.png", 3)
p2=SetParticleUpdateCycle(2)

EM0 = CreateEmitter_Test()
EM1 = CreateEmitter_Rocks()
EM2 = CreateEmitter_Explosion1()
EM3 = CreateEmitter_Explosion2()
EM4 = CreateEmitter_Smoke()
EM5 = CreateEmitter_Torch()
EM6 = CreateEmitter_Sparks()
EM7 = CreateEmitter_FlameThrower()
EM8 = CreateEmitter_Waterfall()
EM9 = CreateEmitter_WaterFontain()
EM10 = CreateEmitter_SmokeFlares()
EM11 = CreateEmitter_Comet(test)

period=1000/FPS
ztime=MilliSecs()-period

test1 = WB3D_CreateWindow("Test",x,y,GraphicsWidth()/8,GraphicsHeight()-71,RuntimeWindow_hWnd, WINDOW_TITLEBAR) ;Or Window_Minimize Or WindowResizable)

WB3D_DragAcceptFiles(RuntimeWindow_hWnd, 1)
WB3D_DragAcceptFiles(test1, 1)

tabber = WB3D_CreateTabber(0,0,240,150,test1,0)
WB3D_SetGadgetIconStrip(tabber,icons)
ss11=WB3D_CreateToolTip(tabber,"Im a tabber tooltip",0)

For loop = 0 To 10
	icon_index = Rnd(0,5)
	WB3D_AddGadgetItem tabber,"item: "+loop,0,icon_index
Next

panel0 = WB3D_CreateTabberPanel(5,30,200,100,tabber)
button_tab0 = WB3D_CreateButton("Show Panel Splash",5,10,190,40,panel0,0)
WB3D_CreateToolTip button_tab0,"show me the splash",1

font = WB3D_OpenFont("blitz",8,8,True,True,True) ; set bold ,italic ,underline to true
WB3D_Usefont button_tab0,font


panel1 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab1 = WB3D_CreateButton("Tab1",10,10,100,20,panel1,0)
WB3D_HideGadget panel1

panel2 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab2 = WB3D_CreateButton("Tab2",10,10,100,20,panel2,0)
WB3D_HideGadget panel2

panel3 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab3 = WB3D_CreateButton("Tab3",10,10,100,20,panel3,0)
WB3D_HideGadget panel3

blah = WB3D_CreateCheckButton("test", 50, 50, 110, 110, test1, 0)

Global l_surface=CreateSprite(cam)
Global width=GraphicsWidth(),height=GraphicsHeight()

SpriteViewMode l_surface,2
PositionEntity l_surface,0,0,1
EntityOrder l_surface,-100
ScaleSprite l_surface, 1, 0.75

Global l_texture=CreateTexture(width,height,1+256)
TextureBlend l_texture,2
ScaleTexture l_texture, (Float TextureWidth(l_texture)/Float width),(Float TextureHeight(l_texture)/Float Height)

EntityTexture l_surface,l_texture
EntityAlpha l_surface,.3

Global cspeed# = .1

Global cspeed1#

If debug Then t=WB3D_CreateTextArea(GraphicsWidth()/2-550/2, GraphicsHeight()/2-150/2, 550, 150, Runtimewindow_hWnd, 0)

While Not QUIT = 1 Or KeyHit(1)

If debug

WB3D_SetTextAreaText(t, "x="+x+Chr$(13)+"y="+y+Chr$(13)+"z="+z+Chr$(13))
WB3D_SetTextAreaText(t, "Runtimewindow_hWnd="+Runtimewindow_hWnd+Chr$(13))
WB3D_SetTextAreaText(t, "copyright$="+copyright$+Chr$(13))
WB3D_SetTextAreaText(t, "    w="+w+Chr$(13))

WB3D_SetTextAreaText(t, "FrameStart="+FrameStart+Chr$(13))
WB3D_SetTextAreaText(t, "DeltaTime#="+DeltaTime#+Chr$(13))
WB3D_SetTextAreaText(t, "GameTime#="+GameTime#+Chr$(13))
WB3D_SetTextAreaText(t, "framerate#="+framesrate#+Chr$(13))
WB3D_SetTextAreaText(t, "FPS="+FPS+Chr$(13))
WB3D_SetTextAreaText(t, "aFPS="+aFPS+Chr$(13))
WB3D_SetTextAreaText(t, "FPSCount="+FPSCount+Chr$(13))
WB3D_SetTextAreaText(t, "timFPS="+timFPS+Chr$(13))
WB3D_SetTextAreaText(t, "menus="+menus+Chr$(13))
WB3D_SetTextAreaText(t, "req="+req+Chr$(13))
WB3D_SetTextAreaText(t, "snd="+snd+Chr$(13))
WB3D_SetTextAreaText(t, "snd1="+snd1+Chr$(13))
WB3D_SetTextAreaText(t, "snd2="+snd2+Chr$(13))
WB3D_SetTextAreaText(t, "PlaySound="+PlaySound1+Chr$(13))
WB3D_SetTextAreaText(t, "playa="+playa+Chr$(13))
WB3D_SetTextAreaText(t, "menu1="+menu1+Chr$(13))

WB3D_SetTextAreaText(t, "menuii="+menuii+Chr$(13))
WB3D_SetTextAreaText(t, "menuselect="+menuselect+Chr$(13))
WB3D_SetTextAreaText(t, "file1$="+file1$+Chr$(13))
WB3D_SetTextAreaText(t, "keypressed="+keypressed+Chr$(13))
WB3D_SetTextAreaText(t, "menu="+menu+Chr$(13))

WB3D_SetTextAreaText(t, "NUMCOMETS="+NUMCOMETS%+Chr$(13))
WB3D_SetTextAreaText(t, "Comets="+Comets%(NUMCOMETS)+Chr$(13))
WB3D_SetTextAreaText(t, "Xspeeds#="+Xspeeds#(NUMCOMETS)+Chr$(13))
WB3D_SetTextAreaText(t, "Yspeeds#="+Yspeeds#(NUMCOMETS)+Chr$(13))
WB3D_SetTextAreaText(t, "Zspeeds#="+Zspeeds#(NUMCOMETS)+Chr$(13))
WB3D_SetTextAreaText(t, "TrailEmitters="+TrailEmitters%  (NUMCOMETS)+Chr$(13))
WB3D_SetTextAreaText(t, "ImpactEmitters="+ImpactEmitters% (NUMCOMETS)+Chr$(13))
WB3D_SetTextAreaText(t, "CometTex="+CometTex+Chr$(13))

WB3D_SetTextAreaText(t, "menus="+menus+Chr$(13))
WB3D_SetTextAreaText(t, "file="+file+Chr$(13))
WB3D_SetTextAreaText(t, "OpenItem="+OpenItem+Chr$(13))
WB3D_SetTextAreaText(t, "SaveItem="+SaveItem+Chr$(13))
WB3D_SetTextAreaText(t, "QuitItem="+QuitItem+Chr$(13))
WB3D_SetTextAreaText(t, "about="+about+Chr$(13))
WB3D_SetTextAreaText(t, "about1="+about1+Chr$(13))

WB3D_SetTextAreaText(t, "compile="+compile+Chr$(13))
WB3D_SetTextAreaText(t, "u="+u+Chr$(13))

WB3D_SetTextAreaText(t, "s1="+s1+Chr$(13))
WB3D_SetTextAreaText(t, "s2="+s2+Chr$(13))
WB3D_SetTextAreaText(t, "s3="+s3+Chr$(13))
WB3D_SetTextAreaText(t, "s4="+s4+Chr$(13))
WB3D_SetTextAreaText(t, "s5="+s5+Chr$(13))
WB3D_SetTextAreaText(t, "s6="+s6+Chr$(13))
WB3D_SetTextAreaText(t, "s7="+s7+Chr$(13))
WB3D_SetTextAreaText(t, "s8="+s8+Chr$(13))

WB3D_SetTextAreaText(t, "QUIT="+QUIT+Chr$(13))
WB3D_SetTextAreaText(t, "Light="+Light+Chr$(13))
WB3D_SetTextAreaText(t, "Listener="+Listener+Chr$(13))
WB3D_SetTextAreaText(t, "cam="+cam+Chr$(13))

WB3D_SetTextAreaText(t, "Cam X="+EntityX(cam)+Chr$(13))
WB3D_SetTextAreaText(t, "Cam Y="+EntityY(cam)+Chr$(13))
WB3D_SetTextAreaText(t, "Cam Z="+EntityZ(cam)+Chr$(13))
WB3D_SetTextAreaText(t, "test="+test+Chr$(13))
WB3D_SetTextAreaText(t, "snd="+snd+Chr$(13))

WB3D_SetTextAreaText(t, "p1="+p1+Chr$(13))
WB3D_SetTextAreaText(t, "p2="+p2+Chr$(13))

WB3D_SetTextAreaText(t, "EM0="+EM0+Chr$(13))
WB3D_SetTextAreaText(t, "EM1="+EM1+Chr$(13))
WB3D_SetTextAreaText(t, "EM2="+EM2+Chr$(13))
WB3D_SetTextAreaText(t, "EM3="+EM3+Chr$(13))
WB3D_SetTextAreaText(t, "EM4="+EM4+Chr$(13))
WB3D_SetTextAreaText(t, "EM5="+EM5+Chr$(13))
WB3D_SetTextAreaText(t, "EM6="+EM6+Chr$(13))
WB3D_SetTextAreaText(t, "EM7="+EM7+Chr$(13))
WB3D_SetTextAreaText(t, "EM8="+EM8+Chr$(13))
WB3D_SetTextAreaText(t, "EM9="+EM9+Chr$(13))
WB3D_SetTextAreaText(t, "EM10="+EM10+Chr$(13))
WB3D_SetTextAreaText(t, "EM11="+EM11+Chr$(13))

WB3D_SetTextAreaText(t, "period="+period+Chr$(13))
WB3D_SetTextAreaText(t, "ztime="+ztime+Chr$(13))

WB3D_SetTextAreaText(t, "test1="+test1+Chr$(13))
WB3D_SetTextAreaText(t, "tabber="+tabber+Chr$(13))

WB3D_SetTextAreaText(t, "ss11="+ss11+Chr$(13))

For loop = 0 To 10
	icon_index = Rnd(0,5)
	item=WB3D_AddGadgetItem(tabber,"item: "+loop,0,icon_index)
	WB3D_SetTextAreaText(t, "icon_index "+loop+"="+icon_index+Chr$(13))
Next
WB3D_SetTextAreaText(t, "item="+item+Chr$(13))


WB3D_SetTextAreaText(t, "panel0="+panel0+Chr$(13))
WB3D_SetTextAreaText(t, "button_tab0="+button_tab0+Chr$(13))
WB3D_SetTextAreaText(t, "font="+font+Chr$(13))
WB3D_SetTextAreaText(t, "panel1="+panel1+Chr$(13))
WB3D_SetTextAreaText(t, "button_tab1="+button_tab1+Chr$(13))
WB3D_SetTextAreaText(t, "panel2="+panel2+Chr$(13))
WB3D_SetTextAreaText(t, "button_tab2="+button_tab2+Chr$(13))
WB3D_SetTextAreaText(t, "panel3="+panel3+Chr$(13))
WB3D_SetTextAreaText(t, "button_tab3="+button_tab3+Chr$(13))
WB3D_SetTextAreaText(t, "blah="+blah+Chr$(13))
WB3D_SetTextAreaText(t, "l_surface="+l_surface+Chr$(13))
WB3D_SetTextAreaText(t, "width="+width+Chr$(13))
WB3D_SetTextAreaText(t, "height="+height+Chr$(13))
WB3D_SetTextAreaText(t, "l_surface X="+EntityX(l_surface)+Chr$(13))
WB3D_SetTextAreaText(t, "l_surface Y="+EntityY(l_surface)+Chr$(13))
WB3D_SetTextAreaText(t, "l_surface Z="+EntityZ(l_surface)+Chr$(13))
WB3D_SetTextAreaText(t, "l_texture="+l_texture+Chr$(13))
WB3D_SetTextAreaText(t, "cspeed#="+cspeed#+Chr$(13))
WB3D_SetTextAreaText(t, "cspeed1#="+cspeed1#+Chr$(13))
WB3D_SetTextAreaText(t, "debug="+debug+Chr$(13))

If snd2 = 1 Then WB3D_SetTextAreaText(t, "test="+test+Chr$(13))

WB3D_UpdateTextArea t

EndIf

cspeed1# = (KeyDown(200)-KeyDown(208))*cspeed#

;If cspeed1# >= cspeed# Or cspeed1# <= -cspeed# Then alpha# = 0.9

If debug = 0

If api_IsHungAppWindow(test1) Or api_IsHungAppWindow(Runtimewindow_hWnd) Then WB3D_Notify "WARNING","Window is froze",0 : Exit

mainwindow_x = GraphicsWidth()

mainwindow_y = GraphicsHeight()

mainwindow_x2 = GraphicsWidth()

mainwindow_yii = GraphicsHeight()

window_x = GraphicsWidth()/4

window_y = GraphicsHeight()-71

window_x2 = GraphicsWidth()/4

window_yii = GraphicsHeight()-71

mainmove = api_MoveWindow(Runtimewindow_hWnd, 0, 0, mainwindow_x, mainwindow_y, WM_PAINT)

move = api_MoveWindow(test1, 0, 0, window_x, window_y, WM_PAINT)

EndIf

timeStart=MilliSecs()

WB3D_SetStatusText statusbar,0,"FPS:"+framesrate#
WB3D_SetStatusText statusbar,1,"menu:"+menu

WB3D_SetStatusText statusbar,2,"menu1:"+menu1
WB3D_SetStatusText statusbar,3,"menuii:"+menuii

WB3D_SetStatusText statusbar,4,"playa:"+playa
WB3D_SetStatusText statusbar,5,"chanplay:"+ChannelPlaying(snd1)

t=WB3D_CreateToolTip%(statusbar,"test",0)
WB3D_SetToolTipText(t,"test")

time$ = CurrentTime$()

If time$ >= 12 Then am_pm$ = "PM"

If time$ < 12 Then am_pm$ = "AM"

WB3D_SetStatusText statusbar,6,"Time: "+time$+" "+am_pm$

	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_MENU
		
		    Select WB3D_EventData()
					
				Case 1
				
					ext$ = "*.mid"+Chr$(0)+"*.mid"+Chr$(0)+"*.mp3"+Chr$(0)+"*.mp3"+Chr$(0)
					file1$ = WB3D_OpenFileRequest("..","..",ext$,"") : test = 1
											
				If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" 
				req = 1
				Else
				req = 0
				EndIf
				
				If req Then snd = LoadSound(file1$) : request() : test = 1
				
				If test = 1 And ChannelPlaying(snd1)
				Emitter_Start(EM8)

				EndIf
										
				Case 2
					
				Case 3
					QUIT = 1
					
				Case 4
					WB3D_Notify "Menu",copyright$,0
				
				Case 5
				    Write_BB("Test", "Test.bb")
				
				Case 6
			
			Case WB3D_EVENT_DRAGDROP
			
			For do_files = 0 To WB3D_CountDroppedFiles()
		              	file1$ = WB3D_DroppedFileName(do_files)
		
 				If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" 
				req = 1
				Else
				req = 0
				EndIf
								
			Next
			
			End Select
					
						event = WB3D_WaitEvent()	
	                   Select event			
						
							Case tabber
					selectedtab = WB3D_EventData()
					
					Select selectedtab
					
						Case 0
							WB3D_ShowGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 1
							WB3D_ShowGadget panel1
							WB3D_HideGadget panel0
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 2
							WB3D_ShowGadget panel2
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel3
					
						Case 3
							WB3D_ShowGadget panel3
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
					
					Default
										
						WB3D_Notify "Tab Selected","Tab Selected "+selectedtab,0
	
						WB3D_HideGadget panel0
						WB3D_HideGadget panel1
						WB3D_HideGadget panel2
						WB3D_HideGadget panel3	
											
				End Select
				
			End Select
				
		Case WB3D_EVENT_WINDOW_CLOSE
			;WB3D_ShowGadget RuntimeWindow_hWnd
	
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
					
				
			End Select
		End Select
									
	Repeat
		elapsed=MilliSecs()-ztime
	Until elapsed

	;how many 'frames' have elapsed	
	ticks=elapsed/period
	
	;fractional remainder
	tween#=Float(elapsed Mod period)/Float(period)

   ; Frame Update
    FrameStart = MilliSecs()
    If timFPS < FrameStart Then
        aFPS = FPSCount
        FPSCount = 0
        timFPS = FrameStart + 1000
        DeltaTime = 1.0 / Float(aFPS)
        GameTime = GameTime + DeltaTime
    EndIf
	
	For k=1 To ticks
		ztime=ztime+period
		If k=ticks Then CaptureWorld
		
		If KeyDown(200) Or KeyDown(208) MoveEntity cam, 0, 0, cspeed1#

If KeyDown(203) Or KeyDown(205) TurnEntity cam, 0, (KeyDown(203)-KeyDown(205))*1, 0

If em8 <> 0

PositionEntity em8, 0, 1, 20

EndIf
 
x = 0 : y = 0
		
		If em8 > 0 Or em9 > 0 Or em11 > 0 Then 

        updateParticles()

		EndIf
		
		If em8 = 0 Then FreeParticleSystem()
		
		If ChannelPlaying(snd1) = 1 And file1$ Then FreeSound snd
		
		UpdateWorld
	Next
	
;		FPSCount = FPSCount + 1

l_update()
		
	RenderWorld tween
	
timeEnd=MilliSecs()
elapsed=(timeEnd-TimeStart)

framesrate# = ((1000-elapsed)/FPS)

If WB3D_EventData() Then c = c + 1

If WB3D_EventData() Then DebugLog c+" "+WB3D_EventData() : DebugLog event

Text GraphicsWidth()/2, GraphicsHeight()/2+20, event

Text width/2, height/2+40, cspeed1#

Text width/2, height/2+80, cspeed# : Text width/2, height/2+100, test

Text width/2, height/2+120, req

Text GraphicsWidth()/2, GraphicsHeight()/2, wb3d_event_dragdrop

	Flip

Wend

; use notify using external winapi constants. 
If ChannelPlaying(snd1)

stopm()

EndIf

WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK

WB3D_EndGUI()
EndGraphics
End

Function l_setAlpha(alpha#)

EntityAlpha l_surface,alpha#

End Function

Function l_update()

CopyRect 0,0,width,Height,0,0,BackBuffer(),TextureBuffer(l_texture)

End Function

Function notify()

WB3D_Notify "WARNING","Sorry, but file "+file1$+" is invalid.",0

End Function

Function request()
					
If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid"

playa = 1
					
EndIf

If playa Then play()

If test = 1
stopm()

play()

EndIf

Return z

End Function

Function play()
																				
If ChannelPlaying(snd1) = 0 And playa

If FileExtension(file1$) = ".mid"

music  = BASS_MIDI_StreamCreateFile(0,file1$,0,0,0,0) : test = 1 ; we load a midi file

If Not BASS_ChannelPlay (music,0) RuntimeError "Midi file not ready!" ; we play the file

Else

If FileExtension(file1$) = ".mp3" And ChannelPlaying(snd1) = 0 Then

load_music()

EndIf

EndIf

Else

If ChannelPlaying(snd1) And playa

stopm()

play()

EndIf

EndIf

If menus = 1

menu1 = file1$
					
menuii = FileExtension(file1$)

EndIf
										
End Function

Function stopm()

If playa = 1

StopChannel snd1

EndIf

End Function

Function load_music()

snd1 = PlaySound(snd)

End Function

Function Write_BB(appname$, filedata$)

readme=WriteFile("README.txt")

WriteLine readme, "Please use Blitz3D to compile your project!"

file=WriteFile(filedata$)

WriteLine file, "AppTitle "+Chr$(34)+appname$+Chr$(34)

WriteLine file, ""

WriteLine file, "Graphics3D "+screenwidth+", "+screenheight+", "+screendepth+", "+screenmode

WriteLine file, ""

WriteLine file, "cam = CreateCamera()"

WriteLine file, "CameraRange cam, .1, 1000000"

WriteLine file, "PositionEntity cam, "+xcam+", 1, "+zcam

WriteLine file, ""

WriteLine file, "Land = CreatePlane()"

WriteLine file, ""

WriteLine file, "While Not Keyhit(1)"

WriteLine file, ""

WriteLine file, "If KeyDown(200) Or KeyDown(208) MoveEntity cam, 0, 0, (KeyDown(200)-KeyDown(208))*1"

WriteLine file, "If KeyDown(203) Or KeyDown(205) TurnEntity cam, 0, (KeyDown(203)-KeyDown(205))*1, 0"

WriteLine file, ""

WriteLine file, "UpdateWorld()"

WriteLine file, "RenderWorld()"

WriteLine file, ""

WriteLine file, "Flip"

WriteLine file, ""

WriteLine file, "Wend"

CloseFile file

WB3D_Notify "Menu","Compilation Successful",0

WB3D_Notify "Menu","Compiled file in: "+CurrentDir$(),0

End Function

Function get_menu()

menu = menu + 1

If menu > 43 Then menu = 43

Return menu

End Function

Function File_Extension$(ext$)

For I% = Len(ext$) To 1 Step -1

If Mid$(ext$, I%,1) = "," Then Return "*"+Left(ext$, I%-1)+";"+"*"+ Right$(ext$, I%-1)

Next

End Function

Function FileName$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return Mid(File$, I% + 1)
	Next
Return File$
End Function

Function FileExtension$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "." Return "."+Mid(File$, I% + 1)
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return ""
	Next
End Function

Function FilePath$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return Left(File$, I% - 1)
	Next
End Function

; Adds a file extention, if not exists. | F?Et eine Dateiendung hinzu falls noch keine da ist.
Function AddFileExtension$(File$, Extension$)
If FileExtension(File$) = "" Then Return File$ + "." + Extension$ Else Return File$
End Function[/code]

The const.bb file is already posted in 2 posts somewhere above. =)

Thanks again! =)

Also, if you need to take out particle candy for any reason, please comment out the following: 

[code]Include "particle candy.bb"

Include "particle types.bb"

Global CometTex   = LoadTexture("Media\fountain.jpg")

p1=InitParticles(cam,"Media\particles.png", 3)
p2=SetParticleUpdateCycle(2)

UpdateParticleSystem()


and any id with "EM0" through "EM11".

i apologize if this is a bit messed up. im in a hurry. =)

Thanks again! =)

~DarkShadowWing~

i was in a hurry, so i forgot to tell ya. It also requires wb3d =) (winblitz3d for those of you that have no idea what that is =) )

~DarkShadowWing~

You still haven't done any of the things people asked you to do. You say you've been waiting this long and waiting that long for replies, but I didn't realise you meant you had literally been doing nothing and waiting. People asked you to put together a small sample which didn't have hundreds of unused constants, third party dependancies and masses of code unrelated to the problem.

All I can think is you can't want this problem solved very badly if you're not prepared to do anything to it yourself. As it stands that's far too much code to have to look at and understand for me to even try.

...and if I can quietly sneak in a mention of Code Box at this point...

Hey. dont be rude by mouthing off. #1 I'm not waiting for ANYONE to do it for me. I've put together this WHOLE thing so far. All I'm asking for is a little help.

~DarkShadowWing~

I'm not waiting for ANYONE to do it for me.

Good, because you won't get any from me with that attitude.

I've put together this WHOLE thing so far.

It's your (copyrighted) program. You want credit for writing your own program now?

All I'm asking for is a little help.

No, you're asking for a lot of help, and being pretty ill-mannered and impatient in the process. If you tried this sort of thing on some forums, you'd have been torn a new one long before now. On here, people have been politely urging you to help yourself, and gently pushing you in the right direction so that you might get some help. You, however, seem intent on ignoring them, making no effort to cut that huge mass of code down into something manageable, and instead just repeatedly posting about how desperate you are and how long you've been waiting.

So yeah, keep complaining how long you've been waiting, don't cut that code down, don't strip any of the unnecessary third party dependencies out of it, keep telling everyone that *you're* in a hurry while asking them to take a long time to read your pages of code, keep telling anyone who dares to tell you that you're not doing anything to help yourself that they're rude, and keep wondering why you're not getting as much help as you think you deserve.

If you change your mind, however, I'll take another look.

fine. i apologize. i was just a little upset earlier. i will post an example demo code.

~DarkShadowWing~

heres the code shortened & tested, it still wont work..

Const WB3D_EVENT_GADGET						= $401
Const WB3D_EVENT_MENU						= $1001
Const WB3D_EVENT_MOUSEWHEEL					= $208
Const WB3D_EVENT_WINDOW_CLOSE				= $803
Const WB3D_EVENT_WINDOW_SIZE				= $802
Const WB3D_EVENT_WINDOW_SIZEING				= $805
Const WB3D_EVENT_WINDOW_MOVE				= $807
Const WB3D_EVENT_WINDOW_MOVING				= $806
Const WB3D_EVENT_MOUSE_MOVE					= $200
Const WB3D_EVENT_KEYPRESS					= $101
Const WB3D_EVENT_CONTEXTMENU				= $502
Const WB3D_EVENT_SYSTEMTRAY					= $503
Const WB3D_EVENT_DRAGDROP					= $504
Const WB3D_EVENT_MOUSE_DOWN 				= $201 
Const WB3D_EVENT_WINDOW_ACTIVATE			= $544
Const WB3D_EVENT_WINDOW_PAINT				= $594
Const WB3D_COLOR_GADGET 					= $514 
Const WINDOW_TITLEBAR                       = $10000000

Const WB3D_KEY_ENTER 						= $D
Const WB3D_KEY_TAB							= 9
Const WB3D_KEY_SHIFT 						= $10
Const WB3D_KEY_CONTROL 						= 17
Const WB3D_KEY_ESCAPE 						= 27
Const WB3D_KEY_SPACE 						= $20
Const WB3D_KEY_END 							= 35
Const WB3D_KEY_HOME 						= 36
Const WB3D_KEY_CURS_LEFT 					= 37
Const WB3D_KEY_CURS_UP 						= 38
Const WB3D_KEY_CURS_RIGHT 					= 39
Const WB3D_KEY_CURS_DOWN 					= 40
Const WB3D_KEY_INSERT 						= 45
Const WB3D_KEY_DELETE 						= 46
Const WB3D_KEY_NUMPAD0 						= 96
Const WB3D_KEY_NUMPAD1 						= 97
Const WB3D_KEY_NUMPAD2 						= 98
Const WB3D_KEY_NUMPAD3 						= 99
Const WB3D_KEY_NUMPAD4 						= 100
Const WB3D_KEY_NUMPAD5 						= 101
Const WB3D_KEY_NUMPAD6 						= 102
Const WB3D_KEY_NUMPAD7 						= 103
Const WB3D_KEY_NUMPAD8 						= 104
Const WB3D_KEY_NUMPAD9 						= 105
Const WB3D_KEY_F1 							= 112
Const WB3D_KEY_F2 							= 113
Const WB3D_KEY_F3 							= 114
Const WB3D_KEY_F4 							= 115
Const WB3D_KEY_F5 							= 116
Const WB3D_KEY_F6 							= 117
Const WB3D_KEY_F7 							= 118
Const WB3D_KEY_F8 							= 119
Const WB3D_KEY_F9 							= 120
Const WB3D_KEY_F10 							= 121
Const WB3D_KEY_F11 							= 122
Const WB3D_KEY_F12 							= 123
Const WB3D_KEY_NUMLOCK 						= 144
Const WB3D_KEY_SCROLL 						= 145


; default toolbar buttons
Const STD_COPY 								= 1
Const STD_CUT 								= 0
Const STD_DELETE 							= 5
Const STD_FILENEW 							= 6
Const STD_FILEOPEN 							= 7
Const STD_FILESAVE 							= 8
Const STD_FIND 								= 12
Const STD_HELP 								= 11
Const STD_PASTE 							= 2
Const STD_PRINT 							= 14
Const STD_PRINTPRE 							= 9
Const STD_PROPERTIES 						= 10

; standard window constants
Const WS_CHILD 								= $40000000
Const WS_VISIBLE 							= $10000000
Const WS_ACTIVECAPTION 						= 1
Const WS_BORDER 							= $800000
Const WS_CAPTION 							= $C00000
Const WS_CLIPCHILDREN 						= $2000000
Const WS_CLIPSIBLINGS 						= $4000000
Const WS_DISABLED 							= $8000000
Const WS_GROUP 								= $20000
Const WS_HSCROLL 							= $100000
Const WS_MAXIMIZE 							= $1000000
Const WS_MINIMIZE 							= $20000000
Const WS_MAXIMIZEBOX 						= $10000
Const WS_MINIMIZEBOX 						= $20000
Const WS_OVERLAPPED 						= 0
Const WS_POPUP 								= $80000000
Const WS_SYSMENU 							= $80000
Const WS_TABSTOP 							= $10000
Const WS_THICKFRAME 						= $40000
Const WS_VSCROLL 							= $200000
Const WS_ICONIC 							= WS_MINIMIZE
Const WS_TILED 								= WS_OVERLAPPED
Const WS_GT 								= WS_GROUP Or WS_TABSTOP
Const WS_SIZEBOX 							= WS_THICKFRAME
Const WS_POPUPWINDOW 						= WS_POPUP Or WS_BORDER Or WS_SYSMENU
Const WS_OVERLAPPEDWINDOW 					= WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Const WS_TILEDWINDOW 						= WS_OVERLAPPEDWINDOW
Const WS_DLGFRAME 							= $400000

Const WS_EX_ACCEPTFILES 					= $10
Const WS_EX_APPWINDOW 						= $40000
Const WS_EX_CLIENTEDGE 						= $200
Const WS_EX_CONTEXTHELP 					= $400
Const WS_EX_CONTROLPARENT 					= $10000
Const WS_EX_LAYERED 						= $80000
Const WS_EX_LAYOUTRTL 						= $400000
Const WS_EX_LEFT 							= 0
Const WS_EX_LEFTSCROLLBAR 					= $4000
Const WS_EX_LTRREADING 						= 0
Const WS_EX_NOACTIVATE 						= $8000000
Const WS_EX_NOINHERITLAYOUT 				= $100000
Const WS_EX_NOPARENTNOTIFY					= $4
Const WS_EX_RIGHT 							= $1000
Const WS_EX_RIGHTSCROLLBAR 					= $0
Const WS_EX_RTLREADING 						= $2000
Const WS_EX_STATICEDGE 						= $20000
Const WS_EX_TOOLWINDOW 						= $80
Const WS_EX_TOPMOST 						= $8
Const WS_EX_TRANSPARENT 					= $20
Const WS_EX_WINDOWEDGE 						= $100
Const WS_EX_DLGMODALFRAME 					= 1
Const WS_EX_PALETTEWINDOW 					= WS_EX_WINDOWEDGE Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST
Const WS_EX_OVERLAPPEDWINDOW 				= WS_EX_WINDOWEDGE Or WS_EX_CLIENTEDGE

Const BS_NULL 		 						= 1
Const BS_3STATE 							= 5
Const BS_AUTO3STATE  						= 6
Const BS_AUTOCHECKBOX 						= 3
Const BS_AUTORADIOBUTTON  					= $9
Const BS_BITMAP  							= $80
Const BS_BOTTOM  							= $800
Const BS_CENTER  							= $300
Const BS_CHECKBOX  							= 2
Const BS_DEFPUSHBUTTON  					= 1
Const BS_DIBPATTERN 						= 5
Const BS_DIBPATTERN8X8  					= 8
Const BS_DIBPATTERNPT  						= 6
Const BS_FLAT  								= $8000
Const BS_GROUPBOX  							= $7
Const BS_HOLLOW  							= BS_NULL
Const BS_ICON  								= $40
Const BS_INDEXED  							= 4
Const BS_LEFT  								= $100
Const BS_LEFTTEXT  							= $20
Const BS_MONOPATTERN  						= 9
Const BS_MULTILINE 							= $2000
Const BS_NOTIFY 							= $4000
Const BS_PUSHBUTTON 						= 0
Const BS_PUSHLIKE  							= $1000
Const BS_RADIOBUTTON  						= 4
Const BS_RIGHT 								= $200
Const BS_RIGHTBUTTON  						= BS_LEFTTEXT
Const BS_SOLID  							= 0
Const BS_TEXT  								= 0
Const BS_TOP  								= $400


Const CCS_ADJUSTABLE 						= $20
Const CCS_BOTTOM 		 					= 3
Const CCS_TOP 								= 1
Const CCS_VERT 							 	= $80
Const CCS_LEFT 								= (CCS_VERT Or CCS_TOP)
Const CCS_NODIVIDER 						= $40
Const CCS_NOMOVEY 							= 2
Const CCS_NOMOVEX 							= (CCS_VERT Or CCS_NOMOVEY)
Const CCS_NOPARENTALIGN 					= 8
Const CCS_NORESIZE 							= 4
Const CCS_RIGHT 							= (CCS_VERT Or CCS_BOTTOM)
Const TBSTATE_CHECKED 						= 1
Const TBSTATE_ELLIPSES 						= $40
Const TBSTATE_ENABLED 						= 4
Const TBSTATE_HIDDEN  						= 8
Const TBSTATE_INDETERMINATE 				= $10
Const TBSTATE_MARKED  						= $80
Const TBSTATE_PRESSED 						= $2
Const TBSTATE_WRAP 							= $20
Const TBSTYLE_ALTDRAG 						= $400
Const TBSTYLE_AUTOSIZE 						= $10
Const TBSTYLE_BUTTON 						= 0
Const TBSTYLE_CHECK 						= 2
Const TBSTYLE_GROUP 						= 4
Const TBSTYLE_CHECKGROUP 					= (TBSTYLE_GROUP Or TBSTYLE_CHECK)
Const TBSTYLE_CUSTOMERASE 					= $2000
Const TBSTYLE_DROPDOWN 						= 8
Const TBSTYLE_FLAT 							= $800
Const TBSTYLE_LIST 							= $1000
Const TBSTYLE_NOPREFIX 						= $20
Const TBSTYLE_REGISTERDROP 					= $4000
Const TBSTYLE_SEP 							= 1
Const TBSTYLE_TOOLTIPS 						= $100
Const TBSTYLE_TRANSPARENT 					= $8000
Const TBSTYLE_WRAPABLE 		 				= $200

Const TBSTYLE_EX_DOUBLEBUFFER 				= $80
Const TBSTYLE_EX_DRAWDDARROWS 				= $1
Const TBSTYLE_EX_HIDECLIPPEDBUTTONS 		= $10
Const TBSTYLE_EX_MIXEDBUTTONS 				= $8

Const ES_AUTOHSCROLL 		 				= $80
Const ES_AUTOVSCROLL 						= $40
Const ES_CENTER 							= 1
Const ES_CONTINUOUS 						= $80000000
Const ES_DISABLENOSCROLL 					= $2000
Const ES_DISPLAY_REQUIRED 					= 2
Const ES_EX_NOCALLOLEINIT 					= $1000000
Const ES_LEFT 								= 0
Const ES_LOWERCASE 							= $10
Const ES_MULTILINE 							= 4
Const ES_NOHIDESEL 							= $100
Const ES_NOIME 								= $80000
Const ES_NOOLEDRAGDROP 						= $8
Const ES_NUMBER 							= $2000
Const ES_OEMCONVERT 						= $400
Const ES_PASSWORD 							= $20
Const ES_READONLY 							= $800
Const ES_RIGHT 								= 2
Const ES_SAVESEL 							= $8000
Const ES_SELECTIONBAR 						= $1000000
Const ES_SELFIME 							= $40000
Const ES_SUNKEN 							= $4000
Const ES_SYSTEM_REQUIRED 					= 1
Const ES_UPPERCASE 							= $8
Const ES_USER_PRESENT 						= 4
Const ES_VERTICAL 							= $400000
Const ES_WANTRETURN 						= $1000

Const CFM_BOLD = 1
Const CFM_COLOR = $40000000
Const CFM_ITALIC = 2
Const CFM_STRIKEOUT = $8

Const CBS_AUTOHSCROLL 						= $40
Const CBS_DISABLENOSCROLL 					= $800
Const CBS_DROPDOWN 							= 2
Const CBS_DROPDOWNLIST 						= 3
Const CBS_HASSTRINGS 						= $200
Const CBS_LOWERCASE 						= $4000
Const CBS_NOINTEGRALHEIGHT 					= $400
Const CBS_OEMCONVERT 						= $80
Const CBS_SIMPLE 							= 1
Const CBS_SORT 								= $100
Const CBS_UPPERCASE 						= $2000

Const TCS_MULTILINE 						= $200
Const TCS_SINGLELINE 						= $0
Const TCS_FLATBUTTONS 						= $8
Const TCS_BOTTOM 							= $2
Const TCS_HOTTRACK 							= $40
Const TCS_RAGGEDRIGHT 						= $800
Const TCS_VERTICAL 							= $80
Const TCS_FOCUSONBUTTONDOWN 				= $1000
Const TCS_BUTTONS 							= $100
Const TCS_FIXEDWIDTH 						= $400
Const TCS_FOCUSNEVER 						= $8000
Const TCS_FORCEICONLEFT 					= $10
Const TCS_FORCELABELLEFT 					= $20
Const TCS_MULTISELECT 						= 4
Const TCS_RIGHT 							= 2
Const TCS_RIGHTJUSTIFY 						= 0
Const TCS_SCROLLOPPOSITE 					= 1
Const TCS_TABS 								= 0
Const TCS_TOOLTIPS 							= $4000

Const TCS_EX_FLATSEPARATORS 				= 1
Const TCS_EX_REGISTERDROP 					= 2

Const LVS_ALIGNLEFT 						= $800
Const LVS_ALIGNMASK 						= $c00
Const LVS_ALIGNTOP 							= 0
Const LVS_AUTOARRANGE						= $100
Const LVS_EDITLABELS 						= $200
Const LVS_ICON 								= 0
Const LVS_LIST 								= 3
Const LVS_NOCOLUMNHEADER 					= $4000
Const LVS_NOLABELWRAP 						= $80
Const LVS_NOSCROLL 							= $2000
Const LVS_NOSORTHEADER 						= $8000
Const LVS_REPORT 							= 1
Const LVS_SHOWSELALWAYS 					= $8
Const LVS_SINGLESEL 						= 4
Const LVS_SMALLICON 						= 2
Const LVS_SORTASCENDING 					= $10
Const LVS_SORTDESCENDING 					= $20
Const LVS_TYPEMASK 							= 3
Const LVS_TYPESTYLEMASK 					= $fc00

Const LVS_EX_FULLROWSELECT 					= $20
Const LVS_EX_GRIDLINES 						= 1
Const LVS_EX_BORDERSELECT 					= $8000
Const LVS_EX_CHECKBOXES 					= 4
Const LVS_EX_DOUBLEBUFFER 					= $10000
Const LVS_EX_FLATSB 						= $100
Const LVS_EX_HEADERDRAGDROP 				= $10
Const LVS_EX_HIDELABELS 					= $20000
Const LVS_EX_INFOTIP 						= $400
Const LVS_EX_LABELTIP 						= $4000
Const LVS_EX_MULTIWORKAREAS 				= $2000
Const LVS_EX_ONECLICKACTIVATE 				= $40
Const LVS_EX_REGIONAL 						= $200
Const LVS_EX_SINGLEROW 						= $40000
Const LVS_EX_SNAPTOGRID 					= $80000
Const LVS_EX_SUBITEMIMAGES 					= 2
Const LVS_EX_TRACKSELECT 					= $8
Const LVS_EX_TWOCLICKACTIVATE 				= $80
Const LVS_EX_UNDERLINECOLD 					= $1000
Const LVS_EX_UNDERLINEHOT 					= $800

Const PBS_SMOOTH 							= 1
Const PBS_VERTICAL 							= 4

Const TVS_CHECKBOXES 						= $100
Const TVS_DISABLEDRAGDROP 					= $0
Const TVS_EDITLABELS 						= $8
Const TVS_FULLROWSELECT 					= $1000
Const TVS_HASBUTTONS 						= 1
Const TVS_HASLINES 							= 2
Const TVS_INFOTIP 							= $800
Const TVS_LINESATROOT 						= 4
Const TVS_NOHSCROLL 						= $8000
Const TVS_NONEVENHEIGHT 					= $4000
Const TVS_NOSCROLL 							= $2000
Const TVS_NOTOOLTIPS 						= $80
Const TVS_RTLREADING 						= $40
Const TVS_SHOWSELALWAYS 					= $20
Const TVS_SINGLEEXPAND 						= $400
Const TVS_TRACKSELECT 						= $200

Const SS_BITMAP 							= $E
Const SS_BLACKFRAME 						= $7
Const SS_BLACKRECT 							= 4
Const SS_CENTER 							= 1
Const SS_CENTERIMAGE 						= $200
Const SS_ELLIPSISMASK 						= $C000
Const SS_ENDELLIPSIS 						= $4000
Const SS_ENHMETAFILE 						= $F
Const SS_ETCHEDFRAME 						= $12
Const SS_ETCHEDHORZ 						= $10
Const SS_ETCHEDVERT 						= $11
Const SS_GRAYFRAME 							= $8
Const SS_GRAYRECT 							= $5
Const SS_ICON 								= $3
Const SS_LEFT 								= 0
Const SS_LEFTNOWORDWRAP 					= $C
Const SS_SIMPLE 							= $B
Const SS_SUNKEN 							= $1000
Const SS_WHITEFRAME 						= $9
Const SS_WHITERECT 							= $6
Const SS_WORDELLIPSIS 						= $C000
Const SS_NOTIFY								= $100
Const SS_RIGHT 								= $2 

Const TBS_AUTOTICKS 						= 1
Const TBS_BOTH 								= 8
Const TBS_BOTTOM 							= 0
Const TBS_ENABLESELRANGE 					= $20
Const TBS_FIXEDLENGTH 						= $40
Const TBS_HORZ 		 						= 0
Const TBS_LEFT 								= 4
Const TBS_NOTHUMB 							= $80
Const TBS_NOTICKS 							= $10
Const TBS_REVERSED 							= $200
Const TBS_RIGHT 							= 0
Const TBS_TOP 								= 4
Const TBS_VERT 								= 2

Const UDS_ALIGNLEFT 						= $8
Const UDS_ALIGNRIGHT 						= 4
Const UDS_ARROWKEYS 						= $20
Const UDS_AUTOBUDDY 						= $10
Const UDS_HORZ 								= $40
Const UDS_HOTTRACK 							= $100
Const UDS_NOTHOUSANDS 						= $80
Const UDS_SETBUDDYINT 						= 2
Const UDS_WRAP 								= 1

Const MB_ABORTRETRYIGNORE 					= $2
Const MB_APPLMODAL 							= $0
Const MB_CANCELTRYCONTINUE 					= $6
Const MB_COMPOSITE 							= $2
Const MB_DEFAULT_DESKTOP_ONLY 				= $20000
Const MB_DEFBUTTON1 						= 0
Const MB_DEFBUTTON2 						= $100
Const MB_DEFBUTTON3 						= $200
Const MB_DEFBUTTON4 						= $300
Const MB_DEFMASK 							= $F00
Const MB_HELP 								= $4000
Const MB_ICONASTERISK 						= $40
Const MB_ICONEXCLAMATION 					= $30
Const MB_ICONHAND 							= $10
Const MB_ICONERROR 							= MB_ICONHAND
Const MB_ICONINFORMATION 					= MB_ICONASTERISK
Const MB_ICONMASK 							= $F0
Const MB_ICONQUESTION 						= $20
Const MB_ICONSTOP 							= MB_ICONHAND
Const MB_ICONWARNING 						= MB_ICONEXCLAMATION
Const MB_MISCMASK 							= $C000
Const MB_MODEMASK 							= $3000
Const MB_NOFOCUS 							= $8000
Const MB_OK 								= $0
Const MB_OKCANCEL 							= $1
Const MB_PRECOMPOSED 						= $1
Const MB_RETRYCANCEL 						= $5
Const MB_RIGHT 								= $80000
Const MB_RTLREADING 						= $100000
Const MB_SETFOREGROUND 						= $10000
Const MB_SYSTEMMODAL 						= $1000
Const MB_TASKMODAL 							= $2000
Const MB_TOPMOST 							= $40000
Const MB_TYPEMASK 							= $F
Const MB_USERICON 							= $80
Const MB_YESNO 								= 4
Const MB_YESNOCANCEL 						= 3

Const IDABORT								= 3				; Abort button was selected.
Const IDCANCEL								= 2				; Cancel button was selected.
Const IDIGNORE								= 5				; Ignore button was selected.
Const IDNO									= 7				; No button was selected.
Const IDOK									= 1				; OK button was selected.
Const IDRETRY								= 4				; Retry button was selected.
Const IDYES									= 6 			; Yes button was selected.
Const IDCONTINUE 							= 11			; Continue button selected.
Const IDCLOSE 								= 8				; Close button selected
Const IDHELP 								= 9				; Help button selected.
Const IDTRYAGAIN 							= 10			; Try again selected.

Const IDC_APPSTARTING						= 1		

Const IDC_ARROW								= 2 			; Standard arrow
Const IDC_CROSS								= 3 			; Crosshair
Const IDC_IBEAM								= 4 			; Text I-beam
Const IDC_ICON								= 5 			; Windows NT only: Empty icon
Const IDC_NO								= 6 			; Slashed circle
Const IDC_SIZE								= 7 			; Windows NT only: Four-pointed arrow
Const IDC_SIZEALL 							= 8 			; Same as IDC_SIZE
Const IDC_SIZENESW 							= 9 			; Double-pointed arrow pointing northeast And southwest
Const IDC_SIZENS							= 10 			; Double-pointed arrow pointing north And south
Const IDC_SIZENWSE 							= 11 			; Double-pointed arrow pointing northwest And southeast
Const IDC_SIZEWE  							= 12 			; Double-pointed arrow pointing west And east
Const IDC_UPARROW 							= 13 			; Vertical arrow
Const IDC_WAIT								= 14 			; Hourglass

Const RBS_AUTOSIZE 							= $2000
Const RBS_BANDBORDERS 						= $400
Const RBS_DBLCLKTOGGLE 						= $8000
Const RBS_FIXEDORDER 						= $800
Const RBS_REGISTERDROP 						= $1000
Const RBS_TOOLTIPS 							= $100
Const RBS_VARHEIGHT 						= $200
Const RBS_VERTICALGRIPPER 					= $4000

Const RBBS_BREAK 							= $1
Const RBBS_CHILDEDGE 						= $4
Const RBBS_FIXEDBMP 						= $20
Const RBBS_FIXEDSIZE 						= $2
Const RBBS_GRIPPERALWAYS 					= $80
Const RBBS_HIDDEN 							= $8
Const RBBS_HIDETITLE 						= $400
Const RBBS_NOGRIPPER 						= $100
Const RBBS_NOVERT 							= $10
Const RBBS_TOPALIGN 						= $800
Const RBBS_USECHEVRON 						= $200
Const RBBS_VARIABLEHEIGHT 					= $40

Const MOD_ALT 								= $10
Const MOD_CONTROL 							= $8
Const MOD_SHIFT 							= $4

Const WB3D_HOTKEYSLASH$ 					= $220
Const WB3D_HOTKEYTAB$ 						= $9
Global WB3D_MENUHOTKEY_SPACER$ 				= Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYTAB)

Global x = -1

Global y = -1

Global z

AppTitle "Particlos"

Graphics3D 1024,768, 32, 2

Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),0,0,GraphicsWidth(),GraphicsHeight())

Global copyright$ = "Copyright (c) 2008 - 2009 Photo-Xtreme"+Chr$(13)+"          Created by: ~ZeldaX~"

Global w

Global menus
Global req
Global snd
Global snd1


Global snd2

Global PlaySound1

Global playa

Global menu1

Global menuii

Global menuselect = 0
Global file1$

Global keypressed
Global menu

WB3D_HotKeyEvent MOD_CONTROL,65,1	; ctrl+a
WB3D_HotKeyEvent MOD_CONTROL,76,78	; ctrl+l

WB3D_DragAcceptFiles(RuntimeWindow_hWnd, 1)

menus = WB3D_WindowMenu(RuntimeWindow_hWnd)
file = WB3D_CreateMenu("&File",0,menus,0)
	OpenItem = WB3D_CreateMenu("Open",1,file,0) 
	
	SaveItem = WB3D_CreateMenu("Save",2,file,0)

	WB3D_CreateMenu("",0,file,0)
	QuitItem = WB3D_CreateMenu("Quit",3,file,0)

about = WB3D_CreateMenu("About",0,menus,1)

about1 = WB3D_CreateMenu("About...",4,about,0)
		
u=WB3D_UpdateWindowMenu(RuntimeWindow_hWnd)

statusbar = WB3D_CreateStatusBar(RuntimeWindow_hWnd,"")
s1=WB3D_SetStatusParts(statusbar,3)

s2=WB3D_StatusPartWidth(statusbar,0,150)
s3=WB3D_StatusPartWidth(statusbar,1,150)
s4=WB3D_StatusPartWidth(statusbar,2,150)
s5=WB3D_StatusPartWidth(statusbar,3,150)

WB3D_UpdateStatusbar(statusbar)

WB3D_FlushEvents()

; setup out quit flag, and loop until the flag is set.
QUIT = 0

Light  = CreateLight()

Listener = CreateListener(Cam, .005, 1, 1)

tabber = WB3D_CreateTabber(0,0,GraphicsWidth()/4,GraphicsHeight(),Runtimewindow_hWnd,0)
WB3D_SetGadgetIconStrip(tabber,icons)
s6=WB3D_CreateToolTip(tabber,"Im a tabber tooltip",0)

For loop = 0 To 10
	icon_index = Rnd(0,5)
	WB3D_AddGadgetItem tabber,"item: "+loop,0,icon_index
Next

panel0 = WB3D_CreateTabberPanel(5,30,200,100,tabber)
button_tab0 = WB3D_CreateButton("Show Panel Splash",5,10,190,40,panel0,0)
WB3D_CreateToolTip button_tab0,"show me the splash",1

font = WB3D_OpenFont("blitz",8,8,True,True,True) ; set bold ,italic ,underline to true
WB3D_Usefont button_tab0,font


panel1 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab1 = WB3D_CreateButton("Tab1",10,10,100,20,panel1,0)
WB3D_HideGadget panel1

panel2 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab2 = WB3D_CreateButton("Tab2",10,10,100,20,panel2,0)
WB3D_HideGadget panel2

panel3 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab3 = WB3D_CreateButton("Tab3",10,10,100,20,panel3,0)
WB3D_HideGadget panel3

While Not KeyHit(1)

WB3D_SetStatusText statusbar,0,"FPS:"+framesrate#
WB3D_SetStatusText statusbar,1,"playa:"+playa
WB3D_SetStatusText statusbar,2,"chanplay:"+ChannelPlaying(snd1)

time$ = CurrentTime$()

If time$ >= 12 Then am_pm$ = "PM"

If time$ < 12 Then am_pm$ = "AM"

WB3D_SetStatusText statusbar,3,"Time: "+time$+" "+am_pm$

	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_MENU
		
		    Select WB3D_EventData()
					
				Case 1
				
					ext$ = "*.mid"+Chr$(0)+"*.mid"+Chr$(0)+"*.mp3"+Chr$(0)+"*.mp3"+Chr$(0)
					file1$ = WB3D_OpenFileRequest("Open","..",ext$,"") : test = 1
											
				If FileExtension(file1$) = ".mp3"
				req = 1
				Else
				req = 0
				EndIf
				
				If req Then snd = LoadSound(file1$) : request() : test = 1
										
				Case 2
					
				Case 3
					QUIT = 1
					
				Case 4
					WB3D_Notify "Menu",copyright$,0
				
				Case 5
				
				Case 6
			
			Case WB3D_EVENT_DRAGDROP
			
			For do_files = 0 To WB3D_CountDroppedFiles()
		              	file1$ = WB3D_DroppedFileName(do_files)
		
 				If FileExtension(file1$) = ".mp3"
				req = 1
				Else
				req = 0
				EndIf
								
			Next
			
			End Select
					
						event = WB3D_WaitEvent()	
	                   Select event			
						
							Case tabber
					selectedtab = WB3D_EventData()
					
					Select selectedtab
					
						Case 0
							WB3D_ShowGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 1
							WB3D_ShowGadget panel1
							WB3D_HideGadget panel0
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 2
							WB3D_ShowGadget panel2
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel3
					
						Case 3
							WB3D_ShowGadget panel3
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
					
					Default
										
						WB3D_Notify "Tab Selected","Tab Selected "+selectedtab,0
	
						WB3D_HideGadget panel0
						WB3D_HideGadget panel1
						WB3D_HideGadget panel2
						WB3D_HideGadget panel3	
											
				End Select
				
			End Select
				
		Case WB3D_EVENT_WINDOW_CLOSE
			;WB3D_ShowGadget RuntimeWindow_hWnd
	
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
					
				
			End Select
		End Select


UpdateWorld

RenderWorld

Flip

Wend

If ChannelPlaying(snd1)

stopm()

EndIf

WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK

WB3D_EndGUI()
EndGraphics
End


Function FileExtension$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "." Return "."+Mid(File$, I% + 1)
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return ""
	Next
End Function

Function request()
					
If FileExtension(file1$) = ".mp3"

playa = 1
					
EndIf

If playa Then play()

If test = 1
stopm()

play()

EndIf

Return z

End Function

Function play()
																				
If ChannelPlaying(snd1) = 0 And playa

If FileExtension(file1$) = ".mp3" And ChannelPlaying(snd1) = 0 Then

load_music()

EndIf

Else

If ChannelPlaying(snd1) And playa

stopm()

play()

EndIf

EndIf

If menus = 1

menu1 = file1$
					
menuii = FileExtension(file1$)

EndIf
										
End Function

Function stopm()

If playa = 1

StopChannel snd1

EndIf

End Function

Function load_music()

snd1 = PlaySound(snd)

End Function


Please edit your posts and use the [ codebox ] tags instead of [ code ]? This thread is very hard to peruse as it is.

my apologies. i didnt know there was such a function =)

Thanks for telling me =)

fixed. now. can anyone help me fix this please? it would be greatly appreciated. ive done all i can to narrow it down.

thanks =)

I'll take a look at your code when I get home this afternoon but you need to work on your patience. You only need to ask for help once otherwise people will pick up on your frustration. You have asked over 10 times in this thread for help. If you can't learn patience you need to find another hobby because programming requires a lot of it... but I think you have realized that already ;).

Thanks man =) Ill try. I apologize for bein so pushy. I've had a bad day yesterday. I didn't mean to take it out on all of you.. =/

~DarkShadowWing~

What version of WinBlitz3D are you using DarkShadowWing?

Yeah, he's probably using an old version... I downloaded WB3D and tried his code, and it just gives "Not enough parameters" on WB3D_HotKeyEvent...

Try downloading the latest version, man :)
(the link where I downloaded it: http://www.whitegatesoftware.com/winblitz3d.zip)

EDIT: I commented out the 2 Hotkeyevent lines, and the program ran fine with winblitz3d from the link above.

EDIT2: Oops, appears that drag'n'drop isnt really detected... :P

EDIT3: Your code is bugged, you're checking for WB3D_EVENT_DRAGDROP inside the Select/Case code block for MENU EVENT.

Put the DRAGDROP check below the "end select" for the menu event, and it should work, the drag'n drop is detected... but there still more bugs, since you call "waitevent" just after geting the file list, and there's no event being sent at that time.

Try putting some indentation in your code, it would help a lot in cases like this, and also, try to understand how windows events works - they're assyncronous, so "waitevent" doesnt lock your program and keeps waiting for a result, it just keeps sending data all the time.
(run the program in debug mode, and put a "DebugLog event" just below event = WB3D_WaitEvent() so you can see what I mean.

slotman, here's the results so far it works, yet it still lags:

Const WB3D_EVENT_GADGET						= $401
Const WB3D_EVENT_MENU						= $1001
Const WB3D_EVENT_MOUSEWHEEL					= $208
Const WB3D_EVENT_WINDOW_CLOSE				= $803
Const WB3D_EVENT_WINDOW_SIZE				= $802
Const WB3D_EVENT_WINDOW_SIZEING				= $805
Const WB3D_EVENT_WINDOW_MOVE				= $807
Const WB3D_EVENT_WINDOW_MOVING				= $806
Const WB3D_EVENT_MOUSE_MOVE					= $200
Const WB3D_EVENT_KEYPRESS					= $101
Const WB3D_EVENT_CONTEXTMENU				= $502
Const WB3D_EVENT_SYSTEMTRAY					= $503
Const WB3D_EVENT_DRAGDROP					= $504
Const WB3D_EVENT_MOUSE_DOWN 				= $201 
Const WB3D_EVENT_WINDOW_ACTIVATE			= $544
Const WB3D_EVENT_WINDOW_PAINT				= $594
Const WB3D_COLOR_GADGET 					= $514 
Const WINDOW_TITLEBAR                       = $10000000

Const WB3D_KEY_ENTER 						= $D
Const WB3D_KEY_TAB							= 9
Const WB3D_KEY_SHIFT 						= $10
Const WB3D_KEY_CONTROL 						= 17
Const WB3D_KEY_ESCAPE 						= 27
Const WB3D_KEY_SPACE 						= $20
Const WB3D_KEY_END 							= 35
Const WB3D_KEY_HOME 						= 36
Const WB3D_KEY_CURS_LEFT 					= 37
Const WB3D_KEY_CURS_UP 						= 38
Const WB3D_KEY_CURS_RIGHT 					= 39
Const WB3D_KEY_CURS_DOWN 					= 40
Const WB3D_KEY_INSERT 						= 45
Const WB3D_KEY_DELETE 						= 46
Const WB3D_KEY_NUMPAD0 						= 96
Const WB3D_KEY_NUMPAD1 						= 97
Const WB3D_KEY_NUMPAD2 						= 98
Const WB3D_KEY_NUMPAD3 						= 99
Const WB3D_KEY_NUMPAD4 						= 100
Const WB3D_KEY_NUMPAD5 						= 101
Const WB3D_KEY_NUMPAD6 						= 102
Const WB3D_KEY_NUMPAD7 						= 103
Const WB3D_KEY_NUMPAD8 						= 104
Const WB3D_KEY_NUMPAD9 						= 105
Const WB3D_KEY_F1 							= 112
Const WB3D_KEY_F2 							= 113
Const WB3D_KEY_F3 							= 114
Const WB3D_KEY_F4 							= 115
Const WB3D_KEY_F5 							= 116
Const WB3D_KEY_F6 							= 117
Const WB3D_KEY_F7 							= 118
Const WB3D_KEY_F8 							= 119
Const WB3D_KEY_F9 							= 120
Const WB3D_KEY_F10 							= 121
Const WB3D_KEY_F11 							= 122
Const WB3D_KEY_F12 							= 123
Const WB3D_KEY_NUMLOCK 						= 144
Const WB3D_KEY_SCROLL 						= 145


; default toolbar buttons
Const STD_COPY 								= 1
Const STD_CUT 								= 0
Const STD_DELETE 							= 5
Const STD_FILENEW 							= 6
Const STD_FILEOPEN 							= 7
Const STD_FILESAVE 							= 8
Const STD_FIND 								= 12
Const STD_HELP 								= 11
Const STD_PASTE 							= 2
Const STD_PRINT 							= 14
Const STD_PRINTPRE 							= 9
Const STD_PROPERTIES 						= 10

; standard window constants
Const WS_CHILD 								= $40000000
Const WS_VISIBLE 							= $10000000
Const WS_ACTIVECAPTION 						= 1
Const WS_BORDER 							= $800000
Const WS_CAPTION 							= $C00000
Const WS_CLIPCHILDREN 						= $2000000
Const WS_CLIPSIBLINGS 						= $4000000
Const WS_DISABLED 							= $8000000
Const WS_GROUP 								= $20000
Const WS_HSCROLL 							= $100000
Const WS_MAXIMIZE 							= $1000000
Const WS_MINIMIZE 							= $20000000
Const WS_MAXIMIZEBOX 						= $10000
Const WS_MINIMIZEBOX 						= $20000
Const WS_OVERLAPPED 						= 0
Const WS_POPUP 								= $80000000
Const WS_SYSMENU 							= $80000
Const WS_TABSTOP 							= $10000
Const WS_THICKFRAME 						= $40000
Const WS_VSCROLL 							= $200000
Const WS_ICONIC 							= WS_MINIMIZE
Const WS_TILED 								= WS_OVERLAPPED
Const WS_GT 								= WS_GROUP Or WS_TABSTOP
Const WS_SIZEBOX 							= WS_THICKFRAME
Const WS_POPUPWINDOW 						= WS_POPUP Or WS_BORDER Or WS_SYSMENU
Const WS_OVERLAPPEDWINDOW 					= WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Const WS_TILEDWINDOW 						= WS_OVERLAPPEDWINDOW
Const WS_DLGFRAME 							= $400000

Const WS_EX_ACCEPTFILES 					= $10
Const WS_EX_APPWINDOW 						= $40000
Const WS_EX_CLIENTEDGE 						= $200
Const WS_EX_CONTEXTHELP 					= $400
Const WS_EX_CONTROLPARENT 					= $10000
Const WS_EX_LAYERED 						= $80000
Const WS_EX_LAYOUTRTL 						= $400000
Const WS_EX_LEFT 							= 0
Const WS_EX_LEFTSCROLLBAR 					= $4000
Const WS_EX_LTRREADING 						= 0
Const WS_EX_NOACTIVATE 						= $8000000
Const WS_EX_NOINHERITLAYOUT 				= $100000
Const WS_EX_NOPARENTNOTIFY					= $4
Const WS_EX_RIGHT 							= $1000
Const WS_EX_RIGHTSCROLLBAR 					= $0
Const WS_EX_RTLREADING 						= $2000
Const WS_EX_STATICEDGE 						= $20000
Const WS_EX_TOOLWINDOW 						= $80
Const WS_EX_TOPMOST 						= $8
Const WS_EX_TRANSPARENT 					= $20
Const WS_EX_WINDOWEDGE 						= $100
Const WS_EX_DLGMODALFRAME 					= 1
Const WS_EX_PALETTEWINDOW 					= WS_EX_WINDOWEDGE Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST
Const WS_EX_OVERLAPPEDWINDOW 				= WS_EX_WINDOWEDGE Or WS_EX_CLIENTEDGE

Const BS_NULL 		 						= 1
Const BS_3STATE 							= 5
Const BS_AUTO3STATE  						= 6
Const BS_AUTOCHECKBOX 						= 3
Const BS_AUTORADIOBUTTON  					= $9
Const BS_BITMAP  							= $80
Const BS_BOTTOM  							= $800
Const BS_CENTER  							= $300
Const BS_CHECKBOX  							= 2
Const BS_DEFPUSHBUTTON  					= 1
Const BS_DIBPATTERN 						= 5
Const BS_DIBPATTERN8X8  					= 8
Const BS_DIBPATTERNPT  						= 6
Const BS_FLAT  								= $8000
Const BS_GROUPBOX  							= $7
Const BS_HOLLOW  							= BS_NULL
Const BS_ICON  								= $40
Const BS_INDEXED  							= 4
Const BS_LEFT  								= $100
Const BS_LEFTTEXT  							= $20
Const BS_MONOPATTERN  						= 9
Const BS_MULTILINE 							= $2000
Const BS_NOTIFY 							= $4000
Const BS_PUSHBUTTON 						= 0
Const BS_PUSHLIKE  							= $1000
Const BS_RADIOBUTTON  						= 4
Const BS_RIGHT 								= $200
Const BS_RIGHTBUTTON  						= BS_LEFTTEXT
Const BS_SOLID  							= 0
Const BS_TEXT  								= 0
Const BS_TOP  								= $400


Const CCS_ADJUSTABLE 						= $20
Const CCS_BOTTOM 		 					= 3
Const CCS_TOP 								= 1
Const CCS_VERT 							 	= $80
Const CCS_LEFT 								= (CCS_VERT Or CCS_TOP)
Const CCS_NODIVIDER 						= $40
Const CCS_NOMOVEY 							= 2
Const CCS_NOMOVEX 							= (CCS_VERT Or CCS_NOMOVEY)
Const CCS_NOPARENTALIGN 					= 8
Const CCS_NORESIZE 							= 4
Const CCS_RIGHT 							= (CCS_VERT Or CCS_BOTTOM)
Const TBSTATE_CHECKED 						= 1
Const TBSTATE_ELLIPSES 						= $40
Const TBSTATE_ENABLED 						= 4
Const TBSTATE_HIDDEN  						= 8
Const TBSTATE_INDETERMINATE 				= $10
Const TBSTATE_MARKED  						= $80
Const TBSTATE_PRESSED 						= $2
Const TBSTATE_WRAP 							= $20
Const TBSTYLE_ALTDRAG 						= $400
Const TBSTYLE_AUTOSIZE 						= $10
Const TBSTYLE_BUTTON 						= 0
Const TBSTYLE_CHECK 						= 2
Const TBSTYLE_GROUP 						= 4
Const TBSTYLE_CHECKGROUP 					= (TBSTYLE_GROUP Or TBSTYLE_CHECK)
Const TBSTYLE_CUSTOMERASE 					= $2000
Const TBSTYLE_DROPDOWN 						= 8
Const TBSTYLE_FLAT 							= $800
Const TBSTYLE_LIST 							= $1000
Const TBSTYLE_NOPREFIX 						= $20
Const TBSTYLE_REGISTERDROP 					= $4000
Const TBSTYLE_SEP 							= 1
Const TBSTYLE_TOOLTIPS 						= $100
Const TBSTYLE_TRANSPARENT 					= $8000
Const TBSTYLE_WRAPABLE 		 				= $200

Const TBSTYLE_EX_DOUBLEBUFFER 				= $80
Const TBSTYLE_EX_DRAWDDARROWS 				= $1
Const TBSTYLE_EX_HIDECLIPPEDBUTTONS 		= $10
Const TBSTYLE_EX_MIXEDBUTTONS 				= $8

Const ES_AUTOHSCROLL 		 				= $80
Const ES_AUTOVSCROLL 						= $40
Const ES_CENTER 							= 1
Const ES_CONTINUOUS 						= $80000000
Const ES_DISABLENOSCROLL 					= $2000
Const ES_DISPLAY_REQUIRED 					= 2
Const ES_EX_NOCALLOLEINIT 					= $1000000
Const ES_LEFT 								= 0
Const ES_LOWERCASE 							= $10
Const ES_MULTILINE 							= 4
Const ES_NOHIDESEL 							= $100
Const ES_NOIME 								= $80000
Const ES_NOOLEDRAGDROP 						= $8
Const ES_NUMBER 							= $2000
Const ES_OEMCONVERT 						= $400
Const ES_PASSWORD 							= $20
Const ES_READONLY 							= $800
Const ES_RIGHT 								= 2
Const ES_SAVESEL 							= $8000
Const ES_SELECTIONBAR 						= $1000000
Const ES_SELFIME 							= $40000
Const ES_SUNKEN 							= $4000
Const ES_SYSTEM_REQUIRED 					= 1
Const ES_UPPERCASE 							= $8
Const ES_USER_PRESENT 						= 4
Const ES_VERTICAL 							= $400000
Const ES_WANTRETURN 						= $1000

Const CFM_BOLD = 1
Const CFM_COLOR = $40000000
Const CFM_ITALIC = 2
Const CFM_STRIKEOUT = $8

Const CBS_AUTOHSCROLL 						= $40
Const CBS_DISABLENOSCROLL 					= $800
Const CBS_DROPDOWN 							= 2
Const CBS_DROPDOWNLIST 						= 3
Const CBS_HASSTRINGS 						= $200
Const CBS_LOWERCASE 						= $4000
Const CBS_NOINTEGRALHEIGHT 					= $400
Const CBS_OEMCONVERT 						= $80
Const CBS_SIMPLE 							= 1
Const CBS_SORT 								= $100
Const CBS_UPPERCASE 						= $2000

Const TCS_MULTILINE 						= $200
Const TCS_SINGLELINE 						= $0
Const TCS_FLATBUTTONS 						= $8
Const TCS_BOTTOM 							= $2
Const TCS_HOTTRACK 							= $40
Const TCS_RAGGEDRIGHT 						= $800
Const TCS_VERTICAL 							= $80
Const TCS_FOCUSONBUTTONDOWN 				= $1000
Const TCS_BUTTONS 							= $100
Const TCS_FIXEDWIDTH 						= $400
Const TCS_FOCUSNEVER 						= $8000
Const TCS_FORCEICONLEFT 					= $10
Const TCS_FORCELABELLEFT 					= $20
Const TCS_MULTISELECT 						= 4
Const TCS_RIGHT 							= 2
Const TCS_RIGHTJUSTIFY 						= 0
Const TCS_SCROLLOPPOSITE 					= 1
Const TCS_TABS 								= 0
Const TCS_TOOLTIPS 							= $4000

Const TCS_EX_FLATSEPARATORS 				= 1
Const TCS_EX_REGISTERDROP 					= 2

Const LVS_ALIGNLEFT 						= $800
Const LVS_ALIGNMASK 						= $c00
Const LVS_ALIGNTOP 							= 0
Const LVS_AUTOARRANGE						= $100
Const LVS_EDITLABELS 						= $200
Const LVS_ICON 								= 0
Const LVS_LIST 								= 3
Const LVS_NOCOLUMNHEADER 					= $4000
Const LVS_NOLABELWRAP 						= $80
Const LVS_NOSCROLL 							= $2000
Const LVS_NOSORTHEADER 						= $8000
Const LVS_REPORT 							= 1
Const LVS_SHOWSELALWAYS 					= $8
Const LVS_SINGLESEL 						= 4
Const LVS_SMALLICON 						= 2
Const LVS_SORTASCENDING 					= $10
Const LVS_SORTDESCENDING 					= $20
Const LVS_TYPEMASK 							= 3
Const LVS_TYPESTYLEMASK 					= $fc00

Const LVS_EX_FULLROWSELECT 					= $20
Const LVS_EX_GRIDLINES 						= 1
Const LVS_EX_BORDERSELECT 					= $8000
Const LVS_EX_CHECKBOXES 					= 4
Const LVS_EX_DOUBLEBUFFER 					= $10000
Const LVS_EX_FLATSB 						= $100
Const LVS_EX_HEADERDRAGDROP 				= $10
Const LVS_EX_HIDELABELS 					= $20000
Const LVS_EX_INFOTIP 						= $400
Const LVS_EX_LABELTIP 						= $4000
Const LVS_EX_MULTIWORKAREAS 				= $2000
Const LVS_EX_ONECLICKACTIVATE 				= $40
Const LVS_EX_REGIONAL 						= $200
Const LVS_EX_SINGLEROW 						= $40000
Const LVS_EX_SNAPTOGRID 					= $80000
Const LVS_EX_SUBITEMIMAGES 					= 2
Const LVS_EX_TRACKSELECT 					= $8
Const LVS_EX_TWOCLICKACTIVATE 				= $80
Const LVS_EX_UNDERLINECOLD 					= $1000
Const LVS_EX_UNDERLINEHOT 					= $800

Const PBS_SMOOTH 							= 1
Const PBS_VERTICAL 							= 4

Const TVS_CHECKBOXES 						= $100
Const TVS_DISABLEDRAGDROP 					= $0
Const TVS_EDITLABELS 						= $8
Const TVS_FULLROWSELECT 					= $1000
Const TVS_HASBUTTONS 						= 1
Const TVS_HASLINES 							= 2
Const TVS_INFOTIP 							= $800
Const TVS_LINESATROOT 						= 4
Const TVS_NOHSCROLL 						= $8000
Const TVS_NONEVENHEIGHT 					= $4000
Const TVS_NOSCROLL 							= $2000
Const TVS_NOTOOLTIPS 						= $80
Const TVS_RTLREADING 						= $40
Const TVS_SHOWSELALWAYS 					= $20
Const TVS_SINGLEEXPAND 						= $400
Const TVS_TRACKSELECT 						= $200

Const SS_BITMAP 							= $E
Const SS_BLACKFRAME 						= $7
Const SS_BLACKRECT 							= 4
Const SS_CENTER 							= 1
Const SS_CENTERIMAGE 						= $200
Const SS_ELLIPSISMASK 						= $C000
Const SS_ENDELLIPSIS 						= $4000
Const SS_ENHMETAFILE 						= $F
Const SS_ETCHEDFRAME 						= $12
Const SS_ETCHEDHORZ 						= $10
Const SS_ETCHEDVERT 						= $11
Const SS_GRAYFRAME 							= $8
Const SS_GRAYRECT 							= $5
Const SS_ICON 								= $3
Const SS_LEFT 								= 0
Const SS_LEFTNOWORDWRAP 					= $C
Const SS_SIMPLE 							= $B
Const SS_SUNKEN 							= $1000
Const SS_WHITEFRAME 						= $9
Const SS_WHITERECT 							= $6
Const SS_WORDELLIPSIS 						= $C000
Const SS_NOTIFY								= $100
Const SS_RIGHT 								= $2 

Const TBS_AUTOTICKS 						= 1
Const TBS_BOTH 								= 8
Const TBS_BOTTOM 							= 0
Const TBS_ENABLESELRANGE 					= $20
Const TBS_FIXEDLENGTH 						= $40
Const TBS_HORZ 		 						= 0
Const TBS_LEFT 								= 4
Const TBS_NOTHUMB 							= $80
Const TBS_NOTICKS 							= $10
Const TBS_REVERSED 							= $200
Const TBS_RIGHT 							= 0
Const TBS_TOP 								= 4
Const TBS_VERT 								= 2

Const UDS_ALIGNLEFT 						= $8
Const UDS_ALIGNRIGHT 						= 4
Const UDS_ARROWKEYS 						= $20
Const UDS_AUTOBUDDY 						= $10
Const UDS_HORZ 								= $40
Const UDS_HOTTRACK 							= $100
Const UDS_NOTHOUSANDS 						= $80
Const UDS_SETBUDDYINT 						= 2
Const UDS_WRAP 								= 1

Const MB_ABORTRETRYIGNORE 					= $2
Const MB_APPLMODAL 							= $0
Const MB_CANCELTRYCONTINUE 					= $6
Const MB_COMPOSITE 							= $2
Const MB_DEFAULT_DESKTOP_ONLY 				= $20000
Const MB_DEFBUTTON1 						= 0
Const MB_DEFBUTTON2 						= $100
Const MB_DEFBUTTON3 						= $200
Const MB_DEFBUTTON4 						= $300
Const MB_DEFMASK 							= $F00
Const MB_HELP 								= $4000
Const MB_ICONASTERISK 						= $40
Const MB_ICONEXCLAMATION 					= $30
Const MB_ICONHAND 							= $10
Const MB_ICONERROR 							= MB_ICONHAND
Const MB_ICONINFORMATION 					= MB_ICONASTERISK
Const MB_ICONMASK 							= $F0
Const MB_ICONQUESTION 						= $20
Const MB_ICONSTOP 							= MB_ICONHAND
Const MB_ICONWARNING 						= MB_ICONEXCLAMATION
Const MB_MISCMASK 							= $C000
Const MB_MODEMASK 							= $3000
Const MB_NOFOCUS 							= $8000
Const MB_OK 								= $0
Const MB_OKCANCEL 							= $1
Const MB_PRECOMPOSED 						= $1
Const MB_RETRYCANCEL 						= $5
Const MB_RIGHT 								= $80000
Const MB_RTLREADING 						= $100000
Const MB_SETFOREGROUND 						= $10000
Const MB_SYSTEMMODAL 						= $1000
Const MB_TASKMODAL 							= $2000
Const MB_TOPMOST 							= $40000
Const MB_TYPEMASK 							= $F
Const MB_USERICON 							= $80
Const MB_YESNO 								= 4
Const MB_YESNOCANCEL 						= 3

Const IDABORT								= 3				; Abort button was selected.
Const IDCANCEL								= 2				; Cancel button was selected.
Const IDIGNORE								= 5				; Ignore button was selected.
Const IDNO									= 7				; No button was selected.
Const IDOK									= 1				; OK button was selected.
Const IDRETRY								= 4				; Retry button was selected.
Const IDYES									= 6 			; Yes button was selected.
Const IDCONTINUE 							= 11			; Continue button selected.
Const IDCLOSE 								= 8				; Close button selected
Const IDHELP 								= 9				; Help button selected.
Const IDTRYAGAIN 							= 10			; Try again selected.

Const IDC_APPSTARTING						= 1		

Const IDC_ARROW								= 2 			; Standard arrow
Const IDC_CROSS								= 3 			; Crosshair
Const IDC_IBEAM								= 4 			; Text I-beam
Const IDC_ICON								= 5 			; Windows NT only: Empty icon
Const IDC_NO								= 6 			; Slashed circle
Const IDC_SIZE								= 7 			; Windows NT only: Four-pointed arrow
Const IDC_SIZEALL 							= 8 			; Same as IDC_SIZE
Const IDC_SIZENESW 							= 9 			; Double-pointed arrow pointing northeast And southwest
Const IDC_SIZENS							= 10 			; Double-pointed arrow pointing north And south
Const IDC_SIZENWSE 							= 11 			; Double-pointed arrow pointing northwest And southeast
Const IDC_SIZEWE  							= 12 			; Double-pointed arrow pointing west And east
Const IDC_UPARROW 							= 13 			; Vertical arrow
Const IDC_WAIT								= 14 			; Hourglass

Const RBS_AUTOSIZE 							= $2000
Const RBS_BANDBORDERS 						= $400
Const RBS_DBLCLKTOGGLE 						= $8000
Const RBS_FIXEDORDER 						= $800
Const RBS_REGISTERDROP 						= $1000
Const RBS_TOOLTIPS 							= $100
Const RBS_VARHEIGHT 						= $200
Const RBS_VERTICALGRIPPER 					= $4000

Const RBBS_BREAK 							= $1
Const RBBS_CHILDEDGE 						= $4
Const RBBS_FIXEDBMP 						= $20
Const RBBS_FIXEDSIZE 						= $2
Const RBBS_GRIPPERALWAYS 					= $80
Const RBBS_HIDDEN 							= $8
Const RBBS_HIDETITLE 						= $400
Const RBBS_NOGRIPPER 						= $100
Const RBBS_NOVERT 							= $10
Const RBBS_TOPALIGN 						= $800
Const RBBS_USECHEVRON 						= $200
Const RBBS_VARIABLEHEIGHT 					= $40

Const MOD_ALT 								= $10
Const MOD_CONTROL 							= $8
Const MOD_SHIFT 							= $4

Const WB3D_HOTKEYSLASH$ 					= $220
Const WB3D_HOTKEYTAB$ 						= $9
Global WB3D_MENUHOTKEY_SPACER$ 				= Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYTAB)

Global x = -1

Global y = -1

Global z

AppTitle "Particlos"

Graphics3D 1024,768, 32, 2

Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),0,0,GraphicsWidth(),GraphicsHeight())

Global copyright$ = "Copyright (c) 2008 - 2009 Photo-Xtreme"+Chr$(13)+"          Created by: ~ZeldaX~"

Global w

Global menus
Global req
Global snd
Global snd1


Global snd2

Global PlaySound1

Global playa

Global menu1

Global menuii

Global menuselect = 0
Global file1$

Global keypressed
Global menu

WB3D_HotKeyEvent MOD_CONTROL,65,1	; ctrl+a
WB3D_HotKeyEvent MOD_CONTROL,76,78	; ctrl+l

WB3D_DragAcceptFiles(RuntimeWindow_hWnd, 1)

menus = WB3D_WindowMenu(RuntimeWindow_hWnd)
file = WB3D_CreateMenu("&File",0,menus,0)
	OpenItem = WB3D_CreateMenu("Open",1,file,0) 
	
	SaveItem = WB3D_CreateMenu("Save",2,file,0)

	WB3D_CreateMenu("",0,file,0)
	QuitItem = WB3D_CreateMenu("Quit",3,file,0)

about = WB3D_CreateMenu("About",0,menus,1)

about1 = WB3D_CreateMenu("About...",4,about,0)
		
u=WB3D_UpdateWindowMenu(RuntimeWindow_hWnd)

statusbar = WB3D_CreateStatusBar(RuntimeWindow_hWnd,"")
s1=WB3D_SetStatusParts(statusbar,3)

s2=WB3D_StatusPartWidth(statusbar,0,150)
s3=WB3D_StatusPartWidth(statusbar,1,150)
s4=WB3D_StatusPartWidth(statusbar,2,150)
s5=WB3D_StatusPartWidth(statusbar,3,150)

WB3D_UpdateStatusbar(statusbar)

WB3D_FlushEvents()

; setup out quit flag, and loop until the flag is set.
QUIT = 0

Light  = CreateLight()

Listener = CreateListener(Cam, .005, 1, 1)

tabber = WB3D_CreateTabber(0,0,GraphicsWidth()/4,GraphicsHeight(),Runtimewindow_hWnd,0)
WB3D_SetGadgetIconStrip(tabber,icons)
s6=WB3D_CreateToolTip(tabber,"Im a tabber tooltip",0)

For loop = 0 To 10
	icon_index = Rnd(0,5)
	WB3D_AddGadgetItem tabber,"item: "+loop,0,icon_index
Next

panel0 = WB3D_CreateTabberPanel(5,30,200,100,tabber)
button_tab0 = WB3D_CreateButton("Show Panel Splash",5,10,190,40,panel0,0)
WB3D_CreateToolTip button_tab0,"show me the splash",1

font = WB3D_OpenFont("blitz",8,8,True,True,True) ; set bold ,italic ,underline to true
WB3D_Usefont button_tab0,font


panel1 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab1 = WB3D_CreateButton("Tab1",10,10,100,20,panel1,0)
WB3D_HideGadget panel1

panel2 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab2 = WB3D_CreateButton("Tab2",10,10,100,20,panel2,0)
WB3D_HideGadget panel2

panel3 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab3 = WB3D_CreateButton("Tab3",10,10,100,20,panel3,0)
WB3D_HideGadget panel3

While Not KeyHit(1)

WB3D_SetStatusText statusbar,0,"FPS:"+framesrate#
WB3D_SetStatusText statusbar,1,"playa:"+playa
WB3D_SetStatusText statusbar,2,"chanplay:"+ChannelPlaying(snd1)

time$ = CurrentTime$()

If time$ >= 12 Then am_pm$ = "PM"

If time$ < 12 Then am_pm$ = "AM"

	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	DebugLog event
	
	Select event
		
		Case WB3D_EVENT_MENU
		
		 Select WB3D_EventData()
					
				Case 1
				
					ext$ = "*.mid"+Chr$(0)+"*.mid"+Chr$(0)+"*.mp3"+Chr$(0)+"*.mp3"+Chr$(0)
					file1$ = WB3D_OpenFileRequest("Open","..",ext$,"") : test = 1
											
				If FileExtension(file1$) = ".mp3"
				req = 1
				Else
				req = 0
				EndIf
				
				If req Then snd = LoadSound(file1$) : request() : test = 1
										
				Case 2
					
				Case 3
					QUIT = 1
					
				Case 4
					WB3D_Notify "Menu",copyright$,0
				
				Case 5
				
				Case 6
				
			End Select
			
			Case WB3D_EVENT_DRAGDROP
			
			For do_files = 0 To WB3D_CountDroppedFiles()
		              	file1$ = WB3D_DroppedFileName(do_files)
				req = 1
				
				If req Then snd2 = 1
								
			Next
			
			 If snd2 Then request()
					
						event = WB3D_WaitEvent()	
	                   Select event			
						
							Case tabber
					selectedtab = WB3D_EventData()
					
					Select selectedtab
					
						Case 0
							WB3D_ShowGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 1
							WB3D_ShowGadget panel1
							WB3D_HideGadget panel0
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 2
							WB3D_ShowGadget panel2
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel3
					
						Case 3
							WB3D_ShowGadget panel3
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
					
					Default
										
						WB3D_Notify "Tab Selected","Tab Selected "+selectedtab,0
	
						WB3D_HideGadget panel0
						WB3D_HideGadget panel1
						WB3D_HideGadget panel2
						WB3D_HideGadget panel3	
											
				End Select
			End Select
				
		Case WB3D_EVENT_WINDOW_CLOSE
			;WB3D_ShowGadget RuntimeWindow_hWnd
	
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1

			End Select
		End Select

UpdateWorld
RenderWorld

Flip

Wend

If ChannelPlaying(snd1)

stopm()

EndIf

WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK

WB3D_EndGUI()
EndGraphics
End


Function FileExtension$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "." Return "."+Mid(File$, I% + 1)
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return ""
	Next
End Function

Function request()
					
If FileExtension(file1$) = ".mp3"

playa = 1
					
EndIf

If playa Then play()

If test = 1
stopm()

play()

EndIf

Return z

End Function

Function play()
																				
If ChannelPlaying(snd1) = 0 And playa

If FileExtension(file1$) = ".mp3" And ChannelPlaying(snd1) = 0 Then

load_music()

EndIf

Else

If ChannelPlaying(snd1) And playa

stopm()

play()

EndIf

EndIf

If menus = 1

menu1 = file1$
					
menuii = FileExtension(file1$)

EndIf
										
End Function

Function stopm()

If playa = 1

StopChannel snd1

EndIf

End Function

Function load_music()

snd1 = PlaySound(snd)

End Function


stayne, im using 1.1.

~DarkShadowWing~

ok. i have tried EVERYTHING to be able to fix the lag, but it STILL doesnt work.

can someone please be kind enough to help me?

Thanks =)

~DarkShadowWing~

What lag? After selecting the file? That's just the time Blitz take to load it into memory :P

Use the libs I sent you to play mp3/mid/wav, and it will open the files *much* faster, since it will be streaming then from disk, instead of loading it all to RAM.

i am. the problem is, after a while of loading songs, it lags ><

~DarkShadowWing~

I found the problem. how do i fix it? The event keeps lagging b/c it keeps reading.

Ok. I found the glitch by using both file => open, and drag & drop. not at the same time. i did this multiple times, i found it also by doing a debuglog event. it kept showing the events over & over. it should only do it once yes? and im using windows xp. also, i dont get why "case tabber" doesnt work.

if u dont understand what i said above, feel free to ask me questions =)

~DarkShadowWing~

anyone? please, i NEED to finish this project before January.

~DarkShadowWing~

Someone once asked me what it takes to be a programmer.
Answer, one word: Tenacity. (-and lots of coffee).

Debug. Debug. Debug.
No-one can do it for you.

And for your other questions on the forum, raid the code archives, and pick the code apart to learn.
No-ones got the time to do it for you. They've all learned the hard and slow way.

Thanks. but no thanks. I need help. I dont want it done for me. Alls I need is a lag fix. thats ALL i ask. nothing more. If no one is willing to help, then Ill just take it to another forum, and never come here again.

~DarkShadowWing~

I found the glitch by using both file => open, and drag & drop. not at the same time. i did this multiple times, i found it also by doing a debuglog event. it kept showing the events over & over. it should only do it once yes? and im using windows xp. also, i dont get why "case tabber" doesnt work.

Post a small example showing the problem and removing any unnecessary dependencies.

heres my code w/o anything added, and dependencies removed

Const WB3D_EVENT_GADGET						= $401
Const WB3D_EVENT_MENU						= $1001
Const WB3D_EVENT_MOUSEWHEEL					= $208
Const WB3D_EVENT_WINDOW_CLOSE				= $803
Const WB3D_EVENT_WINDOW_SIZE				= $802
Const WB3D_EVENT_WINDOW_SIZEING				= $805
Const WB3D_EVENT_WINDOW_MOVE				= $807
Const WB3D_EVENT_WINDOW_MOVING				= $806
Const WB3D_EVENT_MOUSE_MOVE					= $200
Const WB3D_EVENT_KEYPRESS					= $101
Const WB3D_EVENT_CONTEXTMENU				= $502
Const WB3D_EVENT_SYSTEMTRAY					= $503
Const WB3D_EVENT_DRAGDROP					= $504
Const WB3D_EVENT_MOUSE_DOWN 				= $201 
Const WB3D_EVENT_WINDOW_ACTIVATE			= $544
Const WB3D_EVENT_WINDOW_PAINT				= $594
Const WB3D_COLOR_GADGET 					= $514 
Const WINDOW_TITLEBAR                       = $10000000

Const WB3D_KEY_ENTER 						= $D
Const WB3D_KEY_TAB							= 9
Const WB3D_KEY_SHIFT 						= $10
Const WB3D_KEY_CONTROL 						= 17
Const WB3D_KEY_ESCAPE 						= 27
Const WB3D_KEY_SPACE 						= $20
Const WB3D_KEY_END 							= 35
Const WB3D_KEY_HOME 						= 36
Const WB3D_KEY_CURS_LEFT 					= 37
Const WB3D_KEY_CURS_UP 						= 38
Const WB3D_KEY_CURS_RIGHT 					= 39
Const WB3D_KEY_CURS_DOWN 					= 40
Const WB3D_KEY_INSERT 						= 45
Const WB3D_KEY_DELETE 						= 46
Const WB3D_KEY_NUMPAD0 						= 96
Const WB3D_KEY_NUMPAD1 						= 97
Const WB3D_KEY_NUMPAD2 						= 98
Const WB3D_KEY_NUMPAD3 						= 99
Const WB3D_KEY_NUMPAD4 						= 100
Const WB3D_KEY_NUMPAD5 						= 101
Const WB3D_KEY_NUMPAD6 						= 102
Const WB3D_KEY_NUMPAD7 						= 103
Const WB3D_KEY_NUMPAD8 						= 104
Const WB3D_KEY_NUMPAD9 						= 105
Const WB3D_KEY_F1 							= 112
Const WB3D_KEY_F2 							= 113
Const WB3D_KEY_F3 							= 114
Const WB3D_KEY_F4 							= 115
Const WB3D_KEY_F5 							= 116
Const WB3D_KEY_F6 							= 117
Const WB3D_KEY_F7 							= 118
Const WB3D_KEY_F8 							= 119
Const WB3D_KEY_F9 							= 120
Const WB3D_KEY_F10 							= 121
Const WB3D_KEY_F11 							= 122
Const WB3D_KEY_F12 							= 123
Const WB3D_KEY_NUMLOCK 						= 144
Const WB3D_KEY_SCROLL 						= 145


; default toolbar buttons
Const STD_COPY 								= 1
Const STD_CUT 								= 0
Const STD_DELETE 							= 5
Const STD_FILENEW 							= 6
Const STD_FILEOPEN 							= 7
Const STD_FILESAVE 							= 8
Const STD_FIND 								= 12
Const STD_HELP 								= 11
Const STD_PASTE 							= 2
Const STD_PRINT 							= 14
Const STD_PRINTPRE 							= 9
Const STD_PROPERTIES 						= 10

; standard window constants
Const WS_CHILD 								= $40000000
Const WS_VISIBLE 							= $10000000
Const WS_ACTIVECAPTION 						= 1
Const WS_BORDER 							= $800000
Const WS_CAPTION 							= $C00000
Const WS_CLIPCHILDREN 						= $2000000
Const WS_CLIPSIBLINGS 						= $4000000
Const WS_DISABLED 							= $8000000
Const WS_GROUP 								= $20000
Const WS_HSCROLL 							= $100000
Const WS_MAXIMIZE 							= $1000000
Const WS_MINIMIZE 							= $20000000
Const WS_MAXIMIZEBOX 						= $10000
Const WS_MINIMIZEBOX 						= $20000
Const WS_OVERLAPPED 						= 0
Const WS_POPUP 								= $80000000
Const WS_SYSMENU 							= $80000
Const WS_TABSTOP 							= $10000
Const WS_THICKFRAME 						= $40000
Const WS_VSCROLL 							= $200000
Const WS_ICONIC 							= WS_MINIMIZE
Const WS_TILED 								= WS_OVERLAPPED
Const WS_GT 								= WS_GROUP Or WS_TABSTOP
Const WS_SIZEBOX 							= WS_THICKFRAME
Const WS_POPUPWINDOW 						= WS_POPUP Or WS_BORDER Or WS_SYSMENU
Const WS_OVERLAPPEDWINDOW 					= WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Const WS_TILEDWINDOW 						= WS_OVERLAPPEDWINDOW
Const WS_DLGFRAME 							= $400000

Const WS_EX_ACCEPTFILES 					= $10
Const WS_EX_APPWINDOW 						= $40000
Const WS_EX_CLIENTEDGE 						= $200
Const WS_EX_CONTEXTHELP 					= $400
Const WS_EX_CONTROLPARENT 					= $10000
Const WS_EX_LAYERED 						= $80000
Const WS_EX_LAYOUTRTL 						= $400000
Const WS_EX_LEFT 							= 0
Const WS_EX_LEFTSCROLLBAR 					= $4000
Const WS_EX_LTRREADING 						= 0
Const WS_EX_NOACTIVATE 						= $8000000
Const WS_EX_NOINHERITLAYOUT 				= $100000
Const WS_EX_NOPARENTNOTIFY					= $4
Const WS_EX_RIGHT 							= $1000
Const WS_EX_RIGHTSCROLLBAR 					= $0
Const WS_EX_RTLREADING 						= $2000
Const WS_EX_STATICEDGE 						= $20000
Const WS_EX_TOOLWINDOW 						= $80
Const WS_EX_TOPMOST 						= $8
Const WS_EX_TRANSPARENT 					= $20
Const WS_EX_WINDOWEDGE 						= $100
Const WS_EX_DLGMODALFRAME 					= 1
Const WS_EX_PALETTEWINDOW 					= WS_EX_WINDOWEDGE Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST
Const WS_EX_OVERLAPPEDWINDOW 				= WS_EX_WINDOWEDGE Or WS_EX_CLIENTEDGE

Const BS_NULL 		 						= 1
Const BS_3STATE 							= 5
Const BS_AUTO3STATE  						= 6
Const BS_AUTOCHECKBOX 						= 3
Const BS_AUTORADIOBUTTON  					= $9
Const BS_BITMAP  							= $80
Const BS_BOTTOM  							= $800
Const BS_CENTER  							= $300
Const BS_CHECKBOX  							= 2
Const BS_DEFPUSHBUTTON  					= 1
Const BS_DIBPATTERN 						= 5
Const BS_DIBPATTERN8X8  					= 8
Const BS_DIBPATTERNPT  						= 6
Const BS_FLAT  								= $8000
Const BS_GROUPBOX  							= $7
Const BS_HOLLOW  							= BS_NULL
Const BS_ICON  								= $40
Const BS_INDEXED  							= 4
Const BS_LEFT  								= $100
Const BS_LEFTTEXT  							= $20
Const BS_MONOPATTERN  						= 9
Const BS_MULTILINE 							= $2000
Const BS_NOTIFY 							= $4000
Const BS_PUSHBUTTON 						= 0
Const BS_PUSHLIKE  							= $1000
Const BS_RADIOBUTTON  						= 4
Const BS_RIGHT 								= $200
Const BS_RIGHTBUTTON  						= BS_LEFTTEXT
Const BS_SOLID  							= 0
Const BS_TEXT  								= 0
Const BS_TOP  								= $400


Const CCS_ADJUSTABLE 						= $20
Const CCS_BOTTOM 		 					= 3
Const CCS_TOP 								= 1
Const CCS_VERT 							 	= $80
Const CCS_LEFT 								= (CCS_VERT Or CCS_TOP)
Const CCS_NODIVIDER 						= $40
Const CCS_NOMOVEY 							= 2
Const CCS_NOMOVEX 							= (CCS_VERT Or CCS_NOMOVEY)
Const CCS_NOPARENTALIGN 					= 8
Const CCS_NORESIZE 							= 4
Const CCS_RIGHT 							= (CCS_VERT Or CCS_BOTTOM)
Const TBSTATE_CHECKED 						= 1
Const TBSTATE_ELLIPSES 						= $40
Const TBSTATE_ENABLED 						= 4
Const TBSTATE_HIDDEN  						= 8
Const TBSTATE_INDETERMINATE 				= $10
Const TBSTATE_MARKED  						= $80
Const TBSTATE_PRESSED 						= $2
Const TBSTATE_WRAP 							= $20
Const TBSTYLE_ALTDRAG 						= $400
Const TBSTYLE_AUTOSIZE 						= $10
Const TBSTYLE_BUTTON 						= 0
Const TBSTYLE_CHECK 						= 2
Const TBSTYLE_GROUP 						= 4
Const TBSTYLE_CHECKGROUP 					= (TBSTYLE_GROUP Or TBSTYLE_CHECK)
Const TBSTYLE_CUSTOMERASE 					= $2000
Const TBSTYLE_DROPDOWN 						= 8
Const TBSTYLE_FLAT 							= $800
Const TBSTYLE_LIST 							= $1000
Const TBSTYLE_NOPREFIX 						= $20
Const TBSTYLE_REGISTERDROP 					= $4000
Const TBSTYLE_SEP 							= 1
Const TBSTYLE_TOOLTIPS 						= $100
Const TBSTYLE_TRANSPARENT 					= $8000
Const TBSTYLE_WRAPABLE 		 				= $200

Const TBSTYLE_EX_DOUBLEBUFFER 				= $80
Const TBSTYLE_EX_DRAWDDARROWS 				= $1
Const TBSTYLE_EX_HIDECLIPPEDBUTTONS 		= $10
Const TBSTYLE_EX_MIXEDBUTTONS 				= $8

Const ES_AUTOHSCROLL 		 				= $80
Const ES_AUTOVSCROLL 						= $40
Const ES_CENTER 							= 1
Const ES_CONTINUOUS 						= $80000000
Const ES_DISABLENOSCROLL 					= $2000
Const ES_DISPLAY_REQUIRED 					= 2
Const ES_EX_NOCALLOLEINIT 					= $1000000
Const ES_LEFT 								= 0
Const ES_LOWERCASE 							= $10
Const ES_MULTILINE 							= 4
Const ES_NOHIDESEL 							= $100
Const ES_NOIME 								= $80000
Const ES_NOOLEDRAGDROP 						= $8
Const ES_NUMBER 							= $2000
Const ES_OEMCONVERT 						= $400
Const ES_PASSWORD 							= $20
Const ES_READONLY 							= $800
Const ES_RIGHT 								= 2
Const ES_SAVESEL 							= $8000
Const ES_SELECTIONBAR 						= $1000000
Const ES_SELFIME 							= $40000
Const ES_SUNKEN 							= $4000
Const ES_SYSTEM_REQUIRED 					= 1
Const ES_UPPERCASE 							= $8
Const ES_USER_PRESENT 						= 4
Const ES_VERTICAL 							= $400000
Const ES_WANTRETURN 						= $1000

Const CFM_BOLD = 1
Const CFM_COLOR = $40000000
Const CFM_ITALIC = 2
Const CFM_STRIKEOUT = $8

Const CBS_AUTOHSCROLL 						= $40
Const CBS_DISABLENOSCROLL 					= $800
Const CBS_DROPDOWN 							= 2
Const CBS_DROPDOWNLIST 						= 3
Const CBS_HASSTRINGS 						= $200
Const CBS_LOWERCASE 						= $4000
Const CBS_NOINTEGRALHEIGHT 					= $400
Const CBS_OEMCONVERT 						= $80
Const CBS_SIMPLE 							= 1
Const CBS_SORT 								= $100
Const CBS_UPPERCASE 						= $2000

Const TCS_MULTILINE 						= $200
Const TCS_SINGLELINE 						= $0
Const TCS_FLATBUTTONS 						= $8
Const TCS_BOTTOM 							= $2
Const TCS_HOTTRACK 							= $40
Const TCS_RAGGEDRIGHT 						= $800
Const TCS_VERTICAL 							= $80
Const TCS_FOCUSONBUTTONDOWN 				= $1000
Const TCS_BUTTONS 							= $100
Const TCS_FIXEDWIDTH 						= $400
Const TCS_FOCUSNEVER 						= $8000
Const TCS_FORCEICONLEFT 					= $10
Const TCS_FORCELABELLEFT 					= $20
Const TCS_MULTISELECT 						= 4
Const TCS_RIGHT 							= 2
Const TCS_RIGHTJUSTIFY 						= 0
Const TCS_SCROLLOPPOSITE 					= 1
Const TCS_TABS 								= 0
Const TCS_TOOLTIPS 							= $4000

Const TCS_EX_FLATSEPARATORS 				= 1
Const TCS_EX_REGISTERDROP 					= 2

Const LVS_ALIGNLEFT 						= $800
Const LVS_ALIGNMASK 						= $c00
Const LVS_ALIGNTOP 							= 0
Const LVS_AUTOARRANGE						= $100
Const LVS_EDITLABELS 						= $200
Const LVS_ICON 								= 0
Const LVS_LIST 								= 3
Const LVS_NOCOLUMNHEADER 					= $4000
Const LVS_NOLABELWRAP 						= $80
Const LVS_NOSCROLL 							= $2000
Const LVS_NOSORTHEADER 						= $8000
Const LVS_REPORT 							= 1
Const LVS_SHOWSELALWAYS 					= $8
Const LVS_SINGLESEL 						= 4
Const LVS_SMALLICON 						= 2
Const LVS_SORTASCENDING 					= $10
Const LVS_SORTDESCENDING 					= $20
Const LVS_TYPEMASK 							= 3
Const LVS_TYPESTYLEMASK 					= $fc00

Const LVS_EX_FULLROWSELECT 					= $20
Const LVS_EX_GRIDLINES 						= 1
Const LVS_EX_BORDERSELECT 					= $8000
Const LVS_EX_CHECKBOXES 					= 4
Const LVS_EX_DOUBLEBUFFER 					= $10000
Const LVS_EX_FLATSB 						= $100
Const LVS_EX_HEADERDRAGDROP 				= $10
Const LVS_EX_HIDELABELS 					= $20000
Const LVS_EX_INFOTIP 						= $400
Const LVS_EX_LABELTIP 						= $4000
Const LVS_EX_MULTIWORKAREAS 				= $2000
Const LVS_EX_ONECLICKACTIVATE 				= $40
Const LVS_EX_REGIONAL 						= $200
Const LVS_EX_SINGLEROW 						= $40000
Const LVS_EX_SNAPTOGRID 					= $80000
Const LVS_EX_SUBITEMIMAGES 					= 2
Const LVS_EX_TRACKSELECT 					= $8
Const LVS_EX_TWOCLICKACTIVATE 				= $80
Const LVS_EX_UNDERLINECOLD 					= $1000
Const LVS_EX_UNDERLINEHOT 					= $800

Const PBS_SMOOTH 							= 1
Const PBS_VERTICAL 							= 4

Const TVS_CHECKBOXES 						= $100
Const TVS_DISABLEDRAGDROP 					= $0
Const TVS_EDITLABELS 						= $8
Const TVS_FULLROWSELECT 					= $1000
Const TVS_HASBUTTONS 						= 1
Const TVS_HASLINES 							= 2
Const TVS_INFOTIP 							= $800
Const TVS_LINESATROOT 						= 4
Const TVS_NOHSCROLL 						= $8000
Const TVS_NONEVENHEIGHT 					= $4000
Const TVS_NOSCROLL 							= $2000
Const TVS_NOTOOLTIPS 						= $80
Const TVS_RTLREADING 						= $40
Const TVS_SHOWSELALWAYS 					= $20
Const TVS_SINGLEEXPAND 						= $400
Const TVS_TRACKSELECT 						= $200

Const SS_BITMAP 							= $E
Const SS_BLACKFRAME 						= $7
Const SS_BLACKRECT 							= 4
Const SS_CENTER 							= 1
Const SS_CENTERIMAGE 						= $200
Const SS_ELLIPSISMASK 						= $C000
Const SS_ENDELLIPSIS 						= $4000
Const SS_ENHMETAFILE 						= $F
Const SS_ETCHEDFRAME 						= $12
Const SS_ETCHEDHORZ 						= $10
Const SS_ETCHEDVERT 						= $11
Const SS_GRAYFRAME 							= $8
Const SS_GRAYRECT 							= $5
Const SS_ICON 								= $3
Const SS_LEFT 								= 0
Const SS_LEFTNOWORDWRAP 					= $C
Const SS_SIMPLE 							= $B
Const SS_SUNKEN 							= $1000
Const SS_WHITEFRAME 						= $9
Const SS_WHITERECT 							= $6
Const SS_WORDELLIPSIS 						= $C000
Const SS_NOTIFY								= $100
Const SS_RIGHT 								= $2 

Const TBS_AUTOTICKS 						= 1
Const TBS_BOTH 								= 8
Const TBS_BOTTOM 							= 0
Const TBS_ENABLESELRANGE 					= $20
Const TBS_FIXEDLENGTH 						= $40
Const TBS_HORZ 		 						= 0
Const TBS_LEFT 								= 4
Const TBS_NOTHUMB 							= $80
Const TBS_NOTICKS 							= $10
Const TBS_REVERSED 							= $200
Const TBS_RIGHT 							= 0
Const TBS_TOP 								= 4
Const TBS_VERT 								= 2

Const UDS_ALIGNLEFT 						= $8
Const UDS_ALIGNRIGHT 						= 4
Const UDS_ARROWKEYS 						= $20
Const UDS_AUTOBUDDY 						= $10
Const UDS_HORZ 								= $40
Const UDS_HOTTRACK 							= $100
Const UDS_NOTHOUSANDS 						= $80
Const UDS_SETBUDDYINT 						= 2
Const UDS_WRAP 								= 1

Const MB_ABORTRETRYIGNORE 					= $2
Const MB_APPLMODAL 							= $0
Const MB_CANCELTRYCONTINUE 					= $6
Const MB_COMPOSITE 							= $2
Const MB_DEFAULT_DESKTOP_ONLY 				= $20000
Const MB_DEFBUTTON1 						= 0
Const MB_DEFBUTTON2 						= $100
Const MB_DEFBUTTON3 						= $200
Const MB_DEFBUTTON4 						= $300
Const MB_DEFMASK 							= $F00
Const MB_HELP 								= $4000
Const MB_ICONASTERISK 						= $40
Const MB_ICONEXCLAMATION 					= $30
Const MB_ICONHAND 							= $10
Const MB_ICONERROR 							= MB_ICONHAND
Const MB_ICONINFORMATION 					= MB_ICONASTERISK
Const MB_ICONMASK 							= $F0
Const MB_ICONQUESTION 						= $20
Const MB_ICONSTOP 							= MB_ICONHAND
Const MB_ICONWARNING 						= MB_ICONEXCLAMATION
Const MB_MISCMASK 							= $C000
Const MB_MODEMASK 							= $3000
Const MB_NOFOCUS 							= $8000
Const MB_OK 								= $0
Const MB_OKCANCEL 							= $1
Const MB_PRECOMPOSED 						= $1
Const MB_RETRYCANCEL 						= $5
Const MB_RIGHT 								= $80000
Const MB_RTLREADING 						= $100000
Const MB_SETFOREGROUND 						= $10000
Const MB_SYSTEMMODAL 						= $1000
Const MB_TASKMODAL 							= $2000
Const MB_TOPMOST 							= $40000
Const MB_TYPEMASK 							= $F
Const MB_USERICON 							= $80
Const MB_YESNO 								= 4
Const MB_YESNOCANCEL 						= 3

Const IDABORT								= 3				; Abort button was selected.
Const IDCANCEL								= 2				; Cancel button was selected.
Const IDIGNORE								= 5				; Ignore button was selected.
Const IDNO									= 7				; No button was selected.
Const IDOK									= 1				; OK button was selected.
Const IDRETRY								= 4				; Retry button was selected.
Const IDYES									= 6 			; Yes button was selected.
Const IDCONTINUE 							= 11			; Continue button selected.
Const IDCLOSE 								= 8				; Close button selected
Const IDHELP 								= 9				; Help button selected.
Const IDTRYAGAIN 							= 10			; Try again selected.

Const IDC_APPSTARTING						= 1		

Const IDC_ARROW								= 2 			; Standard arrow
Const IDC_CROSS								= 3 			; Crosshair
Const IDC_IBEAM								= 4 			; Text I-beam
Const IDC_ICON								= 5 			; Windows NT only: Empty icon
Const IDC_NO								= 6 			; Slashed circle
Const IDC_SIZE								= 7 			; Windows NT only: Four-pointed arrow
Const IDC_SIZEALL 							= 8 			; Same as IDC_SIZE
Const IDC_SIZENESW 							= 9 			; Double-pointed arrow pointing northeast And southwest
Const IDC_SIZENS							= 10 			; Double-pointed arrow pointing north And south
Const IDC_SIZENWSE 							= 11 			; Double-pointed arrow pointing northwest And southeast
Const IDC_SIZEWE  							= 12 			; Double-pointed arrow pointing west And east
Const IDC_UPARROW 							= 13 			; Vertical arrow
Const IDC_WAIT								= 14 			; Hourglass

Const RBS_AUTOSIZE 							= $2000
Const RBS_BANDBORDERS 						= $400
Const RBS_DBLCLKTOGGLE 						= $8000
Const RBS_FIXEDORDER 						= $800
Const RBS_REGISTERDROP 						= $1000
Const RBS_TOOLTIPS 							= $100
Const RBS_VARHEIGHT 						= $200
Const RBS_VERTICALGRIPPER 					= $4000

Const RBBS_BREAK 							= $1
Const RBBS_CHILDEDGE 						= $4
Const RBBS_FIXEDBMP 						= $20
Const RBBS_FIXEDSIZE 						= $2
Const RBBS_GRIPPERALWAYS 					= $80
Const RBBS_HIDDEN 							= $8
Const RBBS_HIDETITLE 						= $400
Const RBBS_NOGRIPPER 						= $100
Const RBBS_NOVERT 							= $10
Const RBBS_TOPALIGN 						= $800
Const RBBS_USECHEVRON 						= $200
Const RBBS_VARIABLEHEIGHT 					= $40

Const MOD_ALT 								= $10
Const MOD_CONTROL 							= $8
Const MOD_SHIFT 							= $4

Const WB3D_HOTKEYSLASH$ 					= $220
Const WB3D_HOTKEYTAB$ 						= $9
Global WB3D_MENUHOTKEY_SPACER$ 				= Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYSLASH) + Chr(WB3D_HOTKEYTAB)

Global x = -1

Global y = -1

Global z

AppTitle "Particlos"

Graphics3D 1024,768, 32, 2

Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),0,0,GraphicsWidth(),GraphicsHeight())

Global copyright$ = "Copyright (c) 2008 - 2009 Photo-Xtreme"+Chr$(13)+"          Created by: ~ZeldaX~"

Global w

Global menus
Global req
Global snd
Global snd1


Global snd2

Global PlaySound1

Global playa

Global menu1

Global menuii

Global menuselect = 0
Global file1$

Global keypressed
Global menu

WB3D_HotKeyEvent MOD_CONTROL,65,1	; ctrl+a
WB3D_HotKeyEvent MOD_CONTROL,76,78	; ctrl+l

WB3D_DragAcceptFiles(RuntimeWindow_hWnd, 1)

menus = WB3D_WindowMenu(RuntimeWindow_hWnd)
file = WB3D_CreateMenu("&File",0,menus,0)
	OpenItem = WB3D_CreateMenu("Open",1,file,0) 
	
	SaveItem = WB3D_CreateMenu("Save",2,file,0)

	WB3D_CreateMenu("",0,file,0)
	QuitItem = WB3D_CreateMenu("Quit",3,file,0)

about = WB3D_CreateMenu("About",0,menus,1)

about1 = WB3D_CreateMenu("About...",4,about,0)
		
u=WB3D_UpdateWindowMenu(RuntimeWindow_hWnd)

statusbar = WB3D_CreateStatusBar(RuntimeWindow_hWnd,"")
s1=WB3D_SetStatusParts(statusbar,3)

s2=WB3D_StatusPartWidth(statusbar,0,150)
s3=WB3D_StatusPartWidth(statusbar,1,150)
s4=WB3D_StatusPartWidth(statusbar,2,150)
s5=WB3D_StatusPartWidth(statusbar,3,150)

WB3D_UpdateStatusbar(statusbar)

WB3D_FlushEvents()

; setup out quit flag, and loop until the flag is set.
QUIT = 0

Light  = CreateLight()

Listener = CreateListener(Cam, .005, 1, 1)

tabber = WB3D_CreateTabber(0,0,GraphicsWidth()/4,GraphicsHeight(),Runtimewindow_hWnd,0)
WB3D_SetGadgetIconStrip(tabber,icons)
s6=WB3D_CreateToolTip(tabber,"Im a tabber tooltip",0)

For loop = 0 To 10
	icon_index = Rnd(0,5)
	WB3D_AddGadgetItem tabber,"item: "+loop,0,icon_index
Next

panel0 = WB3D_CreateTabberPanel(5,30,200,100,tabber)
button_tab0 = WB3D_CreateButton("Show Panel Splash",5,10,190,40,panel0,0)
WB3D_CreateToolTip button_tab0,"show me the splash",1

font = WB3D_OpenFont("blitz",8,8,True,True,True) ; set bold ,italic ,underline to true
WB3D_Usefont button_tab0,font


panel1 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab1 = WB3D_CreateButton("Tab1",10,10,100,20,panel1,0)
WB3D_HideGadget panel1

panel2 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab2 = WB3D_CreateButton("Tab2",10,10,100,20,panel2,0)
WB3D_HideGadget panel2

panel3 = WB3D_CreateTabberPanel(5,30,150,100,tabber)
button_tab3 = WB3D_CreateButton("Tab3",10,10,100,20,panel3,0)
WB3D_HideGadget panel3

While Not KeyHit(1)

WB3D_SetStatusText statusbar,0,"FPS:"+framesrate#
WB3D_SetStatusText statusbar,1,"playa:"+playa
WB3D_SetStatusText statusbar,2,"chanplay:"+ChannelPlaying(snd1)

time$ = CurrentTime$()

If time$ >= 12 Then am_pm$ = "PM"

If time$ < 12 Then am_pm$ = "AM"

Gosub bb

UpdateWorld
RenderWorld

Flip

Wend

If ChannelPlaying(snd1)

stopm()

EndIf

WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK

WB3D_EndGUI()
EndGraphics
End

.bb

	event = WB3D_WaitEvent()
	Select event

		Case WB3D_EVENT_MENU
		
		edata = WB3D_EventData()
		
;	     DebugLog "data:"+edata
										
		 Select edata
											
				Case 1

					ext$ = "*.mpg"+Chr$(0)+"*.mpg"+Chr$(0)+"*.mid"+Chr$(0)+"*.mid"+Chr$(0)+"*.midi"+Chr$(0)+"*.midi"+Chr$(0)+"*.mp3"+Chr$(0)+"*.mp3"+Chr$(0)+"*.wav"+Chr$(0)+"*.wav"+Chr$(0)
					file1$ = WB3D_OpenFileRequest("Open","..",ext$,"") : test = 1 : edata = 0
											
				If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" Or FileExtension(file1$) = ".midi" Or FileExtension(file1$) = ".wav"
				loc=1 : test = 1
				
				If loc Then request() : Else loc = 0
				
				;If test = 1 Then Emitter_Start(EM8) : Else test = 0
								
				EndIf
										
				Case 2
					
				Case 3
					QUIT = 1
					
				Case 4
					WB3D_Notify "Menu",copyright$,0
				
				Case 5
				
				Case 6
				
				Case 7
									
				End Select
			
			Case WB3D_EVENT_DRAGDROP
			
			For do_files = 0 To WB3D_CountDroppedFiles()
		              	file1$ = WB3D_DroppedFileName(do_files)
				req = 1
				
				If req Then snd2 = 1
								
			Next
			
			 If snd2 Then request() : test = 1 : event = 0
						
			;If test = 1
						
			;Emitter_Start(EM8)
			
			;EndIf

		
		Case $1001 ; menu selection
			
			menuID = WB3D_EventData()
			Select menuID
				
				Case 44
					WB3D_Notify "","here",0
					
				Case 2 ; open
					; file extensions
					; first the description then the .extension
					file_ext$ = "BlitzBasic Source Code"+Chr(0)+"*.bb"+Chr(0)+"Text"+Chr(0)+"*.txt"+Chr(0)
					open$ = WB3D_OpenFileRequest("select file open","D:\Blitz3D_GUI_DLL",file_ext$,"Test")
					If open$ <> "" Then WB3D_Notify("Selected File To Open",open$,0)
				
				Case 3 ; save
					save_file_ext$ = "BlitzBasic Source Code"+Chr(0)+"*.bb"+Chr(0)+"Text"+Chr(0)+"*.txt"+Chr(0)
					save$ = WB3D_SaveFileRequest("select file save","D:\Blitz3D_GUI_DLL",save_file_ext$,"Test")
					If save$ <> "" Then WB3D_Notify("Selected File To Save",save$,0)
					
				Case 4 ; quit
					
					WB3D_EndGUI()
					EndGraphics 
					
					Print "finished press mouse button"
					MouseWait
					End
				
				Case 5,6,7 ; test radio check menu items 5,6,7
					WB3D_RadiocheckMenu editmenu_window_1,5,7,menuID

				Case 15 
					
					
					selectedColor = WB3D_RequestColor(100,100,105)
					If selectedColor <> 0 Then
						red = WB3D_RequestedRED()
						green = WB3D_RequestedGREEN()
						blue = WB3D_RequestedBLUE()
					EndIf
					WB3D_Notify "colors","red "+red+" green "+green+" blue "+blue,0

				Case 16
					newdir$ = WB3D_RequestDir("Select NEW Folder",newdir$)
					WB3D_Notify "folder selected","You Selected: "+newdir$,0
				
				Case 17
					font = WB3D_OpenFontRequest()
					WB3D_Notify "font selected","Selected font pointer: "+font,0
					WB3D_Usefont button,font
					
				Case 6000
					;Notify "context menu","6000",0
					WB3D_ShowGadget RuntimeWindow_hWnd
					WB3D_ShowGadget window
					
				Case 6001
					;Notify "context menu","6001",0
					WB3D_HideGadget RuntimeWindow_hWnd
					WB3D_HideGadget window
				Case 6002
					WB3D_Notify "WB3D Demo","WB3D Copyright Kevin Poole"+Chr(13)+"2005,2006.",0
					
				Case 5000
					WB3D_Notify "context menu","5000",0
					
				Case 5001
					WB3D_Notify "context menu","5001",0
							
			End Select
			
		Case $208	; mouse wheel
				flagkey = WB3D_EventFlagKey()
				wheeldata = WB3D_EventData()
				cursx = WB3D_EventX()
				cursy = WB3D_EventY()
						
		Case WB3D_EVENT_GADGET	; gadget event
			id = WB3D_EventSource()
			
			Select id
				
				Case floatbutton
					ret_notify_code = WB3D_Notify("Testing......","WB3D_Notify Test",MB_CANCELTRYCONTINUE Or MB_ICONEXCLAMATION)
					Select ret_notify_code
						Case IDCANCEL
							WB3D_Notify "You Selected","Cancel button was selected",0
								
						Case IDRETRY
						 	WB3D_Notify "You Selected","Retry button was selected",0
						
						Case IDCONTINUE
						 	WB3D_Notify "You selected","Continue button selected",0
						
					End Select
					
				Case trackbar_red
					track_red_pos = WB3D_GetTrackBarPos(trackbar_red)

				Case trackbar_green
					track_green_pos = WB3D_GetTrackBarPos(trackbar_green)

				Case trackbar_blue
					track_blue_pos = WB3D_GetTrackBarPos(trackbar_blue)
					
					
				Case toggle1 
					WB3D_Notify "","Toggle Button State "+WB3D_ButtonState(toggle1),0

				Case toggle2 
					WB3D_Notify "","Toggle Button State "+WB3D_ButtonState(toggle2),0
					
				Case button_tab0
					splash_window = WB3D_CreateWindow("spash window",400,140,320,250,0,0)
					panel_splash = WB3D_CreatePanel(20,20,400,200,splash_window,0)
					WB3D_AddPanelImage panel_splash,"SPLASH.bmp"

				Case button_tab1
					WB3D_Notify "button_tab1","button_tab1",0

				Case button_tab2
					WB3D_Notify "button_tab2","button_tab2",0

				Case button_tab3
					WB3D_Notify "button_tab3","button_tab3",0
					
				Case toolbar
					WB3D_Notify "toolbar","toolbar: "+WB3D_EventData(),0

				Case toolbar2
					WB3D_Notify "toolbar2","toolbar2: "+WB3D_EventData(),0
					
				Case listview
					
					If WB3D_EventEdited() = 0 Then

						selectedcolumn = WB3D_EventData()
						If(selectedcolumn = -1) Then
							oldicon = WB3D_SetGadgetItemIcon(WB3D_EventSource(),WB3D_SelectedListViewItem(listview),22,0)
							WB3D_Notify "listview","listview item selected "+WB3D_SelectedListViewItem(listview),0
						Else
							WB3D_Notify "listview","listview column clicked "+selectedcolumn,0
						EndIf
					
					EndIf
																
				Case button
					
					
				Case edit
					 
				Case combo1
					selected = WB3D_SelectedGadgetItem(combo1)
					
					If selected <> -1 Then
						WB3D_Notify "combo Selected","combo Selected "+selected,0
					
					Else
						If WB3D_GetEditedLabel() <> "" Then
							WB3D_ModifyGadgetItem WB3D_EventSource(),WB3D_GetEditedLabelIndex(),WB3D_GetEditedLabel(),-1	; -1 use same icon
							WB3D_SelectGadgetItem WB3D_EventSource(),WB3D_GetEditedLabelIndex()
						EndIf
					EndIf

				Case combo2
					selected = WB3D_SelectedGadgetItem(combo2)
					
					If selected <> -1 Then
						WB3D_Notify "combo Selected","combo Selected "+selected,0
					
					Else
						If WB3D_GetEditedLabel() <> "" Then
							WB3D_ModifyGadgetItem WB3D_EventSource(),WB3D_GetEditedLabelIndex(),WB3D_GetEditedLabel(),-1	; -1 use same icon
							WB3D_SelectGadgetItem WB3D_EventSource(),WB3D_GetEditedLabelIndex()
						EndIf
					EndIf
					
				Case listbox
								
										
					If WB3D_EventEdited() = 0 Then
												
						; wb3d_eventdata returns -1 if the items label was clicked, or the index of
						; the items whos checkbox has been selected
						checkbox_selected = WB3D_EventData()
					
						; has the listbox checkbox generated the event?
						If checkbox_selected = -1 Then
							selected = WB3D_SelectedGadgetItem(listbox)
							oldicon = WB3D_SetGadgetItemIcon(WB3D_EventSource(),selected,22,0)
							WB3D_Notify "listbox Selected","listbox Selected "+selected,0
						Else
							selected = checkbox_selected
							WB3D_Notify "listbox Selected","listbox Selected "+selected+Chr(13)+"Checkbox Selected "+WB3D_ListCheckState(listbox,selected),0
						EndIf
								
					Else
						If WB3D_GetEditedLabel() <> "" Then
							WB3D_ModifyGadgetItem WB3D_EventSource(),WB3D_GetEditedLabelIndex(),WB3D_GetEditedLabel(),0
						EndIf
					EndIf
					

				Case button2
					
					WB3D_ShowGadget window_floating
										
										
				Case tabber
					selectedtab = WB3D_EventData()
					
					Select selectedtab
					
						Case 0
							WB3D_ShowGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 1
							WB3D_ShowGadget panel1
							WB3D_HideGadget panel0
							WB3D_HideGadget panel2
							WB3D_HideGadget panel3
						
						Case 2
							WB3D_ShowGadget panel2
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel3
						
						Case 3
							WB3D_ShowGadget panel3
							WB3D_HideGadget panel0
							WB3D_HideGadget panel1
							WB3D_HideGadget panel2
					
					Default
						WB3D_Notify "Tab Selected","Tab Selected "+selectedtab,0
	
						WB3D_HideGadget panel0
						WB3D_HideGadget panel1
						WB3D_HideGadget panel2
						WB3D_HideGadget panel3		
					End Select
					
					oldicon = WB3D_SetGadgetItemIcon(WB3D_EventSource(),selectedtab,22,0)
					
				Case treeview
					
					selectednode = WB3D_EventData()
					
					If selectednode = subnode1 
						WB3D_Notify "subnode1 ","subnode1 selected",0
					Else
						WB3D_Notify "selected node","Selected Node "+selectednode ,0
					EndIf
					
					If WB3D_GetEditedLabelIndex() Then
						If WB3D_GetEditedLabel() <> "" Then
							WB3D_ModifyTreeViewNode WB3D_EventSource(),WB3D_GetEditedLabelIndex(),WB3D_GetEditedLabel()
						EndIf
					EndIf
					
					WB3D_SetGadgetItemIcon(WB3D_EventSource(),selectednode,22,1)

 
				Case name_field
					;
					WB3D_SetGadgetText window,WB3D_GetGadgetText(name_field)
					;WB3D_Notify "",Len(WB3D_GetGadgetText(name_field)),0
									
				
			End Select
			
		Case WB3D_EVENT_WINDOW_CLOSE   ; close window
			
			closewin = WB3D_EventSource()
			If closewin = window_floating Then
				WB3D_HideGadget window_floating
			EndIf
						
		Case $802	; window size
			; for move,moving,size,sizing see 
			; WB3D_EventData() - edge being moved Or sized
			; WB3D_EventX()	- new size, position
			; WB3D_EventY()	- new size position
			
			; update window toolbars
			;WB3D_UpdateToolbar toolbar
			;WB3D_UpdateToolbar toolbar2
			
			
			; update the status bars
			;WB3D_UpdateStatusbar status
			;WB3D_UpdateStatusbar rstatus
			

		Case $805	; window sizing	
		WB3D_Notify "","NO",0
			
		Case $806	; window moving
		WB3D_Notify "","NO",0
		
		Case $807	; window move
		
		Case $200	; mousemove
			gadget_mouse_over = WB3D_EventSource()
			gadget_mouse_overX = WB3D_EventX()
			gadget_mouse_overY = WB3D_EventY()
							
		Case $101	; key down
			
			gadget_keydown = WB3D_EventSource()
			key_code = WB3D_EventData()	
			
			Select gadget_keydown
				
				Case name_field
					If key_code = WB3D_KEY_ENTER Then
						WB3D_Notify "Gadget Contents",WB3D_GetGadgetText(name_field),0
					EndIf
				
				Case edit
					If key_code = WB3D_KEY_ENTER Then
						WB3D_Notify "Gadget Contents",WB3D_TextAreaText(edit),0
					EndIf

				Case listbox
					If key_code = WB3D_KEY_ENTER Then
						WB3D_Notify "Selected Gadget Item","You Selected Item: "+WB3D_SelectedGadgetItem(listbox)+Chr(13)+"Item Text: "+WB3D_GadgetItemText(listbox,WB3D_SelectedGadgetItem(listbox)),0
					EndIf
				
				Case spinner_label
					
					If key_code = WB3D_KEY_ENTER Then
						WB3D_Notify "Spinner ","Spinner Value "+WB3D_GetSpinnerPos(spinner),0
						;WB3D_SetSpinnerPos(spinner,WB3D_GetGadgetText(spinner_label))
					EndIf
					
			End Select
		
		Case $502	; gadgets context menus
				gadget = WB3D_EventSource()
				
				;;Notify Hex(window),Hex(gadget),0
								
				contextmenu_popup = 0
				Select gadget
						
					Case RuntimeWindow_hWnd	
						contextmenu_popup = contextmenu_RuntimeWindow_hWnd
					
					Case button,button3
						contextmenu_popup = contextmenu_button_hWnd
					
					Case listview,listbox
						contextmenu_popup = contextmenu_list_hWnd
					
					Case edit 
						contextmenu_popup = contextmenu_edit_hWnd
								
				End Select
				WB3D_TrackContextMenu(gadget,contextmenu_popup,WB3D_EventX(),WB3D_EventY())
			
		Case $503	; system tray
			
			eventtype = WB3D_EventData()
			
			Select eventtype
				
				Case 1
					WB3D_Notify "system tray","system tray left mouse double click",0

				Case 2,3
					WB3D_TrackContextMenu(WB3D_EventSource(),contextmenu,WB3D_EventX(),WB3D_EventY())
			End Select
		
		
;		Case $504	; drag and drop files
;			gadget = WB3D_EventSource()
			
			
;			For do_files = 0 To WB3D_CountDroppedFiles()
;				WB3D_Notify "",""+WB3D_DroppedFileName(do_files),0
;			Next
		
		Case $200
												
	Default
		
		; reset wheel move flag 	
		wheeldata = 0
		
	End Select

Return

Function FileExtension$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "." Return "."+Mid(File$, I% + 1)
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return ""
	Next
End Function

Function request()
					
If FileExtension(file1$) = ".mp3"

playa = 1
					
EndIf

If playa Then play()

If test = 1
stopm()

play()

EndIf

Return z

End Function

Function play()
																				
If ChannelPlaying(snd1) = 0 And playa

If FileExtension(file1$) = ".mp3" And ChannelPlaying(snd1) = 0 Then

load_music()

EndIf

Else

If ChannelPlaying(snd1) And playa

stopm()

play()

EndIf

EndIf

If menus = 1

menu1 = file1$
					
menuii = FileExtension(file1$)

EndIf
										
End Function

Function stopm()

If playa = 1

StopChannel snd1

EndIf

End Function

Function load_music()

snd1 = PlaySound(snd)

End Function


heres a working drag&drop

Include "WB3DStyles.bb"

; setup gfx mode.
Graphics3D 640,480,16,3


Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,600)
WB3D_DragAcceptFiles RuntimeWindow_hWnd,True


; 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 

; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1
 	
	Cls
		
	
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_DRAGDROP
			Select WB3D_EventSource()	

				Case RuntimeWindow_hWnd
				
					For do_files = 0 To WB3D_CountDroppedFiles()
		              	file$ = WB3D_DroppedFileName(do_files)
						WB3D_Notify "dropped files",file$,0	
					Next
				
			End Select			

		
		Case WB3D_EVENT_GADGET
			Select WB3D_EventSource()	

			End Select			

		Case WB3D_EVENT_WINDOW_CLOSE
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
				
			End Select
			
	End Select
	
	; generate an internal blitz event
	Flip

Wend

; use notify using external winapi constants. 
WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK
WB3D_EndGUI()
EndGraphics
End


Sorry but i dont quite understand what you want and whats not working, looking through your post i cant seem to make sence of the problem. looking at your code above i would recommend you use the event loop in such away as my examples.

a basic event loop under winblitz3d
Include "WB3DStyles.bb"

; setup gfx mode.
Graphics3D 640,480,16,3


Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,600)

; 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 

; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1
 	
	Cls
		
	
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_DRAGDROP
	
		Case WB3D_EVENT_GADGET

		Case WB3D_EVENT_WINDOW_CLOSE
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
				
			End Select
			
	End Select
	
	; generate an internal blitz event
	Flip

Wend

; use notify using external winapi constants. 
WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK
WB3D_EndGUI()
EndGraphics
End


please if you can be clearer of your problem im happy to help

kev

Well, the problem is. When it starts playing a song (Loads a song into memory), it starts lagging, or taking up memory usage. and it keeps going. I ran some tests, and windows media player doesnt take up memory usage when PLAYING the song. only when LOADING the song. so ONE of the events keeps repeating itself, i think. What I wanna know is how I can play a song multiple times w/o it taking up memory usage, except when loading the song.

Thanks Kev =)

~DarkShadowWing~

i would do it like so, i first create an array to hold the playlist. I then load and play the first item in the playlist, finaly i check if the songs still playing if not i free it then move to the next song in the playlist.

and example

Include "WB3DStyles.bb"

; setup gfx mode.
Graphics3D 640,480,16,3


Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,600)
WB3D_DragAcceptFiles RuntimeWindow_hWnd,True

; quick playlist contains the filename of files To be played
Dim playlist$(200)

; the playing loaded_song, and its play status  
Global loaded_song,loaded_song_playing

; the index of the loaded_song playing
Global current_loaded_song_index = 0

; 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 

; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1
 	
	Cls
		
	
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
		
		Case WB3D_EVENT_DRAGDROP
			Select WB3D_EventSource()	

				Case RuntimeWindow_hWnd
				
					For do_files = 0 To WB3D_CountDroppedFiles()
		              	file$ = WB3D_DroppedFileName(do_files)
						playlist(do_files) = file$
					Next
				
			End Select			

			; play first loaded_song in playlist
			loaded_song = LoadSound(playlist(current_loaded_song_index))
			loaded_song_playing = PlaySound(loaded_song)
			
		Case WB3D_EVENT_GADGET
			Select WB3D_EventSource()	

			End Select			

		Case WB3D_EVENT_WINDOW_CLOSE
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
				
			End Select
			
	End Select

	Text 10,10,"Playing loaded_song: "+playlist(current_loaded_song_index)
	
	; generate an internal blitz event
	Flip


	; process the playlist
	process_playlist()
	
	
Wend

; plays the next loaded_song in the playlist, or reset to the first loaded_song.
Function process_playlist()

	; return if loaded_songs still playing
	If ChannelPlaying(loaded_song_playing) = 1 
		Return
	Else
	
		; free the memory of the finished loaded_song
		FreeSound loaded_song

		; move to the next loaded_song in the playlist
		current_loaded_song_index = current_loaded_song_index + 1

		; check we have a loaded_song in the playlist, if we do play it
		If playlist(current_loaded_song_index) <> "" Then
			loaded_song = LoadSound(playlist(current_loaded_song_index))
			loaded_song_playing = PlaySound(loaded_song)
		Else
			; loop playlist 
			current_loaded_song_index = 0
			loaded_song = LoadSound(playlist(current_loaded_song_index))
			loaded_song_playing = PlaySound(loaded_song)
		EndIf
	EndIf
	
End Function

; use notify using external winapi constants. 
WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK
WB3D_EndGUI()
EndGraphics
End



there no error checking with the example but it should point you in the right direction

kev

This helps a little bit. I cant figure out what to do to allow playlist() to be used with file request function: request(). I need to know how to use File => open just like it works for drag & drop.

Code:

Include "WB3DStyles.bb"

; setup gfx mode.
Graphics3D 800,600,16,2


Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),10,10,800,600)
WB3D_DragAcceptFiles RuntimeWindow_hWnd,True

; quick playlist contains the filename of files To be played
Dim playlist$(200)

; the playing loaded_song, and its play status  
Global loaded_song,loaded_song_playing

; the index of the loaded_song playing
Global current_loaded_song_index = 0

menus = WB3D_WindowMenu(RuntimeWindow_hWnd)
file = WB3D_CreateMenu("&File",0,menus,0)
	OpenItem = WB3D_CreateMenu("Open",1,file,0) 
	
	SaveItem = WB3D_CreateMenu("Save",2,file,0)

	WB3D_CreateMenu("",0,file,0)
	QuitItem = WB3D_CreateMenu("Quit",3,file,0)

about = WB3D_CreateMenu("About",0,menus,1)

about1 = WB3D_CreateMenu("About...",4,about,0)

option = WB3D_CreateMenu("Options",5,menus,1)

loop = WB3D_CreateMenu("Loop",6,option,0)
		
u=WB3D_UpdateWindowMenu(RuntimeWindow_hWnd)

; 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 

; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1 Or KeyHit(1)
 	
	Cls
		
	
	; get an event of the event queue.
	event = WB3D_WaitEvent()
	
	Select event
	 
	  Case WB3D_EVENT_MENU
	
	  Select WB3D_EventData()
	   					Case 1

					ext$ = "*.mpg"+Chr$(0)+"*.mpg"+Chr$(0)+"*.mid"+Chr$(0)+"*.mid"+Chr$(0)+"*.midi"+Chr$(0)+"*.midi"+Chr$(0)+"*.mp3"+Chr$(0)+"*.mp3"+Chr$(0)+"*.wav"+Chr$(0)+"*.wav"+Chr$(0)
					file1$ = WB3D_OpenFileRequest("Open","..",ext$,"") : test = 1 : edata = 0
											
				If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" Or FileExtension(file1$) = ".midi" Or FileExtension(file1$) = ".wav"
				 file1$ = request() : file1$ = playlist(snd)

;				loc=1 : test = 1
				
;				If loc Then request() : Else loc = 0
				
;				If test = 1 Then Emitter_Start(EM8) : Else test = 0
								
				EndIf
				
			End Select
				
		Case WB3D_EVENT_DRAGDROP
			Select WB3D_EventSource()	

				Case RuntimeWindow_hWnd
				
					For do_files = 0 To WB3D_CountDroppedFiles()
		              	
						file1$ = WB3D_DroppedFileName(do_files)
						playlist(do_files) = file1$
					Next
				
			End Select			

			; play first loaded_song in playlist
			loaded_song = LoadSound(playlist(current_loaded_song_index))
			loaded_song_playing = PlaySound(loaded_song)
			
		Case WB3D_EVENT_GADGET
			Select WB3D_EventSource()	

			End Select			

		Case WB3D_EVENT_WINDOW_CLOSE
			Select WB3D_EventSource()
				Case RuntimeWindow_hWnd
					QUIT = 1
				
			End Select
			
	End Select

If ChannelPlaying(loaded_song_playing) Then	Text 10,10,"Playing loaded_song: "+playlist(current_loaded_song_index) : Else Text 10,10,"Please load song"
	
	; generate an internal blitz event
	Flip


	; process the playlist
	process_playlist()
	
	
Wend

; plays the next loaded_song in the playlist, or reset to the first loaded_song.
Function process_playlist()

	; return if loaded_songs still playing
	If ChannelPlaying(loaded_song_playing) = 1 
		Return
	Else
	
		; free the memory of the finished loaded_song
		FreeSound loaded_song

		; move to the next loaded_song in the playlist
		current_loaded_song_index = current_loaded_song_index + 1

		; check we have a loaded_song in the playlist, if we do play it
		If playlist(current_loaded_song_index) <> "" Then
			loaded_song = LoadSound(playlist(current_loaded_song_index))
			loaded_song_playing = PlaySound(loaded_song)
		Else
			; loop playlist 
			current_loaded_song_index = 0
			loaded_song = LoadSound(playlist(current_loaded_song_index))
			loaded_song_playing = PlaySound(loaded_song)
		EndIf
	EndIf
	
End Function

Function Millisecs2Time$(m)
Local HourPart%, MinSecLeft%, MinPart%, SecLeft%, SecPart%
Local TimeStr$

   HourPart = Int(m / 3600000)
   MinSecLeft = m Mod 3600000
   MinPart = Int(MinSecLeft / 60000)
   SecLeft = m Mod 60000
   SecPart = SecLeft / 1000

   TimeStr=Str$(HourPart)+":"
   If HourPart<10 Then TimeStr="0"+TimeStr

   If MinPart<10 Then TimeStr=TimeStr+"0"
   TimeStr=TimeStr+Str$(MinPart)+":"
   
   If SecPart<10 Then TimeStr=TimeStr+"0"
   TimeStr=TimeStr+Str$(SecPart)
   
   Return TimeStr
End Function

Function l_setAlpha(alpha#)

EntityAlpha l_surface,alpha#

End Function

Function l_update()

CopyRect 0,0,width,Height,0,0,BackBuffer(),TextureBuffer(l_texture)

End Function

Function notify()

WB3D_Notify "WARNING","Sorry, but file "+file11$+" is invalid.",0

End Function

Function request1()

If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" Or FileExtension(file1$) = ".midi" Or FileExtension(file1$) = ".wav"

playa = 1

EndIf

End Function

Function request()
					
If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" Or FileExtension(file1$) = ".midi" Or FileExtension(file1$) = ".wav" And playlist(file1$)

playa = 1

Else

notify()

EndIf

If playa Then play()

If file1$ <> "" And channelplaying(snd) Then stopm() : play()

End Function

Function play()

If playa Then load_music()

If menus = 1

menu1 = file1$
					
menuii = FileExtension(file1$)

EndIf
										
End Function

Function stopm()

If FileExtension(file1$) = ".mp3" Or FileExtension(file1$) = ".mid" Or FileExtension(file1$) = ".midi" Or FileExtension(file1$) = ".wav" Then freesound snd

End Function

Function load_music()

If File Extension(file1$) = ".mp3" or FileExtension(file1$) = ".mid" Or FileExtension(file1$) = ".midi" or FileExtension(file1$) = ".wav" And playa

snd = load sound(file1$) : snd1 = playsound(snd)

EndIf

End Function

Function Write_BB(appname$, filedata$)

readme=WriteFile("README.txt")

WriteLine readme, "Please use Blitz3D to compile your project!"

file=WriteFile(filedata$)

WriteLine file, "AppTitle "+Chr$(34)+appname$+Chr$(34)

WriteLine file, ""

WriteLine file, "Graphics3D "+screenwidth+", "+screenheight+", "+screendepth+", "+screenmode

WriteLine file, ""

WriteLine file, "cam = CreateCamera()"

WriteLine file, "CameraRange cam, .1, 1000000"

WriteLine file, "PositionEntity cam, "+xcam+", 1, "+zcam

WriteLine file, ""

WriteLine file, "Land = CreatePlane()"

WriteLine file, ""

WriteLine file, "While Not Keyhit(1)"

WriteLine file, ""

WriteLine file, "If KeyDown(200) Or KeyDown(208) MoveEntity cam, 0, 0, (KeyDown(200)-KeyDown(208))*1"

WriteLine file, "If KeyDown(203) Or KeyDown(205) TurnEntity cam, 0, (KeyDown(203)-KeyDown(205))*1, 0"

WriteLine file, ""

WriteLine file, "UpdateWorld()"

WriteLine file, "RenderWorld()"

WriteLine file, ""

WriteLine file, "Flip"

WriteLine file, ""

WriteLine file, "Wend"

CloseFile file

WB3D_Notify "Menu","Compilation Successful",0

WB3D_Notify "Menu","Compiled file in: "+CurrentDir$(),0

End Function

Function get_menu()

menu = menu + 1

If menu > 43 Then menu = 43

Return menu

End Function

Function File_Extension$(ext$)

For I% = Len(ext$) To 1 Step -1

If Mid$(ext$, I%,1) = "," Then Return "*"+Left(ext$, I%-1)+";"+"*"+ Right$(ext$, I%-1)

Next

End Function

Function FileName$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return Mid(File$, I% + 1)
	Next
Return File$
End Function

Function FileExtension$(File$)
If FileType(file$) = 1
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "." Return "."+Mid(File$, I% + 1)
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return ""
	Next
Else
Return "Unknown"
EndIf
End Function

Function FilePath$(File$)
For I% = Len(File$) To 1 Step -1
	If Mid(File$, I%, 1) = "" Or Mid(File$, I%, 1) = "/" Then Return Left(File$, I% - 1)
	Next
End Function

; Adds a file extention, if not exists. | F?Et eine Dateiendung hinzu falls noch keine da ist.
Function AddFileExtension$(File$, Extension$)
If FileExtension(File$) = "" Then Return File$ + "." + Extension$ Else Return File$
End Function

; use notify using external winapi constants. 
WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK
WB3D_EndGUI()
EndGraphics
End


Then it will be PERFECT =)

~DarkShadowWing~

you cant use multi file selection in wb3d openfilerequester, so what you need to do is use a global var that hold the current play list index for the selected files then once your finished with the selection of files call process_playlist() function to check the state of playing files

i can add it to the above example but it wont be tonight

kev

i dont wanna use multiple songs. i want it to work like drag drop, only using File => Open =)

~DarkShadowWing~

this will popup the filerequester and add the selected song to the playlist then start playing it. NOTE theres no error checking you need to add this yourself

; open filerequester and select song to play
ext$ = "*.mid"+Chr$(0)+"*.mid"+Chr$(0)+"*.mp3"+Chr$(0)+"*.mp3"+Chr$(0)
file$ = WB3D_OpenFileRequest("..","..",ext$,"")
playlist(0) = file$

; play first loaded_song in playlist
loaded_song = LoadSound(playlist(current_loaded_song_index))
loaded_song_playing = PlaySound(loaded_song)


kev

Kev. I honestly cant thank ya enough =) You saved my program from disaster =) I was afraid if I couldnt figure it out, I'd have to cancel it due to lag. But it is now fixed.

Thanks again! =)

~DarkShadowWing~