| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1685 人关注过本帖
标题:帮助,请将prg编为可视表单,谢谢!
取消只看楼主 加入收藏
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1735
专家分:3329
注 册:2012-2-29
结帖率:93.55%
收藏
已结贴  问题点数:20 回复次数:6 
帮助,请将prg编为可视表单,谢谢!
请将下列代码改为可视表单,VFP播放Flash的,谢谢!
因我的电脑无法上传两个文件:vfp2c.h、vfp2c32.fll。
请给一个操作说明、或表单示例,特别是红色部分,非常感谢!
附代码:
PUBLIC goFlashForm
goFlashForm = CREATEOBJECT("FlashForm")
goFlashForm.Show()

DEFINE CLASS FlashForm AS Form
    Width = 412
    Height = 306
    FlashCount = 0
    DIMENSION FlashHandler[1]
    Callback = NULL
   
    ADD OBJECT oleFlash0 AS OleControl WITH OleClass = "ShockwaveFlash.ShockwaveFlash.9",;
        Width = 335,;
        Height =275,;
        Left = 11,;
        Top =  11
   
    PROCEDURE Init
        #DEFINE GW_CHILD 5
        #DEFINE GWL_WNDPROC -4
        PRIVATE loFlash, lcPath, lnHwnd, lnHandler, i
        LOCAL loFlash, lcPath, lnHWnd, lnHandler, i
        THIS.DeclareDlls()
        lcPath = ADDBS(ALLTRIM(JUSTPATH(SUBSTR(SYS(16),AT("INIT", SYS(16)) + 5))))
        FOR EACH loFlash AS OleControl IN THIS.Controls
            loFlash.Movie = lcPath + "外婆的澎湖湾.swf"
            loFlash.Play
        ENDFOR
        lnHandler = 0
        THIS.FlashCount = 0
        IF THIS.ShowWindow = 2
            lnHWnd = GetWindow(THIS.HWnd, GW_CHILD)
        ELSE
            lnHWnd = THIS.HWnd
        ENDIF
        DO WHILE .T.
            lnHandler = FindWindowEx(lnHWnd, lnHandler,"MacromediaFlashPlayerActiveX", NULL)
            IF lnHandler = 0
                EXIT
            ENDIF
            THIS.FlashCount = THIS.FlashCount + 1
            DIMENSION THIS.FlashHandler[THIS.FlashCount]
            THIS.FlashHandler[THIS.FlashCount] = lnHandler
        ENDDO
        IF THIS.FlashCount > 0
            THIS.Callback = CREATEOBJECT("CallbackFunction")
            DIMENSION THIS.Callback.PrevWndFunc[THIS.FlashCount, 2]
            FOR i = 1 TO THIS.FlashCount
                THIS.Callback.PrevWndFunc[i,1] = THIS.FlashHandler[i]
                THIS.Callback.PrevWndFunc[i,2] = SetWindowLong(THIS.FlashHandler[i],GWL_WNDPROC,THIS.Callback.Address)
            ENDFOR
        ENDIF
    ENDPROC
   
    PROCEDURE DeclareDlls
        DECLARE Integer GetWindow IN USER32 Integer,Integer
        DECLARE Integer FindWindowEx IN USER32 Integer,Integer,String,String
        DECLARE Integer SetWindowLong IN USER32 Integer,Integer,Integer
    ENDPROC

    PROCEDURE Unload
        THIS.Callback = NULL
    ENDPROC

ENDDEFINE

DEFINE CLASS CallbackFunction AS Custom
    #INCLUDE "vfp2c.h"
    Address = 0
    DIMENSION PrevWndFunc[1,2]
   
    PROCEDURE Init
        LPARAMETERS tcPath
        THIS.DeclareDlls()
        SET LIBRARY TO IIF(EMPTY(tcPath) = .T., "vfp2c32.fll",ADDBS(tcPath) + "vfp2c32.fll") ADDITIVE
        INITVFP2C32(VFP2C_INIT_CALLBACK)
        THIS.Address = CreateCallbackFunc("CallbackFunction","LONG", "LONG,;
 LONG, LONG, LONG", THIS)   
    ENDPROC

    PROCEDURE DeclareDlls
        DECLARE Integer CallWindowProc IN USER32 Integer,Integer,Integer,Integer,Integer
    ENDPROC
   
    PROCEDURE CallbackFunction
        LPARAMETERS hwnd, Msg, wParam, lParam
        PRIVATE lnIndex
        LOCAL lnIndex
        lnIndex = CEILING(ASCAN(THIS.PrevWndFunc, hwnd,1,ALEN(THIS.PrevWndFunc,1),1)/2)
        IF Msg = WM_RBUTTONDOWN
            RETURN 0
        ENDIF
        RETURN CallWindowProc(THIS.PrevWndFunc[lnIndex,2],hwnd, Msg, wParam, lParam)
    ENDPROC
   
    PROCEDURE Destroy
        IF THIS.AddRess <> 0
            DestroyCallbackFunc(THIS.Address)
        ENDIF
    ENDPROC
ENDDEFINE
搜索更多相关主题的帖子: PUBLIC Flash 
2016-11-08 15:07
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1735
专家分:3329
注 册:2012-2-29
收藏
得分:0 
好的,谢谢!我试一下,有问题再请教版主!
2016-11-08 16:39
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1735
专家分:3329
注 册:2012-2-29
收藏
得分:0 
版主,请帮忙哦,我确实做不出来表单、类哦,请帮忙,帮我做一个,好吗、谢谢!
2016-11-09 07:35
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1735
专家分:3329
注 册:2012-2-29
收藏
得分:0 
好的,谢谢!
2016-11-09 10:47
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1735
专家分:3329
注 册:2012-2-29
收藏
得分:0 
版主:
自定义类中的下面部分代码,该写在类的哪里?谢谢!
  #INCLUDE "vfp2c.h"
  Address = 0
  DIMENSION PrevWndFunc[1, 2]
2016-11-09 11:04
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1735
专家分:3329
注 册:2012-2-29
收藏
得分:0 
版主:
自定义类中的下面部分代码,该写在类的哪里?谢谢!
  #INCLUDE "vfp2c.h"
  Address = 0
  DIMENSION PrevWndFunc[1, 2]

这是我制作的类,请帮我修改一下,谢谢版主!
callbackfunction.rar (1.87 KB)
2016-11-09 11:10
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1735
专家分:3329
注 册:2012-2-29
收藏
得分:0 
这是
vfp2c.rar (5.53 KB)
2016-11-09 11:10
快速回复:帮助,请将prg编为可视表单,谢谢!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024175 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved