pinvoke.net is handy for finding out dllimport and structure definitions, or at the very least getting a starting point for them :)
SHChangeNotifyEntry
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
struct SHChangeNotifyEntry
{
public IntPtr pIdl;
[MarshalAs(UnmanagedType.Bool)] public Boolean Recursively;
}
SHChangeNotifyRegister
[DllImport("shell32.dll", SetLastError=true, EntryPoint="#2", CharSet=CharSet.Auto)]
static extern UInt32 SHChangeNotifyRegister(
IntPtr hWnd,
SHCNF fSources,
SHCNE fEvents,
uint wMsg,
int cEntries,
ref SHChangeNotifyEntry pFsne)
As others have said, try posting the dllimports you have, and the structure definitions that you are passing into the p/invokes, and the exact error messages/exceptions you are getting.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…