请问怎么通过API函数获取正在运行的程序的标题栏的内容,包括图标和文字?

fishflywithbird 2004-11-22 04:01:56
我想请问一下高手:
1、请问怎么通过API函数获取正在运行的程序的标题栏的内容,包括图标(icon)和文字?
2、能够修改这些文字还有图标(icon)
...全文
152 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fishflywithbird 2004-11-30
  • 打赏
  • 举报
回复
好像是你说得那样!就算是可以修改app.name什么的,但是不能修改icon!看了一下API好像也没有好的办法!郁闷!
再到这个周末,没有高手能够帮忙,那就结帖给分!
limitworld 2004-11-29
  • 打赏
  • 举报
回复
图标可能不能动态修改的吧。
fishflywithbird 2004-11-29
  • 打赏
  • 举报
回复
谢谢!
请问一下怎么去修改icon呢?
nanshenvip 2004-11-22
  • 打赏
  • 举报
回复
得到当前运行的程序:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Const GW_CHILD = 5
Private Const GW_HWNDNEXT = 2
Sub xiao()
Dim ret As Long
Dim hwnd As Long
Dim str As String * 256
ret = GetDesktopWindow()
hwnd = GetWindow(ret, GW_CHILD)
Do While hwnd <> 0
GetWindowText hwnd, str, Len(str)
hwnd = GetWindow(hwnd, GW_HWNDNEXT)
If Left$(str, 1) <> vbNullChar Then
Form1.List1.AddItem str
End If
Loop
End Sub

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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