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)
我需要隐藏任务栏上的窗口和图标.
请帮忙.
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中隐藏工作进程的图标所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)