ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
VB.NET CMDEX.EXE ( No.6 )
日時: 2013/03/09 13:34
名前: lightbox



最大化して、解像度にあわせてカラム数を大きく調整します

拡張子:
Imports System
Imports System.Diagnostics

Module MyModule

' ********************************************************
' * 実行
' ********************************************************
Sub Main(ByVal CmdArgs() As String)

	Dim startInfo As New ProcessStartInfo("cmd.exe")
	startInfo.WindowStyle = ProcessWindowStyle.Maximized

	Dim w As Integer = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
	Dim cols As String = ""

	if w >= 1024 then
		cols = "120"
	end if
	if w >= 1152 then
		cols = "135"
	end if
	if w >= 1280 then
		cols = "150"
	end if

	Dim strArg As String = "/k mode con: cols=" & cols
	Dim idx As Integer = 0

	if CmdArgs.GetUpperBound(0) <> -1 then
		strArg &= " & "
		For idx = 0 to CmdArgs.GetUpperBound(0)
			strArg &= " " & CmdArgs(idx)
		Next
	end if
	startInfo.Arguments = strArg

	Process.Start(startInfo)

End Sub

End Module