Guest User

Untitled

a guest
Dec 28th, 2011
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <INet.au3>
  2.  
  3. #include <GUIConstantsEx.au3>
  4. #include <GuiRichEdit.au3>
  5. #include <GuiStatusBar.au3>
  6. #include <WindowsConstants.au3>
  7.  
  8. Opt('MustDeclareVars', 1)
  9.  
  10. Global Const $NAME = 'TerrariaServe'
  11. Global Const $VERSION = '20111228'
  12.  
  13. Global $sFont = 'Lucida Console'
  14.  
  15. ; -------------------------------------------------------------------------
  16. Global $hGUI = GUICreate($NAME & ' v' & $VERSION, 400, 300 + 23, Default, Default, $WS_OVERLAPPEDWINDOW)
  17. TraySetToolTip($NAME & ' v' & $VERSION)
  18.  
  19. Global $hRich = _GUICtrlRichEdit_Create($hGUI, '', 5, 5, 390, 265, BitOR($ES_MULTILINE, $ES_READONLY, $WS_VSCROLL))
  20.  
  21. Global $hInput = GUICtrlCreateInput('', 5, 275, 390, 20)
  22. GUICtrlSetResizing($hInput, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)
  23. GUICtrlSetFont($hInput, 8.5, Default, Default, $sFont)
  24. Local $aAccel[1][2] = [['{ENTER}', $hInput]]
  25. GUISetAccelerators($aAccel)
  26.  
  27. Global $hStatus = _GUICtrlStatusBar_Create($hGUI)
  28. _GUICtrlStatusBar_SetUnicodeFormat($hStatus, True)
  29. Local $aStatusParts[4] = [140, 205, 270, -1]
  30. _GUICtrlStatusBar_SetParts($hStatus, $aStatusParts)
  31. _GUICtrlStatusBar_SetIcon($hStatus, 0, _WinAPI_LoadShell32Icon(7))
  32. _GUICtrlStatusBar_SetIcon($hStatus, 1, _WinAPI_LoadShell32Icon(6))
  33. _GUICtrlStatusBar_SetIcon($hStatus, 2, _WinAPI_LoadShell32Icon(8))
  34. _GUICtrlStatusBar_SetIcon($hStatus, 3, _WinAPI_LoadShell32Icon(5))
  35.  
  36. _GUICtrlStatusBar_SetText($hStatus, _GetIP(), 0)
  37. _GUICtrlStatusBar_SetText($hStatus, 'b', 1)
  38. _GUICtrlStatusBar_SetText($hStatus, 'c', 2)
  39. _GUICtrlStatusBar_SetText($hStatus, 'd', 3)
  40.  
  41. GUISetState()
  42. ; -------------------------------------------------------------------------
  43.  
  44.  
  45. While 1
  46.     Switch GUIGetMsg()
  47.         Case $GUI_EVENT_CLOSE
  48.             ExitLoop
  49.     EndSwitch
  50.  
  51.     ConsoleWrite('Get/Set' & @CRLF)
  52.     ConsoleWrite('Get: ' & _GUICtrlStatusBar_GetText($hStatus, 0) & @CRLF)
  53. ;~  ConsoleWrite('Set: ' & _GUICtrlStatusBar_SetText($hStatus, @MSEC, 0) & @CRLF)
  54.  
  55.     Sleep(1000)
  56. WEnd
RAW Paste Data