#ifndef __WINDOW9_BI__
	#define __WINDOW9_BI__
	
	'#Define UNICODE
	
	#define w9TabStopSortByGadget
	
	'#define WIN_INCLUDEALL
	
	#include Once "windows.bi"
	#include Once "win/ddraw.bi"
	#include Once "win/commctrl.bi"
	#include Once "win/commdlg.bi"
	#include Once "win/shellapi.bi"
	#include Once "win/shlobj.bi"
	#include Once "win/tlhelp32.bi"
	#include Once "win/gdiplus.bi"
	#include Once "win/richedit.bi"
	#include Once "win/dshow.bi"
	#include Once "win/exdisp.bi"
	#include Once "win/mshtmhst.bi"
	#include Once "GL/glu.bi"
	#include Once "win/wininet.bi"
	
	#include Once "zlib.bi"
	
	#ifdef UNICODE		
		#include Once "extwstring.bi"		
		Type USTRING As extWstring		
	#else		
		Type USTRING As String		
	#endif
	
	#define FB_IGNORE 999999
	
	#define Eventmove     &h3
	#define Eventsize     &h5
	#define Eventactivate &H6
	#define Eventclose    &H10
	#define EventPaint    &hF
	
	#define Eventkeydown &h100
	#define Eventkeyup   &h101
	
	#define Eventtimer &H113
	
	#define Eventlbdown   &H201
	#define Eventlbup     &H202
	#define Eventrbdown   &H204
	#define Eventrbup     &H205
	#define Eventmbdown   &H207
	#define Eventmbup     &H208
	#define Eventdblclick WM_LBUTTONDBLCLK
	
	#define Eventmousemove  &H200
	#define Eventmousewheel &H20A
	
	#define Eventgadget   &h401
	#define Eventmenu  &h402
	
	#define FB_BS_PUSHLIKE (BS_PUSHLIKE Or BS_AUTOCHECKBOX)
	
	#ifndef Integer32
		#define Integer32 Long
	#endif
	#ifndef UInteger32
		#define UInteger32 Ulong
	#endif
	
	Const ANTIALIAS_NONE = 0
	
	Const ANTIALIAS_FAST = 4
	
	Const ANTIALIAS_GOOD = 4
	
	Const ANTIALIAS_BEST = 5
	
	Const WS_TABSTOPENABLE = &h1000
	
	#ifndef __incany_bi__
		#define __incany_bi__
		#macro Includebinary(strFile,lpAny)
			Dim Shared As Ubyte Ptr ##lpAny
			Dim Shared As Long  ##lpAny##__len__mem__
			Asm
				.section .text
				jmp .end_##lpAny
				.section .data
				.align 16
				.start_##lpAny:
				__##lpAny##__start__ = .
				.incbin ##strFile
				__##lpAny##__len = . - __##lpAny##__start__
				.section .text
				.align 16
				.end_##lpAny:
				#ifdef __FB_64BIT__
					lea rax, .start_##lpAny
					mov qword ptr [lpAny], rax
					mov qword ptr [##lpAny##__len__mem__] , offset __##lpAny##__len
				#else
					lea eax, .start_##lpAny
					mov dword ptr [lpAny], eax
					mov dword ptr [##lpAny##__len__mem__] , offset __##lpAny##__len
				#endif
			End Asm
			addInclude_binary_info((##lpAny) , ##lpAny##__len__mem__)
		#endmacro
	#endif ' __incany_bi__
	
	' is it a exe build ?
	#if __fb_out_exe__ Or __fb_out_dll__
		
		#inclib "window9"
		
		InitCommonControls()
		Dim As INITCOMMONCONTROLSEX InitCtrlEx
		InitCtrlEx.dwSize = Sizeof(INITCOMMONCONTROLSEX)
		InitCtrlEx.dwICC  = ICC_STANDARD_CLASSES
		InitCommonControlsEx(@InitCtrlEx)
		
	#else
		
		' no must be a lib build declare things for internal use only
		
		#undef Export
		#define Export
		
		Type ACCELERATOR
			As HACCEL hAccel
			As HWND   hwnd
		End Type
		
		#define ACCELERATORSTRUCT ACCELERATOR
		
		Declare Function win9GetGadgetClass(Byval hWin As HWND) As Long
		Declare Sub      win9GetAcceleratorInfo(Byval a As ACCELERATOR Ptr)
		Declare Function win9GetCurrent() As HWND
		Declare Function win9AddNewGadget(Byval gadget As Integer, Byval hWin As HWND) As Integer
		Declare Function win9GetGadgetFont() As Integer
		Declare Function win9AddColor(Byval hWin As HWND, Byval colorBKD_ As Integer, Byval colorText_ As Integer) As Integer
		Declare Function win9GetGuiWinProc() As Integer
		Declare Function win9GetGuiMSG() As Integer
		Declare Sub      win9SetDCPrint(Byval pHdc As HDC)
		Declare Function win9SetGadgetColor(Byval hWin As HWND,Byval colorBKD_ As Integer,Byval colorText_ As Integer, Byval flag As Byte) As Byte
		Declare Function win9SetErrorColor(Byval colorBKD_ As Integer) As Integer
		Declare Function win9SetCurrentColors(Byval colorBKD_ As Integer, Byval colorText_ As Integer) As Integer
		Declare Sub      win9SetMDIClient(Byval hWin As HWND)
		Declare Sub      win9removeMenu(Byval menu As Integer)
		Declare Sub win9AddTabStop(Byval hWin As HWND, Byval iGadget As Integer)
		Declare Sub win9DeleteGadgetTabStop(Byval iGadget As Integer)
		Declare Sub win9SwitchTabStop(Byval parentHwnd As Hwnd, Byval iId As Integer)
		
	#endif
	
	Namespace window9
		Type FontPrint
			As USTRING Name_
			As Integer size
			As Integer Bold
			As Integer Italic
			As Integer Underline
			As Integer StrikeOut
		End Type
		Type SinglePoint
			As Single x,y
		End Type
		Declare Function Startprinter(Byref Scale As SinglePoint Ptr=0, Byval Flagstart As Integer=1) As HDC
		Declare Sub Stopprinter()
		Declare Sub Framepage(Byref Left_ As Integer, Byref Right_ As Integer, Byref Top As Integer, Byref Bottom As Integer)
		Declare Sub Printtext(Byref text As USTRING, Byval L As Integer=0, Byval T As Integer=0, Byval R As Integer=0, Byval B As Integer=0, Byval flag As Integer=0)
		Declare Sub Printimage(Byval bitmap_ As HBITMAP,Byval x As Integer, Byval y As Integer)
		Declare Sub Colorprinter(Byval ColorText As Integer=0, Byval colorBK As Integer=-1, Byval Flag As Integer=1)
		Declare Sub Fontprinter(Byval Font As FontPrint Ptr=0)
		Declare Sub Getrealsize(Byref X As Integer, Byref Y As Integer)
		Declare Function Getcountline() As Integer
		Declare Sub Getfullsize(Byref X As Integer, Byref Y As Integer)
		Declare Sub Getlenstring(Byref Str_ As USTRING, Byref X As Integer, Byref Y As Integer)
		Declare Function Getcountdoc() As Integer
		Declare Sub Documentstart()
		Declare Sub Documentend()
		Declare Sub Pagestart()
		Declare Sub Pageend()
	End Namespace
	
	Declare Sub Sleepw9(Byval n As Integer)
	
	' events
	Declare Function Windowevent() As Long
	Declare Function Waitevent() As Long
	Declare Function Eventnumber() As Integer
	Declare Function Mousex() As Integer
	Declare Function Mousey() As Integer
	Declare Function Eventhwnd() As HWND
	Declare Function Eventkey() As Integer
	Declare Function Eventnumbertoolbar() As Integer
	Declare Function Eventnumberlistview() As Integer
	Declare Function Eventnumbertreeview() As Integer
	Declare Function Eventwparam() As WPARAM
	Declare Function EventLParam() As LPARAM
	
	' window
	Declare Function Openwindow(Byref sName As USTRING, _
	Byval x As Integer, Byval y As Integer, _
	Byval w As Integer, Byval h As Integer, _
	Byval Style As Integer=WS_OVERLAPPEDWINDOW Or WS_VISIBLE Or WS_TABSTOPENABLE, _
	Byval ExStyle As Integer=0, _
	Byval User_data_Sub As Any Ptr = 0, _
    Byval hParentHwnd As HWND = 0) As HWND
	
	Declare Sub Close_window(Byval hWin As HWND)
	Declare Sub Disablewindow(Byval hWin As HWND, Byval state As Long) 
	Declare Sub Hidewindow(Byval hWin As HWND, Byval state As Long)
	Declare Sub Centerwindow(Byval hWin As HWND)
	Declare Sub Windowcolor(Byval hWin As HWND, Byval iColor As Ulong) 
	Declare Sub Usegadgetlist(Byval hWin As HWND) 
	Declare Function W9sizewidth() As Integer
	Declare Function W9sizeheight() As Integer
	Declare Sub Resizewindow(Byval hWin As HWND, _
	Byval x As Long=FB_ignore, Byval y As Long=FB_ignore, _
	Byval w As Long=FB_ignore, Byval h As Long=FB_ignore)
	Declare Function Windowx(Byval hWin As HWND) As Integer
	Declare Function Windowy(Byval hWin As HWND) As Integer
	Declare Function Windowwidth(Byval hWin As HWND) As Integer
	Declare Function Windowheight(Byval hWin As HWND) As Integer
	Declare Function Windowclientwidth(Byval hWin As HWND) As Integer
	Declare Function Windowclientheight(Byval hWin As HWND) As Integer
	Declare Sub Windowbounds(Byval hWin As HWND, Byval MinimalWidth As Long ,Byval  MinimalHeight As Long, Byval MaximalWidth As Long, Byval MaximalHeight As Long)
	Declare Function Setwindowstyle(Byval hWin As HWND, Byval Style As Integer, Byval ExStyle As Bool=0, Byval added As BOOL = 0) As Integer
	Declare Function Getclassname_(Byval hWin As HWND) As USTRING
	Declare Sub Deletewindowproperty(hWin As HWND , sKey As UString)
	Declare Function Getwindowproperty(hWin As HWND , sKey As UString) As Any Ptr
	Declare Sub Setwindowproperty(hWin As HWND , sKey As UString , pValue As Any Ptr)
	
	#undef Getwindowtext
	Declare Function Getwindowtext Overload(Byval hWin As HWND) As USTRING
	Declare Function Getwindowtext Overload(Byval hWin As HWND, Byval buf As Any Ptr, Byval lenBuf As Integer) As Integer
	
	Declare Sub Setwindowtop(Byval hWin As HWND, Byval state As Integer)
	Declare Function Settransparentwindow(Byval hWin As HWND, Byval AlphaState As Integer) As Integer
	Declare Function Windowbackgroundimage(Byval hWin As HWND, Byval bitmap_ As HBITMAP, Byval param As Integer=0) As Integer
	Declare Function Addkeyboardshortcut(Byval hWin As HWND, Byval Syskey As Integer, Byval Shortcut As Integer, Byval ID_Event As Integer)As HACCEL
	Declare Sub Deleteallkeyboardshortcut(Byval hWin As HWND)
	Declare Function Ismouseover(Byval hWin As HWND) As Integer
	
	' gadget
	Declare Function Id_in_number(Byval hWin As HWND) As Integer
	Declare Function Gadgetid(Byval gadget As Integer) As HWND
	Declare Sub Freegadget(Byval gadget As Long) 
	Declare Function Gadgetx(Byval gadget As Long) As Long
	Declare Function Gadgety(Byval gadget As Long) As Long
	Declare Function Gadgetwidth(Byval gadget As Long) As Long
	Declare Function Gadgetheight(Byval gadget As Long) As Long
	Declare Sub Resizegadget(Byval gadget As Long, Byval x As Long=FB_ignore, Byval y As Long=FB_ignore, Byval w As Long=FB_ignore,Byval h As Long=FB_ignore) 
	Declare Sub Disablegadget(Byval gadget As Long, Byval state As Long)
	Declare Sub Hidegadget(Byval gadget As Long, Byval state As Long)
	
	Declare Function Getgadgettext(Byval gadget As Long) As USTRING
	Declare Sub Setgadgettext(Byval gadget As Long, Byref Text As USTRING)
	
	Declare Function Getgadgetstate(Byval gadget As Long) As Integer
	Declare Sub Setgadgetstate(Byval gadget As Long, Byval state As Long)
	
	Declare Function Getgadgetattribute(Byval gadget As Integer, Byval Attribut As Integer) As Integer
	Declare Function Setgadgetattribute(Byval gadget As Integer ,Byval Attribut As Integer, Byval ValueMax As Integer, Byval ValueMin As Integer=0) As Integer
	
	Declare Sub Setgadgetcolor(Byval gadget As Long, Byval colorBKD_ As Long, Byval colorText_ As Long, Byval flag As Long)
	Declare Function Getgadgetcolor(Byval gadget As Long ,Byval flag As Long ) As Integer
	
	Declare Sub Updateitem(Byval gadget As Long,Byval item As Long)
	Declare Function Setgadgetstyle(Byval gadget As Long, Byval style As Integer, Byval ExStyle As Bool=0, Byval added As BOOL = 0) As Integer
	
	' statusbar
	Declare Function Statusbargadget(Byval gadget As Long, Byref SingleText As USTRING="", Byval style As Integer=0, Byval style2 As Integer=0) As HWND
	Declare Sub      Removestatusbar(Byval gadget As Integer)
	Declare Sub Setstatusbarfield(Byval gadget As Long ,Byval NField As Long, Byval Width_ As Long, Byref Text As USTRING) 
	Declare Sub Tooltipstatusbar(Byval gadget As Integer, Byval NumberField As Integer, Byref text As USTRING)
	
	' combobox
	Declare Function Comboboxgadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byval Style As Long=CBS_DROPDOWNLIST Or WS_VSCROLL) As HWND
	Declare Sub Showlistcombobox(Byval gadget As Long, Byval state As Long=0)
	Declare Function Lenitemtextcombobox(Byval gadget As Long, Byval item As Long=0) As Integer
	Declare Sub Addcomboboxitem(Byval gadget As Long, Byref sItem As USTRING, Byval iPos As Long)
	Declare Sub Deletecomboboxitem(Byval gadget As Long, Byval iPos As Long)
	Declare Function Getcomboboxtext(Byval gadget As Long, Byval iPos As Long) As USTRING
	Declare Function Countitemcombobox(Byval gadget As Long) As Integer
	Declare Sub Resetallcombobox(Byval gadget As Long)
	Declare Function Finditemcombobox(Byval gadget As Long, Byref sItem As USTRING, Byval Startpos As Long = -1) As Integer
	Declare Sub Setitemcombobox(Byval gadget As Long, Byval number As Long)
	Declare Function Getitemcombobox(Byval gadget As Long) As Integer
	Declare Sub Filecomboboxitem(Byval gadget As Long, Byref File_AND_MASK As USTRING, Byval ATTRIBUT As Long=DDL_READWRITE Or DDL_READONLY Or DDL_HIDDEN Or DDL_SYSTEM Or DDL_DIRECTORY) 
	Declare Function Comboboximagegadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byval SizeIcon As Long=16, _
	Byval Style As Long=CBS_DROPDOWNLIST Or WS_VSCROLL) As HWND
	Declare Function Gethimagecombo_(Byval gadget As Integer) As Integer
	Declare Sub Addcomboboximageitem(Byval gadget As Long, Byref string_ As USTRING, Byval IDImage_ As HBITMAP, Byval pos_ As Long) 
	Declare Sub Setcomboboxitemtext(Byval gadget As Long, Byref string_ As USTRING, Byval Item As Long)
	
	' listbox
	Declare Function Listboxgadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long, Byval parametr As Long=LBS_SORT Or WS_VSCROLL Or WS_HSCROLL Or LBS_WANTKEYBOARDINPUT Or LBS_NOTIFY,Byval parametr2 As Long=0) As HWND
	Declare Sub Addlistboxitem(Byval gadget As Long, Byref string_ As USTRING, Byval item As Long=-1)
	Declare Sub Deletelistboxitem(Byval gadget As Long, Byval pos_ As Long) 
	Declare Sub Filelistboxitem(Byval gadget As Long, Byref File_AND_MASK As USTRING, Byval ATTRIBUT As Long=DDL_READWRITE Or DDL_READONLY Or DDL_HIDDEN Or DDL_SYSTEM Or DDL_DIRECTORY) 
	Declare Function Finditemlistbox(Byval gadget As Long, Byref stri As USTRING, Byval Startpos As Long = -1) As Integer
	Declare Function Countitemlistbox(Byval gadget As Long) As Integer
	Declare Sub Setselectmanyitem(Byval gadget As Long, Byval Start As Long, Byval Finish As Long, Byval flag As Long=1)
	Declare Sub Setcolumnwidthlistbox(Byval gadget As Long, Byval width_ As Long) 
	Declare Sub Setitemlistbox(Byval gadget As Long, Byval item As Long)
	Declare Function Getitemlistbox(Byval gadget As Long) As Integer
	Declare Function Getselcountlistbox(Byval gadget As Long, Byval ARRAY_ As Long Ptr=0) As Integer
	Declare Function Getlistboxtext(Byval gadget As Long, Byval item As Long) As USTRING
	Declare Function Lenitemtextlistbox(Byval gadget As Long, Byval item As Long) As Integer
	Declare Function Gettopindexlistbox(Byval gadget As Long) As Integer
	Declare Sub Settopindexlistbox(Byval gadget As Long, Byval item As Long) 
	Declare Sub Resetalllistbox(Byval gadget As Long)
	Declare Sub Setlistboxitemtext(Byval gadget As Long, Byref text As USTRING, Byval Item As Long)
	
	' listview
	Declare Function Listviewgadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long, Byval ExStyle As Long = 0, Byval Style As Long = LVS_ICON  Or LVS_REPORT,Byval Style2 As Long = 0,Byval SizeIcon As Long = 16, Byval StyleIcon As Long = LVSIL_SMALL) As HWND
	Declare Function Addlistviewcolumn(Byval gadget As Long, Byref string_ As USTRING, Byval pos_ As Long, Byval SubItem_ As Long, Byval width_Column As Long, Byval Style_Column_TEXT As Long=LVCFMT_CENTER, Byval Style_Mask As Long=LVCF_FMT Or LVCF_SUBITEM Or LVCF_TEXT Or LVCF_WIDTH) As Long
	Declare Function Addlistviewitem(Byval  iGadget As Long, Byref sText As USTRING, Byval IDImage As HBITMAP, Byval iPos As Long, Byval iSubItem As Long, Byval iMaskItem As Long =LVIF_TEXT Or LVIF_IMAGE) As Integer
	Declare Function Getsubitemlistview() As Integer
	Declare Function Getitemlistview() As Integer
	Declare Function Flagkeylistview(iState As Long = -1) As Integer
	Declare Function Getcolumnlistview() As Long
	Declare Sub Deletelistviewitemsall(Byval gadget As Long)
	Declare Sub Deleteitemlistview(Byval gadget As Long, Byval Item As Long) 
	Declare Sub Deletelistviewcolumn(Byval gadget As Long, Byval columnIndex As Long)
	Declare Function Getcolumnwidthlistview(Byval gadget As Long, Byval IndexColumn As Long) As Integer
	Declare Function Getitemcountlistview(Byval gadget As Long) As Integer
	Declare Function Gettextitemlistview(Byval gadget As Long, Byval Item As Long, Byval SubItem_ As Long) As USTRING
	Declare Sub Setcolumnwidthlistview(Byval gadget As Long, Byval IndexColumn As Long,Byval Width_ As Long, Byval flag As Long =-1)
	Declare Function Getselectedcountlistview(Byval gadget As Long,Byval  iArray As Long Ptr = 0) As Integer
	Declare Sub Settextitemlistview(Byval gadget As Long, Byval item As Long, Byval subItem As Long, Byref text As USTRING)
	Declare Sub Settextcolumnlistview(Byval gadget As Long,Byval Column As Long, Byref Text As USTRING)
	Declare Function Replaceimagelistview(Byval gadget As Long, Byval iItem As Integer,Byval iSubItem As Integer,Byval Image As HBITMAP) As Integer
	Declare Sub Setselectlistviewitem(Byval gadget As Long, Byval Item As Long) 
	Declare Function Getselectedlistviewitem(Byval gadget As Long, Byval Item As Long, Byval Mask As Long = LVIS_SELECTED  Or LVIS_FOCUSED) As Integer
	
	'ExplorerListGadget
	Type OptionsExplorerGadget
		#ifdef UNICODE
			szName As Wstring*30 = "Name"
			szSize As Wstring*15 = "Size"
			szType As Wstring*15 = "Type"
			szModified As Wstring*15 = "Modified"
			szCaptionError As Wstring*15 = "Error"
			szTextError As Wstring*50 = "Access Denied"  
		#else
			szName As USTRING*30 = "Name"
			szSize As USTRING*15 = "Size"
			szType As USTRING*15 = "Type"
			szModified As USTRING*15 = "Modified"
			szCaptionError As USTRING*15 = "Error"
			szTextError As USTRING*50 = "Access Denied"  
		#endif
		iStyle As Integer  = 0
		iOneWidth As Integer = FB_IGNORE
		iTwoWidth As Integer = FB_IGNORE
		iThreeWidth As Integer = FB_IGNORE
		iFourWidth As Integer = FB_IGNORE
	End Type
	Declare Function Explorerlistgadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long=400, Byval h As Long=300, Byref szPath As USTRING = "C:\", Byval LGELocal As OptionsExplorerGadget Ptr= 0) As HWND
	Declare Function Getexplorerlistgadgethwnd(Byval gadget As Long) As HWND
	Declare Function Getexplorerlistgadgetpath(Byval gadget As Long) As USTRING
	Declare Function Setexplorerlistgadgetpath(Byval gadget As Integer, Byref sPath As USTRING) As BOOL
	Declare Function Setexplorerlistgadgetsort(Byval gadget As Integer, Byval Column As Integer) As Integer
	Declare Function Getexplorerlistgadgetcurentitem(Byval gadget As Long) As Integer
	Declare Function Setexplorerlistgadgetstyle(Byval gadget As Integer, Byval Style As Integer) As Integer
	Declare Sub Flagexplorerlistgadget(Byval gadget As Integer, Byval iFlag As Integer = 3)
	
	' trackbar
	Declare Function Trackbargadget(Byval gadget As Long, Byval x As Long , Byval y As Long , Byval w As Long, Byval h As Long, Byval min_ As Integer, Byval max_ As Integer, Byval style As Integer=1) As HWND
	Declare Sub Settrackbarpos(Byval gadget As Long, Byval NewPos As Long)
	Declare Function Gettrackbarpos(Byval gadget As Long) As Integer
	Declare Sub Settrackbarmaxpos(Byval gadget As Long, Byval MaxPos As Long,Byval flag As Long=0)
	Declare Sub Settrackbarminpos(Byval gadget As Long, Byval MinPos As Long,Byval flag As Long=0)
	
	' calender
	Declare Function Calendargadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long,Byval Style As Long=0) As HWND
	Declare Function Datecalendargadget(Byval gadget As Long,Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long) As HWND
	Declare Function Getstatecalendar(Byval gadget As Long,Byval flag As Long=5) As Integer
	Declare Sub Setstatecalendar(Byval gadget As Long,Byval YEAR_ As Long, Byval MONTH_ As Long, Byval DAY_ As Long)
	
	' treeview
	#undef TVI_ROOT
	#undef TVI_FIRST
	#undef TVI_LAST
	#undef TVI_SORT
	#define TVI_ROOT  &hFFFF0000
	#define TVI_FIRST  &hFFFF0001
	#define TVI_LAST  &hFFFF0002
	#define TVI_SORT  &hFFFF0003
	Declare Function Treeviewgadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long, Byval Style As Long= 0, Byval ExStyle As Long=0, Byval SizeIcon As Long=16)As HWND
	Declare Function Addtreeviewitem Overload(Byval gadget As Long, Byref string_ As USTRING, Byval IDImage_0 As HBITMAP, Byval IDImage_Selected As HBITMAP, Byval pos_ As Integer, Byval parent As Integer=0) As Integer
	Declare Function Addtreeviewitem(Byval gadget As Long, Byref string_ As USTRING,Byval IDImage_0 As HICON,Byval IDImage_Selected As HICON,Byval pos_ As Integer,Byval parent As Integer=0) As Integer
	Declare Function Getitemtreeview(Byval iGadget As Long) As Integer
	Declare Sub Deletetreeviewitem(Byval gadget As Long, Byval Item As Integer)
	Declare Function Getcountitemtreeview(Byval gadget As Long) As Integer
	Declare Sub Replaceimageitemtreeview Overload(Byval gadget As Integer, Byval item As Integer, Byval image As Hbitmap=0,Byval Selectimage As Hbitmap=0)
	Declare Sub Replaceimageitemtreeview (Byval gadget As Integer, Byval item As Integer, Byval image As HICON=0  ,Byval Selectimage As HICON=0)
	Declare Sub Settextitemtreeview(Byval gadget As Integer,Byval item As Integer, Byval String_ As USTRING)
	Declare Function Getindeximagetreeview(Byval gadget As Long, Byval item As Integer,Byval flag As Long=0) As Integer
	Declare Function Gettexttreeview(Byval gadget As Long, Byval item As Integer) As USTRING
	Declare Function Moveitemtreeview(Byval gadget As Long,Byval itembegin As Integer, Byval itemend As Integer, Byval Parent As Integer) As Integer
	Declare Sub Setselecttreeviewitem(iGadget As Long  , iPos As Integer )
	Declare Function Getparentitemtreeview(iGadget As Long , iItem As Integer) As Integer
	Declare Function Getchilditemtreeview(iGadget As Long , iItem As Integer) As Integer
	Declare Function Getnextitemtreeview(iGadget As Long , iItem As Integer) As Integer
	Declare Function Getprevitemtreeview(iGadget As Long , iItem As Integer) As Integer
	Declare Function Getfirstitemtreeview(iGadget As Long) As Integer
	Declare Sub Deletetreeviewitemall(iGadget As Long)
	Declare Sub Expandtreeviewitem(iGadget As Long  , iItem As Integer , iFlagAll As Long)
	Declare Sub Collapsetreeviewitem(iGadget As Long  , iItem As Integer)
	Declare Sub Expandtreeviewitemall(iGadget As Long)
	Declare Sub Collapsetreeviewitemall(iGadget As Long)
	
	' ipstringfield
	Declare Function Ipaddressgadget(Byval gadget As Integer, Byval x As Integer, Byval y As Integer, Byval w As Integer, Byval h As Integer) As HWND
	Declare Sub Setipaddress(Byval gadget As Long, Byref IP_ADDRESS As USTRING)
	Declare Function Getipaddress(Byval gadget As Long) As USTRING
	
	' toolbar
	Declare Function Createtoolbar(Byval nID As Integer=0, Byval Style As Integer=CCS_ADJUSTABLE Or CCS_NODIVIDER, Byval ExStyle As Integer=0) As Integer
	Declare Function Toolbarstandardbutton(Byval hwndToolBar As Integer, Byval ButtonID As Integer, Byval IndexImage As Integer, Byref String_ As USTRING="", Byval PositionButton As Integer=-1, Byval State As Integer=4, Byval Style As Integer=0) As Integer
	Declare Function Toolbarimagebutton(Byval hwndToolBar As Integer, Byval buttonID As Integer, Byval ImageID_ As Integer, Byref String_ As USTRING="", Byval PositionButton As Integer=-1, Byval State As Integer=4, Byval Style As Integer=0, Byval SizeIcon As Integer=16) As Integer
	Declare Sub Deletebuttontoolbar(Byval hwndToolBar As Integer, Byval IndexButton As Long) 
	Declare Sub Setbuttontoolbarstate(Byval hwndToolBar As Integer, Byval IdButton As Integer, Byval flag As Long, Byval State As Long) 
	Declare Function Getbuttontoolbarstate(Byval hwndToolBar As Integer, Byval IdButton As Integer, Byval flag As Long) As Integer
	Declare Function Countbuttontoolbar(Byval hwndToolBar As Integer) As Integer
	Declare Sub Toolbartooltip(Byval Hwnd As hwnd, Byval buttonID As Integer, Byref toolTipS As USTRING) 
	Declare Sub Settoolbartooltipfont(Byval HwndToolBar As Integer, Byval Font_ As Integer) 
	Declare Sub Settoolbartooltipcolor(Byval HwndToolBar As Integer, Byval colorBk_ As Integer=0, Byval colorText_ As Integer=0, Byval flag As Integer=0) 
	Declare Function Gettoolbartextbutton(Byval HwndToolBar As Integer, Byval ButtonID As Integer) As USTRING
	Declare Sub Settoolbarbuttonsize(Byval HwndToolBar As Integer, Byval w As Integer, Byval h As Integer)
	Declare Function Toolbarseparator(Byval hwndToolBar As Integer, Byval IndexButton As Integer=-1 , Byval  iFlagDrawSeparator As Long = 1) As Integer
	Declare Sub Deletetoolbar(Byval hwndToolBar As Integer)
	
	' image
	Declare Function Imagegadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long, Byval imageId As Any Ptr = 0, Byval ExSyle As Long =0, Byval Style As Long = SS_BITMAP) As HWND
	Declare Sub Setimagegadget(Byval gadget As Long, Byval imageID As HBITMAP) 
	Declare Sub Seticongadget(Byval gadget As Long, Byval icon As HICON) 
	
	Declare Function Load_imagea(Byref sFileName As USTRING) As Any Ptr
	Declare Function Load_image(Byref sFileName As USTRING,Byval ColorBack As Integer=0) As HBITMAP
	Declare Function Catch_image(Byval array  As Ubyte Ptr, Byval color_ As COLORREF=&hf0f0f0) As HBITMAP
	Declare Function Catch_imagea(Byval array As Ubyte Ptr) As Any Ptr
	Declare Function Loadimagefromresource(Byval lpResName As Any Ptr, Byval color_ As Integer=&hf0f0f0) As HBITMAP
	Declare Function Loadimagefromresourcea(Byval lpResName As Any Ptr) As Any Ptr
	
	Declare Sub Free_image(Byval hBmp As HBITMAP)
	Declare Sub Free_imagea(Byval GpBitmap As Any Ptr)
	
	Declare Function Image_height(Byval hBmp As HBITMAP) As Long
	Declare Function Image_width(Byval hBmp As HBITMAP) As Long
	Declare Function Image_widtha(Byval GpImage As Any Ptr) As Integer
	Declare Function Image_heighta(Byval GpImage As Any Ptr) As Integer
	Declare Function Resize_image(Byval hBmp As HBITMAP, Byval w As Integer, Byval h As Integer) As HBITMAP
	Declare Sub Resize_imagea(Byref GpImage As Any Ptr,Byref w As Single=0, Byref h As Single=0)
	Declare Function Copy_imagea(Byval GpImage As Any Ptr) As Any Ptr
	Declare Function Copy_image(Byval hBmp As HBITMAP) As HBITMAP
	Declare Sub Save_image(Byval hBmp As HBITMAP,Byref sFileName As USTRING)
	Declare Function Save_imagea(Byval GpBitmap As Any Ptr, Byref sFileName As USTRING) As Integer
	Declare Function Grab_image(Byval soursehBmp As HBITMAP, Byval x As Integer,Byval y As Integer, Byval w As Integer, Byval h As Integer) As HBITMAP
	Declare Function Grab_imagea(Byval GpImage As Any Ptr,Byval x As Single=0, Byval y As Single=0, Byref w As Single=0, Byref h As Single=0) As Any Ptr
	Declare Function Createcopyimagewindow(Byval hWin As HWND, Byval iFlag As Long = 0) As HBITMAP
	Declare Function Createcopyimagewindowclient(Byval hWin As HWND, Byval iFlag As Long = 0) As HBITMAP
	Declare Function Createcopyimagedesktop() As HBITMAP
	Declare Function Createcopyimagerect(Byval hWin As HWND,Byval x As Long,Byval y As Long,Byval w As Long,Byval h As Long ,Byval  iFlag As Long = 0) As HBITMAP
	Declare Function Create_image(Byval w As Long, Byval h As Long) As HBITMAP
	Declare Function Create_imagea(Byval w As Single, Byval h As Single) As Any Ptr
	Declare Function Createhbitmapfromgpbitmap(Byval GpBitmap As Any Ptr,Byval BackColor As Integer=&hf0f0f0) As HBITMAP
	Declare Function Creategpbitmapfromhbitmap(Byval hBmp As HBITMAP) As Any Ptr
	
	Declare Function Rotate4_image(Byval soursehBmp As HBITMAP, Byval angle As Integer) As HBITMAP
	Declare Sub Rotateandscaleimage(Byval sourcehBmp As HBITMAP, Byref hbmpDest As HBITMAP, Byval X As Integer, Byval Y As Integer,Byval Xr As Integer,Byval Yr As Integer,Byval angle As Single,Byval Xscale As Single=0,Byval Yscale As Single=0,Byval Color_ As Integer=0,Byval BGbitmap As HBITMAP=0)
	Declare Sub Rotateandscaleimagea(Byval GpbitmapSource As Any Ptr, Byref hbmpDest As HBITMAP, Byval X As Integer, Byval Y As Integer,Byval Xr As Integer,Byval Yr As Integer,Byval angle As Single,Byval Xscale As Single=0,Byval Yscale As Single=0,Byval Color_ As Integer=0,Byval BGbitmap As Any Ptr=0)
	
	' icon
	Declare Function Createiconorcursorfromfile(Byref sFileName As USTRING) As HICON
	Declare Function Createiconorcursorfrombitmap(Byval hBmp As HBITMAP) As HICON
	Declare Function Createiconorcursorfromgpbitmap(Byval GpBitmap As Any Ptr) As HICON
	Declare Function Saveiconorcursor(Byval hIco As HICON, Byref sFileName As USTRING) As Integer
	Declare Function Load_icon(Byref sFileName As USTRING) As HICON
	Declare Function Extract_icon(Byref sFileName As USTRING, Byval number As Integer,Byval colorBk As Integer=&hf0f0f0) As HBITMAP
	
	' button
	Declare Function Buttonimagegadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byval imageId As Any Ptr = 0, _
	Byval Style As Long=BS_BITMAP) As HWND
	Declare Function Buttongadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byref s As USTRING="", Byval Style As Long=0) As HWND
	Declare Function Checkboxgadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byref s As USTRING="", Byval Style As Long=3) As HWND
	Declare Function Textgadget(Byval gadget As Integer, _
	Byval x As Integer, Byval y As Integer, _
	Byval w As Integer, Byval h As Integer, _
	Byref s As USTRING="", Byval Style As Integer=SS_NOTIFY) As HWND
	Declare Function Optiongadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byref s As USTRING="", Byval Style As Long = 9) As HWND
	Declare Function Stringgadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byref s As USTRING="", _
	Byval Style As Long=0, _
	Byval ExStyle As Long=0) As HWND
	Declare Function Hyperlinkgadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byref s As USTRING="") As HWND
	Declare Function Spingadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byval maxvalue As Integer, Byval minvalue As Integer, _
	Byval curvalue As Integer, Byval style As Integer=2 Or 4, Byval style2 As Integer=0) As HWND
	Declare Function Groupgadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byref s As USTRING="") As HWND
	
	Declare Function Progressbargadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byval BeginPos As Long=0, Byval EndPos As Long=0, _
	Byval style As Long=0) As HWND
	Declare Sub Setrangeprogressbar(Byval gadget As Long, Byval BeginPos As Integer, Byval EndPos As Integer)
	Declare Sub Setxprogressbarcolor(Byval gadget As Long, Byval iColor As Long)
	
	' browser
	Declare Function Webgadget(Byval Gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byref URL As USTRING=" ", _
	Byval Style As Integer=0, Byval ExStyle As Integer=0) As Integer Ptr
	Declare Sub Webgadgetnavigate(Byval pIWebBrowser As Integer Ptr, Byval URL As Wstring Ptr) 
	Declare Sub Webgadgetgoforward(Byval pIWebBrowser As Integer Ptr)
	Declare Sub Webgadgetgoback(Byval pIWebBrowser As Integer Ptr)
	Declare Sub Webgadgetrefresh(Byval pIWebBrowser As Integer Ptr)
	Declare Function Webgadgetgeturl(Byval pIWebBrowser As Integer Ptr) As USTRING
	Declare Function Webgadgetstate(Byval pIWebBrowser As Integer Ptr) As Integer
	Declare Sub Webgadgetstop(Byval pIWebBrowser As Integer Ptr) 
	Declare Function Webgadgetgetbody(Byval pIWebBrowser As Integer Ptr,Byval flag As Long=0) As USTRING
	Declare Sub      Webgadgetsetbody(Byval pIWebBrowser As Integer Ptr,Byval text As USTRING)
	
	'splitter
    Declare Sub SplitterGadgetAddGadget(iGadgetSplitter As Long , iGadgetChild1 As Long , iGadgetChild2 As Long)
    Declare Function SplitterGadget(iGadget As Long , iX As Long , iY As Long , iWidth As Long , iHeight As Long, iPos As Long , iStyle As Long = 0) As HWND
    Declare Sub AddCallbackSplitterPosition(pFunc As Any Ptr)
    Declare Sub AddCallbackSplitterResize(pFunc As Any Ptr)
    Declare Sub SetSplitterPos(iGadgetSplitter As Long , iPos As Long)
    Declare Sub SplitterGadgetUnMapGadget(iGadgetSplitter As Long  , iParam As Long)
    Declare Sub SplitterGadgetMapGadget(iGadgetSplitter As Long  , iGadget As Long , iParam As Long)
    Declare Function GetSplitterPos(iGadget As Long) As Long
	
	' tooltip
	Declare Function Gadgettooltip(Byval parentGadget As Long, Byref text As USTRING, Byval gadget As Long=0) As Integer
	Declare Sub Deltooltip(Byval parentGadget As Long, Byval gadget As Long)
	Declare Sub Disabletooltip(Byval gadget As Long, Byval state As Long)
	Declare Function Gettooltiptext(Byval parentGadget As Long, Byval gadget As Long) As USTRING
	Declare Sub Settooltiptext(Byval parentGadget As Long, Byval gadget As Long, Byref text As USTRING)
	
	' menu
	Declare Function Create_menu() As HMENU
	Declare Function Createpopmenu() As HMENU
	Declare Sub Createiconitemmenu(Byval menu As HMENU, Byval Number As Long, Byval ImageId As Hbitmap)
	Declare Function Menutitle(Byval menu As HMENU, Byref name_ As USTRING ) As HMENU
	Declare Function Menuitem  Overload(Byval number As Integer,Byval menu As HMENU,Byref sName As USTRING, Byval flag As Integer=0 ) As Integer
	Declare Function Menuitem  Overload(Byval number As Integer,Byval menu As HMENU,Byval iName As Integer, Byval flag As Integer=MF_BITMAP ) As Integer
	Declare Function Insert_menu  Overload(Byval number As Integer,Byval menu As HMENU,Byref sName As USTRING, Byval NumberSpace As Integer,Byval flag As Integer=0) As Integer
	Declare Function Insert_menu  Overload(Byval number As Integer,Byval menu As HMENU,Byval iName As Integer, Byval NumberSpace As Integer,Byval flag As Integer=MF_BITMAP) As Integer
	Declare Function Menubar(Byval menu As HMENU) As Integer
	Declare Function Opensubmenu(Byval menu As HMENU, Byref sName As USTRING) As HMENU
	Declare Sub Delete_menu(Byval menu As HMENU)
	Declare Sub Hidemenu(Byval menu As HMENU, Byval State As Long) 
	Declare Function Freemenu(Byval menu As HMENU) As Integer
	Declare Function Modify_menu Overload(Byval Soursenumber As Integer,Byval menu As HMENU,Byref sName As USTRING, Byval Newnumber As Integer=FB_IGNORE,Byval flag As Integer=0) As Integer
	Declare Function Modify_menu  Overload(Byval Soursenumber As Integer,Byval menu As HMENU,Byval iName As Integer, Byval Newnumber As Integer=FB_IGNORE,Byval flag As Integer=MF_BITMAP) As Integer
	Declare Sub Deleteitemmenu(Byval menu As HMENU, Byval Npos As Long,Byval flag As Long=0)
	Declare Sub Setstatemenu(Byval menu As HMENU, Byval Npos As Integer,Byval State As Integer) 
	Declare Function Getstatemenu(Byval menu As HMENU, Byval Npos As Long) As Integer
	Declare Function Getmenuitemtext(Byval menu As HMENU, Byval Npos As Long) As USTRING
	Declare Sub Displaypopupmenu(Byval menu As HMENU, Byval Xpos As Long=FB_IGNORE, Byval Ypos As Long=FB_IGNORE, Byval hwnd As hwnd = Cast(hwnd,1),Byval flag As Long=TPM_VERTICAL) 
	Declare Function Menubackcolor(Byval menu As HMENU, Byval colour As Integer, Byval submenues As Integer) As Byte
	
	' requester
	Declare Function Openfilerequester(Byref Title As USTRING, Byref curentdir As USTRING, Byref Pattern As USTRING = "All files(*.*)"+Chr(0)+"*.*"+Chr(0), Byval flag As Integer=0, Byref templateName As USTRING = "", Byval  hParentWin As HWND = 0) As USTRING
	Declare Function Nextselectedfilename() As USTRING
	Declare Function Savefilerequester(Byref Title As USTRING, Byref curentdir As USTRING, Byref Pattern As USTRING = "All files(*.*)"+Chr(0)+"*.*"+Chr(0), Byval defaultsetpattern As bool=0, Byref templateName As USTRING = "",  Byval hParentWin As HWND = 0) As USTRING
	Declare Function Shellfolder(Byref NameDialog As USTRING, Byref DefaultFolder As USTRING, Byval FlagOption As Integer=81, Byval hParentWin As HWND = 0) As USTRING 'BIF_RETURNONLYFSDIRS Or BIF_USENEWUI=81
	Declare Function Colorrequester(Byval rgbCurrentUSER As Integer=0, Byval flagg As Integer=2, Byval hwnd As HWND=0) As COLORREF
	
	' simple dialog
	#define Messbox MsgBox
	Declare Function MsgBox(Byref Caption As USTRING, Byref Message As USTRING, Byval flag As Integer=0,Byval  ParentWin As Hwnd = 0) As Integer
	
	Declare Function Inputbox(Byref Caption As USTRING="", Byref Message As USTRING="Enter text:", Byref DefaultString As USTRING="", Byval flag As Integer=0, Byval flag2 As Integer=0, hParentWin As Hwnd = 0) As USTRING
	
	' font
	Declare Function Loadfont(Byref sFileName As USTRING , _
	Byval Size      As Long, _
	Byval Corner    As Long=0, _
	Byval Bold      As Long=0, _
	Byval Italic    As Long=0, _
	Byval Underline As Long=0, _
	Byval StrikeOut As Long=0) As Integer
	Declare Function Setgadgetfont(Byval gadget As Long = -1 ,Byval Font As Integer=-1) As Integer
	Declare Function Fontrequester(Byval hWin As HWND = 0, Byval nColor As Integer = 0) As Integer
	Declare Function Selectedfontcolor() As Integer
	Declare Function Selectedfontname() As USTRING
	Declare Function Selectedfontsize() As Integer
	Declare Function Selectedfontstyle(Byval style As Byte) As Byte
	Declare Sub Freefont(iFont As Integer)
	Declare Function Getcurentdefaultfont() As Integer
	Declare Function Getnamefromfont(font As Integer) As UString
	Declare Function Getsizefromfont(font As Integer) As Long
	Declare Sub Getsizestringfromfont(sText As UString , font As Integer , Byref iW As Long , Byref iH As Long)
	Declare Function Getstylefromfont(font As Integer, iStyle As Long) As Long
	Declare Function Getsystemdefaultfont() As Integer
	
	' clipboard
	Declare Function Getclipboardtext() As USTRING
	Declare Sub Setclipboardtext(Byref Text As USTRING)
	Declare Function Getclipboardimage() As HBITMAP
	Declare Sub Setclipboardimage(Byval hbmp As HBITMAP) 
	Declare Function Getclipboardfile() As USTRING
	Declare Function Setclipboardfile(Byref sFile As USTRING) As Integer
	Declare Function Clearclipboard() As Integer
	
	' file
	Declare Function Create_file(Byref FileName As USTRING,Byval PAR As Integer=FILE_ATTRIBUTE_NORMAL) As HANDLE
	Declare Function Open_file(Byref FileName As USTRING,Byval PAR As Integer=FILE_ATTRIBUTE_NORMAL) As HANDLE
	Declare Function Read_file(Byref FileName As USTRING,Byval PAR As Integer=FILE_ATTRIBUTE_NORMAL) As HANDLE
	Declare Sub Close_file(Byref H As HANDLE)
	Declare Function Size_file(Byval fileHandle As HANDLE) As Integer
	Declare Function E_o_f(Byval fileHandle As HANDLE) As Long
	Declare Function Get_file_pointer(Byval fileHandle As HANDLE) As Integer
	Declare Sub Set_file_pointer(Byval fileHandle As HANDLE,Byval Number As Integer, Byval Method As Integer=1) 
	Declare Function w9isFile(sFileName As UString) As Long
	Declare Function w9isFileExists(sFileName As UString) As Long
	
	Declare Function Read_character(Byval fileHandle As HANDLE) As USTRING
	Declare Function Read_byte(Byval fileHandle As HANDLE) As Byte
	Declare Function Read_word(Byval fileHandle As HANDLE) As Short
	Declare Function Read_Long(Byval fileHandle As HANDLE) As Long
	#define Read_integer Read_Long
	Declare Function Read_single(Byval fileHandle As HANDLE) As Single
	Declare Function Read_double(Byval fileHandle As HANDLE) As Double
	Declare Function Read_longint(Byval fileHandle As HANDLE) As Longint
	Declare Sub Read_data(Byval fileHandle As HANDLE,Byref pMemory As Byte Ptr ,Byval Lenght As Integer) 
	Declare Function Read_dataa(Byval fileHandle As HANDLE, Byval Lenght As Integer) As Byte Ptr
	Declare Function Read_datas(Byval fileHandle As HANDLE, Byval Lenght As Integer) As Byte Ptr
	Declare Function Read_string(Byval fileHandle As HANDLE) As USTRING
	
	Declare Sub Write_character(Byval fileHandle As HANDLE, Byref CHAR As USTRING)
	Declare Sub Write_byte(Byval fileHandle As HANDLE, Byval Byte_ As Byte) 
	Declare Sub Write_word(Byval fileHandle As HANDLE, Byval Word_ As Short) 
	Declare Sub Write_Long(Byval fileHandle As HANDLE, Byval i32 As Long)
	#define Write_integer Write_Long
	Declare Sub Write_single(Byval fileHandle As HANDLE, Byval Single_ As Single) 
	Declare Sub Write_double(Byval fileHandle As HANDLE, Byval Double_ As Double) 
	Declare Sub Write_string(Byval fileHandle As HANDLE, Byref String_ As USTRING) 
	Declare Sub Write_stringn(Byval fileHandle As HANDLE, Byref String_ As USTRING) 
	Declare Sub Write_longint(Byval fileHandle As HANDLE, Byval Longint_ As Longint) 
	Declare Sub Write_data(Byval H As handle, Byval Address As Any Ptr, Byval Lenght As Long)
	
	' folder
	Declare Sub Delete_file (Byref sFile As USTRING)
	Declare Sub Createdir(Byref sDir As USTRING) 
	Declare Function Removedir(Byref sDir As USTRING) As Integer
	Declare Function Getcurentdir() As USTRING
	Declare Sub Setcurentdir(Byref sDir As USTRING)
	Declare Function Getwindowsdir() As USTRING
	Declare Function Getsystemdir() As USTRING
	Declare Function Gettempdir() As USTRING
	Declare Function Getspecialfolder(Byval folderFlag As Integer) As USTRING
	Declare Sub Copydir(Byref SourseDir As USTRING, Byref NewDir As USTRING, Byval flag As Long=0) 
	Declare Sub Movedir(Byref SourseDir As USTRING, Byref NewDir As USTRING, Byval flag As Long=0) 
	Declare Sub Renamedir(Byref SourseDirName As USTRING,Byref NewDirName As USTRING, Byval flag As Integer=0)
	Declare Sub Deletedir(Byref DeleteDirName As USTRING,Byval flag As Integer=0)
	Declare Function Getextensionpart(Byref sPath As USTRING) As USTRING
	Declare Function Getpathpart(Byref sPath As USTRING) As USTRING
	Declare Function Getfilepart(Byref sPath As USTRING) As USTRING
	Declare Function Examinedirectory(Byref DirectoryName As USTRING, Byref Pattern As USTRING) As Integer
	Declare Function Nextdirectoryentry(Byval HandleDirectory As Integer) As Integer
	Declare Sub Finishdirectory(Byval HandleDirectory As Integer) 
	Declare Function Directoryentrysize(Byval HandleDirectory As Integer) As Ulongint
	Declare Function Directoryentrydate(Byval HandleDirectory As Integer, Byval flag As Long) As USTRING
	Declare Function Directoryentryname(Byval HandleDirectory As Integer) As USTRING
	Declare Function Directoryentryattributes(Byval HandleDirectory As Integer) As Uinteger
	Declare Function w9isDirExists(sFileName As UString) As Long
	
	' dshow movie
	Declare Function Loadmovie(Byval hWin As HWND, Byref sFileName As USTRING, Byval x As Integer, Byval y As Integer,Byval w As Integer, Byval h As Integer) As Integer
	Declare Function Freemovie(Byval Movie_ As Integer) As Integer
	Declare Function Playmovie(Byval Movie_ As Integer) As Integer
	Declare Function Stopmovie(Byval Movie_ As Integer) As Integer
	Declare Function Pausemovie(Byval Movie_ As Integer) As Integer
	Declare Function Resizemovie(Byval Movie_ As Integer,Byval x As Integer, Byval y As Integer, Byval Width_ As Integer, Byval Height_ As Integer) As Integer
	Declare Function Setratemovie(Byval Movie_ As Integer,Byval Rate As Double) As bool
	Declare Function Getratemovie(Byval Movie_ As Integer) As Double
	Declare Function Getendposmovie(Byval Movie_ As Integer) As Longint
	Declare Function Moviesetpositions(Byval Movie_ As Integer,Byval Rnew As Longint,Byval Rend As Longint,Byval flagNew As Integer=1,Byval flagEnd As Integer=1) As Integer 'AM_SEEKING_AbsolutePositioning=1
	Declare Function Moviegetcurrentposition(Byval Movie_ As Integer) As Longint
	Declare Function Moviesoursewidth(Byval Movie_ As Integer) As Longint
	Declare Function Moviesourseheight(Byval Movie_ As Integer) As Longint
	Declare Function Moviefullscreen(Byval Movie_ As Integer,Byval Mode As Integer) As Integer
	Declare Function Movieaudiosetvolume(Byval Movie_ As Integer,Byval Volume As Integer) As Integer
	Declare Function Movieaudiogetvolume(Byval Movie_ As Integer) As Integer
	Declare Function Moviescreenshot(Byval Movie_ As Integer) As HBITMAP
	Declare Function Moviegetstate(Byval Movie_ As Integer,Byval msTimeout As Integer=-1) As Integer
	
	' 2D drawing
	Declare Function Imagestartdraw(Byval hBmp As HBITMAP) As HDC
	Declare Function Windowstartdraw(Byval hWin As HWND,Byval x As Long=0,Byval y As Long=0,Byval w As Long=0, Byval h As Long=0,Byval Alpha_FLAG As Long=0, Byval Alpha_VALUE As Ulong=0) As HDC
	Declare Function Stopdraw() As Integer
	Declare Function Linedraw(Byval x As Long,Byval y As Long,Byval x1 As Long,Byval y1 As Long,Byval width_ As Long=0,Byval color_ As Long=0,Byval style As Long=PS_SOLID) As Integer
	Declare Sub Pixdraw(Byval x As Long,Byval y As Long,Byval Color_ As Long)
	Declare Function Getpix(Byval x As Long,Byval y As Long) As Long
	Declare Function Boxdraw(Byval x As Long,Byval y As Long,Byval w As Long,Byval h As Long,Byval ColorPen As Long=0,Byval ColorBk As Long=0,Byval widthPen As Long=0,Byval StylePen As Long=PS_SOLID, Byval AlPHAPARAM As Long=255) As Integer
	Declare Function Roundboxdraw(Byval x As Long,Byval y As Long,Byval w As Long,Byval h As Long,Byval ColorPen As Long=0,Byval ColorBk As Long=0,Byval widthPen As Long=0,Byval StylePen As Long=PS_SOLID,Byval ellipsewidth As Long=0,Byval ellipseheight As Long=0, Byval AlPHAPARAM As Long=255) As Integer
	Declare Function Rounddraw(Byval x As Long,Byval y As Long,Byval w As Long,Byval h As Long,Byval ColorPen As Long=0,Byval ColorBk As Long=0,Byval widthPen As Long=0,Byval StylePen As Long=PS_SOLID, Byval AlPHAPARAM As Long=255) As Integer
	Declare Function Circledraw(Byval x As Long,Byval y As Long,Byval radius As Long,Byval ColorPen As Long=0,Byval ColorBk As Long=0,Byval widthPen As Long=0,Byval StylePen As Long=PS_SOLID, Byval AlPHAPARAM As Long=255) As Integer
	Declare Sub Fontdraw(Byval FontID As Integer)
	Declare Function Textdraw(Byval x As Long, Byval y As Long, Byref txt As USTRING, Byval ColorBK As Long=0, Byval ColorText As Long=0, Byval AlPHAPARAM As Long=255) As Integer
	Declare Function Polylinedraw(Byval pPoint As Point Ptr,Byval nCount As Long, Byval ColorPen As Long=0, Byval widthPen As Long=0, Byval StylePen As Long=PS_SOLID) As Integer
	Declare Function Polygondraw(Byval pPoint As Point Ptr,Byval nCount As Long, Byval FillColor As Long, Byval BorderColor As Long=0,Byval BorderWidth As Long=0,Byval BorderStyle As Long=PS_SOLID) As Integer
	Declare Sub Imagedraw(Byval hBmp As HBITMAP,Byval x As Long, Byval y As Long, Byval AlPHAPARAM As Long=255) 
	Declare Sub Fillrectdraw(Byval x As Long, Byval y As Long, Byval Color_ As Long)
	Declare Sub Focusdraw(Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long ,Byval  iColor As Long = 0)
	Declare Sub Icondraw(Byval x As Long, Byval y As Long, Byval Hicon As HICON)
	Declare Function Gradientfilldraw(Byval x As Long, Byval y As Long,Byval w As Long, Byval h As Long,Byval Rbegin As Long,Byval Gbegin As Long,Byval Bbegin As Long,Byval REnd As Long,Byval GEnd As Long,Byval BEnd As Long, Byval GOR_VERT As bool=0)As Integer
	Declare Function Piedraw(Byval x As Long,Byval y As Long,Byval w As Long,Byval h As Long,Byval x1 As Long,Byval y1 As Long,Byval x2 As Long,Byval y2 As Long,Byval ColorPen As Long=0,Byval ColorBk As Long=0,Byval widthPen As Long=0,Byval StylePen As Long=PS_SOLID) As Integer
	
	' 2D drawing GDI+
	Declare Function Imagestartdrawa(Byref bitmapGP As Any Ptr,Byval ColorFlag As Integer=0,Byval Color_ As Integer=&hFFFFFFFF) As Any Ptr
	Declare Function Windowstartdrawa(Byval hWin As HWND,Byval x As Integer=0,Byval y As Integer=0,Byval width_ As Integer=0, Byval height_ As Integer=0,Byval ColorFlag As Integer=0,Byval Color_ As Integer=&hFFFFFFFF) As Any Ptr
	Declare Sub Stopdrawa()
	Declare Sub Linedrawa(Byval x As Single,Byval y As Single,Byval x1 As Single,Byval y1 As Single,Byval width_ As Single=1,Byval color_ As Integer=&hff000000,Byval brushPen As Any Ptr=0)
	Declare Sub Boxdrawa(Byval x As Single,Byval y As Single,Byval width_ As Single,Byval height_ As Single,Byval ColorPen As Integer=&hff000000,Byval flagcolorBK As Integer=1,Byval ColorBk As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval brushBk As Any Ptr=0,Byval widthPen As Single=1)
	Declare Sub Bezierdrawa(Byval x0 As Single,Byval y0 As Single,Byval x1 As Single,Byval y1 As Single,Byval x2 As Single,Byval y2 As Single,Byval x3 As Single,Byval y3 As Single,Byval ColorPen As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval widthPen As Single=1)
	Declare Sub Rounddrawa(Byval x As Single,Byval y As Single,Byval width_ As Single,Byval height_ As Single,Byval ColorPen As Integer=&hff000000,Byval flagcolorBK As Integer=1,Byval ColorBk As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval brushBk As Any Ptr=0,Byval widthPen As Single=1)
	Declare Sub Circledrawa(Byval x As Single,Byval y As Single,Byval Radius As Single,Byval ColorPen As Integer=&hff000000,Byval flagcolorBK As Integer=1,Byval ColorBk As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval brushBk As Any Ptr=0,Byval widthPen As Single=1)
	Declare Sub Arcdrawa(Byval x As Single,Byval y As Single,Byval width_ As Single,Byval height_ As Single,Byval startAngle As Single,Byval sweepAngle As Single,Byval ColorPen As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval widthPen As Single=1)
	Declare Sub Piedrawa(Byval x As Single,Byval y As Single,Byval width_ As Single,Byval height_ As Single,Byval startAngle As Single,Byval sweepAngle As Single,Byval ColorPen As Integer=&hff000000,Byval flagcolorBK As Integer=1,Byval ColorBk As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval brushBk As Any Ptr=0,Byval widthPen As Single=1)
	Declare Sub Polygondrawa(Byval Points As Any Ptr,Byval countPoints As Integer,Byval ColorPen As Integer=&hff000000,Byval flagcolorBK As Integer=1,Byval ColorBk As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval brushBk As Any Ptr=0,Byval widthPen As Single=1,Byval fillmode As Integer=0)
	Declare Sub Setpixa(Byval X As Single,Byval Y As Single,Byval Color_ As Integer=&hff000000)
	Declare Function Getpixa(Byval X As Single,Byval Y As Single) As Integer
	Declare Sub Curvedrawa(Byval Points As Any Ptr,Byval countPoints As Integer,Byval RoundPoints As Single=0.5,Byval ColorPen As Integer=&hff000000,Byval flagcolorBK As Integer=1,Byval ColorBk As Integer=&hff000000,Byval brushPen As Any Ptr=0,Byval brushBk As Any Ptr=0,Byval widthPen As Single=1,Byval Closed As Integer=0,Byval fillmode As Integer=0)
	Declare Function Createbrusha(Byval x0 As Single=0,Byval y0 As Single=0,Byval x1 As Single=0,Byval y1 As Single=0, Byval color1 As Integer=&hFF00FF00, Byval color2 As Integer=&hFF0000FF,Byval GpImage As Any Ptr=0,Byval WrapMode As Integer=3 ) As Any Ptr
	Declare Function Createfontdrawa(Byval name_ As USTRING="Arial",Byval size As Integer=10,Byval style As Integer=0,Byval Unit As Integer=6) As Any Ptr
	Declare Sub Freefontdrawa(Byval GpFont As Any Ptr)
	Declare Sub Freebrusha(Byval Brush As Any Ptr)
	Declare Sub Textdrawa(Byref text As USTRING,Byval x As Integer, Byval y As Integer, Byval GpFont As Any Ptr=0, Byval color_ As Integer=&hFFFFFFFF,Byval brush As Any Ptr=0,Byval mode As Integer=0)
	Declare Sub Imagedrawa(Byval GpImage As Any Ptr,Byval x As Single, Byval y As Single,Byval Width_ As Single=0, Byval Height_ As Single=0)
	Declare Sub Modedrawa(Byval mode As Integer)
	Declare Sub Fillrectdrawa(Byval x As Integer, Byval y As Integer, Byval newcol As Integer)
	
	' 3D / 2D OpenGL
	Declare Sub Perspective(Byval fov As Double,Byval ratio As Double,Byval zNear As Double,Byval zFar As Double)
	Declare Sub LookAt(Byval ex As Double, Byval ey As Double, Byval ez As Double, _
	Byval lx As Double, Byval ly As Double, Byval lz As Double, _
	Byval ux As Double, Byval uy As Double, Byval uz As Double )
	
	Declare Function Openglgadget(Byval gadget As Long, _
	Byval x As Long, Byval y As Long, _
	Byval w As Long, Byval h As Long, _
	Byval cBits As Long = 32, _
	Byval dBits As Long = 24, _
	Byval sBits As Long =  0, _
	Byval aBits As Long =  0) As HWND
	Declare Sub Openglgadgetmakecurrent(Byval gadget As Long) 
	Declare Sub Openglgadgetswapbuffers(Byval gadget As Long)
	
	' desktop
	Declare Function Enumsettingsdisplay() As USTRING
	Declare Function Resetenum() As Integer
	Declare Function Setcurrentsettingsdisplay(Byval w As Integer, Byval h As Integer,Byval Bits As Integer,Byval Frequency As Integer) As Integer
	Declare Function Getcurrentsettingsdisplay() As USTRING
	Declare Function Getwidthdesktop(Byref setting As USTRING) As Integer
	Declare Function Getheightdesktop(Byref setting As USTRING) As Integer
	Declare Function Getbitsdesktop(Byref setting As USTRING) As Integer
	Declare Function Getfrequencydesktop(Byref setting As USTRING) As Integer
	Declare Function Globalmousex() As Integer
	Declare Function Globalmousey() As Integer
	
	' scrollbar
	Declare Function Scrollbargadget(Byval gadget As Long,Byval x As Long, Byval y As Long, Byval w As Long, Byval h As Long, Byval MINRange As Long, Byval MAXRange As Long, Byval Style As Long = SB_HORZ, Byval PageLength As Long = 10) As HWND
	Declare Function Getscrollgadgetrange Overload(Byval hWin As HWND,Byval flag As Integer, Byval style As Integer) As Integer
	Declare Function Getscrollgadgetrange Overload(Byval gadget As Long, Byval flag As Integer) As Integer
	Declare Sub Setscrollgadgetrange Overload(Byval hWin As HWND,Byval MINRange As Integer,Byval MAXRange As Integer, Byval style As Integer) 
	Declare Sub Setscrollgadgetrange Overload(Byval gadget As Long,Byval MINRange As Integer,Byval MAXRange As Integer) 
	Declare Function Getscrollgadgetpos Overload(Byval hWin As HWND, Byval style As Integer) As Integer
	Declare Function Getscrollgadgetpos Overload(Byval gadget As Long) As Integer
	Declare Sub Setscrollgadgetpos Overload(Byval hWin As HWND,Byval POSITION As Integer, Byval style As Integer) 
	Declare Sub Setscrollgadgetpos Overload(Byval gadget As Long,Byval POSITION As Integer) 
	Declare Sub Setscrollgadgetpage Overload(Byval gadget As Long, Byval page As Integer)
	Declare Sub Setscrollgadgetpage Overload(Byval hWin As HWND, Byval page As Integer,Byval style As Integer) 
	Declare Sub Setpagestepscrollbar Overload(Byval iGadget As Long , Byval parscroll As Integer)
	Declare Sub Setpagestepscrollbar (Byval hw As HWND, Byval parscroll As Integer)
	
	' systray
	#ifndef NIIF_USER
		#define NIIF_USER 4
	#endif
	Declare Function Addsystrayicon(Byval NumberSysTray As Integer,Byval hwnd As HWND,Byval icon As HICON,Byref ToolTipSysTray As USTRING) As Integer
	Declare Sub Replacesystrayicon(Byval NumberSysTray As Integer,Byval icon As HICON,Byref ToolTipSysTray As USTRING) 
	Declare Sub Deletesystrayicon(Byval NumberSysTray As Integer)
	Declare Function Messagesystrayicon(Byval NumberSysTray As Integer, Byval hwnd As HWND, Byref Title As USTRING, Byref Text As USTRING, Byval Timeout As Integer = 5000, Byval icon As HICON = 0, Byval TypeIcon As Integer = NIIF_INFO) As Integer
	
	' MDI
	Declare Function Clientmdigadget(Byval menu As HMENU,Byval IDmenuMDI As Integer, Byval Style As Integer=WS_CLIPCHILDREN Or WS_CLIPSIBLINGS  Or WS_VSCROLL Or WS_HSCROLL) As HWND
	Declare Function Mdigadget(Byref sName As USTRING, Byval x As Integer, Byval y As Integer,Byval w As Integer, Byval h As Integer, Byval Style As Integer=WS_OVERLAPPEDWINDOW) As HWND
	
	' printer
	Declare Function Hwndprinter(Byval hWin As HWND, Byval Xpr As Integer=0, Byval Ypr As Integer=0, Byval X As Integer=0, Byval Y As Integer=0, Byval X1 As Integer=0, Byval Y1 As Integer=0) As Integer
	Declare Sub      Textprinter(Byref SourseText As USTRING, Byval Font As window9.FontPrint Ptr=0, Byval color_BK As COLORREF=0, Byval color_T As COLORREF=0)
	
	
	Declare Function Containergadget(Byval gadget As Long, Byval x As Long,Byval y As Long,Byval w As Long, Byval h As Long, Byval par As Long=0) As HWND
	Declare Function GroupContainerGadget(Byval id As Integer, Byval x As Integer, Byval y As Integer, Byval w As Integer, Byval h As Integer, Byref caption As USTRING) As HWND
	
	' panel
	Declare Function Panelgadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long=0, Byval h As Long=0, Byval SizeIcon As Long=16, Byval par As Long=0) As HWND
	Declare Function Addpanelgadgetitem(Byval gadget As Long, Byval Item As Long, Byref text As USTRING, Byval ImageID As HBITMAP=0, Byval flag As Long=0) As HWND
	Declare Sub Deleteitempanelgadget(Byval gadget As Long, Byval item As Long) 
	Declare Function Panelgadgetgetcursel(Byval gadget As Long) As Long
	Declare Sub Panelgadgetsetcursel(Byval gadget As Long, Byval item As Long)
	
	' richedit
	Declare Function Editorgadget(Byval gadget As Long, Byval x As Long, Byval y As Long, Byval w As Long,Byval h As Long, Byref stri As USTRING="", Byval style As Long=0 ,Byval tag As Long = 0) As HWND
	Declare Function Undoeditor(Byval gadget As Long) As Integer
	Declare Function Redoeditor(Byval gadget As Long) As Integer
	Declare Sub Pasteeditor(Byval gadget As Long, Byref text As USTRING, Byval param As Integer=1) 
	Declare Function Canundoeditor(Byval gadget As Long) As Integer
	Declare Function Canredoeditor(Byval gadget As Long) As Integer
	Declare Sub Emptyundobuffereditor(Byval gadget As Long)
	Declare Function Getlinetexteditor(Byval gadget As Long, Byval Number As Integer, Byval Buffer As Integer=512) As USTRING
	Declare Function Getlinecounteditor(Byval gadget As Long) As Integer
	Declare Function Getmodifyeditor(Byval gadget As Long) As Integer
	Declare Function Getrecteditor(Byval gadget As Long, Byval rect As RECT Ptr) As Integer
	Declare Function Setlimittexteditor(Byval gadget As Long, Byval Limit As Integer=0) As Integer
	Declare Sub Setmodifyeditor(Byval gadget As Long, Byval Flag As Long=0) 
	Declare Sub Setpasswordchar(Byval gadget As Long, Byval CharCode As Ubyte=0)
	Declare Function Getpasswordchar(Byval gadget As Long) As Ubyte
	Declare Function Linefromchareditor(Byval gadget As Long, Byval index As Integer=-1) As Integer
	Declare Function Lineindexeditor(Byval gadget As Long, Byval NumberLine As Integer=-1) As Integer
	Declare Function Linelengtheditor(Byval gadget As Long, Byval index As Integer=-1) As Integer
	Declare Function Linescrolleditor(Byval gadget As Long, Byval VertPos As Integer) As Integer
	Declare Sub Settabstopseditor(Byval gadget As Long, Byval TabWidth As Integer=0) 
	Declare Sub Readonlyeditor(Byval gadget As Long, Byval ReadOnly As Integer=0)
	Declare Function Getfirstvisiblelineeditor(Byval gadget As Long) As Integer
	Declare Function Setrecteditor(Byval gadget As Long, Byval rec As RECT Ptr) As Integer
	Declare Function Getcurrentindexchareditor(Byval gadget As Long) As Integer
	Declare Sub Settransfertextlineeditorgadget(Byval gadget As Long, Byval state As Long) 
	Declare Function Getselecttexteditorgadget(Byval gadget As Long) As USTRING
	Declare Sub Setselecttexteditorgadget(Byval gadget As Long, Byval selBegin As Long, Byval selEnd As Long) 
	
	' rebar
	Declare Function Rebargadget(Byval gadget  As Long, _
	Byval Style   As Integer = WS_CLIPCHILDREN Or WS_CLIPSIBLINGS Or RBS_VARHEIGHT Or RBS_AUTOSIZE Or RBS_BANDBORDERS Or CCS_ADJUSTABLE Or CCS_TOP Or CCS_NODIVIDER, _
	Byval ExStyle As Integer = 0) As HWND
	Declare Function Addrebartab(Byval gadget As Long, _
	Byval GadgetChild As Long, _
	Byval IDinNumber As Integer = 0, _
	Byref string_ As USTRING = "", _
	Byval pos_ As Integer = -1, _
	Byval x    As Integer = 100, _
	Byval MinX As Integer = 0, _
	Byval MinY As Integer = 20, _
	Byval Mask As Integer = RBBIM_STYLE Or RBBIM_CHILD Or RBBIM_CHILDSIZE Or RBBIM_SIZE Or RBBIM_TEXT Or RBBIM_ID, _
	Byval Style As Integer = RBBS_CHILDEDGE Or RBBS_GRIPPERALWAYS) As Integer
	Declare Function Getcounttabrebargadget(Byval gadget As Long) As Integer
	Declare Function Getheightrebargadget(Byval gadget As Long) As Integer
	Declare Function Gettextrebargadget(Byval gadget As Long, Byval index As Long) As USTRING
	Declare Sub Settextrebargadget(Byval gadget As Long, Byval index As Integer, Byval text As USTRING) 
	Declare Function Movetabrebargadget(Byval gadget As Long, Byval IndexMove As Integer, Byval IndexNew As Integer) As Integer
	Declare Sub Deletetabrebargadget(Byval gadget As Long, Byval Index As Long) 
	Declare Function Idinindexrebargadget(Byval gadget As Long, Byval ID As Integer) As Integer
	
	' ini
	Declare Function Createfbini(Byref sFileName As USTRING) As handle
	Declare Function Openfbini(Byref sFileName As USTRING, Byval flag As bool = 0) As handle
	Declare Function Closefbini() As bool
	Declare Sub      Writegroupfbini(Byref group As USTRING)
	Declare Sub      Writevaluefbini Overload(Byref sGroup As USTRING, Byref sKey As USTRING, Byval value As Byte)
	Declare Sub      Writevaluefbini (Byref sGroup As USTRING, Byref sKey As USTRING, Byval value As Short)
	Declare Sub      Writevaluefbini (Byref sGroup As USTRING, Byref sKey As USTRING, Byval value As Integer32)
	Declare Sub      Writevaluefbini (Byref sGroup As USTRING, Byref sKey As USTRING, Byval value As Double)
	Declare Sub      Writevaluefbini (Byref sGroup As USTRING, Byref sKey As USTRING, Byval value As Longint)
	Declare Sub      Writevaluefbini (Byref sGroup As USTRING, Byref sKey As USTRING, Byref value As USTRING)
	Declare Function Readbytevaluefbini(Byref sGroup As USTRING, Byref sKey As USTRING) As Byte
	Declare Function Readshortvaluefbini(Byref sGroup As USTRING, Byref sKey As USTRING) As Short
	Declare Function Readintegervaluefbini(Byref sGroup As USTRING, Byref sKey As USTRING) As Integer32
	Declare Function Readlongintvaluefbini(Byref sGroup As USTRING, Byref sKey As USTRING) As Longint
	Declare Function Readdoublevaluefbini(Byref sGroup As USTRING, Byref sKey As USTRING) As Double
	Declare Function Readstringvaluefbini(Byref sGroup As USTRING, Byref sKey As USTRING) As USTRING
	Declare Function Getcurrentfilename() As USTRING
	Declare Function Getcurrentfilenamea() As USTRING
	
	Declare Sub Setrunonlyexe()
	
	' process / thread
	Declare Function Initprocess() As HANDLE
	Declare Function Firstprocess(Byval hProc As HANDLE) As Long
	Declare Function Nextprocess(Byval hProc As HANDLE) As Long
	Declare Function Getnameprocess() As USTRING
	Declare Function Getidprocess() As Integer
	Declare Function Create_process(Byref FileName As USTRING, Byref DirDefault As USTRING="", Byval flag As Integer=0, Byval STARTUPINFO_ As STARTUPINFO Ptr=0, Byval PROCESS_INFORMATION_ As PROCESS_INFORMATION Ptr=0) As Integer
	Declare Function Open_process(Byval pid As Integer, Byval Access_ As Integer=PROCESS_ALL_ACCESS, Byval flag As BOOL=0) As HANDLE
	Declare Sub Killprocess(Byval hProc As HANDLE, Byval ExitCode As Integer=0)
	Declare Function Waitexitprocess(Byval hProc As HANDLE, Byval WaitTime As Integer=INFINITE)As bool
	Declare Function Waitloadprocess(Byval hProc As HANDLE, Byval WaitTime As Integer=INFINITE)As bool
	Declare Function Getexitcode(Byval hProc As HANDLE) As Integer
	
	' zip packer
	Declare Function Compressmem(Byref BUF_DEST As Byte Ptr,Byval SOURSEDATA As Byte Ptr,Byval SIZEDATA As Ulong, Byval level As Long=5) As Long
	Declare Function Decompressmem(Byref BUF_COMPRESSED As Byte Ptr,Byval SIZECOMPRESSED As Long,Byref BUFDESTDATA As Byte Ptr) As Long
	Declare Function Compressfile(Byref filename As USTRING, Byref filenameDest As USTRING,Byval level As Long=5) As Long
	Declare Function Decompressfile(Byref filename As USTRING, Byref filenameDest As USTRING) As Long
	
	' HELP
	Declare Function Openhelp(Byref sPathHelp As USTRING, Byref sTopic As USTRING, Byval iParam As Integer = FB_IGNORE) As HWND
	Declare Sub Closehelp()
	
	' tools and misc.
	Declare Function Asciitoutf(Byref text As String) As Wstring Ptr
	Declare Function Utftoascii(Byval text As Wstring Ptr) As String
	Declare Function Utf8tounicode(Byref sTextUtf8 As String) As Wstring Ptr
	Declare Function Unicodetoutf8(Byval wsText As Wstring Ptr ) As String
	
	Declare Sub Fastcopy(Byval pTarget As Any Ptr, Byval pSource As Any Ptr, Byval nBytes As Uinteger)
	
	Declare Function FastCRC16(Byval pBuffer As Any Ptr, Byval BufferSize As Uinteger) As Ushort
	Declare Function Fastcrc32(Byval pBuffer As Any Ptr, Byval BufferSize As Uinteger) As Ulong
	
	Declare Function Aesencoder(Byref Text As USTRING, Byref Key As USTRING) As USTRING
	Declare Function Aesdecoder(Byref Text As USTRING, Byref Key As USTRING) As USTRING
	
	Declare Function Encode64(Byref text As USTRING) As USTRING
	Declare Function Decode64(Byref strb64 As USTRING) As USTRING
	
	Declare Function Md5createfilehash(Byref file As String) As String
	Declare Function Md5createhash(Byref text As String) As String
	
	Declare Function Sha512create(Byref text As String) As String
	Declare Function Sha512createfile(Byref file As String) As String
	
	Declare Function Sha1createfile(Byref file As String) As String
	Declare Function Sha1create(Byref file As String) As String
	
	Declare Function Peeks(Byval Memory As Any Ptr, Byval iLen As Integer = 0) As USTRING
	Declare Function Runprogram(Byref Filename As USTRING, Byref Parameter As USTRING="", Byref WorkingDirectory As USTRING="", Byref Flags As USTRING = "open", Byval ShowCmd As Integer=1) As Integer
	Declare Function Replacestring(Byref String_ As USTRING, Byref SearchString As USTRING, Byref ReplaceString_ As USTRING, Byval Position As Long=1,Byval searchParam As Long=0, Byval RegisterParam As Long=0) As USTRING
	Declare Function Insertstring(Byref DestS As USTRING, Byref InsertS As USTRING, Byval Position As Integer) As Integer
	Declare Function Ltrima(Byref dest As USTRING, Byref trimString As USTRING=" ") As USTRING
	Declare Function Rtrima(Byref dest As USTRING, Byref trimString As USTRING=" ") As USTRING
	Declare Function Trima(Byref dest As USTRING, Byref trimString As USTRING=" ") As USTRING
	Declare Function Clearstring(Byref dest As USTRING, Byref trimString As USTRING=" ") As USTRING
	
	Declare Function Setwindowcallback(Byval Address_Function As Integer,Byval flag As Integer=0) As Integer
	Declare Function Freecallback(Byval flag As Integer) As Integer
	
	Declare Sub Updateinfoxserver(iCountCicles As Long = 10000)
	
	Declare Function Uboundincbin(Byval pBuf As Any Ptr) As Long
	Declare Sub      addInclude_binary_info(Byval pAny As Any Ptr ,Byval iLen As Long)
	
	' Internet
	Type FTPINFO
		As WIN32_FIND_DATA FileInformation
		Declare Function Ftpexaminedirectory(Byval hConnect As HINTERNET, Byref DirectoryName As USTRING, Byref Pattern As USTRING, Byval dwFlags As Integer = 0) As HINTERNET
		Declare Function Ftpnextdirectoryentry(Byval hFind As HINTERNET) As Integer
		Declare Function Ftpfinishdirectory(Byval hFind As HINTERNET) As Integer
		Declare Function Ftpdirectoryentryattributes() As Integer
		Declare Function Ftpdirectoryentrysize() As Ulongint
		Declare Function Ftpdirectoryentrydate() As USTRING
		Declare Function Ftpdirectoryentryname() As USTRING
	End Type
	
	Declare Function Urldecoder(Byref sUrl As USTRING) As USTRING
	Declare Function Urlencoder(Byref sUrl As USTRING) As USTRING
	
	Declare Function Inetopen(Byref szUserAgent As USTRING = "FB", Byval iType As Integer = INTERNET_OPEN_TYPE_DIRECT, Byref szProxyName As USTRING = "", Byref szProxyBypass As USTRING="", Byval iFlags As Integer = 0) As HINTERNET
	Declare Function Openurl(Byval hInet As HINTERNET, Byref szURL As USTRING, Byref szHeaders As USTRING = "", Byval iSizeHeaders As Integer = 0, Byval iFlags As Integer = INTERNET_FLAG_RELOAD) As HINTERNET
	Declare Function Inetreadfile(Byval hUrl As HINTERNET, Byval psData As Any Ptr, Byval iLenData As Integer) As Integer
	Declare Sub      Inetfreehandle(Byval handle As HINTERNET)
	Declare Function Gethttpheader(Byval hUrl As HINTERNET) As USTRING
	Declare Function Receivehttpfile(Byref sUrl As USTRING, Byref sFile As USTRING) As Integer
	Declare Function Getcontentsize(Byval hUrl As HINTERNET) As Ulongint
	Declare Function Ftpfinishdirectory(Byval hFind As HINTERNET) As Integer
	Declare Function Ftpconnect(Byval hInet As HINTERNET, Byref ServerName As USTRING, Byref UserName As USTRING, Byref UserPassword As USTRING, Byval ServerPort As Integer = 21, Byval Flags As Integer = 0) As HINTERNET
	Declare Function Ftpfileget(Byval hConnect As HINTERNET, Byref RemoteFile As USTRING, Byref LocalFile As USTRING, Byval fFailExists As Integer = 0, Byval dwFlagAttributes As Integer = 0, Byval dwFlags As Integer = FTP_TRANSFER_TYPE_BINARY ) As Integer
	Declare Function Ftpfileput(Byval hInet As HINTERNET, Byref LocalFile As USTRING, Byref RemoteFile As USTRING, Byval dwFlags As Integer = FTP_TRANSFER_TYPE_BINARY) As Integer
	Declare Function Ftpsetdirectory(Byval hConnect As HINTERNET, Byref Directory As USTRING) As Integer
	Declare Function Ftpgetdirectory(Byval hConnect As HINTERNET) As USTRING
	Declare Function Ftpfileopen(Byval hConnect As HINTERNET, Byref File As USTRING, Byval dwFlags As Integer = FTP_TRANSFER_TYPE_BINARY, Byval dwAccess As Integer = GENERIC_WRITE) As HINTERNET
	Declare Function Ftpfileclose(Byval hFile As HINTERNET) As Integer
	Declare Function Ftpwritefile(Byval hFile As HINTERNET, Byval Buffer As Any Ptr, Byval nBuffer As Integer) As Integer
	Declare Function Ftpgetsizefile(Byval hFile As HINTERNET) As Ulongint

	'----------------------------------------Data Container
	'hashtable
	Declare Function CreateHashTable() As Any Ptr
	Declare Function GetSizeHashTable(p As Any Ptr) As Long
	Declare Sub SetValueHashTable(p As Any Ptr , sKey As String , anyValue As Any Ptr)
	Declare Sub SetValueStrHashTable(p As Any Ptr , sKey As String , anyValue As USTRING)
	Declare Function GetValueHashTable(p As Any Ptr , sKey As String) As Any Ptr
	Declare Function GetValueStrHashTable(p As Any Ptr , sKey As String) As USTRING
	Declare Sub FreeHashTable(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub FreeKeyHashTable(p As Any Ptr , sKey As String , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub DeleteHashTable(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	'list
	Declare Function CreateList() As Any Ptr
	Declare Function GetSizeList(p As Any Ptr) As Long
	Declare Sub AddList(p As Any Ptr , anyValue As Any Ptr)
	Declare Sub AddStrList(p As Any Ptr , anyValue As USTRING)
	Declare Function GetValueList(p As Any Ptr , iIndex As Long) As Any Ptr
	Declare Function GetValueStrList(p As Any Ptr , iIndex As Long) As USTRING
	Declare Sub InsertItemList(p As Any Ptr , iIndex As Long , anyValue As Any Ptr)
	Declare Sub InsertItemStrList(p As Any Ptr , iIndex As Long , anyValue As USTRING)
	Declare Sub SetValueList(p As Any Ptr , iIndex As Long , anyValue As Any Ptr)
	Declare Sub SetValueStrList(p As Any Ptr , iIndex As Long , anyValue As USTRING)
	Declare Sub MoveItemList(p As Any Ptr , iIndexFrom As Long , iIndexTo As Long)
	Declare Sub DeleteItemList(p As Any Ptr , iIndex As Long , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub FreeList(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub DeleteList(p As Any Ptr, bFlagFreeMemoryStrings As Long = 0)
	'map
	Declare Function CreateMap() As Any Ptr
	Declare Function GetSizeMap(p As Any Ptr) As Long
	Declare Function GetValueMap(p As Any Ptr , sKey As String) As Any Ptr
	Declare Sub SetValueMap(p As Any Ptr , sKey As String , anyValue As Any Ptr)
	Declare Function GetValueStrMap(p As Any Ptr , sKey As String) As USTRING
	Declare Sub SetValueStrMap(p As Any Ptr , sKey As String , anyValue As USTRING)
	Declare Sub FreeMap(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub FreeKeyMap(p As Any Ptr , sKey As String , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub DeleteMap(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	'queue
	Declare Function CreateQueue() As Any Ptr
	Declare Function GetSizeQueue(p As Any Ptr) As Long
	Declare Function PopQueue(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0) As Any Ptr
	Declare Sub PushQueue(p As Any Ptr  , anyValue As Any Ptr)
	Declare Sub PushStrQueue(p As Any Ptr  , anyValue As USTRING)
	Declare Function BackQueue(p As Any Ptr) As Any Ptr
	Declare Function BackStrQueue(p As Any Ptr) As USTRING
	Declare Function FrontQueue(p As Any Ptr) As Any Ptr
	Declare Function FrontStrQueue(p As Any Ptr) As USTRING
	Declare Sub FreeQueue(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub DeleteQueue(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	'stack
	Declare Function CreateStack() As Any Ptr
	Declare Function GetSizeStack(p As Any Ptr) As Long
	Declare Function PopStack(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0) As Any Ptr
	Declare Sub PushStack(p As Any Ptr  , anyValue As Any Ptr)
	Declare Sub PushStrStack(p As Any Ptr  , anyValue As USTRING)
	Declare Function FrontStack(p As Any Ptr) As Any Ptr
	Declare Function FrontStrStack(p As Any Ptr) As USTRING
	Declare Sub FreeStack(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	Declare Sub DeleteStack(p As Any Ptr , bFlagFreeMemoryStrings As Long = 0)
	
	' stack internal
	Declare Function NewStackFreeIndexes() As Any Ptr
	Declare Sub PushStackFreeIndexes(p As Any Ptr , iValue As Long)
	Declare Function PopStackFreeIndexes(p As Any Ptr) As Long
	Declare Function SizeStackFreeIndexes(p As Any Ptr) As Long
	Declare Sub FreeStackFreeIndexes(p As Any Ptr)
	Declare Sub FreeStackPointer(p As Any Ptr)
	
	' config
	Declare Function ConfigCreate() As Any Ptr
	Declare Sub ConfigDelete(p As Any Ptr)
	Declare Sub ConfigClear(p As Any Ptr)
	Declare Sub ConfigDeleteValue(p As Any Ptr , sGroup As USTRING  , sKey As USTRING)
	Declare Sub ConfigLoad(p As Any Ptr  , sPath As USTRING)
	Declare Sub ConfigSave(p As Any Ptr  , sPath As USTRING)
	Declare Sub SetConfigValue(p As Any Ptr  , sGroup As USTRING , sKey As USTRING , sValue As USTRING)
	Declare Function GetConfigValue(p As Any Ptr  , sGroup As USTRING , sKey As USTRING) As USTRING
#endif ' __WINDOW9_BI__


