Click here to Skip to main content
15,921,941 members
Home / Discussions / C#
   

C#

 
GeneralAbout Hook Pin
lajiyo30-Nov-03 15:06
lajiyo30-Nov-03 15:06 
GeneralCore DLL Documentation Pin
Tristan Rhodes30-Nov-03 12:04
Tristan Rhodes30-Nov-03 12:04 
GeneralRe: Core DLL Documentation Pin
Alex Korchemniy30-Nov-03 14:13
Alex Korchemniy30-Nov-03 14:13 
GeneralClickety Pin
J. Dunlap30-Nov-03 16:26
J. Dunlap30-Nov-03 16:26 
GeneralRe: Clickety Pin
Tristan Rhodes1-Dec-03 3:33
Tristan Rhodes1-Dec-03 3:33 
Generalsource code Pin
Amirjalaly30-Nov-03 5:00
Amirjalaly30-Nov-03 5:00 
GeneralRe: source code Pin
Alex Korchemniy30-Nov-03 14:15
Alex Korchemniy30-Nov-03 14:15 
GeneralQuery: The | Operator Pin
30-Nov-03 4:53
suss30-Nov-03 4:53 
I have some sample code Heath (Stewart) may recognise it, as it's from his Icon Extraction sample.

Anyway, I'm confused about the use of the | operator with enumerations.
<br />
	[DllImport("shell32.dll", CharSet=CharSet.Auto)]<br />
	private static extern IntPtr SHGetFileInfo(<br />
		string path,<br />
		int fileAttributes,<br />
		[MarshalAs(UnmanagedType.Struct), Out]out SHFileInfo info,<br />
		int fileInfoSize,<br />
		[MarshalAs(UnmanagedType.U4)]SHGFI flags);<br />


First is the use of the SHGFI Flags, which I take as wanting to use the Hex values as handles or refferences or pointers or something. I'm sure I'll figure it out.

The next part is:
<br />
		IntPtr retVal = SHGetFileInfo(filename, FILE_ATTRIBUTE_NORMAL,<br />
			out info, Marshal.SizeOf(typeof(SHFileInfo)),<br />
			SHGFI.AddOverlays | SHGFI.DisplayName | SHGFI.Icon | SHGFI.SmallIcon<br />
			| SHGFI.TypeName | SHGFI.UseFileAttributes);<br />


Now, how does the | operator in this work? Is it actualy an or statement? Or a collection of flags from the enumeration? If so, what effect does the | charachter have?

Thanks guys

Cata
GeneralRe: Query: The | Operator Pin
leppie30-Nov-03 6:11
leppie30-Nov-03 6:11 
GeneralRe: Query: The | Operator Pin
Tristan Rhodes30-Nov-03 7:06
Tristan Rhodes30-Nov-03 7:06 
GeneralRe: Query: The | Operator Pin
J. Dunlap30-Nov-03 10:32
J. Dunlap30-Nov-03 10:32 
GeneralRe: Query: The | Operator Pin
Tristan Rhodes30-Nov-03 7:06
Tristan Rhodes30-Nov-03 7:06 
QuestionHow to convert &quot;string&quot; type to &quot;Shortcut&quot; type ? Pin
god4k30-Nov-03 3:35
god4k30-Nov-03 3:35 
AnswerRe: How to convert &quot;string&quot; type to &quot;Shortcut&quot; type ? Pin
Alex Korchemniy30-Nov-03 14:23
Alex Korchemniy30-Nov-03 14:23 
AnswerRe: How to convert &quot;string&quot; type to &quot;Shortcut&quot; type ? Pin
J. Dunlap30-Nov-03 16:42
J. Dunlap30-Nov-03 16:42 
GeneralRounding the Time Pin
Anonymous30-Nov-03 0:29
Anonymous30-Nov-03 0:29 
GeneralRe: Rounding the Time Pin
Alex Korchemniy30-Nov-03 14:17
Alex Korchemniy30-Nov-03 14:17 
Generalselect, insert, update, del with ADO.net with C# Pin
Azel Low29-Nov-03 23:07
Azel Low29-Nov-03 23:07 
GeneralRe: select, insert, update, del with ADO.net with C# Pin
Uwe Keim30-Nov-03 3:14
sitebuilderUwe Keim30-Nov-03 3:14 
GeneralRe: select, insert, update, del with ADO.net with C# Pin
Azel Low1-Dec-03 0:51
Azel Low1-Dec-03 0:51 
QuestionHow to customize http connection timeout? Pin
shooterlily29-Nov-03 19:51
shooterlily29-Nov-03 19:51 
AnswerRe: How to customize http connection timeout? Pin
Heath Stewart1-Dec-03 2:07
protectorHeath Stewart1-Dec-03 2:07 
GeneralRe: How to customize http connection timeout? Pin
shooterlily4-Dec-03 15:38
shooterlily4-Dec-03 15:38 
GeneralRe: How to customize http connection timeout? Pin
shooterlily4-Dec-03 18:11
shooterlily4-Dec-03 18:11 
GeneralRe: How to customize http connection timeout? Pin
Heath Stewart4-Dec-03 18:55
protectorHeath Stewart4-Dec-03 18:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.