คุณ admin คัรบ ขอบคุณสำหรับแนวทางน่ะครับเด่วผมจะเอาไป ดัดแปลง แต่ ผมขอ โพสแนวทางที่จะทำเรยน่ะครับ
#include
#include
#include
;Get the Windows Shell Object
Global $IE01_3 = ObjCreate("Shell.Explorer.2"),$IE02_4 = ObjCreate("Shell.Explorer.2"),$resolution
Dim $width = @DesktopWidth, $height = @DesktopHeight ,$freq = @DesktopRefresh
;msgbox(0,"text",$width)
;msgbox(0,"text",$height)
;msgbox(0,"text",$freq)
;MsgBox(0, "Desktop Resolution","Resolution is " & _Desktop_Resolution() & " @ " & @DesktopRefresh & " Hertz")
;MsgBox(0, "Desktop Resolution","Resolution is " & _Desktop_Resolution() & " @ " & @DesktopRefresh & " Hertz")
;Msgbox(0,"Display_Resolution", & $x " x " & $y & " " & $z & " Hertz")
;msgbox(0,"text",$WS_POPUP)
;msgbox(0,"text",$WS_SIZEBOX)
;bitor Cut Tool web
;Create a GUI window.
;GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )
;Parameters
;title The title of the dialog box.
;width [optional] The width of the window.
;height [optional] The height of the window.
;left [optional] The left side of the dialog box. By default (-1), the window is centered. If defined, top must also be defined.
;top [optional] The top of the dialog box. Default (-1) is centered
;style [optional] defines the style of the window. See GUI Control Styles Appendix.
;Use -1 for the default style which includes a combination of $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU styles.
;Some styles are always included: $WS_CLIPSIBLINGS, and $WS_SYSMENU if $WS_MAXIMIZEBOX or $WS_SIZEBOX is specified.
;exStyle [optional] defines the extended style of the window. See the Extended Style Table below. -1 is the default.
;parent [optional] The handle of another previously created window - this new window then becomes a child of that window.
$Form1 = GUICreate("DCS", $width, $height, 0, 0,BitOR($WS_POPUP, $WS_SIZEBOX))
$Graphic1_3 = GUICtrlCreateObj($IE01_3,0, 0, $width/2, $height/2)
GUISetState(@SW_SHOW)
;#sleep(2000)
;$Form2 = GUICreate("DCS2", $width/2, $height/2, $width/2, 0,BitOR($WS_POPUP, $WS_SIZEBOX))
$Graphic1_4 = GUICtrlCreateObj($IE02_4,$width/2, $height/2, $width/2, $height/2)
GUISetState(@SW_SHOW)
;$Form3 = GUICreate("DCS3", $width/2, $height/2, $width/2, $height-$height/2,BitOR($WS_POPUP, $WS_SIZEBOX))
;$Graphic1_5 = GUICtrlCreateObj($IE03_5,0, 0, $width/2, $height/2)
;GUISetState(@SW_SHOW)
;GUICtrlCreateObj ( ObjectVar, left, top [, width [, height ]] )
;ObjectVar A variable pointing to a previously opened object
;left The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
;top The top of the control. If -1 is used then top will be computed according to GUICoordMode.
;width [optional] The width of the control (default is the previously used width).
;height [optional] The height of the control (default is the previously used height).
;#$Graphic1_3 = GUICtrlCreateObj($IE01_3,0, 0, $width/2, $height/2)
;#$Graphic1_4 = GUICtrlCreateObj($IE02_4,0, 0, $width/2, $height/2)
;Changes the state of a GUI window.
;GUISetState ( [flag [, winhandle]] )
;Parameters
;flag [optional] @SW_SHOW = Shows a previously hidden window (default)
;@SW_HIDE = Hide window
;@SW_MINIMIZE = Minimize window
;@SW_MAXIMIZE = Maximize window
;@SW_RESTORE = Undoes a window minimization
;@SW_DISABLE = Disables the window
;@SW_ENABLE = Enables the window
;@SW_LOCK = Lock the window to avoid repainting.
;@SW_UNLOCK = Unlock windows to allow painting.
;winhandle [optional] Windows handle as returned by GUICreate (default is the previously used window).
#GUISetState(@SW_SHOW)
;object.Navigate2( _
;URL As Variant, _
;[Flags As Variant,] _
;[TargetFrameName As Variant,] _
;[PostData As Variant,] _
;[Headers As Variant])
$IE01_3.navigate2("")
$IE02_4.navigate2("")
;$IE03_5.navigate2("")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _Desktop_Resolution()
Switch $resolution = ""
Case @DesktopWidth = 640 And @DesktopHeight = 480; Video Graphics Array
$resolution = "640 x 480 (4:3) VGA"
Case @DesktopWidth = 800 And @DesktopHeight = 480; Wide Video Graphics Array
$resolution = "800 x 480 (4:3) WVGA"
Case @DesktopWidth = 854 And @DesktopHeight = 480; Full Wide Video Graphics Array
$resolution = "854 x 480 (4:3) FWVGA"
Case @DesktopWidth = 800 And @DesktopHeight = 600; Super Video Graphics Array
$resolution = "800 x 600 (4:3) SVGA"
Case @DesktopWidth = 960 And @DesktopHeight = 540; Quarter Full HD
$resolution = "960 x 540 (16:9) qHD"
Case @DesktopWidth = 1024 And @DesktopHeight = 576; Wide Super Video Graphics Array
$resolution = "1024 x 576 (5:3) WSVGA"
Case @DesktopWidth = 1024 And @DesktopHeight = 600; Wide Super Video Graphics Array
$resolution = "1024 x 600 (5:3) WSVGA"
Case @DesktopWidth = 1024 And @DesktopHeight = 768; eXtended Graphics Array
$resolution = "1024 x 768 (4:3) XGA"
Case @DesktopWidth = 1152 And @DesktopHeight = 864; eXtended Graphics Array Plus
$resolution = "1152 x 864 (4:3) XGA+"
Case @DesktopWidth = 1280 And @DesktopHeight = 720; Wide eXtended Graphics Array
$resolution = "1280 x 720 (16:9) HD Ready"
Case @DesktopWidth = 1280 And @DesktopHeight = 768; Wide eXtended Graphics Array
$resolution = "1280 x 768 (15:9) WXGA"
Case @DesktopWidth = 1280 And @DesktopHeight = 800; Wide eXtended Graphics Array
$resolution = "1280 x 800 (16:10) WXGA"
Case @DesktopWidth = 1280 And @DesktopHeight = 960; Super eXtended Graphics Array
$resolution = "1280 x 960 (4:3) SXGA"
Case @DesktopWidth = 1280 And @DesktopHeight = 1024; Super eXtended Graphics Array
$resolution = "1280 x 1024 (5:4) SXGA"
Case @DesktopWidth = 1360 And @DesktopHeight = 768; Wide eXtended Graphics Array
$resolution = "1360 x 768 (16:9) WXGA"
Case @DesktopWidth = 1366 And @DesktopHeight = 768; High Definition (720p)
$resolution = "1366 x 768 (16:9) HD [720p]"
Case @DesktopWidth = 1440 And @DesktopHeight = 900; Wide Super eXtended Graphics Array
$resolution = "1440 x 900 (16:10) WSXGA"
Case @DesktopWidth = 1400 And @DesktopHeight = 1050; Wide Super eXtended Graphics Array
$resolution = "1440 x 900 (16:10) WSXGA"
Case @DesktopWidth = 1600 And @DesktopHeight = 900; High Definition Plus (900p)
$resolution = "1600 x 900 (16:9) HD+ [900p]"
Case @DesktopWidth = 1600 And @DesktopHeight = 1200; Ultra eXtended Graphics Array
$resolution = "1600 x 1200 (4:3) UXGA"
Case @DesktopWidth = 1680 And @DesktopHeight = 1050; Wide Super eXtended Graphics Array Plus
$resolution = "1680 x 1050 (16:10) WSXGA+"
Case @DesktopWidth = 1920 And @DesktopHeight = 1080; Full High Definition (1080p)
$resolution = "1920 x 1080 (16:9) HD [1080p]"
Case @DesktopWidth = 1920 And @DesktopHeight = 1200; Wide Ultra eXtended Graphics Array
$resolution = "1920 x 1200 (16:10) WUXGA"
Case @DesktopWidth = 1920 And @DesktopHeight = 1400; Tesselar eXtended Graphics Array
$resolution = "1920 x 1400 (48:35) TXGA"
Case @DesktopWidth = 2048 And @DesktopHeight = 1080; Digital Film Projection
$resolution = "2048 x 1080 (19:10) 2K"
Case @DesktopWidth = 2048 And @DesktopHeight = 1152; Quad Wide eXtended Graphics Array
$resolution = "2048 x 1152 (4:3) QWXGA"
Case @DesktopWidth = 2048 And @DesktopHeight = 1536; Quad eXtended Graphics Array
$resolution = "2048 x 1536 (4:3) QXGA"
Case @DesktopWidth = 2538 And @DesktopHeight = 1080; Wide Projector
$resolution = "2538 x 1080 (47:20) Wide Projector"
Case @DesktopWidth = 2560 And @DesktopHeight = 1080; Cinema TV
$resolution = "2560 x 1080 (64:27) Cinema TV"
Case @DesktopWidth = 2560 And @DesktopHeight = 1440; Wide Quad High Definition
$resolution = "2560 x 1440 (16:9) WQHD"
Case @DesktopWidth = 2560 And @DesktopHeight = 1600; Wide Quad eXtended Graphics Array
$resolution = "2560 x 1600 (16:10) WQXGA"
Case @DesktopWidth = 2560 And @DesktopHeight = 2048; Quad Super eXtended Graphics Array
$resolution = "2560 x 2048 (5:4) QSXGA"
Case @DesktopWidth = 2880 And @DesktopHeight = 900; Dell Alienware
$resolution = "2880 x 900 (16:5) Curved Display"
Case @DesktopWidth = 3200 And @DesktopHeight = 2048; Wide Quad Super eXtended Graphics Array
$resolution = "3200 x 2048 (25:16) WQSXGA"
Case @DesktopWidth = 3200 And @DesktopHeight = 2400; Quad Ultra eXtended Graphics Array
$resolution = "3200 x 2048 (4:3) QUXGA"
Case @DesktopWidth = 3840 And @DesktopHeight = 2160; Quad Full High Definition
$resolution = "3840 x 2160 (16:9) QFHD"
Case @DesktopWidth = 3840 And @DesktopHeight = 2400; Wide Quad Ultra eXtended Graphics Array
$resolution = "3840 x 2048 (16:10) WQUXGA"
Case @DesktopWidth = 4096 And @DesktopHeight = 1716; Digital Film Projection
$resolution = "4096 x 1716 (2:39) 4K"
Case @DesktopWidth = 4096 And @DesktopHeight = 3072; Hex[adecatuple] eXtended Graphics Array
$resolution = "4096 x 3072 (4:3) HXGA"
Case @DesktopWidth = 5120 And @DesktopHeight = 3200; Wide Hex[adecatuple] Extended Graphics Array
$resolution = "5120 x 3200 (16:10) WHXGA"
Case @DesktopWidth = 5120 And @DesktopHeight = 4096; Hex[adecatuple] Super eXtended Graphics Array
$resolution = "5120 x 4096 (5:4) HSXGA"
Case @DesktopWidth = 6400 And @DesktopHeight = 4096; Wide Hex[adecatuple] Super eXtended Graphics Array
$resolution = "6400 x 4096 (25:16) WHSXGA"
Case @DesktopWidth = 6400 And @DesktopHeight = 4800; Hex[adecatuple] Ultra eXtended Graphics Array
$resolution = "6400 x 4800 (4:3) HUXGA"
Case @DesktopWidth = 7680 And @DesktopHeight = 4320; Ultra High Definition Television
$resolution = "7680 x 4320 (16:9) UHDT"
Case @DesktopWidth = 7680 And @DesktopHeight = 4800; Wide Hex[adecatuple] Ultra eXtended Graphics Array
$resolution = "7680 x 4800 (16:10) WHUXGA"
Case Else
Return SetError(1, 0, $resolution)
EndSwitch
Return $resolution
EndFunc ;==>_Desktop_Resolution
จากโคด จะได้ประมาณ ว่า ผมจะดึง โปรแกรม Radmin มาแทน Ie น่ะครับ โค้ดจากด้านบนเป็นโค้ดเก่าของผมเอง
ซึ่งผมสามารถทำให้ดึงโปรแกรม Radmin มาแสดงตามตำแหน่งที่ต้องการได้แล้วครับ
แต่ที่ผมทำไม่ได้คือผมต้องการคือ ทำการเลือก Ipaddress ตามที่ผมต้องการให้อัตโนมัติและทำการ ใส่ user , password และทำการ Login เองด้วยอ่ะครับ
นี้คือที่ผมต้องการ
ยังไงก็ขอบคุณสำหรับตัวอย่างน่ะคัรบเด่ว ผมจะเอาไปใช้ศึกษาต่อยอดด ต่อ แต่มีแนวทางอะไร รบกวนบอกดว้ยน๊าคัรบ ขอบคุณครับ