哪个API可以代替RESIZE啊?要在得到SIZE,但没有刷新屏幕时候的事件。

tanyx 2003-08-22 10:23:10
RESIZE事件在刷新屏幕后才发生,不好,不理想,API有什么办法?
...全文
102 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
900126 2003-09-28
  • 打赏
  • 举报
回复
其实API并不比VB本身功能速度更快。
道素 2003-08-22
  • 打赏
  • 举报
回复
发送WM_SIZE 消息
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Const SIZE_RESTORED As Long = 0
Private Const WM_SIZE As Long = &H5


Private Sub Command1_Click()
Call SendMessage(Me.hWnd, WM_SIZE, ByVal SIZE_RESTORED, ByVal MakeDWord(5000, 5000))

End Sub

Public Function MakeDWord(ByVal LoWord As Integer, ByVal HiWord As Integer) As Long
MakeDWord = (HiWord * &H10000) Or (LoWord And &HFFFF&)
End Function
道素 2003-08-22
  • 打赏
  • 举报
回复
显示隐藏任务栏 桌面
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal fEnable As Long) As Long

Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Dim isVisual As Boolean


Public Sub ApplicationBar(Visible As Boolean)
Dim hWnd As Long

hWnd = FindWindow("Shell_TrayWnd", "")
If Visible Then
ShowWindow hWnd, SW_SHOW
Else
ShowWindow hWnd, SW_HIDE
End If
EnableWindow hWnd, Visible
End Sub

Public Sub Desktop(Visible As Boolean)
Dim hWnd As Long

hWnd = FindWindow("Progman", "Program Manager")
If Visible Then
ShowWindow hWnd, SW_SHOW
Else
ShowWindow hWnd, SW_HIDE
End If
EnableWindow hWnd, Visible
End Sub

Private Sub Command1_Click()
ApplicationBar isVisual
isVisual = Not isVisual
End Sub
tanyx 2003-08-22
  • 打赏
  • 举报
回复
还有啊,在任务栏隐藏时,哪个API函数可以得到任务栏弹出呢?
tanyx 2003-08-22
  • 打赏
  • 举报
回复
错了,不是要显示和隐藏任务栏,而是在任务栏自动隐藏时,能得到通知。
第二个程序没看明白,执行没结果。

6,898

社区成员

发帖
与我相关
我的任务
社区描述
《新程序员》读者俱乐部
其他 其他
社区管理员
  • 《程序员》杂志社区
  • SoftwareTeacher
  • 《新程序员》编辑部
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