PDA

Click to See Complete Forum and Search --> : Start Menu Items Enable/Disable


Vipul Shah
Oct 31st, 1999, 12:25 PM
Hi,

I want to make certain menus in the START MENU to
be Disabled & then Enabled as per need

Kindly let me know the solution.

Thanking you
regards

Vipul Shah

Yonatan
Nov 1st, 1999, 11:56 AM
You can modify the contents of the Start Menu directory. Here's how to retrieve its name:


Option Explicit

Private Declare Function SHGetSpecialFolderLocation Lib "shell32" (ByVal hWndOwner As Long, ByVal nFolder As Long, ppIDL As Long) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" Alias "SHGetPathFromIDListA" (ByVal pIDL As Long, ByVal pszPath As String) As Long


Private Const CSIDL_STARTMENU = &HB
Private Const MAX_PATH As Integer = 260


Function GetStartMenuPath() As String
Dim iPos As Integer
Dim pIDL As Long ' Pointer to ID List
Call SHGetSpecialFolderLocation(0, CSIDL_STARTMENU, pIDL)
GetStartMenuPath = String(MAX_PATH, vbNullChar)
Call SHGetPathFromIDList(pIDL, GetStartMenuPath)
iPos = InStr(GetStartMenuPath, vbNullChar)
If iPos > 0 Then GetStartMenuPath = Left(GetStartMenuPath, iPos - 1)
End Function

Usage:

Dim S As String
S = GetStartMenuPath

------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)