S
SpotNet
Hi Newsgroup,
While trying to customise my common dialogs and learn C#, I'm having trouble
getting this to work;
OFNOTIFY ofny = (OFNOTIFY)Marshal.PtrToStructure(lParam, typeof(OFNOTIFY));
Under the "case CDN_FOLDERCHANGE:" switch. I haven't seen this in any C#
documentation, but C++ doc's does this, in a different way like
OFNOTIFY ofny = (OFNOTIFY)lParam; (using the C++ pointer notation though).
From the same documentation I can get;
case WM_NOTIFY:
NMHDR nmhdr = (NMHDR)Marshal.PtrToStructure(lParam, typeof(NMHDR));
and
case WM_INITDIALOG:
ofn = (OPENFILENAME)Marshal.PtrToStructure(lParam,
typeof(OPENFILENAME));
to work well translating it from the C++ doc's from the web, but can't get
the OFNOTIFY, despite it stating this structure comes from lParam in the
hook proc under the CDN_FOLDERCHANGE switch message.
My Hook proc is typically defined as;
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected IntPtr HookProc(IntPtr hWnd, int iMsg, IntPtr wParam, IntPtr
lParam)
Can some one point me in the correct direction on what I'm missing. I'm
thinking C++ programmers have it all, wish I knew it (as well as C# too).
Regards,
- SpotNet
While trying to customise my common dialogs and learn C#, I'm having trouble
getting this to work;
OFNOTIFY ofny = (OFNOTIFY)Marshal.PtrToStructure(lParam, typeof(OFNOTIFY));
Under the "case CDN_FOLDERCHANGE:" switch. I haven't seen this in any C#
documentation, but C++ doc's does this, in a different way like
OFNOTIFY ofny = (OFNOTIFY)lParam; (using the C++ pointer notation though).
From the same documentation I can get;
case WM_NOTIFY:
NMHDR nmhdr = (NMHDR)Marshal.PtrToStructure(lParam, typeof(NMHDR));
and
case WM_INITDIALOG:
ofn = (OPENFILENAME)Marshal.PtrToStructure(lParam,
typeof(OPENFILENAME));
to work well translating it from the C++ doc's from the web, but can't get
the OFNOTIFY, despite it stating this structure comes from lParam in the
hook proc under the CDN_FOLDERCHANGE switch message.
My Hook proc is typically defined as;
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected IntPtr HookProc(IntPtr hWnd, int iMsg, IntPtr wParam, IntPtr
lParam)
Can some one point me in the correct direction on what I'm missing. I'm
thinking C++ programmers have it all, wish I knew it (as well as C# too).
Regards,
- SpotNet