预览加载中,请您耐心等待几秒...
在线预览结束,喜欢就下载吧,查找使用更方便
如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
精选范本,供参考!
精选范本,供参考!
精选范本,供参考!
VB制作幻灯片随机点名工具
大家好,我是丶灬尛坏坏"
注:此程序适用于学校班级实用,
此文是原创,转载请标明出处,
本次教程:这个在powerpoint里,完全和powerpoint结合起来,我简单写了一下,新建一个vb程序,在窗体上放一个label,一个timer和一个按钮,timer的interval设置为1,Enable设置为False。
源码(不解释,自己研究):
Dima(0To9)AsString
PrivateSubCommand1_Click()Timer1.Enabled=NotTimer1.EnabledEndSub
PrivateSubForm_Load()SetHotkeyMe.hwnd,1,0,vbKeyHome,"Add"a(0)="张三"a(1)="李四"a(2)="王五"a(3)="刘六"a(4)="牛七"a(5)="马八"a(6)="HYPERLINK"http://wenwen.soso.com/z/Search.e?sp=S%E6%9D%A8%E4%B9%9D&ch=w.search.yjjlink&cid=w.search.yjjlink"\t"_blank"杨九"a(7)="苟十"a(8)="朱十一"a(9)="吕十二"EndSub
PrivateSubForm_Unload(CancelAsInteger)SetHotkeyMe.hwnd,1,0,0,"Del"EndSub
PrivateSubTimer1_Timer()DimiAsIntegeri=Int(Rnd*10)Label1.Caption=a(i)Label1.Tag=iEndSub
新建一个模块,写入以下代码
PrivateDeclareFunctionSetWindowLongLib"user32"Alias"SetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLongPrivateDeclareFunctionGetWindowLongLib"user32"Alias"GetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong)AsLongPrivateDeclareFunctionCallWindowProcLib"user32"Alias"CallWindowProcA"(ByVallpPrevWndFuncAsLong,ByValhwndAsLong,ByValMsgAsLong,ByValwParamAsLong,ByVallParamAsLong)AsLongPrivateDeclareFunctionRegisterHotKeyLib"user32"(ByValhwndAsLong,ByValidAsLong,ByValfskey_ModifiersAsLong,ByValvkAsLong)AsLongPrivateDeclareFunctionUnregisterHotKeyLib"user32"(ByValhwndAsLong,ByValidAsLong)AsLongPublicDeclareFunctionShowWindowLib"user32"(ByValhwndAsLong,ByValnCmdShowAsLong)AsLongPublicDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)PublicDeclareFunctionSendMessageLib"user32"Alias"SendMessageA"(ByValhwndAsLong,ByValwMsgAsLong,ByValwParamAsLong,lParamAsAny)AsLongPublicDeclareFunctionSetForegroundWindowLib"user32"(ByValhwndAsLong)AsLong
ConstSW_HIDE=0ConstSW_SHOW=5ConstWM_HOTKEY=&H312ConstMOD_ALT=&H1ConstMOD_CONTROL=&H2ConstMOD_SHIFT=&H4ConstGWL_WNDPROC=(-4)'窗口函数的地址DimFormIsShowingAsBooleanDimkey_preWinProcAsLong'用来保存窗口信息Dimkey_IsWinAddressAsBoolean'是否取得窗