using System ;
using System.Collections.Generic ;
using System.Runtime.InteropServices ;
using System.Text ;


namespace DxLibDLL
{


	public delegate int ActiveStateChangeCallBackFunction( int ActiveState , IntPtr UserData ) ;

	public delegate void UseASyncChangeWindowModeFunction( IntPtr Data ) ;

	public delegate IntPtr WndProc( IntPtr Wnd , int Msg , IntPtr WParam , IntPtr LParam ) ;

	public delegate void MenuItemSelectCallBackFunction( string ItemName , int ItemID ) ;


	public static partial class DX
	{


		/// <summary> ライブラリ初期化関数 </summary>
		public static void DxLib_Init()
		{
			lock( locker )
			{
				int result = dx_DxLib_Init() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				Graph.InitializeAll() ;
				BlendGraph.InitializeAll() ;
				Sound.InitializeAll() ;
				Movie.InitializeAll() ;
				MovieToOverlay.InitializeAll() ;
				Font.InitializeAll() ;
				Mask.InitializeAll() ;
				NetWork.InitializeAll() ;
				NetWorkUDP.InitializeAll() ;
				KeyInput.InitializeAll() ;
				Music.InitializeAll() ;
				Light.InitializeAll() ;
				Model.InitializeAll() ;
				SoftImage.InitializeAll() ;
				Shader.InitializeAll() ;
				SoftSound.InitializeAll() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxLib_Init() ;


		/// <summary> ライブラリ使用の終了関数 </summary>
		public static void DxLib_End()
		{
			lock( locker )
			{
				SoftSound.FinalizeAll() ;
				Shader.FinalizeAll() ;
				SoftImage.FinalizeAll() ;
				Model.FinalizeAll() ;
				Light.FinalizeAll() ;
				Music.FinalizeAll() ;
				KeyInput.FinalizeAll() ;
				NetWorkUDP.FinalizeAll() ;
				NetWork.FinalizeAll() ;
				Mask.FinalizeAll() ;
				Font.FinalizeAll() ;
				MovieToOverlay.FinalizeAll() ;
				Movie.FinalizeAll() ;
				Sound.FinalizeAll() ;
				BlendGraph.FinalizeAll() ;
				Graph.FinalizeAll() ;
				int result = dx_DxLib_End() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxLib_End() ;


		/// <summary> ライブラリの内部で使用している構造体をゼロ初期化して、DxLib_Init の前に行った設定を無効化する( DxLib_Init の前でのみ有効 ) </summary>
		public static void DxLib_GlobalStructInitialize()
		{
			lock( locker )
			{
				int result = dx_DxLib_GlobalStructInitialize() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxLib_GlobalStructInitialize() ;


		/// <summary> ライブラリが初期化されているかどうかを取得する( 戻り値: TRUE=初期化されている  FALSE=されていない ) </summary>
		public static bool DxLib_IsInit()
		{
			lock( locker )
			{
				int result = dx_DxLib_IsInit() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxLib_IsInit() ;


		/// <summary> エラー文書を書き出す </summary>
		public static void ErrorLogAdd( string ErrorStr )
		{
			lock( locker )
			{
				int result = dx_ErrorLogAdd( ErrorStr ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ErrorLogAdd( string ErrorStr ) ;


		/// <summary> タブ数を増やす </summary>
		public static void ErrorLogTabAdd()
		{
			lock( locker )
			{
				int result = dx_ErrorLogTabAdd() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ErrorLogTabAdd() ;


		/// <summary> タブ数を減らす </summary>
		public static void ErrorLogTabSub()
		{
			lock( locker )
			{
				int result = dx_ErrorLogTabSub() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ErrorLogTabSub() ;


		/// <summary> タイムスタンプの有無を設定する </summary>
		public static void SetUseTimeStampFlag( bool UseFlag )
		{
			lock( locker )
			{
				int result = dx_SetUseTimeStampFlag( UseFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseTimeStampFlag( bool UseFlag ) ;


		/// <summary> 書式付きログ文字列を書き出す </summary>
		public static void AppLogAdd( string String )
		{
			lock( locker )
			{
				int result = dx_AppLogAdd( String.Replace( "%" , "%%" ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AppLogAdd( string String ) ;


		/// <summary> メモリを確保する </summary>
		public static IntPtr DxAlloc( int AllocSize )
		{
			lock( locker )
			{
				IntPtr result = dx_DxAlloc( ( IntPtr )( AllocSize ) , null , -1 ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_DxAlloc( IntPtr AllocSize , string File , int Line ) ;


		/// <summary> メモリを確保して０で初期化する </summary>
		public static IntPtr DxCalloc( int AllocSize )
		{
			lock( locker )
			{
				IntPtr result = dx_DxCalloc( ( IntPtr )( AllocSize ) , null , -1 ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_DxCalloc( IntPtr AllocSize , string File , int Line ) ;


		/// <summary> メモリの再確保を行う </summary>
		public static IntPtr DxRealloc( IntPtr Memory , int AllocSize )
		{
			lock( locker )
			{
				IntPtr result = dx_DxRealloc( Memory , ( IntPtr )( AllocSize ) , null , -1 ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_DxRealloc( IntPtr Memory , IntPtr AllocSize , string File , int Line ) ;


		/// <summary> メモリを解放する </summary>
		public static void DxFree( IntPtr Memory )
		{
			lock( locker )
			{
				dx_DxFree( Memory ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern void dx_DxFree( IntPtr Memory ) ;


		/// <summary> 列挙対象にするメモリの確保容量をセットする </summary>
		public static void DxSetAllocSizeTrap( IntPtr Size )
		{
			lock( locker )
			{
				IntPtr result = dx_DxSetAllocSizeTrap( Size ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_DxSetAllocSizeTrap( IntPtr Size ) ;


		/// <summary> ＤＸライブラリ内でメモリ確保が行われる時に情報を出力するかどうかをセットする </summary>
		public static void DxSetAllocPrintFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_DxSetAllocPrintFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxSetAllocPrintFlag( bool Flag ) ;


		/// <summary> DxAlloc や DxCalloc で確保しているメモリサイズを取得する </summary>
		public static int DxGetAllocSize()
		{
			lock( locker )
			{
				IntPtr result = dx_DxGetAllocSize() ;
				return ( int )( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_DxGetAllocSize() ;


		/// <summary> DxAlloc や DxCalloc で確保しているメモリの数を取得する </summary>
		public static int DxGetAllocNum()
		{
			lock( locker )
			{
				int result = dx_DxGetAllocNum() ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxGetAllocNum() ;


		/// <summary> DxAlloc や DxCalloc で確保しているメモリを列挙する </summary>
		public static void DxDumpAlloc()
		{
			lock( locker )
			{
				dx_DxDumpAlloc() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern void dx_DxDumpAlloc() ;


		/// <summary> 確保したメモリ情報が破壊されていないか調べる( -1:破壊あり  0:なし ) </summary>
		public static bool DxErrorCheckAlloc()
		{
			lock( locker )
			{
				int result = dx_DxErrorCheckAlloc() ;
				return result == 0 ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxErrorCheckAlloc() ;


		/// <summary> メモリが確保、解放が行われる度に確保しているメモリの容量を出力するかどうかのフラグをセットする </summary>
		public static void DxSetAllocSizeOutFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_DxSetAllocSizeOutFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxSetAllocSizeOutFlag( bool Flag ) ;


		/// <summary> メモリの確保、解放が行われる度に確保しているメモリ確保情報が破損していないか調べるかどうかのフラグをセットする </summary>
		public static void DxSetAllocMemoryErrorCheckFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_DxSetAllocMemoryErrorCheckFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DxSetAllocMemoryErrorCheckFlag( bool Flag ) ;


		/// <summary> ログ出力フラグをセットする </summary>
		public static void SetLogDrawOutFlag( bool DrawFlag )
		{
			lock( locker )
			{
				int result = dx_SetLogDrawOutFlag( DrawFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetLogDrawOutFlag( bool DrawFlag ) ;


		/// <summary> ログ出力をするかフラグの取得 </summary>
		public static bool GetLogDrawFlag()
		{
			lock( locker )
			{
				int result = dx_GetLogDrawFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetLogDrawFlag() ;


		/// <summary> 簡易画面出力 </summary>
		public static void printfDx( string FormatString )
		{
			lock( locker )
			{
				int result = dx_printfDx( FormatString.Replace( "%" , "%%" ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_printfDx( string FormatString ) ;


		/// <summary> 簡易画面出力をクリアする </summary>
		public static void clsDx()
		{
			lock( locker )
			{
				int result = dx_clsDx() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_clsDx() ;


		/// <summary> ファイルを開く </summary>
		public static FileStream FileRead_open( string FilePath )
		{
			return FileRead_open( FilePath , false ) ;
		}

		/// <summary> ファイルを開く </summary>
		public static FileStream FileRead_open( string FilePath , bool ASync )
		{
			lock( locker )
			{
				int result = dx_FileRead_open( FilePath , ASync ) ;
				if( !( result != 0 ) ) { throw new DX.Exception() ; }
				return FileStream.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_open( string FilePath , bool ASync ) ;


		/// <summary> ファイルのサイズを得る </summary>
		public static int FileRead_size( string FilePath )
		{
			lock( locker )
			{
				int result = dx_FileRead_size( FilePath ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_size( string FilePath ) ;


		/// <summary> ファイルポインタの現在位置を得る </summary>
		public static int FileRead_tell( FileStream FileHandle )
		{
			lock( locker )
			{
				int result = dx_FileRead_tell( FileStream.ToHandle( FileHandle ) ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_tell( int FileHandle ) ;


		/// <summary> ファイルポインタの位置を変更する </summary>
		public static int FileRead_seek( FileStream FileHandle , int Offset , STREAM_SEEKTYPE Origin )
		{
			lock( locker )
			{
				int result = dx_FileRead_seek( FileStream.ToHandle( FileHandle ) , Offset , Origin ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_seek( int FileHandle , int Offset , STREAM_SEEKTYPE Origin ) ;


		/// <summary> ファイルからデータを読み込む </summary>
		public static int FileRead_read( IntPtr Buffer , int ReadSize , FileStream FileHandle )
		{
			lock( locker )
			{
				int result = dx_FileRead_read( Buffer , ReadSize , FileStream.ToHandle( FileHandle ) ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_read( IntPtr Buffer , int ReadSize , int FileHandle ) ;


		/// <summary> ファイル読み込みが完了しているかどうかを取得する </summary>
		public static bool FileRead_idle_chk( FileStream FileHandle )
		{
			lock( locker )
			{
				int result = dx_FileRead_idle_chk( FileStream.ToHandle( FileHandle ) ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_idle_chk( int FileHandle ) ;


		/// <summary> ファイルの終端かどうかを得る </summary>
		public static bool FileRead_eof( FileStream FileHandle )
		{
			lock( locker )
			{
				int result = dx_FileRead_eof( FileStream.ToHandle( FileHandle ) ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_eof( int FileHandle ) ;


		/// <summary> ファイルから文字列を読み出す </summary>
		public static int FileRead_gets( out string Buffer , int BufferSize , FileStream FileHandle )
		{
			lock( locker )
			{
				StringBuilder Buffer_ = new StringBuilder( BufferSize ) ;
				int result = dx_FileRead_gets( Buffer_ , BufferSize , FileStream.ToHandle( FileHandle ) ) ;
				Buffer = Buffer_.ToString() ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_gets( [ Out ] StringBuilder Buffer , int BufferSize , int FileHandle ) ;


		/// <summary> ファイルから一文字読み出す </summary>
		public static char FileRead_getc( FileStream FileHandle )
		{
			lock( locker )
			{
				char result = dx_FileRead_getc( FileStream.ToHandle( FileHandle ) ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern char dx_FileRead_getc( int FileHandle ) ;


		/// <summary> ファイル情報ハンドルを作成する( 戻り値  -1:エラー  -1以外:ファイル情報ハンドル ) </summary>
		public static FILEINFO[] FileRead_createInfo( string ObjectPath )
		{
			lock( locker )
			{
				int FileInfoHandle = dx_FileRead_createInfo( ObjectPath ) ;
				if( !( FileInfoHandle != -1 ) ) { throw new DX.Exception() ; }

				try
				{
					int FileInfoNum = dx_FileRead_getInfoNum( FileInfoHandle ) ;
					if( !( FileInfoNum >= 0 ) ) { throw new DX.Exception() ; }
					FILEINFO[] fileInfos = new FILEINFO[ FileInfoNum ] ;

					for( int Index = 0 ; Index < fileInfos.Length ; Index ++ )
					{
						int result = dx_FileRead_getInfo( Index , out fileInfos[ Index ] , FileInfoHandle ) ;
						if( !( result == 0 ) ) { throw new DX.Exception(); }
					}

					return fileInfos ;
				}
				finally
				{
					dx_FileRead_deleteInfo( FileInfoHandle ) ;
				}
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_createInfo( string ObjectPath ) ;

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_getInfoNum( int FileInfoHandle ) ;

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_getInfo( int Index , out FILEINFO Buffer , int FileInfoHandle ) ;

		/// <summary> ファイル情報ハンドルを削除する </summary>
	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_deleteInfo( int FileInfoHandle ) ;


		/// <summary> 指定のファイル又はフォルダの情報を取得し、ファイル検索ハンドルも作成する( 戻り値: -1=エラー  -1以外=ファイル検索ハンドル ) </summary>
		public static FileFinder FileRead_findFirst( string FilePath , out FILEINFO Buffer )
		{
			lock( locker )
			{
				int result = dx_FileRead_findFirst( FilePath , out Buffer ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return FileFinder.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_findFirst( string FilePath , out FILEINFO Buffer ) ;


		/// <summary> 条件の合致する次のファイルの情報を取得する( 戻り値: -1=エラー  0=成功 ) </summary>
		public static bool FileRead_findNext( FileFinder FindHandle , out FILEINFO Buffer )
		{
			lock( locker )
			{
				int result = dx_FileRead_findNext( FileFinder.ToHandle( FindHandle ) , out Buffer ) ;
				return result == 0 ? true : false ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_FileRead_findNext( int FindHandle , out FILEINFO Buffer ) ;


		/// <summary> 指定のリソースを取得する( -1:失敗  0:成功 ) </summary>
		public static void GetResourceInfo( string ResourceName , string ResourceType , out IntPtr DataPointerP , out int DataSizeP )
		{
			lock( locker )
			{
				int result = dx_GetResourceInfo( ResourceName , ResourceType , out DataPointerP , out DataSizeP ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetResourceInfo( string ResourceName , string ResourceType , out IntPtr DataPointerP , out int DataSizeP ) ;


		/// <summary> リソースＩＤからリソースＩＤ文字列を得る  </summary>
		public static string GetResourceIDString( int ResourceID )
		{
			lock( locker )
			{
				IntPtr result = dx_GetResourceIDString( ResourceID ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
			#if UNICODE
				return Marshal.PtrToStringUni( result ) ;
			#else
				return Marshal.PtrToStringAnsi( result ) ;
			#endif
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_GetResourceIDString( int ResourceID ) ;


		/// <summary> ウインドウズのメッセージループに代わる処理を行う </summary>
		public static bool ProcessMessage()
		{
			lock( locker )
			{
				int result = dx_ProcessMessage() ;
				return result != -1 ? true : false ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ProcessMessage() ;


		/// <summary> ウインドウのクライアント領域を取得する </summary>
		public static void GetWindowCRect( out RECT RectBuf )
		{
			lock( locker )
			{
				int result = dx_GetWindowCRect( out RectBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowCRect( out RECT RectBuf ) ;


		/// <summary> ウインドウのアクティブフラグを取得 </summary>
		public static bool GetWindowActiveFlag()
		{
			lock( locker )
			{
				int result = dx_GetWindowActiveFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowActiveFlag() ;


		/// <summary> メインウインドウのハンドルを取得する </summary>
		/// <returns> HWND </returns>
		public static IntPtr GetMainWindowHandle()
		{
			lock( locker )
			{
				IntPtr result = dx_GetMainWindowHandle() ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_GetMainWindowHandle() ;


		/// <summary> ウインドウモードで起動しているか、のフラグを取得する </summary>
		public static bool GetWindowModeFlag()
		{
			lock( locker )
			{
				int result = dx_GetWindowModeFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowModeFlag() ;


		/// <summary> 起動時のデスクトップの画面モードを取得する </summary>
		public static void GetDefaultState( out int SizeX , out int SizeY , out int ColorBitDepth )
		{
			lock( locker )
			{
				int result = dx_GetDefaultState( out SizeX , out SizeY , out ColorBitDepth ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetDefaultState( out int SizeX , out int SizeY , out int ColorBitDepth ) ;


		/// <summary> ソフトがアクティブかどうかを取得する </summary>
		public static bool GetActiveFlag()
		{
			lock( locker )
			{
				int result = dx_GetActiveFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetActiveFlag() ;


		/// <summary> 非アクティブになり、処理が一時停止していたかどうかを取得する(引数 ResetFlag=TRUE:状態をリセット FALSE:状態をリセットしない	戻り値: 0=一時停止はしていない  1=一時停止していた ) </summary>
		public static bool GetNoActiveState( bool ResetFlag )
		{
			lock( locker )
			{
				int result = dx_GetNoActiveState( ResetFlag ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

		/// <summary> 非アクティブになり、処理が一時停止していたかどうかを取得する(引数 ResetFlag=TRUE:状態をリセット FALSE:状態をリセットしない	戻り値: 0=一時停止はしていない  1=一時停止していた ) </summary>
		public static bool GetNoActiveState()
		{
			return GetNoActiveState( true ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNoActiveState( bool ResetFlag ) ;


		/// <summary> マウスを表示するかどうかのフラグを取得する </summary>
		public static bool GetMouseDispFlag()
		{
			lock( locker )
			{
				int result = dx_GetMouseDispFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMouseDispFlag() ;


		/// <summary> ウインドウがアクティブではない状態でも処理を続行するか、フラグを取得する </summary>
		public static bool GetAlwaysRunFlag()
		{
			lock( locker )
			{
				int result = dx_GetAlwaysRunFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetAlwaysRunFlag() ;


		/// <summary> ＤＸライブラリと DirectX のバージョンと Windows のバージョンを得る </summary>
		public static void _GetSystemInfo( out int DxLibVer , out DX_DIRECTXVERSION DirectXVer , out DX_WINDOWSVERSION WindowsVer )
		{
			lock( locker )
			{
				int result = dx__GetSystemInfo( out DxLibVer , out DirectXVer , out WindowsVer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx__GetSystemInfo( out int DxLibVer , out DX_DIRECTXVERSION DirectXVer , out DX_WINDOWSVERSION WindowsVer ) ;


		/// <summary> ＰＣの情報を得る </summary>
		/// <param name="CPUSpeed"> 単位MHz </param>
		/// <param name="FreeMemorySize"> 単位MByte </param>
		/// <param name="FreeVideoMemorySize"> 単位MByte </param>
		public static void GetPcInfo( out string OSString , out string DirectXString , out string CPUString , out int CPUSpeed , out double FreeMemorySize , out double TotalMemorySize , out string VideoDriverFileName , out string VideoDriverString , out double FreeVideoMemorySize , out double TotalVideoMemorySize )
		{
			lock( locker )
			{
				StringBuilder OSString_ = new StringBuilder( 0x200 ) ;
				StringBuilder DirectXString_ = new StringBuilder( 0x200 ) ;
				StringBuilder CPUString_ = new StringBuilder( 0x200 ) ;
				StringBuilder VideoDriverFileName_ = new StringBuilder( 0x200 ) ;
				StringBuilder VideoDriverString_ = new StringBuilder( 0x200 ) ;
				int result = dx_GetPcInfo( OSString_ , DirectXString_ , CPUString_ , out CPUSpeed , out FreeMemorySize , out TotalMemorySize , VideoDriverFileName_ , VideoDriverString_ , out FreeVideoMemorySize , out TotalVideoMemorySize ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				OSString = OSString_.ToString() ;
				DirectXString = DirectXString_.ToString() ;
				CPUString = CPUString_.ToString() ;
				VideoDriverFileName = VideoDriverFileName_.ToString() ;
				VideoDriverString = VideoDriverString_.ToString() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPcInfo( [ Out ] StringBuilder OSString , [ Out ] StringBuilder DirectXString , [ Out ] StringBuilder CPUString , out int CPUSpeed , out double FreeMemorySize , out double TotalMemorySize , [ Out ] StringBuilder VideoDriverFileName , [ Out ] StringBuilder VideoDriverString , out double FreeVideoMemorySize , out double TotalVideoMemorySize ) ;


		/// <summary> ＭＭＸが使えるかどうかの情報を得る </summary>
		public static bool GetUseMMXFlag()
		{
			lock( locker )
			{
				int result = dx_GetUseMMXFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetUseMMXFlag() ;


		/// <summary> ＳＳＥが使えるかどうかの情報を得る </summary>
		public static bool GetUseSSEFlag()
		{
			lock( locker )
			{
				int result = dx_GetUseSSEFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetUseSSEFlag() ;


		/// <summary> ＳＳＥ２が使えるかどうかの情報を得る </summary>
		public static bool GetUseSSE2Flag()
		{
			lock( locker )
			{
				int result = dx_GetUseSSE2Flag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetUseSSE2Flag() ;


		/// <summary> ウインドウを閉じようとしているかの情報を得る </summary>
		public static bool GetWindowCloseFlag()
		{
			lock( locker )
			{
				int result = dx_GetWindowCloseFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowCloseFlag() ;


		/// <summary> ソフトのインスタンスを取得する </summary>
		/// <returns> HINSTANCE </returns>
		public static IntPtr GetTaskInstance()
		{
			lock( locker )
			{
				IntPtr result = dx_GetTaskInstance() ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_GetTaskInstance() ;


		/// <summary> リージョンを使っているかどうかを取得する </summary>
		public static bool GetUseWindowRgnFlag()
		{
			lock( locker )
			{
				int result = dx_GetUseWindowRgnFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetUseWindowRgnFlag() ;


		/// <summary> ウインドウのサイズを変更できるかどうかのフラグを取得する </summary>
		public static bool GetWindowSizeChangeEnableFlag( out bool FitScreen )
		{
			lock( locker )
			{
				int result = dx_GetWindowSizeChangeEnableFlag( out FitScreen ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

		/// <summary> ウインドウのサイズを変更できるかどうかのフラグを取得する </summary>
		public static bool GetWindowSizeChangeEnableFlag()
		{
			bool FitScreen ;
			return GetWindowSizeChangeEnableFlag( out FitScreen ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowSizeChangeEnableFlag( out bool FitScreen ) ;


		/// <summary> 描画画面のサイズに対するウインドウサイズの比率を取得する( 戻り値は ExRateX に代入される値と同じです ) </summary>
		public static void GetWindowSizeExtendRate( out double ExRateX , out double ExRateY )
		{
			lock( locker )
			{
				double result = dx_GetWindowSizeExtendRate( out ExRateX , out ExRateY ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern double dx_GetWindowSizeExtendRate( out double ExRateX , out double ExRateY ) ;


		/// <summary> ウインドウモードのウインドウののクライアント領域のサイズを取得する </summary>
		public static void GetWindowSize( out int Width , out int Height )
		{
			lock( locker )
			{
				int result = dx_GetWindowSize( out Width , out Height ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowSize( out int Width , out int Height ) ;


		/// <summary> ウインドウモードのウインドウの位置を取得する( 枠も含めた左上座標 ) </summary>
		public static void GetWindowPosition( out int x , out int y )
		{
			lock( locker )
			{
				int result = dx_GetWindowPosition( out x , out y ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowPosition( out int x , out int y ) ;


		/// <summary> ウインドウの閉じるボタンが押されたかどうかを取得する </summary>
		public static bool GetWindowUserCloseFlag( bool StateResetFlag )
		{
			lock( locker )
			{
				int result = dx_GetWindowUserCloseFlag( StateResetFlag ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

		/// <summary> ウインドウの閉じるボタンが押されたかどうかを取得する </summary>
		public static bool GetWindowUserCloseFlag()
		{
			return GetWindowUserCloseFlag( false ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetWindowUserCloseFlag( bool StateResetFlag ) ;


		/// <summary> 描画機能を使うかどうかのフラグを取得する </summary>
		public static bool GetNotDrawFlag()
		{
			lock( locker )
			{
				int result = dx_GetNotDrawFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNotDrawFlag() ;


		/// <summary> WM_PAINT メッセージが来たかどうかを取得する(戻り値  TRUE:WM_PAINTメッセージが来た(一度取得すると以後、再び WM_PAINTメッセージが来るまで false が返ってくるようになる)  FALSE:WM_PAINT メッセージは来ていない) </summary>
		public static bool GetPaintMessageFlag()
		{
			lock( locker )
			{
				int result = dx_GetPaintMessageFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetPaintMessageFlag() ;


		/// <summary> パフォーマンスカウンタが有効かどうかを取得する(戻り値  TRUE:有効  FALSE:無効) </summary>
		public static bool GetValidHiPerformanceCounter()
		{
			lock( locker )
			{
				int result = dx_GetValidHiPerformanceCounter() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetValidHiPerformanceCounter() ;


		/// <summary> ウインドウモードを変更する </summary>
		public static void ChangeWindowMode( bool Flag )
		{
			lock( locker )
			{
				int result = dx_ChangeWindowMode( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ChangeWindowMode( bool Flag ) ;


		/// <summary> ＤＸライブラリの文字列処理で前提とする文字列セットを設定する </summary>
		/// <param name="CharSet"> = DX_CHARSET_SHFTJIS 等 </param>
		public static void SetUseCharSet( int CharSet )
		{
			lock( locker )
			{
				int result = dx_SetUseCharSet( CharSet ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseCharSet( int CharSet ) ;


		/// <summary> アクティブウインドウが他のソフトに移っている際に表示する画像のロード(NULL で解除) </summary>
		public static void LoadPauseGraph( string FileName )
		{
			lock( locker )
			{
				int result = dx_LoadPauseGraph( FileName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_LoadPauseGraph( string FileName ) ;


		/// <summary> アクティブウインドウが他のソフトに移っている際に表示する画像のロード(NULL で解除) </summary>
		public static void LoadPauseGraphFromMem( IntPtr MemImage , int MemImageSize )
		{
			lock( locker )
			{
				int result = dx_LoadPauseGraphFromMem( MemImage , MemImageSize ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_LoadPauseGraphFromMem( IntPtr MemImage , int MemImageSize ) ;


		/// <summary> ウインドウのアクティブ状態に変化があったときに呼ばれるコールバック関数をセットする( NULL をセットすると呼ばれなくなる ) </summary>
		public static void SetActiveStateChangeCallBackFunction( ActiveStateChangeCallBackFunction CallBackFunction , IntPtr UserData )
		{
			lock( locker )
			{
				ActiveStateChangeCallBackFunction = delegate( int ActiveState , IntPtr UserData_ )
				{
					return CallBackFunction( ActiveState , UserData_ ) ;
				} ;
				int result = dx_SetActiveStateChangeCallBackFunction( ActiveStateChangeCallBackFunction , UserData ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

		/// <summary> ウインドウのアクティブ状態に変化があったときに呼ばれるコールバック関数をセットする( NULL をセットすると呼ばれなくなる ) </summary>
	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetActiveStateChangeCallBackFunction( [ MarshalAs( UnmanagedType.FunctionPtr ) ] ACTIVESTATECHANGECALLBACKFUNCTION CallBackFunction , IntPtr UserData ) ;

		private static ACTIVESTATECHANGECALLBACKFUNCTION ActiveStateChangeCallBackFunction ;

	#if UNICODE
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Unicode ) ]
	#else
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Ansi ) ]
	#endif
		private delegate int ACTIVESTATECHANGECALLBACKFUNCTION( int ActiveState , IntPtr UserData ) ;


		/// <summary> メインウインドウのウインドウテキストを変更する </summary>
		public static void SetWindowText( string WindowText )
		{
			lock( locker )
			{
				int result = dx_SetWindowText( WindowText ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowText( string WindowText ) ;


		/// <summary> メインウインドウのウインドウテキストを変更する </summary>
		public static void SetMainWindowText( string WindowText )
		{
			lock( locker )
			{
				int result = dx_SetMainWindowText( WindowText ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMainWindowText( string WindowText ) ;


		/// <summary> メインウインドウのクラス名を設定する </summary>
		public static void SetMainWindowClassName( string ClassName )
		{
			lock( locker )
			{
				int result = dx_SetMainWindowClassName( ClassName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMainWindowClassName( string ClassName ) ;


		/// <summary> ログ出力を行うか否かのセット </summary>
		public static void SetOutApplicationLogValidFlag( bool Flag )
		{
			lock( locker )
			{
				logOutFlag = Flag ;
				int result = dx_SetOutApplicationLogValidFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetOutApplicationLogValidFlag( bool Flag ) ;


		/// <summary> ウインドウがアクティブではない状態でも処理を続行するか、フラグをセットする </summary>
		public static void SetAlwaysRunFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetAlwaysRunFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetAlwaysRunFlag( bool Flag ) ;


		/// <summary> 使用するアイコンのＩＤをセットする </summary>
		public static void SetWindowIconID( int ID )
		{
			lock( locker )
			{
				int result = dx_SetWindowIconID( ID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowIconID( int ID ) ;


		/// <summary> 最大化ボタンやALT+ENTERキーによる非同期なウインドウモードの変更の機能の設定を行う </summary>
		public static void SetUseASyncChangeWindowModeFunction( bool Flag , UseASyncChangeWindowModeFunction CallBackFunction , IntPtr Data )
		{
			lock( locker )
			{
				UseASyncChangeWindowModeFunction = delegate( IntPtr data )
				{
					CallBackFunction( data ) ;
				} ;
				int result = dx_SetUseASyncChangeWindowModeFunction( Flag , UseASyncChangeWindowModeFunction , Data ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

		/// <summary> 最大化ボタンやALT+ENTERキーによる非同期なウインドウモードの変更の機能の設定を行う </summary>
	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseASyncChangeWindowModeFunction( bool Flag , [ MarshalAs( UnmanagedType.FunctionPtr ) ] USEASYNCCHANGEWINDOWMODEFUNCTION CallBackFunction , IntPtr Data ) ;

		private static USEASYNCCHANGEWINDOWMODEFUNCTION UseASyncChangeWindowModeFunction ;

	#if UNICODE
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Unicode ) ]
	#else
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Ansi ) ]
	#endif
		private delegate void USEASYNCCHANGEWINDOWMODEFUNCTION( IntPtr Data ) ;


		/// <summary> ウインドウのスタイルを変更する </summary>
		public static void SetWindowStyleMode( WS Mode )
		{
			lock( locker )
			{
				int result = dx_SetWindowStyleMode( Mode ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowStyleMode( WS Mode ) ;


		/// <summary> ウインドウのサイズを変更できるかどうかのフラグをセットする( NotFitScreen:ウインドウのクライアント領域に画面をフィットさせる(拡大させる)かどうか  TRUE:フィットさせる  FALSE:フィットさせない ) </summary>
		public static void SetWindowSizeChangeEnableFlag( bool Flag )
		{
			SetWindowSizeChangeEnableFlag( Flag , true ) ;
		}

		/// <summary> ウインドウのサイズを変更できるかどうかのフラグをセットする( NotFitScreen:ウインドウのクライアント領域に画面をフィットさせる(拡大させる)かどうか  TRUE:フィットさせる  FALSE:フィットさせない ) </summary>
		public static void SetWindowSizeChangeEnableFlag( bool Flag , bool FitScreen )
		{
			lock( locker )
			{
				int result = dx_SetWindowSizeChangeEnableFlag( Flag , FitScreen ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowSizeChangeEnableFlag( bool Flag , bool FitScreen ) ;


		/// <summary> 描画画面のサイズに対するウインドウサイズの比率を設定する( ExRateY がマイナスの場合は ExRateX の値が ExRateY にも使用されます ) </summary>
		public static void SetWindowSizeExtendRate( double ExRate )
		{
			SetWindowSizeExtendRate( ExRate , ExRate ) ;
		}

		/// <summary> 描画画面のサイズに対するウインドウサイズの比率を設定する( ExRateY がマイナスの場合は ExRateX の値が ExRateY にも使用されます ) </summary>
		public static void SetWindowSizeExtendRate( double ExRateX , double ExRateY )
		{
			lock( locker )
			{
				int result = dx_SetWindowSizeExtendRate( ExRateX , ExRateY ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowSizeExtendRate( double ExRateX , double ExRateY ) ;


		/// <summary> ウインドウモード時のウインドウのクライアント領域のサイズを設定する </summary>
		public static void SetWindowSize( int Width , int Height )
		{
			lock( locker )
			{
				int result = dx_SetWindowSize( Width , Height ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowSize( int Width , int Height ) ;


		/// <summary> ウインドウモードのウインドウの位置を設定する( 枠も含めた左上座標 ) </summary>
		public static void SetWindowPosition( int x , int y )
		{
			lock( locker )
			{
				int result = dx_SetWindowPosition( x , y ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowPosition( int x , int y ) ;


		/// <summary> タスクスイッチを有効にするかどうかを設定する </summary>
		public static void SetSysCommandOffFlag( bool Flag )
		{
			SetSysCommandOffFlag( Flag , null ) ;
		}

		/// <summary> タスクスイッチを有効にするかどうかを設定する </summary>
		public static void SetSysCommandOffFlag( bool Flag , string HookDllPath )
		{
			lock( locker )
			{
				int result = dx_SetSysCommandOffFlag( Flag , HookDllPath ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetSysCommandOffFlag( bool Flag , string HookDllPath ) ;


		/// <summary> メッセージをフックするウインドウプロージャを登録する </summary>
		public static void SetHookWinProc( WndProc WinProc )
		{
			lock( locker )
			{
				WndProc = delegate( IntPtr Wnd , int Msg , IntPtr WParam , IntPtr LParam)
				{
					return WinProc( Wnd , Msg , WParam , LParam ) ;
				} ;
				int result = dx_SetHookWinProc( WndProc ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetHookWinProc( WNDPROC WinProc ) ;

		private static WNDPROC WndProc ;

	#if UNICODE
		[ UnmanagedFunctionPointer( CallingConvention.StdCall , CharSet = CharSet.Unicode ) ]
	#else
		[ UnmanagedFunctionPointer( CallingConvention.StdCall , CharSet = CharSet.Ansi ) ]
	#endif
		private delegate IntPtr WNDPROC( IntPtr Wnd , int Msg , IntPtr WParam , IntPtr LParam ) ;


		/// <summary> ２重起動を許すかどうかのフラグをセットする </summary>
		public static void SetDoubleStartValidFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetDoubleStartValidFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetDoubleStartValidFlag( bool Flag ) ;


		/// <summary> メッセージ処理をＤＸライブラリに肩代わりしてもらうウインドウを追加する </summary>
		/// <param name="Window"> HWND </param>
		public static void AddMessageTakeOverWindow( IntPtr Window )
		{
			lock( locker )
			{
				int result = dx_AddMessageTakeOverWindow( Window ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddMessageTakeOverWindow( IntPtr Window ) ;


		/// <summary> メッセージ処理をＤＸライブラリに肩代わりしてもらうウインドウを減らす </summary>
		/// <param name="Window"> HWND </param>
		public static void SubMessageTakeOverWindow( IntPtr Window )
		{
			lock( locker )
			{
				int result = dx_SubMessageTakeOverWindow( Window ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SubMessageTakeOverWindow( IntPtr Window ) ;


		/// <summary> ウインドウの初期位置を設定する </summary>
		public static void SetWindowInitPosition( int x , int y )
		{
			lock( locker )
			{
				int result = dx_SetWindowInitPosition( x , y ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowInitPosition( int x , int y ) ;


		/// <summary> ＤＸライブラリのウインドウ関連の機能を使用しないフラグ </summary>
		public static void SetNotWinFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetNotWinFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetNotWinFlag( bool Flag ) ;


		/// <summary> 描画機能を使うかどうかのフラグをセットする </summary>
		public static void SetNotDrawFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetNotDrawFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetNotDrawFlag( bool Flag ) ;


		/// <summary> サウンド機能を使うかどうかのフラグをセットする </summary>
		public static void SetNotSoundFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetNotSoundFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetNotSoundFlag( bool Flag ) ;


		/// <summary> 入力状態の取得機能を使うかどうかのフラグをセットする </summary>
		public static void SetNotInputFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetNotInputFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetNotInputFlag( bool Flag ) ;


		/// <summary> ＤＸライブラリでメッセージ処理を行うダイアログボックスを登録する </summary>
		/// <param name="Window"> HWND </param>
		public static void SetDialogBoxHandle( IntPtr Window )
		{
			lock( locker )
			{
				int result = dx_SetDialogBoxHandle( Window ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetDialogBoxHandle( IntPtr Window ) ;


		/// <summary> メインウインドウを表示するかどうかのフラグをセットする </summary>
		public static void SetWindowVisibleFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetWindowVisibleFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowVisibleFlag( bool Flag ) ;


		/// <summary> メインウインドウの×ボタンを押した時にライブラリが自動的にウインドウを閉じるかどうかのフラグをセットする </summary>
		public static void SetWindowUserCloseEnableFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetWindowUserCloseEnableFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowUserCloseEnableFlag( bool Flag ) ;


		/// <summary> ＤＸライブラリ終了時に PostQuitMessage を呼ぶかどうかのフラグをセットする </summary>
		public static void SetDxLibEndPostQuitMessageFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetDxLibEndPostQuitMessageFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetDxLibEndPostQuitMessageFlag( bool Flag ) ;


		/// <summary> ＤＸライブラリで利用するウインドウのハンドルをセットする(DxLib_Init を実行する以前でのみ有効) </summary>
		/// <param name="Window"> HWND </param>
		public static void SetUserWindow( IntPtr Window )
		{
			lock( locker )
			{
				int result = dx_SetUserWindow( Window ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUserWindow( IntPtr Window ) ;


		/// <summary> SetUseWindow で設定したウインドウのメッセージループ処理をＤＸライブラリで行うかどうか、フラグをセットする </summary>
		public static void SetUserWindowMessageProcessDXLibFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUserWindowMessageProcessDXLibFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUserWindowMessageProcessDXLibFlag( bool Flag ) ;


		/// <summary> ＤＸアーカイブファイルの読み込み機能を使うかどうかを設定する( FALSE:使用しない  TRUE:使用する ) </summary>
		public static void SetUseDXArchiveFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseDXArchiveFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseDXArchiveFlag( bool Flag ) ;


		/// <summary> 検索するＤＸアーカイブファイルの拡張子を変更する </summary>
		public static void SetDXArchiveExtension()
		{
			SetDXArchiveExtension( null ) ;
		}

		/// <summary> 検索するＤＸアーカイブファイルの拡張子を変更する </summary>
		public static void SetDXArchiveExtension( string Extension )
		{
			lock( locker )
			{
				int result = dx_SetDXArchiveExtension( Extension ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetDXArchiveExtension( string Extension ) ;


		/// <summary> ＤＸアーカイブファイルの鍵文字列を設定する </summary>
		public static void SetDXArchiveKeyString()
		{
			SetDXArchiveKeyString( null ) ;
		}

		/// <summary> ＤＸアーカイブファイルの鍵文字列を設定する </summary>
		public static void SetDXArchiveKeyString( string KeyString )
		{
			lock( locker )
			{
				int result = dx_SetDXArchiveKeyString( KeyString ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetDXArchiveKeyString( string KeyString ) ;


		/// <summary> ログファイル名に日付をつけるかどうかをセットする </summary>
		public static void SetUseDateNameLogFile( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseDateNameLogFile( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseDateNameLogFile( bool Flag ) ;


		/// <summary> メインウインドウのバックグラウンドカラーを設定する </summary>
		public static void SetBackgroundColor( int Red , int Green , int Blue )
		{
			lock( locker )
			{
				int result = dx_SetBackgroundColor( Red , Green , Blue ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetBackgroundColor( int Red , int Green , int Blue ) ;


		/// <summary> printfDx で画面に出力するログフォントのサイズを変更する </summary>
		public static void SetLogFontSize( int Size )
		{
			lock( locker )
			{
				int result = dx_SetLogFontSize( Size ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetLogFontSize( int Size ) ;

		/// <summary>FPUの精度を落とさない設定を使用するかどうかを設定する、DxLib_Init を呼び出す前のみ有効( TRUE:使用する(精度が落ちない)  FALSE:使用しない(精度を落とす(デフォルト) ) </summary>
		public static void SetUseFPUPreserveFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseFPUPreserveFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseFPUPreserveFlag( bool Flag ) ;


		/// <summary> マウスポインタがウインドウのクライアントエリアの外にいけるかどうかを設定する( TRUE:いける( デフォルト設定 )  FALSE:いけない ) </summary>
		public static void SetValidMousePointerWindowOutClientAreaMoveFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetValidMousePointerWindowOutClientAreaMoveFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetValidMousePointerWindowOutClientAreaMoveFlag( bool Flag ) ;


		/// <summary> バックバッファの透過色の部分を透過させるかどうかを設定する( TRUE:透過させる  FALSE:透過させない ) </summary>
		public static void SetUseBackBufferTransColorFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseBackBufferTransColorFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseBackBufferTransColorFlag( bool Flag ) ;


		/// <summary> リソースを読み込む際に使用するモジュールを設定する( NULL を指定すると初期状態に戻ります、デフォルトでは NULL ) </summary>
		/// <param name="ResourceModule"> HMODULE </param>
		public static void SetResourceModule( IntPtr ResourceModule )
		{
			lock( locker )
			{
				int result = dx_SetResourceModule( ResourceModule ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetResourceModule( IntPtr ResourceModule ) ;


		/// <summary> クリップボードに格納されているテキストデータを読み出す、-1 の場合はクリップボードにテキストデータは無いということ( DestBuffer に NULL を渡すと格納に必要なデータサイズが返ってくる ) </summary>
		public static void GetClipboardText( out string DestBuffer )
		{
			lock( locker )
			{
				int capacity = dx_GetClipboardText( null ) ;

				if( capacity >= 0 )
				{
					StringBuilder DestBuffer_ = new StringBuilder( capacity ) ;
					int result = dx_GetClipboardText( DestBuffer_ ) ;
					if( !( result == 0 ) ) { throw new DX.Exception(); }
					DestBuffer = DestBuffer_.ToString() ;
				}
				else
				{
					DestBuffer = null ;
				}
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetClipboardText( [ Out ] StringBuilder DestBuffer ) ;


		/// <summary> クリップボードにテキストデータを格納する </summary>
		public static void SetClipboardText( string Text )
		{
			lock( locker )
			{
				int result = dx_SetClipboardText( Text ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetClipboardText( string Text ) ;


		/// <summary> ファイルのドラッグ＆ドロップ機能を有効にするかどうかのフラグをセットする </summary>
		public static void SetDragFileValidFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetDragFileValidFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetDragFileValidFlag( bool Flag ) ;


		/// <summary> ドラッグ＆ドロップされたファイルの情報を初期化する </summary>
		public static void DragFileInfoClear()
		{
			lock( locker )
			{
				int result = dx_DragFileInfoClear() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DragFileInfoClear() ;


		/// <summary> ドラッグ＆ドロップされたファイル名を取得する( -1:取得できなかった  0:取得できた ) </summary>
		public static void GetDragFilePath( out string FilePathBuffer )
		{
			lock( locker )
			{
				int capacity = dx_GetDragFilePath( null ) ;

				if( capacity >= 0 )
				{
					StringBuilder FilePathBuffer_ = new StringBuilder( capacity ) ;
					int result = dx_GetDragFilePath( FilePathBuffer_ ) ;
					if( !( result == 0 ) ) { throw new DX.Exception(); }
					FilePathBuffer = FilePathBuffer_.ToString() ;
				}
				else
				{
					FilePathBuffer = null ;
				}
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetDragFilePath( [ Out ] StringBuilder FilePathBuffer ) ;


		/// <summary> ドラッグ＆ドロップされたファイルの数を取得する </summary>
		public static int GetDragFileNum()
		{
			lock( locker )
			{
				int result = dx_GetDragFileNum() ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetDragFileNum() ;


		/// <summary> 任意のグラフィックからRGNハンドルを作成する </summary>
		/// <returns> HRGN </returns>
		public static IntPtr CreateRgnFromGraph( int Width , int Height , IntPtr MaskData , int Pitch , int Byte )
		{
			lock( locker )
			{
				IntPtr result = dx_CreateRgnFromGraph( Width , Height , MaskData , Pitch , Byte ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_CreateRgnFromGraph( int Width , int Height , IntPtr MaskData , int Pitch , int Byte ) ;


		/// <summary> 任意の基本イメージデータと透過色からRGNハンドルを作成する </summary>
		/// <returns> HRGN </returns>
		public static IntPtr CreateRgnFromBaseImage( BaseImage BaseImage , int TransColorR , int TransColorG , int TransColorB )
		{
			lock( locker )
			{
				IntPtr result = dx_CreateRgnFromBaseImage( ref BaseImage.buffer , TransColorR , TransColorG , TransColorB ) ;
				if( !( result != IntPtr.Zero ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_CreateRgnFromBaseImage( [ In ] ref BASEIMAGE BaseImage , int TransColorR , int TransColorG , int TransColorB ) ;


		/// <summary> 任意のグラフィックからＲＧＮをセットする </summary>
		public static void SetWindowRgnGraph( string FileName )
		{
			lock( locker )
			{
				int result = dx_SetWindowRgnGraph( FileName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetWindowRgnGraph( string FileName ) ;


		/// <summary> 描画先の画面の透過色の部分を透過させるＲＧＮをセットする </summary>
		public static void UpdateTransColorWindowRgn()
		{
			lock( locker )
			{
				int result = dx_UpdateTransColorWindowRgn() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_UpdateTransColorWindowRgn() ;


		/// <summary> ツールバーの準備( NULL を指定するとツールバーを解除、ResourceID は BitmapName が NULL の際に使用される ) </summary>
		public static void SetupToolBar( string BitmapName , int DivNum )
		{
			SetupToolBar( BitmapName , DivNum , -1 ) ;
		}

		/// <summary> ツールバーの準備( NULL を指定するとツールバーを解除、ResourceID は BitmapName が NULL の際に使用される ) </summary>
		public static void SetupToolBar( string BitmapName , int DivNum , int ResourceID )
		{
			lock( locker )
			{
				int result = dx_SetupToolBar( BitmapName , DivNum , ResourceID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetupToolBar( string BitmapName , int DivNum , int ResourceID ) ;


		/// <summary> ツールバーにボタンを追加 </summary>
		/// <param name="Type"> TOOLBUTTON_TYPE_NORMAL 等 </param>
		/// <param name="State"> TOOLBUTTON_STATE_ENABLE 等 </param>
		public static void AddToolBarButton( TOOLBUTTON_TYPE Type , TOOLBUTTON_STATE State , int ImageIndex , int ID )
		{
			lock( locker )
			{
				int result = dx_AddToolBarButton( Type , State , ImageIndex , ID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddToolBarButton( TOOLBUTTON_TYPE Type , TOOLBUTTON_STATE State , int ImageIndex , int ID ) ;


		/// <summary> ツールバーに隙間を追加 </summary>
		public static void AddToolBarSep()
		{
			lock( locker )
			{
				int result = dx_AddToolBarSep() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddToolBarSep() ;


		/// <summary> ツールバーのボタンの状態を取得( TRUE:押されている or 押された  FALSE:押されていない ) </summary>
		public static bool GetToolBarButtonState( int ID )
		{
			lock( locker )
			{
				int result = dx_GetToolBarButtonState( ID ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetToolBarButtonState( int ID ) ;


		/// <summary> ツールバーのボタンの状態を設定 </summary>
		public static void SetToolBarButtonState( int ID , TOOLBUTTON_STATE State )
		{
			lock( locker )
			{
				int result = dx_SetToolBarButtonState( ID , State ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetToolBarButtonState( int ID , TOOLBUTTON_STATE State ) ;


		/// <summary> ツールバーのボタンを全て削除 </summary>
		public static void DeleteAllToolBarButton()
		{
			lock( locker )
			{
				int result = dx_DeleteAllToolBarButton() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DeleteAllToolBarButton() ;


		/// <summary> メニューを有効にするかどうかを設定する </summary>
		public static void SetUseMenuFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseMenuFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseMenuFlag( bool Flag ) ;


		/// <summary> キーボードアクセラレーターを使用するかどうかを設定する </summary>
		public static void SetUseKeyAccelFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseKeyAccelFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseKeyAccelFlag( bool Flag ) ;


		/// <summary> ショートカットキーを追加する </summary>
		public static void AddKeyAccel( string ItemName , int ItemID , KEY_INPUT KeyCode , bool CtrlFlag , bool AltFlag , bool ShiftFlag )
		{
			lock( locker )
			{
				int result = dx_AddKeyAccel( ItemName , ItemID , KeyCode , CtrlFlag , AltFlag , ShiftFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddKeyAccel( string ItemName , int ItemID , KEY_INPUT KeyCode , bool CtrlFlag , bool AltFlag , bool ShiftFlag ) ;


		/// <summary> ショートカットキーを追加する </summary>
		public static void AddKeyAccel_Name( string ItemName , KEY_INPUT KeyCode , bool CtrlFlag , bool AltFlag , bool ShiftFlag )
		{
			lock( locker )
			{
				int result = dx_AddKeyAccel_Name( ItemName , KeyCode , CtrlFlag , AltFlag , ShiftFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddKeyAccel_Name( string ItemName , KEY_INPUT KeyCode , bool CtrlFlag , bool AltFlag , bool ShiftFlag ) ;


		/// <summary> ショートカットキーを追加する </summary>
		public static void AddKeyAccel_ID( int ItemID , KEY_INPUT KeyCode , bool CtrlFlag , bool AltFlag , bool ShiftFlag )
		{
			lock( locker )
			{
				int result = dx_AddKeyAccel_ID( ItemID , KeyCode , CtrlFlag , AltFlag , ShiftFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddKeyAccel_ID( int ItemID , KEY_INPUT KeyCode , bool CtrlFlag , bool AltFlag , bool ShiftFlag ) ;


		/// <summary> ショートカットキーの情報を初期化する </summary>
		public static void ClearKeyAccel()
		{
			lock( locker )
			{
				int result = dx_ClearKeyAccel() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ClearKeyAccel() ;


		/// <summary> メニューに項目を追加する </summary>
		public static void AddMenuItem( MENUITEM_ADD AddType , string ItemName , int ItemID , bool SeparatorFlag )
		{
			AddMenuItem( AddType , ItemName , ItemID , SeparatorFlag , null ) ;
		}

		/// <summary> メニューに項目を追加する </summary>
		public static void AddMenuItem( MENUITEM_ADD AddType , string ItemName , int ItemID , bool SeparatorFlag , string NewItemName )
		{
			AddMenuItem( AddType , ItemName , ItemID , SeparatorFlag , NewItemName , -1 ) ;
		}

		/// <summary> メニューに項目を追加する </summary>
		/// <param name="AddType"> MENUITEM_ADD_CHILD等 </param>
		public static void AddMenuItem( MENUITEM_ADD AddType , string ItemName , int ItemID , bool SeparatorFlag , string NewItemName , int NewItemID )
		{
			lock( locker )
			{
				int result = dx_AddMenuItem( AddType , ItemName , ItemID , SeparatorFlag , NewItemName , NewItemID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddMenuItem( MENUITEM_ADD AddType , string ItemName , int ItemID , bool SeparatorFlag , string NewItemName , int NewItemID ) ;


		/// <summary> メニューから選択項目を削除する </summary>
		public static void DeleteMenuItem( string ItemName , int ItemID )
		{
			lock( locker )
			{
				int result = dx_DeleteMenuItem( ItemName , ItemID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DeleteMenuItem( string ItemName , int ItemID ) ;


		/// <summary> メニューが選択されたかどうかを取得する( 0:選択されていない  1:選択された ) </summary>
		public static bool CheckMenuItemSelect( string ItemName , int ItemID )
		{
			lock( locker )
			{
				int result = dx_CheckMenuItemSelect( ItemName , ItemID ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckMenuItemSelect( string ItemName , int ItemID ) ;


		/// <summary> メニューの項目を選択出来るかどうかを設定する </summary>
		public static void SetMenuItemEnable( string ItemName , int ItemID , bool EnableFlag )
		{
			lock( locker )
			{
				int result = dx_SetMenuItemEnable( ItemName , ItemID , EnableFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMenuItemEnable( string ItemName , int ItemID , bool EnableFlag ) ;


		/// <summary> メニューの項目にチェックマークやラジオボタンを表示するかどうかを設定する( MENUITEM_MARK_NONE 等 ) </summary>
		public static void SetMenuItemMark( string ItemName , int ItemID , MENUITEM_MARK Mark )
		{
			lock( locker )
			{
				int result = dx_SetMenuItemMark( ItemName , ItemID , Mark ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMenuItemMark( string ItemName , int ItemID , MENUITEM_MARK Mark ) ;


		/// <summary> メニューの項目がどれか選択されたかどうかを取得する( 戻り値  TRUE:どれか選択された  FALSE:選択されていない ) </summary>
		public static bool CheckMenuItemSelectAll()
		{
			lock( locker )
			{
				int result = dx_CheckMenuItemSelectAll() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckMenuItemSelectAll() ;


		/// <summary> メニューに選択項目を追加する </summary>
		public static void AddMenuItem_Name( string ParentItemName , string NewItemName )
		{
			lock( locker )
			{
				int result = dx_AddMenuItem_Name( ParentItemName , NewItemName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddMenuItem_Name( string ParentItemName , string NewItemName ) ;


		/// <summary> メニューのリストに区切り線を追加する </summary>
		public static void AddMenuLine_Name( string ParentItemName )
		{
			lock( locker )
			{
				int result = dx_AddMenuLine_Name( ParentItemName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddMenuLine_Name( string ParentItemName ) ;


		/// <summary> 指定の項目と、指定の項目の一つ上の項目との間に新しい項目を追加する </summary>
		public static void InsertMenuItem_Name( string ItemName , string NewItemName )
		{
			lock( locker )
			{
				int result = dx_InsertMenuItem_Name( ItemName , NewItemName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_InsertMenuItem_Name( string ItemName , string NewItemName ) ;


		/// <summary> 指定の項目と、指定の項目の一つ上の項目との間に区切り線を追加する </summary>
		public static void InsertMenuLine_Name( string ItemName )
		{
			lock( locker )
			{
				int result = dx_InsertMenuLine_Name( ItemName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_InsertMenuLine_Name( string ItemName ) ;


		/// <summary> メニューから選択項目を削除する </summary>
		public static void DeleteMenuItem_Name( string ItemName )
		{
			lock( locker )
			{
				int result = dx_DeleteMenuItem_Name( ItemName ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DeleteMenuItem_Name( string ItemName ) ;


		/// <summary> メニューが選択されたかどうかを取得する( 0:選択されていない  1:選択された ) </summary>
		public static bool CheckMenuItemSelect_Name( string ItemName )
		{
			lock( locker )
			{
				int result = dx_CheckMenuItemSelect_Name( ItemName ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckMenuItemSelect_Name( string ItemName ) ;


		/// <summary> メニューの項目を選択出来るかどうかを設定する( 1:選択できる  0:選択できない ) </summary>
		public static void SetMenuItemEnable_Name( string ItemName , bool EnableFlag )
		{
			lock( locker )
			{
				int result = dx_SetMenuItemEnable_Name( ItemName , EnableFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMenuItemEnable_Name( string ItemName , bool EnableFlag ) ;


		/// <summary> メニューの項目にチェックマークやラジオボタンを表示するかどうかを設定する( MENUITEM_MARK_NONE 等 ) </summary>
		public static void SetMenuItemMark_Name( string ItemName , MENUITEM_MARK Mark )
		{
			lock( locker )
			{
				int result = dx_SetMenuItemMark_Name( ItemName , Mark ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMenuItemMark_Name( string ItemName , MENUITEM_MARK Mark ) ;


		/// <summary> メニューに選択項目を追加する </summary>
		public static void AddMenuItem_ID( int ParentItemID , string NewItemName , int NewItemID )
		{
			lock( locker )
			{
				int result = dx_AddMenuItem_ID( ParentItemID , NewItemName , NewItemID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

		/// <summary> メニューに選択項目を追加する </summary>
		public static void AddMenuItem_ID( int ParentItemID , string NewItemName )
		{
			AddMenuItem_ID( ParentItemID , NewItemName , -1 ) ;
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddMenuItem_ID( int ParentItemID , string NewItemName , int NewItemID ) ;


		/// <summary> メニューのリストに区切り線を追加する </summary>
		public static void AddMenuLine_ID( int ParentItemID )
		{
			lock( locker )
			{
				int result = dx_AddMenuLine_ID( ParentItemID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_AddMenuLine_ID( int ParentItemID ) ;


		/// <summary> 指定の項目と、指定の項目の一つ上の項目との間に新しい項目を追加する </summary>
		public static void InsertMenuItem_ID( int ItemID , int NewItemID )
		{
			lock( locker )
			{
				int result = dx_InsertMenuItem_ID( ItemID , NewItemID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_InsertMenuItem_ID( int ItemID , int NewItemID ) ;


		/// <summary> 指定の項目と、指定の項目の一つ上の項目との間に区切り線を追加する </summary>
		public static void InsertMenuLine_ID( int ItemID , int NewItemID )
		{
			lock( locker )
			{
				int result = dx_InsertMenuLine_ID( ItemID , NewItemID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_InsertMenuLine_ID( int ItemID , int NewItemID ) ;


		/// <summary> メニューから選択項目を削除する </summary>
		public static void DeleteMenuItem_ID( int ItemID )
		{
			lock( locker )
			{
				int result = dx_DeleteMenuItem_ID( ItemID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DeleteMenuItem_ID( int ItemID ) ;


		/// <summary> メニューが選択されたかどうかを取得する( 0:選択されていない  1:選択された ) </summary>
		public static bool CheckMenuItemSelect_ID( int ItemID )
		{
			lock( locker )
			{
				int result = dx_CheckMenuItemSelect_ID( ItemID ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckMenuItemSelect_ID( int ItemID ) ;


		/// <summary> メニューの項目を選択出来るかどうかを設定する </summary>
		public static void SetMenuItemEnable_ID( int ItemID , bool EnableFlag )
		{
			lock( locker )
			{
				int result = dx_SetMenuItemEnable_ID( ItemID , EnableFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMenuItemEnable_ID( int ItemID , bool EnableFlag ) ;


		/// <summary> メニューの項目にチェックマークやラジオボタンを表示するかどうかを設定する( MENUITEM_MARK_NONE 等 ) </summary>
		public static void SetMenuItemMark_ID( int ItemID , MENUITEM_MARK Mark )
		{
			lock( locker )
			{
				int result = dx_SetMenuItemMark_ID( ItemID , Mark ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMenuItemMark_ID( int ItemID , MENUITEM_MARK Mark ) ;


		/// <summary> メニューの全ての選択項目を削除する </summary>
		public static void DeleteMenuItemAll()
		{
			lock( locker )
			{
				int result = dx_DeleteMenuItemAll() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DeleteMenuItemAll() ;


		/// <summary> メニューが選択されたかどうかの情報を初期化 </summary>
		public static void ClearMenuItemSelect()
		{
			lock( locker )
			{
				int result = dx_ClearMenuItemSelect() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ClearMenuItemSelect() ;


		/// <summary> メニューの項目名からＩＤを取得する </summary>
		public static int GetMenuItemID( string ItemName )
		{
			lock( locker )
			{
				int result = dx_GetMenuItemID( ItemName ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMenuItemID( string ItemName ) ;


		/// <summary> メニューの項目名からＩＤを取得する </summary>
		public static void GetMenuItemName( int ItemID , out string NameBuffer )
		{
			lock( locker )
			{
				StringBuilder NameBuffer_ = new StringBuilder( 0x200 ) ;
				int result = dx_GetMenuItemName( ItemID , NameBuffer_ ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				NameBuffer = NameBuffer_.ToString() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMenuItemName( int ItemID , [ Out ] StringBuilder NameBuffer ) ;


		/// <summary> メニューをリソースから読み込む </summary>
		public static void LoadMenuResource( int MenuResourceID )
		{
			lock( locker )
			{
				int result = dx_LoadMenuResource( MenuResourceID ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_LoadMenuResource( int MenuResourceID ) ;


		/// <summary> メニューの選択項目が選択されたときに呼ばれるコールバック関数を設定する </summary>
		public static void SetMenuItemSelectCallBackFunction( MenuItemSelectCallBackFunction CallBackFunction )
		{
			lock( locker )
			{
				MenuItemSelectCallBackFunction = delegate( string ItemName , int ItemID )
				{
					CallBackFunction( ItemName , ItemID ) ;
				} ;
				int result = dx_SetMenuItemSelectCallBackFunction( MenuItemSelectCallBackFunction ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMenuItemSelectCallBackFunction( [ MarshalAs( UnmanagedType.FunctionPtr ) ] MENUITEMSELECTCALLBACKFUNCTION CallBackFunction ) ;

		private static MENUITEMSELECTCALLBACKFUNCTION MenuItemSelectCallBackFunction ;

	#if UNICODE
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Unicode ) ]
	#else
		[ UnmanagedFunctionPointer( CallingConvention.Cdecl , CharSet = CharSet.Ansi ) ]
	#endif
		private delegate void MENUITEMSELECTCALLBACKFUNCTION( string ItemName , int ItemID ) ;


		/// <summary> メニューを表示するかどうかをセットする </summary>
		public static void SetDisplayMenuFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetDisplayMenuFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetDisplayMenuFlag( bool Flag ) ;


		/// <summary> メニューを表示しているかどうかを取得する </summary>
		public static bool GetDisplayMenuFlag()
		{
			lock( locker )
			{
				int result = dx_GetDisplayMenuFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetDisplayMenuFlag() ;


		/// <summary> メニューを使用しているかどうかを得る </summary>
		public static bool GetUseMenuFlag()
		{
			lock( locker )
			{
				int result = dx_GetUseMenuFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetUseMenuFlag() ;


		/// <summary> フルスクリーン時にメニューを自動で表示したり非表示にしたりするかどうかのフラグをセットする </summary>
		public static void SetAutoMenuDisplayFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetAutoMenuDisplayFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetAutoMenuDisplayFlag( bool Flag ) ;


		/// <summary> マウスの表示フラグのセット </summary>
		public static void SetMouseDispFlag( bool DispFlag )
		{
			lock( locker )
			{
				int result = dx_SetMouseDispFlag( DispFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMouseDispFlag( bool DispFlag ) ;


		/// <summary> マウスの位置を取得する </summary>
		public static void GetMousePoint( out int XBuf , out int YBuf )
		{
			lock( locker )
			{
				int result = dx_GetMousePoint( out XBuf , out YBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMousePoint( out int XBuf , out int YBuf ) ;


		/// <summary> マウスの位置をセットする </summary>
		public static void SetMousePoint( int PointX , int PointY )
		{
			lock( locker )
			{
				int result = dx_SetMousePoint( PointX , PointY ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetMousePoint( int PointX , int PointY ) ;


		/// <summary> マウスのボタンの状態を得る  </summary>
		public static MOUSE_INPUT GetMouseInput()
		{
			lock( locker )
			{
				MOUSE_INPUT result = dx_GetMouseInput() ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern MOUSE_INPUT dx_GetMouseInput() ;


		/// <summary> マウスホイールの回転量を得る </summary>
		public static int GetMouseWheelRotVol()
		{
			return GetMouseWheelRotVol( true ) ;
		}

		/// <summary> マウスホイールの回転量を得る </summary>
		public static int GetMouseWheelRotVol( bool CounterReset )
		{
			lock( locker )
			{
				int result = dx_GetMouseWheelRotVol( CounterReset ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMouseWheelRotVol( bool CounterReset ) ;


		/// <summary> マウスのクリック情報を取得する( 戻り値  -1:ログが無かった ) </summary>
		public static void GetMouseInputLog( out MOUSE_INPUT Button , out int ClickX , out int ClickY )
		{
			GetMouseInputLog( out Button , out ClickX , out ClickY , true ) ;
		}

		/// <summary> マウスのクリック情報を取得する( 戻り値  -1:ログが無かった ) </summary>
		public static void GetMouseInputLog( out MOUSE_INPUT Button , out int ClickX , out int ClickY , bool LogDelete )
		{
			lock( locker )
			{
				int result = dx_GetMouseInputLog( out Button , out ClickX , out ClickY , LogDelete ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMouseInputLog( out MOUSE_INPUT Button , out int ClickX , out int ClickY , bool LogDelete ) ;


		/// <summary> 指定の時間だけ処理をとめる </summary>
		public static void WaitTimer( int WaitTime )
		{
			lock( locker )
			{
				int result = dx_WaitTimer( WaitTime ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_WaitTimer( int WaitTime ) ;


		/// <summary> キーの入力待ち </summary>
		public static void WaitKey()
		{
			lock( locker )
			{
				int result = dx_WaitKey() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_WaitKey() ;


		/// <summary> ミリ秒単位の精度を持つカウンタの現在値を得る </summary>
		public static int GetNowCount()
		{
			return GetNowCount( false ) ;
		}

		/// <summary> ミリ秒単位の精度を持つカウンタの現在値を得る </summary>
		public static int GetNowCount( bool UseRDTSCFlag )
		{
			lock( locker )
			{
				int result = dx_GetNowCount( UseRDTSCFlag ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNowCount( bool UseRDTSCFlag ) ;


		/// <summary> GetNowCountの高精度バージョン </summary>
		public static long GetNowHiPerformanceCount()
		{
			return GetNowHiPerformanceCount( false ) ;
		}

		/// <summary> GetNowCountの高精度バージョン </summary>
		public static long GetNowHiPerformanceCount( bool UseRDTSCFlag )
		{
			lock( locker )
			{
				long result = dx_GetNowHiPerformanceCount( UseRDTSCFlag ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern long dx_GetNowHiPerformanceCount( bool UseRDTSCFlag ) ;


		/// <summary> 現在時刻を取得する  </summary>
		public static void GetDateTime( out DATEDATA DateBuf )
		{
			lock( locker )
			{
				int result = dx_GetDateTime( out DateBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetDateTime( out DATEDATA DateBuf ) ;


		/// <summary> 乱数を取得する( RandMax : 返って来る値の最大値 ) </summary>
		public static int GetRand( int RandMax )
		{
			lock( locker )
			{
				int result = dx_GetRand( RandMax ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetRand( int RandMax ) ;


		/// <summary> 乱数の初期値を設定する </summary>
		public static void SRand( int Seed )
		{
			lock( locker )
			{
				int result = dx_SRand( Seed ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SRand( int Seed ) ;


		/// <summary> 通信メッセージの処理をする関数 </summary>
		public static void ProcessNetMessage()
		{
			ProcessNetMessage( false ) ;
		}

		/// <summary> 通信メッセージの処理をする関数 </summary>
		public static void ProcessNetMessage( bool RunReleaseProcess )
		{
			lock( locker )
			{
				int result = dx_ProcessNetMessage( RunReleaseProcess ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ProcessNetMessage( bool RunReleaseProcess ) ;


		/// <summary> ＤＮＳサーバーを使ってホスト名からＩＰアドレスを取得する </summary>
		public static void GetHostIPbyName( string HostName , out IPDATA IPDataBuf )
		{
			lock( locker )
			{
				int result = dx_GetHostIPbyName( HostName , out IPDataBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetHostIPbyName( string HostName , out IPDATA IPDataBuf ) ;


		/// <summary> 他マシンに接続する </summary>
		public static NetWork ConnectNetWork( IPDATA IPData )
		{
			return ConnectNetWork( IPData , -1 ) ;
		}

		/// <summary> 他マシンに接続する </summary>
		public static NetWork ConnectNetWork( IPDATA IPData , int Port )
		{
			lock( locker )
			{
				int result = dx_ConnectNetWork( IPData , Port ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return NetWork.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ConnectNetWork( IPDATA IPData , int Port ) ;


		/// <summary> 接続を受けられる状態にする </summary>
		public static void PreparationListenNetWork()
		{
			PreparationListenNetWork( -1 ) ;
		}

		/// <summary> 接続を受けられる状態にする </summary>
		public static void PreparationListenNetWork( int Port )
		{
			lock( locker )
			{
				int result = dx_PreparationListenNetWork( Port ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_PreparationListenNetWork( int Port ) ;


		/// <summary> 接続を受けつけ状態の解除 </summary>
		public static void StopListenNetWork()
		{
			lock( locker )
			{
				int result = dx_StopListenNetWork() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_StopListenNetWork() ;


		/// <summary> 接続状態を取得する </summary>
		public static bool GetNetWorkAcceptState( int NetHandle )
		{
			lock( locker )
			{
				int result = dx_GetNetWorkAcceptState( NetHandle ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNetWorkAcceptState( int NetHandle ) ;


		/// <summary> 受信データの量を得る </summary>
		public static int GetNetWorkDataLength( NetWork NetHandle )
		{
			lock( locker )
			{
				int result = dx_GetNetWorkDataLength( NetWork.ToHandle( NetHandle ) ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNetWorkDataLength( int NetHandle ) ;


		/// <summary> 未送信のデータの量を得る  </summary>
		public static int GetNetWorkSendDataLength( NetWork NetHandle )
		{
			lock( locker )
			{
				int result = dx_GetNetWorkSendDataLength( NetWork.ToHandle( NetHandle ) ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNetWorkSendDataLength( int NetHandle ) ;


		/// <summary> 新たに接続した通信回線を得る </summary>
		public static NetWork GetNewAcceptNetWork()
		{
			lock( locker )
			{
				int result = dx_GetNewAcceptNetWork() ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return NetWork.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNewAcceptNetWork() ;


		/// <summary> 接続を切断された通信回線を得る </summary>
		public static NetWork GetLostNetWork()
		{
			lock( locker )
			{
				int result = dx_GetLostNetWork() ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return NetWork.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetLostNetWork() ;


		/// <summary> 接続先のＩＰを得る </summary>
		public static void GetNetWorkIP( NetWork NetHandle , out IPDATA IpBuf )
		{
			lock( locker )
			{
				int result = dx_GetNetWorkIP( NetWork.ToHandle( NetHandle ) , out IpBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNetWorkIP( int NetHandle , out IPDATA IpBuf ) ;


		/// <summary> 自分のＩＰを得る </summary>
		public static void GetMyIPAddress( out IPDATA IpBuf )
		{
			lock( locker )
			{
				int result = dx_GetMyIPAddress( out IpBuf ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetMyIPAddress( out IPDATA IpBuf ) ;


		/// <summary> 接続のタイムアウトまでの時間を設定する </summary>
		public static void SetConnectTimeOutWait( int Time )
		{
			lock( locker )
			{
				int result = dx_SetConnectTimeOutWait( Time ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetConnectTimeOutWait( int Time ) ;


		/// <summary> ＤＸライブラリの通信形態を使うかどうかをセットする </summary>
		public static void SetUseDXNetWorkProtocol( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetUseDXNetWorkProtocol( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseDXNetWorkProtocol( bool Flag ) ;


		/// <summary> ＤＸライブラリの通信形態を使うかどうかを取得する </summary>
		public static bool GetUseDXNetWorkProtocol()
		{
			lock( locker )
			{
				int result = dx_GetUseDXNetWorkProtocol() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetUseDXNetWorkProtocol() ;


		/// <summary> 接続が切断された直後に接続ハンドルを解放するかどうかのフラグをセットする </summary>
		public static void SetNetWorkCloseAfterLostFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetNetWorkCloseAfterLostFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetNetWorkCloseAfterLostFlag( bool Flag ) ;


		/// <summary> 接続が切断された直後に接続ハンドルを解放するかどうかのフラグを取得する </summary>
		public static bool GetNetWorkCloseAfterLostFlag()
		{
			lock( locker )
			{
				int result = dx_GetNetWorkCloseAfterLostFlag() ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetNetWorkCloseAfterLostFlag() ;


		/// <summary> 受信したデータを読み込む </summary>
		public static void NetWorkRecv( NetWork NetHandle , IntPtr Buffer , int Length )
		{
			lock( locker )
			{
				int result = dx_NetWorkRecv( NetWork.ToHandle( NetHandle ) , Buffer , Length ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_NetWorkRecv( int NetHandle , IntPtr Buffer , int Length ) ;


		/// <summary> 受信したデータを読み込む、読み込んだデータはバッファから削除されない </summary>
		public static void NetWorkRecvToPeek( NetWork NetHandle , IntPtr Buffer , int Length )
		{
			lock( locker )
			{
				int result = dx_NetWorkRecvToPeek( NetWork.ToHandle( NetHandle ) , Buffer , Length ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_NetWorkRecvToPeek( int NetHandle , IntPtr Buffer , int Length ) ;


		/// <summary> 受信したデータをクリアする </summary>
		public static void NetWorkRecvBufferClear( NetWork NetHandle )
		{
			lock( locker )
			{
				int result = dx_NetWorkRecvBufferClear( NetWork.ToHandle( NetHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_NetWorkRecvBufferClear( int NetHandle ) ;


		/// <summary> データを送信する </summary>
		public static void NetWorkSend( NetWork NetHandle , IntPtr Buffer , int Length )
		{
			lock( locker )
			{
				int result = dx_NetWorkSend( NetWork.ToHandle( NetHandle ) , Buffer , Length ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_NetWorkSend( int NetHandle , IntPtr Buffer , int Length ) ;


		/// <summary> UDPを使用した通信を行うソケットハンドルを作成する( RecvPort を -1 にすると送信専用のソケットハンドルになります ) </summary>
		public static NetWorkUDP MakeUDPSocket()
		{
			return MakeUDPSocket( -1 ) ;
		}

		/// <summary> UDPを使用した通信を行うソケットハンドルを作成する( RecvPort を -1 にすると送信専用のソケットハンドルになります ) </summary>
		public static NetWorkUDP MakeUDPSocket( int RecvPort )
		{
			lock( locker )
			{
				int result = dx_MakeUDPSocket( RecvPort ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return NetWorkUDP.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_MakeUDPSocket( int RecvPort ) ;


		/// <summary> UDPを使用した通信で指定のＩＰにデータを送信する、Length は最大65507、SendPort を -1 にすると MakeUDPSocket に RecvPort で渡したポートが使用されます( 戻り値  0以上;送信できたデータサイズ  -1:エラー  -2:送信データが大きすぎる  -3:送信準備ができていない  ) </summary>
		public static int NetWorkSendUDP( NetWorkUDP NetUDPHandle , IPDATA SendIP , int SendPort , IntPtr Buffer , int Length )
		{
			lock( locker )
			{
				int result = dx_NetWorkSendUDP( NetWorkUDP.ToHandle( NetUDPHandle ) , SendIP , SendPort , Buffer , Length ) ;
				if( result >= 0 ) { return result ; }
				else if( result != -2 ) { throw new DX.Exception( "送信データが大きすぎる" ) ; }
				else if( result != -3 ) { throw new DX.Exception( "送信準備ができていない" ) ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_NetWorkSendUDP( int NetUDPHandle , IPDATA SendIP , int SendPort , IntPtr Buffer , int Length ) ;


		/// <summary> UDPを使用した通信でデータを受信する、Peek に TRUE を渡すと受信に成功してもデータを受信キューから削除しません( 戻り値  0以上:受信したデータのサイズ  -1:エラー  -2:バッファのサイズが足りない  -3:受信データがない ) </summary>
		public static int NetWorkRecvUDP( int NetUDPHandle , out IPDATA RecvIP , out int RecvPort , IntPtr Buffer , int Length , int Peek )
		{
			lock( locker )
			{
				int result = dx_NetWorkRecvUDP( NetUDPHandle , out RecvIP , out RecvPort , Buffer , Length , Peek ) ;
				if( result >= 0 ) { return result ; }
				else if( result != -2 ) { throw new DX.Exception( "バッファのサイズが足りない" ) ; }
				else if( result != -3 ) { throw new DX.Exception( "受信データがない" ) ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_NetWorkRecvUDP( int NetUDPHandle , out IPDATA RecvIP , out int RecvPort , IntPtr Buffer , int Length , int Peek ) ;


		/// <summary> UDPを使用した通信で新たな受信データが存在するかどうかを調べる( 戻り値  -1:エラー  TRUE:受信データあり  FALSE:受信データなし ) </summary>
		public static bool CheckNetWorkRecvUDP( NetWorkUDP NetUDPHandle )
		{
			lock( locker )
			{
				int result = dx_CheckNetWorkRecvUDP( NetWorkUDP.ToHandle( NetUDPHandle ) ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckNetWorkRecvUDP( int NetUDPHandle ) ;


		/// <summary> バッファにコードをストックする </summary>
		public static void StockInputChar( char CharCode )
		{
			lock( locker )
			{
				int result = dx_StockInputChar( CharCode ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_StockInputChar( char CharCode ) ;


		/// <summary> 文字コードバッファをクリアする </summary>
		public static void ClearInputCharBuf()
		{
			lock( locker )
			{
				int result = dx_ClearInputCharBuf() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ClearInputCharBuf() ;


		/// <summary> 文字コードバッファに溜まったデータから文字コードを取得する </summary>
		public static char GetInputChar( bool DeleteFlag )
		{
			lock( locker )
			{
				char result = dx_GetInputChar( DeleteFlag ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern char dx_GetInputChar( bool DeleteFlag ) ;


		/// <summary> 文字コードバッファに溜まったデータから１バイト分取得する、バッファになにも文字コードがない場合はキーが押されるまで待つ </summary>
		public static char GetInputCharWait( bool DeleteFlag )
		{
			lock( locker )
			{
				char result = dx_GetInputCharWait( DeleteFlag ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern char dx_GetInputCharWait( bool DeleteFlag ) ;


		/// <summary> 文字コードバッファに溜まったデータから１文字分取得する </summary>
		public static void GetOneChar( out char CharBuffer , bool DeleteFlag )
		{
			lock( locker )
			{
				IntPtr CharBuffer_ = IntPtr.Zero ;

				try
				{
				#if UNICODE
					CharBuffer_ = Marshal.AllocHGlobal( 2 * 2 ) ;
				#else
					CharBuffer_ = Marshal.AllocHGlobal( 2 * 1 ) ;
				#endif
					int result = dx_GetOneChar( CharBuffer_ , DeleteFlag ) ;
					if( !( result == 0 ) ) { throw new DX.Exception(); }
				#if UNICODE
					CharBuffer = Marshal.PtrToStringUni( CharBuffer_ , 2 )[ 0 ] ;
				#else
					CharBuffer = Marshal.PtrToStringAnsi( CharBuffer_ , 2 )[ 0 ] ;
				#endif
				}
				finally
				{
					Marshal.FreeHGlobal( CharBuffer_ ) ;
				}
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetOneChar( IntPtr CharBuffer , bool DeleteFlag ) ;


		/// <summary> 文字コードバッファに溜まったデータから１文字分取得する、バッファに何も文字コードがない場合はキーが押されるまで待つ </summary>
		public static void GetOneCharWait( out char CharBuffer , bool DeleteFlag )
		{
			lock( locker )
			{
				IntPtr CharBuffer_ = IntPtr.Zero ;

				try
				{
				#if UNICODE
					CharBuffer_ = Marshal.AllocHGlobal( 2 * 2 ) ;
				#else
					CharBuffer_ = Marshal.AllocHGlobal( 2 * 1 ) ;
				#endif
					int result = dx_GetOneCharWait( CharBuffer_ , DeleteFlag ) ;
					if( !( result == 0 ) ) { throw new DX.Exception(); }
				#if UNICODE
					CharBuffer = Marshal.PtrToStringUni( CharBuffer_ , 2 )[ 0 ] ;
				#else
					CharBuffer = Marshal.PtrToStringAnsi( CharBuffer_ , 2 )[ 0 ] ;
				#endif
				}
				finally
				{
					Marshal.FreeHGlobal( CharBuffer_ ) ;
				}
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetOneCharWait( IntPtr CharBuffer , bool DeleteFlag ) ;


		/// <summary> アスキーコントロールコードか調べる </summary>
		public static bool GetCtrlCodeCmp( char Char )
		{
			lock( locker )
			{
				int result = dx_GetCtrlCodeCmp( Char ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetCtrlCodeCmp( char Char ) ;


		/// <summary> 画面上に入力中の文字列を描画する </summary>
		public static void DrawIMEInputString( int x , int y , int SelectStringNum )
		{
			lock( locker )
			{
				int result = dx_DrawIMEInputString( x , y , SelectStringNum ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawIMEInputString( int x , int y , int SelectStringNum ) ;


		/// <summary> ＩＭＥを使用するかどうかをセットする </summary>
		public static void SetUseIMEFlag( bool UseFlag )
		{
			lock( locker )
			{
				int result = dx_SetUseIMEFlag( UseFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetUseIMEFlag( bool UseFlag ) ;


		/// <summary> ＩＭＥで入力できる最大文字数を MakeKeyInput の設定に合わせるかどうかをセットする( TRUE:あわせる  FALSE:あわせない(デフォルト) ) </summary>
		public static void SetInputStringMaxLengthIMESync( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetInputStringMaxLengthIMESync( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetInputStringMaxLengthIMESync( bool Flag ) ;


		/// <summary> ＩＭＥで一度に入力できる最大文字数を設定する( 0:制限なし  1以上:指定の文字数で制限 ) </summary>
		public static void SetIMEInputStringMaxLength( int Length )
		{
			lock( locker )
			{
				int result = dx_SetIMEInputStringMaxLength( Length ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetIMEInputStringMaxLength( int Length ) ;


		/// <summary> 全角文字、半角文字入り乱れる中から指定の文字数での半角文字数を得る </summary>
		public static int GetStringPoint( string String , int Point )
		{
			lock( locker )
			{
				int result = dx_GetStringPoint( String , Point ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetStringPoint( string String , int Point ) ;


		/// <summary> 全角文字、半角文字入り乱れる中から指定の文字数での全角文字数を得る </summary>
		public static int GetStringPoint2( string String , int Point )
		{
			lock( locker )
			{
				int result = dx_GetStringPoint2( String , Point ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetStringPoint2( string String , int Point ) ;


		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor )
		{
			DrawObtainsString( x , y , AddY , String , StrColor , COLOR_U8.Empty ) ;
		}

		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor )
		{
			DrawObtainsString( x , y , AddY , String , StrColor , StrEdgeColor , null ) ;
		}

		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor , Font FontHandle )
		{
			DrawObtainsString( x , y , AddY , String , StrColor , StrEdgeColor , FontHandle , new COLOR_U8( -1 ) ) ;
		}

		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor , Font FontHandle , COLOR_U8 SelectBackColor )
		{
			DrawObtainsString( x , y , AddY , String , StrColor , StrEdgeColor , FontHandle , SelectBackColor , new COLOR_U8( 0 ) ) ;
		}

		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor , Font FontHandle , COLOR_U8 SelectBackColor , COLOR_U8 SelectStrColor )
		{
			DrawObtainsString( x , y , AddY , String , StrColor , StrEdgeColor , FontHandle , SelectBackColor , SelectStrColor , new COLOR_U8( -1 ) ) ;
		}
		
		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor , Font FontHandle , COLOR_U8 SelectBackColor , COLOR_U8 SelectStrColor , COLOR_U8 SelectStrEdgeColor )
		{
			DrawObtainsString( x , y , AddY , String , StrColor , StrEdgeColor , FontHandle , SelectBackColor , SelectStrColor , SelectStrEdgeColor , -1 ) ;
		}
		
		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor , Font FontHandle , COLOR_U8 SelectBackColor , COLOR_U8 SelectStrColor , COLOR_U8 SelectStrEdgeColor , int SelectStart )
		{
			DrawObtainsString( x , y , AddY , String , StrColor , StrEdgeColor , FontHandle , SelectBackColor , SelectStrColor , SelectStrEdgeColor , SelectStart , -1 ) ;
		}

		/// <summary> 規定領域に収めたかたちで文字列を描画 </summary>
		public static void DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor , Font FontHandle , COLOR_U8 SelectBackColor , COLOR_U8 SelectStrColor , COLOR_U8 SelectStrEdgeColor , int SelectStart , int SelectEnd )
		{
			lock( locker )
			{
				int result = dx_DrawObtainsString( x , y , AddY , String , StrColor , StrEdgeColor , Font.ToHandle( FontHandle ) , SelectBackColor.ToInt() , SelectStrColor.ToInt() , SelectStrEdgeColor.ToInt() , SelectStart , SelectEnd ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawObtainsString( int x , int y , int AddY , string String , COLOR_U8 StrColor , COLOR_U8 StrEdgeColor , int FontHandle , int SelectBackColor , int SelectStrColor , int SelectStrEdgeColor , int SelectStart , int SelectEnd ) ;


		/// <summary> 規定領域に収めたかたちで矩形を描画  </summary>
		public static void DrawObtainsBox( int x1 , int y1 , int x2 , int y2 , int AddY , COLOR_U8 Color , bool FillFlag )
		{
			lock( locker )
			{
				int result = dx_DrawObtainsBox( x1 , y1 , x2 , y2 , AddY , Color , FillFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawObtainsBox( int x1 , int y1 , int x2 , int y2 , int AddY , COLOR_U8 Color , bool FillFlag ) ;


		/// <summary> 文字列の入力取得 </summary>
		public static void InputStringToCustom( int x , int y , int BufLength , out string StrBuffer , bool CancelValidFlag , bool SingleCharOnlyFlag , bool NumCharOnlyFlag )
		{
			lock( locker )
			{
				StringBuilder StrBuffer_ = new StringBuilder( BufLength ) ;
				int result = dx_InputStringToCustom( x , y , BufLength , StrBuffer_ , CancelValidFlag , SingleCharOnlyFlag , NumCharOnlyFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				StrBuffer = StrBuffer_.ToString() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_InputStringToCustom( int x , int y , int BufLength , [ Out ] StringBuilder StrBuffer , bool CancelValidFlag , bool SingleCharOnlyFlag , bool NumCharOnlyFlag ) ;


		/// <summary> 文字列の入力取得 </summary>
		public static void KeyInputString( int x , int y , int CharMaxLength , out string StrBuffer , bool CancelValidFlag )
		{
			lock( locker )
			{
				StringBuilder strBuffer = new StringBuilder( CharMaxLength ) ;
				int result = dx_KeyInputString( x , y , CharMaxLength , strBuffer , CancelValidFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				StrBuffer = strBuffer.ToString() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_KeyInputString( int x , int y , int CharMaxLength , [ Out ] StringBuilder StrBuffer , bool CancelValidFlag ) ;


		/// <summary> 半角文字列のみの入力取得 </summary>
		public static void KeyInputSingleCharString( int x , int y , int CharMaxLength , out string StrBuffer , bool CancelValidFlag )
		{
			lock( locker )
			{
				StringBuilder strBuffer = new StringBuilder( CharMaxLength ) ;
				int result = dx_KeyInputSingleCharString( x , y , CharMaxLength , strBuffer , CancelValidFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				StrBuffer = strBuffer.ToString() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_KeyInputSingleCharString( int x , int y , int CharMaxLength , [ Out ] StringBuilder StrBuffer , bool CancelValidFlag ) ;


		/// <summary> 数値の入力 </summary>
		public static void KeyInputNumber( int x , int y , int MaxNum , int MinNum , bool CancelValidFlag )
		{
			lock( locker )
			{
				int result = dx_KeyInputNumber( x , y , MaxNum , MinNum , CancelValidFlag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_KeyInputNumber( int x , int y , int MaxNum , int MinNum , bool CancelValidFlag ) ;


		/// <summary> IMEの入力モード文字列の取得 </summary>
		public static void GetIMEInputModeStr( out string GetBuffer )
		{
			lock( locker )
			{
				StringBuilder getBuffer = new StringBuilder( 0x200 ) ;
				int result = dx_GetIMEInputModeStr( getBuffer ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				GetBuffer = getBuffer.ToString() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetIMEInputModeStr( [ Out ] StringBuilder GetBuffer ) ;


		/// <summary> IMEで入力中の文字列の情報を取得する </summary>
		public static IMEINPUTDATA GetIMEInputData()
		{
			lock( locker )
			{
				IMEINPUTDATA_ source = ( IMEINPUTDATA_ )( Marshal.PtrToStructure( dx_GetIMEInputData() , typeof( IMEINPUTDATA_ ) ) ) ;
				IMEINPUTDATA target = new IMEINPUTDATA() ;
				target.InputString = source.InputString ;
				target.CursorPosition = source.CursorPosition ;
				target.ClauseData = new IMEINPUTCLAUSEDATA[ source.ClauseNum ] ;
				target.SelectClause = source.SelectClause ;
				target.CandidateList = new string[ source.CandidateNum ] ;
				target.SelectCandidate = source.SelectCandidate ;

				for( int i = 0 ; i < target.ClauseData.Length ; i ++ )
				{
					unsafe
					{
						target.ClauseData[ i ] = source.ClauseData[ i ] ;
					}
				}

				for( int i = 0 ; i < target.CandidateList.Length ; i ++ )
				{
					unsafe
					{
					#if UNICODE
						target.CandidateList[ i ] = Marshal.PtrToStringUni( source.CandidateList[ i ] ) ;
					#else
						target.CandidateList[ i ] = Marshal.PtrToStringAnsi( source.CandidateList[ i ] ) ;
					#endif
					}
				}

				return target ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern IntPtr dx_GetIMEInputData() ;

	#if UNICODE
		[ StructLayout( LayoutKind.Sequential , CharSet = CharSet.Unicode ) ]
	#else
		[ StructLayout( LayoutKind.Sequential , CharSet = CharSet.Ansi ) ]
	#endif
		internal unsafe struct IMEINPUTDATA_
		{

			[ MarshalAs( UnmanagedType.LPTStr ) ]
			public string InputString ;

			public int CursorPosition ;

			public IMEINPUTCLAUSEDATA *ClauseData ;

			public int ClauseNum ;

			public int SelectClause ;

			public int CandidateNum ;

			public IntPtr *CandidateList ;

			public int SelectCandidate ;
		}

		
		/// <summary> InputString関数使用時の文字の各色を変更する </summary>
		public static void SetKeyInputStringColor( COLOR_U8 NmlStr , COLOR_U8 NmlCur , COLOR_U8 IMEStr , COLOR_U8 IMECur , COLOR_U8 IMELine , COLOR_U8 IMESelectStr , COLOR_U8 IMEModeStr )
		{
			SetKeyInputStringColor( NmlStr , NmlCur , IMEStr , IMECur , IMELine , IMESelectStr , IMEModeStr , COLOR_U8.Empty ) ;
		}
		
		/// <summary> InputString関数使用時の文字の各色を変更する </summary>
		public static void SetKeyInputStringColor( COLOR_U8 NmlStr , COLOR_U8 NmlCur , COLOR_U8 IMEStr , COLOR_U8 IMECur , COLOR_U8 IMELine , COLOR_U8 IMESelectStr , COLOR_U8 IMEModeStr , COLOR_U8 NmlStrE )
		{
			SetKeyInputStringColor( NmlStr , NmlCur , IMEStr , IMECur , IMELine , IMESelectStr , IMEModeStr , NmlStrE , COLOR_U8.Empty ) ;
		}
		
		/// <summary> InputString関数使用時の文字の各色を変更する </summary>
		public static void SetKeyInputStringColor( COLOR_U8 NmlStr , COLOR_U8 NmlCur , COLOR_U8 IMEStr , COLOR_U8 IMECur , COLOR_U8 IMELine , COLOR_U8 IMESelectStr , COLOR_U8 IMEModeStr , COLOR_U8 NmlStrE , COLOR_U8 IMESelectStrE )
		{
			SetKeyInputStringColor( NmlStr , NmlCur , IMEStr , IMECur , IMELine , IMESelectStr , IMEModeStr , NmlStrE , IMESelectStrE , COLOR_U8.Empty ) ;
		}
		
		/// <summary> InputString関数使用時の文字の各色を変更する </summary>
		public static void SetKeyInputStringColor( COLOR_U8 NmlStr , COLOR_U8 NmlCur , COLOR_U8 IMEStr , COLOR_U8 IMECur , COLOR_U8 IMELine , COLOR_U8 IMESelectStr , COLOR_U8 IMEModeStr , COLOR_U8 NmlStrE , COLOR_U8 IMESelectStrE , COLOR_U8 IMEModeStrE )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputStringColor( unchecked( ( uint )( NmlStr.ToInt() ) ) , unchecked( ( uint )( NmlCur.ToInt() ) ) , unchecked( ( uint )( IMEStr.ToInt() ) ) , unchecked( ( uint )( IMECur.ToInt() ) ) , unchecked( ( uint )( IMELine.ToInt() ) ) , unchecked( ( uint )( IMESelectStr.ToInt() ) ) , unchecked( ( uint )( IMEModeStr.ToInt() ) ) , unchecked( ( uint )( NmlStrE.ToInt() ) ) , unchecked( ( uint )( IMESelectStrE.ToInt() ) ) , unchecked( ( uint )( IMEModeStrE.ToInt() ) ) , -1 , -1 , -1 , -1 , -1 ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

		/// <summary> InputString関数使用時の文字の各色を変更する </summary>
		public static void SetKeyInputStringColor( COLOR_U8 NmlStr , COLOR_U8 NmlCur , COLOR_U8 IMEStr , COLOR_U8 IMECur , COLOR_U8 IMELine , COLOR_U8 IMESelectStr , COLOR_U8 IMEModeStr , COLOR_U8 NmlStrE , COLOR_U8 IMESelectStrE , COLOR_U8 IMEModeStrE , COLOR_U8 IMESelectWinE , COLOR_U8 IMESelectWinF , COLOR_U8 SelectStrBackColor , COLOR_U8 SelectStrColor , COLOR_U8 SelectStrEdgeColor )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputStringColor( unchecked( ( uint )( NmlStr.ToInt() ) ) , unchecked( ( uint )( NmlCur.ToInt() ) ) , unchecked( ( uint )( IMEStr.ToInt() ) ) , unchecked( ( uint )( IMECur.ToInt() ) ) , unchecked( ( uint )( IMELine.ToInt() ) ) , unchecked( ( uint )( IMESelectStr.ToInt() ) ) , unchecked( ( uint )( IMEModeStr.ToInt() ) ) , unchecked( ( uint )( NmlStrE.ToInt() ) ) , unchecked( ( uint )( IMESelectStrE.ToInt() ) ) , unchecked( ( uint )( IMEModeStrE.ToInt() ) ) , unchecked( ( uint )( IMESelectWinE.ToInt() ) ) , unchecked( ( uint )( IMESelectWinF.ToInt() ) ) , unchecked( ( uint )( SelectStrBackColor.ToInt() ) ) , unchecked( ( uint )( SelectStrColor.ToInt() ) ) , unchecked( ( uint )( SelectStrEdgeColor.ToInt() ) ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputStringColor( long NmlStr , long NmlCur , long IMEStr , long IMECur , long IMELine , long IMESelectStr , long IMEModeStr , long NmlStrE , long IMESelectStrE , long IMEModeStrE , long IMESelectWinE , long IMESelectWinF , long SelectStrBackColor , long SelectStrColor , long SelectStrEdgeColor ) ;


		/// <summary> キー入力文字列描画関連で使用するフォントのハンドルを変更する(-1でデフォルトのフォントハンドル) </summary>
		public static void SetKeyInputStringFont( Font FontHandle )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputStringFont( Font.ToHandle( FontHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputStringFont( int FontHandle ) ;


		/// <summary> 入力モード文字列を描画する </summary>
		public static void DrawKeyInputModeString( int x , int y )
		{
			lock( locker )
			{
				int result = dx_DrawKeyInputModeString( x , y ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawKeyInputModeString( int x , int y ) ;


		/// <summary> 新しいキー入力データの作成 </summary>
		public static KeyInput MakeKeyInput( int MaxStrLength , bool CancelValidFlag , bool SingleCharOnlyFlag , bool NumCharOnlyFlag )
		{
			lock( locker )
			{
				int result = dx_MakeKeyInput( MaxStrLength , CancelValidFlag , SingleCharOnlyFlag , NumCharOnlyFlag ) ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return KeyInput.FromHandle( result , MaxStrLength ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_MakeKeyInput( int MaxStrLength , bool CancelValidFlag , bool SingleCharOnlyFlag , bool NumCharOnlyFlag ) ;


		/// <summary> 指定のキー入力をアクティブにする( -1 を指定するとアクティブなキー入力ハンドルが無い状態になります ) </summary>
		public static void SetActiveKeyInput( KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_SetActiveKeyInput( KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetActiveKeyInput( int InputHandle ) ;


		/// <summary> 現在アクティブになっているキー入力ハンドルを取得する </summary>
		public static KeyInput GetActiveKeyInput()
		{
			lock( locker )
			{
				int result = dx_GetActiveKeyInput() ;
				if( !( result != -1 ) ) { throw new DX.Exception(); }
				return KeyInput.FromHandle( result ) ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetActiveKeyInput() ;


		/// <summary> 入力が終了しているか取得する </summary>
		public static bool CheckKeyInput( KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_CheckKeyInput( KeyInput.ToHandle( InputHandle ) ) ;
				if( result == 0 ) { return false ; }
				else if( result == 1 ) { return true ; }
				else { throw new DX.Exception() ; }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_CheckKeyInput( int InputHandle ) ;


		/// <summary> 入力が完了したキー入力を再度編集状態に戻す </summary>
		public static void ReStartKeyInput( KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_ReStartKeyInput( KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ReStartKeyInput( int InputHandle ) ;


		/// <summary> キー入力処理関数 </summary>
		public static void ProcessActKeyInput()
		{
			lock( locker )
			{
				int result = dx_ProcessActKeyInput() ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_ProcessActKeyInput() ;


		/// <summary> キー入力中データの描画 </summary>
		public static void DrawKeyInputString( int x , int y , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_DrawKeyInputString( x , y , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_DrawKeyInputString( int x , int y , int InputHandle ) ;


		/// <summary> キー入力データの指定の領域を選択状態にする( SelectStart と SelectEnd に -1 を指定すると選択状態が解除されます ) </summary>
		public static void SetKeyInputSelectArea( int SelectStart , int SelectEnd , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputSelectArea( SelectStart , SelectEnd , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputSelectArea( int SelectStart , int SelectEnd , int InputHandle ) ;


		/// <summary> キー入力データの選択領域を取得する </summary>
		public static void GetKeyInputSelectArea( out int SelectStart , out int SelectEnd , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_GetKeyInputSelectArea( out SelectStart , out SelectEnd , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetKeyInputSelectArea( out int SelectStart , out int SelectEnd , int InputHandle ) ;


		/// <summary> キー入力の描画開始文字位置を設定する </summary>
		public static void SetKeyInputDrawStartPos( int DrawStartPos , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputDrawStartPos( DrawStartPos , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputDrawStartPos( int DrawStartPos , int InputHandle ) ;


		/// <summary> キー入力の描画開始文字位置を取得する </summary>
		public static int GetKeyInputDrawStartPos( KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_GetKeyInputDrawStartPos( KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetKeyInputDrawStartPos( int InputHandle ) ;


		/// <summary> キー入力時のカーソルの点滅する早さをセットする </summary>
		public static void SetKeyInputCursorBrinkTime( int Time )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputCursorBrinkTime( Time ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputCursorBrinkTime( int Time ) ;


		/// <summary> キー入力時のカーソルを点滅させるかどうかをセットする </summary>
		public static void SetKeyInputCursorBrinkFlag( bool Flag )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputCursorBrinkFlag( Flag ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputCursorBrinkFlag( bool Flag ) ;


		/// <summary> キー入力データに指定の文字列をセットする </summary>
		public static void SetKeyInputString( string String , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputString( String , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputString( string String , int InputHandle ) ;


		/// <summary> キー入力データに指定の数値を文字に置き換えてセットする </summary>
		public static void SetKeyInputNumber( int Number , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputNumber( Number , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputNumber( int Number , int InputHandle ) ;


		/// <summary> キー入力データに指定の浮動小数点値を文字に置き換えてセットする </summary>
		public static void SetKeyInputNumberToFloat( float Number , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputNumberToFloat( Number , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputNumberToFloat( float Number , int InputHandle ) ;


		/// <summary> 入力データの文字列を取得する </summary>
		public static void GetKeyInputString( out string StrBuffer , KeyInput InputHandle )
		{
			lock( locker )
			{
				StringBuilder StrBuffer_ = new StringBuilder( InputHandle.length ) ;
				int result = dx_GetKeyInputString( StrBuffer_ , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
				StrBuffer = StrBuffer_.ToString() ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetKeyInputString( [ Out ] StringBuilder StrBuffer , int InputHandle ) ;


		/// <summary> 入力データの文字列を整数値として取得する </summary>
		public static int GetKeyInputNumber( KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_GetKeyInputNumber( KeyInput.ToHandle( InputHandle ) ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetKeyInputNumber( int InputHandle ) ;


		/// <summary> 入力データの文字列を浮動小数点値として取得する </summary>
		public static float GetKeyInputNumberToFloat( KeyInput InputHandle )
		{
			lock( locker )
			{
				float result = dx_GetKeyInputNumberToFloat( KeyInput.ToHandle( InputHandle ) ) ;
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern float dx_GetKeyInputNumberToFloat( int InputHandle ) ;


		/// <summary> キー入力の現在のカーソル位置を設定する </summary>
		public static void SetKeyInputCursorPosition( int Position , KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_SetKeyInputCursorPosition( Position , KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result == 0 ) ) { throw new DX.Exception(); }
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_SetKeyInputCursorPosition( int Position , int InputHandle ) ;


		/// <summary> キー入力の現在のカーソル位置を取得する </summary>
		public static int GetKeyInputCursorPosition( KeyInput InputHandle )
		{
			lock( locker )
			{
				int result = dx_GetKeyInputCursorPosition( KeyInput.ToHandle( InputHandle ) ) ;
				if( !( result >= 0 ) ) { throw new DX.Exception(); }
				return result ;
			}
		}

	#if UNICODE
		[ DllImport( "DxLibW.dll" , CharSet = CharSet.Unicode , ExactSpelling = true ) ]
	#else
		[ DllImport( "DxLib.dll" , CharSet = CharSet.Ansi , ExactSpelling = true ) ]
	#endif
		private static extern int dx_GetKeyInputCursorPosition( int InputHandle ) ;
	}
}
