網路上的版本似乎都不太令人滿意的說=w=
VB.net版本,前兩句要放在類別或模組的地方,最後一句要放在Form_Load或Form_Shown事件裡
Public Declare Auto Function SetWindowLong Lib "User32.Dll" (ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer
Public Declare Auto Function GetWindowLong Lib "User32.Dll" (ByVal hWnd As System.IntPtr, ByVal nIndex As Integer) As Integer
SetWindowLong(Me.Handle, -20, GetWindowLong(Me.Handle, -20) Or &H80 And Not &H40000)
C#版本,同上:
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
SetWindowLong(this.Handle, -20, GetWindowLong(this.Handle, -20) | 0x80 & !0x40000);
小小關鍵字?(C# VB.net VB 2005 VB2008 不顯示在Alt+Tab清單|Alt+Tab不顯示)