Namespace System Namespace Windows Namespace Forms Class Application Public /*! @brief アプリケーションの実行ファイルのパスを取得する。 @author Daisuke Yamamoto @date 2007/08/29 @return アプリケーションの実行ファイルのパス文字列 */ Static Function ExecutablePath() As String Dim szModuleFilePath[MAX_PATH] As TCHAR GetModuleFileName( NULL, szModuleFilePath, MAX_PATH ) Return New String( szModuleFilePath ) End Function /*! @brief アプリケーション起動時のディレクトリパスを取得する。 @author Daisuke Yamamoto @date 2007/08/29 @return アプリケーション起動時のディレクトリパス文字列 */ Static Function StartupPath() As String Return System.IO.Path.GetDirectoryName( ExecutablePath ) End Function Static Sub ExitThread() PostQuitMessage(0) End Sub /*! @brief 現在のスレッドで標準のアプリケーション メッセージ ループの実行を開始し、 指定したフォームを表示します。 */ Static Sub Run( form As Form ) ' フォームを表示する form.Show() Dim msgMain As MSG, iResult As Long Do iResult=GetMessage(msgMain,0,0,0) If iResult=0 or iResult=-1 Then Exit Do TranslateMessage(msgMain) DispatchMessage(msgMain) Loop End Sub End Class End Namespace End Namespace End Namespace