udbghdto 发表于 2011-7-24 22:23:27

内嵌IE字幕滚动。为什么在糸统部署时无法运行。有图片。

本帖最后由 udbghdto 于 2011-7-24 22:25 编辑

内嵌IE字幕滚动。为什么在糸统时无法运行
在AU3里面可以正常运行。编译成EXE。在糸统里也可以正常运行。
就是在GHOST糸统后部署时无法,出现错误“line 5263 子脚本使用非数组变量


会不会是糸统部署时不打开IE的问题。。

源码用的是“风行者”发的。。



这是恩远BBS的。
#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\AutoIt\图标\wucltux_1021.ico
#AutoIt3Wrapper_outfile=OEMGHOST.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <WinAPI.au3>
#include <IE.au3>
#include <WindowsConstants.au3>


Global $iMarquee_Loop       = 0
Global $sMarquee_Move       = "scroll"
Global $sMarquee_Direction= "left"
Global $iMarquee_Scroll   = 6
Global $iMarquee_Delay      = 85
Global $iMarquee_Border   = 0
Global $vMarquee_TxtCol   = Default
Global $sMarquee_BkCol      = Default
Global $sMarquee_FontFamily = "Tahoma"
Global $iMarquee_FontSize   = 12
Global $i = 0
Global $Array = ["white", "green", "blue", "red", "yellow"] ;字体颜色
$pos = WinGetPos("")
$Width = 322
$Height = 122
$Left = @DesktopWidth - 310 ;窗体位置
$Top = @DesktopHeight - 102 - $pos ;窗体位置

;~ $Jpg = "logo.jpg";LOGO图片要放在E盘并改名为123
;~ $oIE = _IECreateEmbedded()
;无边框,层叠窗口的属性

$gui = GUICreate("字幕滚动", $Width, $Height, $Left, $Top, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF) ;设置背景透明,层叠窗口才有效
GUICtrlCreateGroup("", 1, 1, 297, 97);外边框架位置及框架大小
WinSetOnTop("字幕滚动", "", 1);总在最前
;~ $obj = GUICtrlCreateObj($oIE,10, 15, 277, 47) ;图片窗体位置及框架大小
$Pic1 = GUICtrlCreatePic("C:\windows\system32\Devdel\logo.jpg", 10, 15, 277, 47)
;~ _IENavigate($oIE,$Jpg)
;~ $oIE.document.body.scroll="no"
_GUICtrlMarquee_SetScroll(Default, Default, Default, 1, 3) ;2是滚动的速度
_GUICtrlMarquee_SetDisplay(1, $Array[$i], 0xABCDEF)
$Marquee = _GUICtrlMarquee_Create("字幕滚动...字幕滚动 ", 10, 70, 277, 20)
_WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF)
;~ AdlibRegister ("SetFontColor",1000);此处多了;~表示颜色单一,如果去掉;~那么字体将变成有色文字
GUISetState()

Do
Until GUIGetMsg() = -3

Func SetFontColor()
      $i += 1
      If $i > 4 Then $i = 0
      $Marquee.document.body.style.color = $Array[$i]
EndFunc   ;==>SetFontColor


Func _GUICtrlMarquee_SetScroll( $iLoop = 0, $sMove = 'scroll', $sDirection = 'left', $iScroll = 6, $iDelay = 85)

    ; Errorcheck and set parameters
    If IsNumber($iLoop) Then $iMarquee_Loop = Int(Abs($iLoop))

    Switch $sMove
      Case 'alternate', 'slide'
            $sMarquee_Move = $sMove
      Case Else
            $sMarquee_Move = 'scroll'
    EndSwitch

    Switch $sDirection
      Case 'right', 'up', 'down'
            $sMarquee_Direction = $sDirection
      Case Else
            $sMarquee_Direction = 'left'
    EndSwitch

    If IsNumber($iScroll) Then $iMarquee_Scroll = Int(Abs($iScroll))

    If IsNumber($iDelay) Then $iMarquee_Delay = Int(Abs($iDelay))

