I am using VS2008 Express Edition on WinVista Business.
I am working with some code which is giving me OverflowExceptions all over the place and I am not familiar enough with the data types involved in order to solve the problem. I have a suspicion it might be causing my program to crash repeatedly but I cannot be sure.
I have downloaded the code for the "C# File Browser," at
FileBrowser.aspx[
^] and the code calls a static property called HiWord, i.e. to unpack the high-order word of a m.WParam where m is the data structure passed to the WndProc() override of any .NET Form.
The code is
public static uint HiWord(IntPtr ptr)
{
if (((uint)ptr & 0x80000000) == 0x80000000)
return ((uint)ptr >> 16);
else
return ((uint)ptr >> 16) & 0xffff;
}
and the exception is on the line
if (((uint)ptr & 0x80000000) == 0x80000000)
.
Can anyone please help me to find out what the proper way to get at the high-order word (it's for a message sent from a Context Menu, and I can't use Windows Forms events because I am interfacing with the Windows Shell) is?
[Tip] When you include a link using the <a href> tags, you need to put something between it and </a> or there won't be any link shown.