Results 1 to 2 of 2

Thread: Start Menu Items Enable/Disable

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Location
    Bombay,India
    Posts
    5

    Post

    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

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    You can modify the contents of the Start Menu directory. Here's how to retrieve its name:

    Code:
    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: [email protected]
    ICQ: 19552879



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width