EndFunc ;=> _GUICtrlMarquee_SetScroll

; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlMarquee_SetDisplay
; Description ...: Sets display parameters for subsequent _GUICtrlCreateMarquee calls
; Syntax.........: _GUICtrlMarquee_SetDisplay([$iBorder, [$vTxtCol, [$vBkCol, [$iPoint, [$sFont]]]])
; Parameters ....: $iBorder - 0 = None (Default), 1 = 1 pixel, 2 = 2 pixel, 3 = 3 pixel
;                  $vTxtCol - Colour for text (Default = system colour, -1 = unchanged)
;                  $vBkCol- Colour for Marquee (Default = system colour, -1 = unchanged)
;                           Colour can be passed as RGB value or as one of the following strings:
;                              'black', 'gray', 'white', 'silver', 'maroon', 'red', 'purple', 'fuchsia',
;                              'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua'
;                  $iPoint- Font size (Default = 12, -1 = unchanged)
;                  $sFont   - Font to use (Default = Tahoma, "" = unchanged)
; Return values .: Success - Returns 0.
; Author ........: Melba 23, based on some original code by james3mg, trancexx and jscript "FROM BRAZIL"
; Related .......: _GUICtrlMarquee_Create, _GUICtrlMarquee_SetScroll, ObjCreate
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================

Func_GUICtrlMarquee_SetDisplay($iBorder = Default, $vTxtCol = Default, $vBkCol = Default, $iPoint = Default, $sFont = Default)

    ; Errorcheck and set parameters
    Select
      Case $iBorder = Default
            $iMarquee_Border = 0
      Case $iBorder >= 0 And $iBorder <= 3
            $iMarquee_Border = Int(Abs($iBorder))
      Case Else
    EndSelect

    Select
      Case $vTxtCol = Default
            $vMarquee_TxtCol = _WinAPI_GetSysColor($COLOR_WINDOWTEXT)
      Case IsNumber($vTxtCol) = 1
            If $vTxtCol >= 0 And $vTxtCol <= 0xFFFFFF Then $vMarquee_TxtCol = Int($vTxtCol)
      Case Else
            $vMarquee_TxtCol = $vTxtCol
    EndSelect

    Select
      Case $vBkCol = Default
            $sMarquee_BkCol = _WinAPI_GetSysColor($COLOR_WINDOW)
      CaseIsNumber($vBkCol) = 1
            If $vBkCol >= 0 And $vBkCol <= 0xFFFFFF Then $sMarquee_BkCol = Int($vBkCol)
      Case Else
            $sMarquee_BkCol = $vBkCol
    EndSelect

    Select
      Case $iPoint = Default
            $iMarquee_FontSize = 12
      Case $iPoint = -1
      Case Else
            If IsNumber($iPoint) Then $iMarquee_FontSize = Int(Abs($iPoint / .75))
    EndSelect

    Select
      Case $sFont = Default
            $sMarquee_FontFamily = "Tahoma"
      Case $sFont = ""
      Case Else
            If IsString($sFont) Then $sMarquee_FontFamily = $sFont
    EndSelect

EndFunc ;=> _GUICtrlMarquee_SetDisplay

; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlMarquee_Create
; Description ...: Creates a marquee Label control for the GUI
; Syntax.........: _GUICtrlMarquee_Create( $sText, $iLeft, $iTop, $iWidth, $iHeight, [$sTipText])
; Parameters ....: $sText   - The text (or HTML markup) the marquee should display.
;                  $iLeft   - The Left side of the control. If -1 is used then left will be computed according to GUICoordMode.
;                  $iTop    - The Top of the control. If -1 is used then left will be computed according to GUICoordMode.
;                  $iWidth- The width of the control.
;                  $iHeight - The height of the control.
;                  $sTipTxt - Tip text displayed when mouse hovers over the control.
; Return values .: Success - Returns the identifier (controlID) of the new Marquee control.
;                  Failure - Returns 0
; Author ........: james3mg, trancexx and jscript "FROM BRAZIL"
; Modified.......: Melba23
; Remarks .......: This function attempts to embed an 'ActiveX Control' or a 'Document Object' inside the GUI.
;                  The GUI functions GUICtrlRead and GUICtrlSet have no effect on this control. The object can only be
;                  controlled using 'methods' or 'properties' on the $ObjectVar.
; Related .......: _GUICtrlMarquee_SetDisplay, _GUICtrlMarquee_SetScroll, ObjCreate
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================

Func _GUICtrlMarquee_Create($sText, $iLeft, $iTop, $iWidth, $iHeight, $sTipText = "")

    ; Declar Local variables
    Local $oShell, $iCtrlID

    $oShell = ObjCreate("Shell.Explorer.2")
    If Not IsObj($oShell) Then Return SetError(1, 0, -1)

    $iCtrlID = GUICtrlCreateObj($oShell, $iLeft, $iTop, $iWidth, $iHeight)

    $oShell.navigate("about:blank")
    While $oShell.busy
      Sleep(100)
    WEnd

    With $oShell.document
      .write('<style>marquee{cursor: default}></style>')
      .write('<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ondragstart="return false" ondragover="return false">')
      .writeln('<marquee width=100% height=100%')
      .writeln("loop=" & $iMarquee_Loop)
      .writeln("behavior=" & $sMarquee_Move)
      .writeln("direction=" & $sMarquee_Direction)
      .writeln("scrollamount=" & $iMarquee_Scroll)
      .writeln("scrolldelay=" & $iMarquee_Delay)
      .write(">")
      .write($sText)
      .body.title = $sTipText
      .body.topmargin = 0
      .body.leftmargin = 0
      .body.scroll = "no"
      .body.style.color = $vMarquee_TxtCol
      .body.bgcolor = $sMarquee_BkCol
      .body.style.borderWidth = $iMarquee_Border
      .body.style.fontFamily = $sMarquee_FontFamily
      .body.style.fontSize = $iMarquee_FontSize
    EndWith

;~   Return $iCtrlID
      Return $oShell

EndFunc ;=> _GUICtrlMarquee_Create

lainline 发表于 2011-7-25 06:58:29

系统部署时 ie功能 还没装好吧试试吧需用DLL内置试试

hzxymkb 发表于 2011-7-25 10:04:03

你调用IE的估计是不行的!换个方法看看!

ayumi502 发表于 2011-7-25 12:42:13

可以调用 ie的 我的在部署中就没有问题~~~

joyue9 发表于 2011-7-25 18:36:47

顶起顶起顶起顶起

udbghdto 发表于 2011-7-26 18:50:52

回复 4# ayumi502


    可以给我一份源码吗。。

我的邮箱是:udbghdto@163.com

谢谢了。。

as86455011 发表于 2011-7-26 19:10:27

使用环境变量。应该是酱紫了。。。

楼上风云 发表于 2011-7-28 20:08:32

GHOST部署时IE有可能有缺陷或受破坏,无法正常支持

ROUSTAR31 发表于 2011-7-29 13:44:04

如果你压缩了全部PF文件夹,部署的时候调用IE,这个就不说了,悲剧撒

itljl 发表于 2011-7-29 21:22:36

将program文件夹先释放

autonet 发表于 2011-7-30 00:37:54

同意多数意见,应该是调用IE时,IE尚未正确安装或配置,导致调用报错。

inter702 发表于 2011-7-30 10:27:54

ghost ? ghost ?

872777825 发表于 2011-7-31 17:36:35

回复 1# udbghdto


    做系统封装都习惯性把软件目录 PF打包起来在部署时才解压,或许由于这个原因造成了IE的问题
可以选择使用DLL来实现试试

udbghdto 发表于 2011-8-1 09:58:18

回复 13# 872777825


    咋个用法呀。。DLL
页: [1]
查看完整版本: 内嵌IE字幕滚动。为什么在糸统部署时无法运行。有图片。