.net – 在TaskBar中隐藏工作进程的图标

.net – 在TaskBar中隐藏工作进程的图标,第1张

概述如何在vb.net的任务栏中隐藏工作过程的图标? Dim startInfo As New ProcessStartInfo("Some Process")startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden 'he hide only window of process'startInfo.ShowInTas 如何在vb.net的任务栏中隐藏工作过程的图标?

Dim startInfo As New processstartinfo("Some Process")startInfo.windowstyle = System.Diagnostics.Processwindowstyle.HIDden 'he hIDe only window of process'startInfo.ShowInTaskbar = False 'don't work with System.Diagnostics and processstartinfoPr = System.Diagnostics.Process.Start(startInfo)

我需要隐藏任务栏上的窗口和图标.
请帮忙.

解决方法 我发现 this post试图解决同样的问题:

imports System.Diagnosticsimports System.Runtime.InteropServicesimports System.windows.FormsModule Module1    Public GWL_EXSTYLE As Integer = -20    Public WS_EX_APPWINDOW As Integer = &H40000    <Dllimport("user32.dll")> _    Public Function getwindowlong(ByVal hWnd As IntPtr,ByVal nIndex As Integer) As Integer    End Function    <Dllimport("user32.dll")> _    Public Function SetwindowLong(ByVal hWnd As IntPtr,ByVal nIndex As Integer,ByVal DWNewLong As Integer) As Integer    End Function    <Dllimport("user32.dll",SetLastError:=True)> _    Public Function SetParent(ByVal hWndChild As IntPtr,ByVal hWndNewParent As IntPtr) As IntPtr    End Function    Sub Main()        ' Start your process        Dim startInfo As New processstartinfo("YourProcessname")        startInfo.windowstyle = System.Diagnostics.Processwindowstyle.HIDden        Dim p as Process = System.Diagnostics.Process.Start(startInfo)                    ' HIDe the process from the task bar        Dim style As Integer = (getwindowlong(p.MainWindowHandle,GWL_EXSTYLE) And Not WS_EX_APPWINDOW)        SetwindowLong(p.MainWindowHandle,GWL_EXSTYLE,style)        SetParent(p.MainWindowHandle,New Form().Handle)    End SubEnd Module
总结

以上是内存溢出为你收集整理的.net – 在TaskBar中隐藏工作进程的图标全部内容,希望文章能够帮你解决.net – 在TaskBar中隐藏工作进程的图标所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1222277.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)

保存