我已经用Google搜索了有关如何执行此 *** 作的信息,但我没有找到任何内容.
UPDATE :
这是我在VB.NET中尝试翻译由Robert评论给出的网址的C#示例,但我不知道如何继续它.
imports System.Runtime.InteropServicesPublic Class Form1 Public Declare Function FinDWindow lib "user32.dll" Alias "FinDWindowA" (ByVal lpClassname As String,ByVal lpWindowname As String) As Long Public Declare Function findwindowex lib "user32.dll" Alias "findwindowexA" (ByVal hWndParent As IntPtr,ByVal hWndChildAfter As IntPtr,ByVal lpClassname As String,ByVal lpWindowname As String) As IntPtr Public Shared Function WindowHandle(sTitle As String) As Long Return FinDWindow(vbNullString,sTitle) End Function Private Shared Function GetSystemTrayHandle() As IntPtr Dim hWndTray As IntPtr = FinDWindow("Shell_TrayWnd",nothing) If hWndTray <> IntPtr.Zero Then hWndTray = findwindowex(hWndTray,IntPtr.Zero,"TrayNotifyWnd",nothing) If hWndTray <> IntPtr.Zero Then hWndTray = findwindowex(hWndTray,"SysPager",nothing) If hWndTray <> IntPtr.Zero Then hWndTray = findwindowex(hWndTray,"ToolbarWindow32",nothing) Return hWndTray End If End If End If Return IntPtr.Zero End Function Private Sub button1_Click(sender As Object,e As EventArgs) Handles button1.Click MsgBox(WindowHandle("Steam")) ' 6687230 MsgBox(GetSystemTrayHandle()) ' 62789 End SubEnd Class解决方法 您应该阅读 this代码项目文章. 总结
以上是内存溢出为你收集整理的c# – 图标存在于系统托盘中?全部内容,希望文章能够帮你解决c# – 图标存在于系统托盘中?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)