Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than shell32, prefix the name with the module name and a period.
<DllImport("shell32.dll")> Shared Sub SHGetSetSettings(ByRef lpss As SHELLSTATE, ByVal dwMask As SSF, ByVal bSet As Boolean)
End Sub
User-Defined Types (C#):
[StructLayout(LayoutKind.Sequential)]
public struct SHELLSTATE {
public uint flags_1;
public uint dwWin95Unused;
public uint uWin95Unused;
public int lParamSort;
public int iSortDirection;
public uint version;
public uint uNotUsed;
public uint flags_2;
public bool fShowAllObjects {
get {return (flags_1 & 0x00000001u) == 0x00000001u;}
set {if (value) {flags_1 |= 0x00000001u;} else {flags_1 &= ~0x00000001u;}}
}
public bool fShowExtensions {
get {return (flags_1 & 0x00000002u) == 0x00000002u;}
set {if (value) {flags_1 |= 0x00000002u;} else {flags_1 &= ~0x00000002u;}}
}
public bool fNoConfirmRecycle {
get {return (flags_1 & 0x00000004u) == 0x00000004u;}
set {if (value) {flags_1 |= 0x00000004u;} else {flags_1 &= ~0x00000004u;}}
}
public bool fShowSysFiles {
get {return (flags_1 & 0x00000008u) == 0x00000008u;}
set {if (value) {flags_1 |= 0x00000008u;} else {flags_1 &= ~0x00000008u;}}
}
public bool fShowCompColor {
get {return (flags_1 & 0x00000010u) == 0x00000010u;}
set {if (value) {flags_1 |= 0x00000010u;} else {flags_1 &= ~0x00000010u;}}
}
public bool fDoubleClickInWebView {
get {return (flags_1 & 0x00000020u) == 0x00000020u;}
set {if (value) {flags_1 |= 0x00000020u;} else {flags_1 &= ~0x00000020u;}}
}
public bool fDesktopHTML {
get {return (flags_1 & 0x00000040u) == 0x00000040u;}
set {if (value) {flags_1 |= 0x00000040u;} else {flags_1 &= ~0x00000040u;}}
}
public bool fWin95Classic {
get {return (flags_1 & 0x00000080u) == 0x00000080u;}
set {if (value) {flags_1 |= 0x00000080u;} else {flags_1 &= ~0x00000080u;}}
}
public bool fDontPrettyPath {
get {return (flags_1 & 0x00000100u) == 0x00000100u;}
set {if (value) {flags_1 |= 0x00000100u;} else {flags_1 &= ~0x00000100u;}}
}
public bool fShowAttribCol {
get {return (flags_1 & 0x00000200u) == 0x00000200u;}
set {if (value) {flags_1 |= 0x00000200u;} else {flags_1 &= ~0x00000200u;}}
}
public bool fMapNetDrvBtn {
get {return (flags_1 & 0x00000400u) == 0x00000400u;}
set {if (value) {flags_1 |= 0x00000400u;} else {flags_1 &= ~0x00000400u;}}
}
public bool fShowInfoTip {
get {return (flags_1 & 0x00000800u) == 0x00000800u;}
set {if (value) {flags_1 |= 0x00000800u;} else {flags_1 &= ~0x00000800u;}}
}
public bool fHideIcons {
get {return (flags_1 & 0x00001000u) == 0x00001000u;}
set {if (value) {flags_1 |= 0x00001000u;} else {flags_1 &= ~0x00001000u;}}
}
public bool fWebView {
get {return (flags_1 & 0x00002000u) == 0x00002000u;}
set {if (value) {flags_1 |= 0x00002000u;} else {flags_1 &= ~0x00002000u;}}
}
public bool fFilter {
get {return (flags_1 & 0x00004000u) == 0x00004000u;}
set {if (value) {flags_1 |= 0x00004000u;} else {flags_1 &= ~0x00004000u;}}
}
public bool fShowSuperHidden {
get {return (flags_1 & 0x00008000u) == 0x00008000u;}
set {if (value) {flags_1 |= 0x00008000u;} else {flags_1 &= ~0x00008000u;}}
}
public bool fNoNetCrawling {
get {return (flags_1 & 0x00010000u) == 0x00010000u;}
set {if (value) {flags_1 |= 0x00010000u;} else {flags_1 &= ~0x00010000u;}}
}
public bool fSepProcess {
get {return (flags_2 & 0x00000001u) == 0x00000001u;}
set {if (value) {flags_2 |= 0x00000001u;} else {flags_2 &= ~0x00000001u;}}
}
public bool fStartPanelOn {
get {return (flags_2 & 0x00000002u) == 0x00000002u;}
set {if (value) {flags_2 |= 0x00000002u;} else {flags_2 &= ~0x00000002u;}}
}
public bool fShowStartPage {
get {return (flags_2 & 0x00000004u) == 0x00000004u;}
set {if (value) {flags_2 |= 0x00000004u;} else {flags_2 &= ~0x00000004u;}}
}
public bool fAutoCheckSelect {
get {return (flags_2 & 0x00000008u) == 0x00000008u;}
set {if (value) {flags_2 |= 0x00000008u;} else {flags_2 &= ~0x00000008u;}}
}
public bool fIconsOnly {
get {return (flags_2 & 0x00000010u) == 0x00000010u;}
set {if (value) {flags_2 |= 0x00000010u;} else {flags_2 &= ~0x00000010u;}}
}
public bool fShowTypeOverlay {
get {return (flags_2 & 0x00000020u) == 0x00000020u;}
set {if (value) {flags_2 |= 0x00000020u;} else {flags_2 &= ~0x00000020u;}}
}
public bool fShowStatusBar {
get {return (flags_2 & 0x00000040u) == 0x00000040u;}
set {if (value) {flags_2 |= 0x00000040u;} else {flags_2 &= ~0x00000040u;}}
}
}
<StructLayout(LayoutKind.Sequential)> Public Structure SHELLSTATE
Public flags_1 As UInteger
Public dwWin95Unused As UInteger
Public uWin95Unused As UInteger
Public lParamSort As Integer
Public iSortDirection As Integer
Public version As UInteger
Public uNotUsed As UInteger
Public flags_2 As UInteger
Public Property fShowAllObjects() As Boolean
Get
Return (flags_1 And &H00000001UI) = &H00000001UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000001UI, flags_1 And Not &H00000001UI)
End Set
End Property
Public Property fShowExtensions() As Boolean
Get
Return (flags_1 And &H00000002UI) = &H00000002UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000002UI, flags_1 And Not &H00000002UI)
End Set
End Property
Public Property fNoConfirmRecycle() As Boolean
Get
Return (flags_1 And &H00000004UI) = &H00000004UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000004UI, flags_1 And Not &H00000004UI)
End Set
End Property
Public Property fShowSysFiles() As Boolean
Get
Return (flags_1 And &H00000008UI) = &H00000008UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000008UI, flags_1 And Not &H00000008UI)
End Set
End Property
Public Property fShowCompColor() As Boolean
Get
Return (flags_1 And &H00000010UI) = &H00000010UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000010UI, flags_1 And Not &H00000010UI)
End Set
End Property
Public Property fDoubleClickInWebView() As Boolean
Get
Return (flags_1 And &H00000020UI) = &H00000020UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000020UI, flags_1 And Not &H00000020UI)
End Set
End Property
Public Property fDesktopHTML() As Boolean
Get
Return (flags_1 And &H00000040UI) = &H00000040UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000040UI, flags_1 And Not &H00000040UI)
End Set
End Property
Public Property fWin95Classic() As Boolean
Get
Return (flags_1 And &H00000080UI) = &H00000080UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000080UI, flags_1 And Not &H00000080UI)
End Set
End Property
Public Property fDontPrettyPath() As Boolean
Get
Return (flags_1 And &H00000100UI) = &H00000100UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000100UI, flags_1 And Not &H00000100UI)
End Set
End Property
Public Property fShowAttribCol() As Boolean
Get
Return (flags_1 And &H00000200UI) = &H00000200UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000200UI, flags_1 And Not &H00000200UI)
End Set
End Property
Public Property fMapNetDrvBtn() As Boolean
Get
Return (flags_1 And &H00000400UI) = &H00000400UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000400UI, flags_1 And Not &H00000400UI)
End Set
End Property
Public Property fShowInfoTip() As Boolean
Get
Return (flags_1 And &H00000800UI) = &H00000800UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00000800UI, flags_1 And Not &H00000800UI)
End Set
End Property
Public Property fHideIcons() As Boolean
Get
Return (flags_1 And &H00001000UI) = &H00001000UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00001000UI, flags_1 And Not &H00001000UI)
End Set
End Property
Public Property fWebView() As Boolean
Get
Return (flags_1 And &H00002000UI) = &H00002000UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00002000UI, flags_1 And Not &H00002000UI)
End Set
End Property
Public Property fFilter() As Boolean
Get
Return (flags_1 And &H00004000UI) = &H00004000UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00004000UI, flags_1 And Not &H00004000UI)
End Set
End Property
Public Property fShowSuperHidden() As Boolean
Get
Return (flags_1 And &H00008000UI) = &H00008000UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00008000UI, flags_1 And Not &H00008000UI)
End Set
End Property
Public Property fNoNetCrawling() As Boolean
Get
Return (flags_1 And &H00010000UI) = &H00010000UI
End Get
Set(ByVal value As Boolean)
flags_1 = IIf(value, flags_1 Or &H00010000UI, flags_1 And Not &H00010000UI)
End Set
End Property
Public Property fSepProcess() As Boolean
Get
Return (flags_2 And &H00000001UI) = &H00000001UI
End Get
Set(ByVal value As Boolean)
flags_2 = IIf(value, flags_2 Or &H00000001UI, flags_2 And Not &H00000001UI)
End Set
End Property
Public Property fStartPanelOn() As Boolean
Get
Return (flags_2 And &H00000002UI) = &H00000002UI
End Get
Set(ByVal value As Boolean)
flags_2 = IIf(value, flags_2 Or &H00000002UI, flags_2 And Not &H00000002UI)
End Set
End Property
Public Property fShowStartPage() As Boolean
Get
Return (flags_2 And &H00000004UI) = &H00000004UI
End Get
Set(ByVal value As Boolean)
flags_2 = IIf(value, flags_2 Or &H00000004UI, flags_2 And Not &H00000004UI)
End Set
End Property
Public Property fAutoCheckSelect() As Boolean
Get
Return (flags_2 And &H00000008UI) = &H00000008UI
End Get
Set(ByVal value As Boolean)
flags_2 = IIf(value, flags_2 Or &H00000008UI, flags_2 And Not &H00000008UI)
End Set
End Property
Public Property fIconsOnly() As Boolean
Get
Return (flags_2 And &H00000010UI) = &H00000010UI
End Get
Set(ByVal value As Boolean)
flags_2 = IIf(value, flags_2 Or &H00000010UI, flags_2 And Not &H00000010UI)
End Set
End Property
Public Property fShowTypeOverlay() As Boolean
Get
Return (flags_2 And &H00000020UI) = &H00000020UI
End Get
Set(ByVal value As Boolean)
flags_2 = IIf(value, flags_2 Or &H00000020UI, flags_2 And Not &H00000020UI)
End Set
End Property
Public Property fShowStatusBar() As Boolean
Get
Return (flags_2 And &H00000040UI) = &H00000040UI
End Get
Set(ByVal value As Boolean)
flags_2 = IIf(value, flags_2 Or &H00000040UI, flags_2 And Not &H00000040UI)
End Set
End Property
End Structure
You can leave out properties of the structure and members of the enumeration that you don't need. That might keep your code more readable and lean which will also decrease the size of the compiled binary.
Tips & Tricks:
You may want to copy the code out of the edit mode of this page because the site software messes up line indentations.
Sample Code (C#):
SHELLSTATE state = new SHELLSTATE();
SHGetSetSettings(ref state, SSF.SSF_DOUBLECLICKINWEBVIEW, false); // get the current fDoubleClickInWebView flag
state.fDoubleClickInWebView = !state.fDoubleClickInWebView; // toggle the fDoubleClickInWebView flag
SHGetSetSettings(ref state, SSF.SSF_DOUBLECLICKINWEBVIEW, true); // set the new flag
Sample Code (VB.NET):
Dim state As SHELLSTATE
SHGetSetSettings(state, SSF.SSF_DOUBLECLICKINWEBVIEW, False) ' get the current fDoubleClickInWebView flag
state.fDoubleClickInWebView = Not state.fDoubleClickInWebView ' toggle the fDoubleClickInWebView flag
SHGetSetSettings(state, SSF.SSF_DOUBLECLICKINWEBVIEW, True) ' set the new flag
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).