| Line | |
|---|
| 1 | Namespace System
|
|---|
| 2 | Namespace Windows
|
|---|
| 3 | Namespace Forms
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 | Class Application
|
|---|
| 7 | Public
|
|---|
| 8 | /*!
|
|---|
| 9 | @brief アプリケーションの実行ファイルのパスを取得する。
|
|---|
| 10 | @author Daisuke Yamamoto
|
|---|
| 11 | @date 2007/08/29
|
|---|
| 12 | @return アプリケーションの実行ファイルのパス文字列
|
|---|
| 13 | */
|
|---|
| 14 | Static Function ExecutablePath() As String
|
|---|
| 15 | Dim szModuleFilePath[MAX_PATH] As TCHAR
|
|---|
| 16 | GetModuleFileName( NULL, szModuleFilePath, MAX_PATH )
|
|---|
| 17 | Return New String( szModuleFilePath )
|
|---|
| 18 | End Function
|
|---|
| 19 |
|
|---|
| 20 | /*!
|
|---|
| 21 | @brief アプリケーション起動時のディレクトリパスを取得する。
|
|---|
| 22 | @author Daisuke Yamamoto
|
|---|
| 23 | @date 2007/08/29
|
|---|
| 24 | @return アプリケーション起動時のディレクトリパス文字列
|
|---|
| 25 | */
|
|---|
| 26 | Static Function StartupPath() As String
|
|---|
| 27 | Return System.IO.Path.GetDirectoryName( ExecutablePath )
|
|---|
| 28 | End Function
|
|---|
| 29 |
|
|---|
| 30 | Static Sub ExitThread()
|
|---|
| 31 | PostQuitMessage(0)
|
|---|
| 32 | End Sub
|
|---|
| 33 |
|
|---|
| 34 | /*!
|
|---|
| 35 | @brief 現在のスレッドで標準のアプリケーション メッセージ ループの実行を開始し、
|
|---|
| 36 | 指定したフォームを表示します。
|
|---|
| 37 | */
|
|---|
| 38 | Static Sub Run( form As Form )
|
|---|
| 39 |
|
|---|
| 40 | ' フォームを表示する
|
|---|
| 41 | form.Show()
|
|---|
| 42 |
|
|---|
| 43 | Dim msgMain As MSG, iResult As Long
|
|---|
| 44 | Do
|
|---|
| 45 | iResult=GetMessage(msgMain,0,0,0)
|
|---|
| 46 | If iResult=0 or iResult=-1 Then Exit Do
|
|---|
| 47 | TranslateMessage(msgMain)
|
|---|
| 48 | DispatchMessage(msgMain)
|
|---|
| 49 | Loop
|
|---|
| 50 | End Sub
|
|---|
| 51 | End Class
|
|---|
| 52 |
|
|---|
| 53 | End Namespace
|
|---|
| 54 | End Namespace
|
|---|
| 55 | End Namespace
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.