程序冲突!如何解决???
<P>Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long<BR>Private Const WS_EX_LAYERED = &H80000<BR>Private Const LWA_ALPHA = &H2<BR>Private Const GWL_EXSTYLE = (-20)<BR>Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long<BR>Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long<BR>Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long<BR>'我们将要调用的那个消息,在MSDN中搜索WM_SYSCOMMAND就可以找到具体说明<BR>Const WM_SYSCOMMAND = &H112<BR>'这个参数指明了我们让系统启动屏幕保护<BR>Const SC_SCREENSAVE = &HF140&<BR>Private Sub Command1_Click()<BR>SendMessage Me.hwnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0<BR>Me.Timer1.Enabled = False<BR>End Sub</P><P><BR>Private Sub Form_Load()<BR>Dim rtn As Long<BR> rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE) '取的窗口原先的样式<BR> rtn = rtn Or WS_EX_LAYERED ' 使窗体添加上新的样式WS_EX_LAYERED<BR> SetWindowLong Me.hwnd, GWL_EXSTYLE, rtn ' 把新的样式赋给窗体<BR> SetLayeredWindowAttributes Me.hwnd, 0, 200, LWA_ALPHA<BR>End Sub<BR></P>
<P>在vb里,这些程序如果在窗体里出现就会和Msgbox冲突,我试了好多次都没有用,版主帮忙解决一下!!!</P> <P>兄弟,你的代码可真有意思,窗体半透明,还启动屏保。。。。</P>
<P>在我这里和MSGBOX并不冲突,你能抓个错误图片放上来吗?</P>
<P>如果这里解决不了,就去CSDN吧,那里是纯VB编程的,专业性较强。。。。</P> <P>错误就是说我的“无效的调用过程或参数”!</P>
<P>我也好纳闷的,我只是看到帖子上有就拿来用,谁知道竟然报错!!</P>
<P>还望大侠支持帮助解决!!</P> <P>知道了,需要在Form上加上time控件和command控件,你添加了吗?</P> <P>添加了,可还是没有用。。。</P> <P>你说的那个错误是程序走到哪个语句时报的错啊?</P> <P>只要遇到Msgbox就报错。。</P>
<P>呵呵</P>
页:
[1]