ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Hide menu in Start Menu

<< < (2/6) > >>

skrommel:
 :) Here's a listview version, HideStartmenuFolders!

Easily hide starmenu folders.
Just toggle a checkbox to change the visibility.
Edit the doubleclick action to change from opening the folder in Explorer or toggeling the hidden state.
Click Restart Explorer to rebuild the Starmenu.

Skrommel @ 2008



--- ---;HideStartmenuFolders.ahk
; Easily hide starmenu folders.
; Just toggle a checkbox to change the visibility.
; Edit the doubleclick action to change from opening the folder in Explorer or toggeling the hidden state.
; Click Restart Explorer to rebuild the Starmenu.
;Skrommel @ 2008

;Settings - changes doubleclick action
doubleclick=Explore ; Toggle

#NoEnv
#SingleInstance,Force
SetBatchLines,-1

applicationname=HideStartmenuFolders

Gui,Margin,0,0
Gui,+Resize
Gui,Add,Button,xm yp w50 GHIDE,&Hide
Gui,Add,Button,x+0 yp w50 GSHOW,&Show
Gui,Add,Button,x+10 yp W50 GDELETE,&Delete
Gui,Add,Button,x+10 yp w75 GREFRESH,&Refresh
Gui,Add,Button,x+0 yp GREBUILD,Restart &Explorer
Gui,Add,ListView,xm Vlistview GTOGGLE Checked AltSubmit,Hidden|Folder|Path|Old Attribute|New Attribute
Gui,Add,StatusBar,G1HOURSOFTWARE,% " www.1HourSoftware.com"

Gosub,REFRESH
Gui,Show,W600 H400,%applicationname%
OnExit,EXIT
changed=0
Return


TRAVERSE:
Loop,%startmenu%\*.*,1,1
{
  IfNotInString,A_LoopFileAttrib,D
    Continue
  IfInString,A_LoopFileAttrib,H
    LV_Add("Check","",A_LoopFileName,A_LoopFileLongPath,"H","H")
  Else
    LV_Add("UnCheck","",A_LoopFileName,A_LoopFileLongPath,"","")
}
Return


REFRESH:
LV_Delete()
building=1
startmenu:=A_StartMenu ;A_Programs
Gosub,TRAVERSE
startmenu:=A_StartMenuCommon ;A_ProgramsCommon
Gosub,TRAVERSE
building=0
LV_ModifyCol(1,"AutoHdr")
LV_ModifyCol(2,"AutoHdr")
LV_ModifyCol(3,"AutoHdr Sort")
LV_ModifyCol(4,0)
LV_ModifyCol(5,0)
Return


TOGGLE:
action:=ErrorLevel
If building=1
  Return

If (A_GuiEvent="ColClick" And A_EventInfo=1)
{
  LV_ModifyCol(5,"SortDesc")
  Return
}
Else
If (A_GuiEvent="I" And action="C")
{
  If (Asc(action)=Asc("C"))
    newattrib=+H
  Else
    newattrib=-H
}
Else
If (A_GuiEvent="DoubleClick")
{
  If doubleclick=Explore
  {
    LV_GetText(path,A_EventInfo,3)
    Run,Explorer.exe /e`,%path%
    Return
  }
  Else
  {
    row:=LV_GetNext(A_EventInfo-1,"C")
    If (row=A_EventInfo)
      LV_Modify(A_EventInfo,"-Check") 
    Else
      LV_Modify(A_EventInfo,"+Check") 
    Return
  }
}
Else
  Return

LV_GetText(path,A_EventInfo,3)
LV_GetText(origattrib,A_EventInfo,4)

FileSetAttrib,%newattrib%,%path%,1,0
FileGetAttrib,attrib,%path%
IfInString,attrib,H
  attrib=H
Else
  attrib=
LV_Modify(A_EventInfo,"Col5",attrib)
If (attrib<>origattrib)
  changed+=1
Else
  changed-=1
SB_SetText(" www.1HourSoftware.com       Changed folders: " changed)
Return


REBUILD:
Process,Close,Explorer.exe
Sleep,5000
Process,Exist,Explorer.exe
If ErrorLevel=0
  Run,Explorer.exe
Return


HIDE:
row=0
Loop
{
  row:=LV_GetNext(row,"")
  If row=0
    Break
  LV_Modify(row,"+Check") 
}
Return


SHOW:
row=0
Loop
{
  row:=LV_GetNext(row,"")
  If row=0
    Break
  LV_Modify(row,"-Check") 
}
Return


DELETE:
count=0
row=0
Loop
{
  row:=LV_GetNext(row,"")
  If row=0
    Break
  count+=1
}
If count=0
  Return

MsgBox,4,%applicationname%,Delete %count% folders?
IfMsgBox,No
 Return

row=0
Loop
{
  row:=LV_GetNext(row,"")
  If row=0
    Break
  LV_GetText(path,row,3)
  FileRecycle,%path%
  LV_Delete(row)
}
Return


1HOURSOFTWARE:
Run,www.1HourSoftware.com
Return


GuiSize:
If A_EventInfo<>1  ;not minimized
  GuiControl,Move,listview,% "W" A_GuiWidth " H" A_GuiHeight-45
Return


GuiClose:
GuiEscape:
Gui,Destroy
ExitApp


EXIT:
If changed<>0
  MsgBox,0,%applicationname%,You may have to log off to update the Startmenu
ExitApp

lanux128:
looks great, Skrommel! i just modified to add another column containing the "name" as separated from the "path" but somehow it's not working. i will go on poking into the source but is there any chance you could add this feature as well? :)

mouser:
Skrommel is on one of his coding snack binges i see  :-* :-* :-*

lanux128:
ok, i have fixed the problem with the additional column. :up: but just wondering why didn't you use AHK's built-in "A_StartMenu" & "A_StartMenuCommon" variable?

skrommel:
 :) Too busy programming to read the manual...

I've added another column and double click action to the script above.

Skrommel

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version