Click here to Skip to main content
15,898,737 members
Home / Discussions / C#
   

C#

 
QuestionHow to add Check Boxes for Extra Column in a DataGrid? Pin
pubududilena8-Feb-05 20:32
pubududilena8-Feb-05 20:32 
AnswerRe: How to add Check Boxes for Extra Column in a DataGrid? Pin
Christian Graus9-Feb-05 9:37
protectorChristian Graus9-Feb-05 9:37 
Generalget URL !!!! Pin
students552 university8-Feb-05 19:41
students552 university8-Feb-05 19:41 
GeneralRe: get URL !!!! Pin
Anonymous9-Feb-05 7:13
Anonymous9-Feb-05 7:13 
GeneralRe: get URL !!!! Pin
Heath Stewart9-Feb-05 15:04
protectorHeath Stewart9-Feb-05 15:04 
GeneralRe: get URL !!!! Pin
students552 university11-Feb-05 6:54
students552 university11-Feb-05 6:54 
GeneralRe: get URL !!!! Pin
Heath Stewart11-Feb-05 7:03
protectorHeath Stewart11-Feb-05 7:03 
GeneralIContextMenu Shell Extension - HandleMenuMsg Pin
LoKi_za8-Feb-05 19:38
LoKi_za8-Feb-05 19:38 
I'm putting together a project and need to extend Windows' shell to add a owner-drawn menu item to the context menu. If I use only IContextMenu, the menu item and owner-drawn (blank) sub menu are added fine.

As soon as I implement IContextMenu2 and HandleMenuMsg, I get a memfault from Explorer whilst debugging. A breakpoint is hit inside the IContextMenu2.HandleMenuMsg but subsequently, Explorer crashes. I'm returning "0" from int HandleMenuMsg(uint, IntPtr, IntPtr).

Any ideas?

--------------------------------
Extension code:

[ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), GuidAttribute("000214e8-0000-0000-c000-000000000046")]
public interface IShellExtInit {
[PreserveSig()]
int Initialize (IntPtr pidlFolder, IntPtr lpdobj, uint /*HKEY*/ hKeyProgID);
}


[ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), GuidAttribute("000214e4-0000-0000-c000-000000000046")]
public interface IContextMenu {
[PreserveSig()]
int QueryContextMenu(HMenu hmenu, int iMenu, int idCmdFirst, int idCmdLast, CMF uFlags);
[PreserveSig()]
void InvokeCommand(IntPtr pici);
[PreserveSig()]
void GetCommandString(int idcmd, uint uflags, int reserved, StringBuilder commandstring, int cch);
}

[ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), GuidAttribute("000214e4-0000-0000-c000-000000000046")]
public interface IContextMenu2 : IContextMenu {
[PreserveSig()]
int HandleMenuMsg(uint Msg, IntPtr LParam, IntPtr WParam);
[PreserveSig()]
new int QueryContextMenu(HMenu hmenu, int iMenu, int idCmdFirst, int idCmdLast, CMF uFlags);
[PreserveSig()]
new void InvokeCommand(IntPtr pici);
[PreserveSig()]
new void GetCommandString(int idcmd, uint uflags, int reserved, StringBuilder commandstring, int cch);
}
--------------------------------
Shell code:

public int QueryContextMenu(HMenu hmenu, int iMenu, int idCmdFirst, int idCmdLast, CMF uFlags) {
//
HMenu AppMenu;
Int32 NewMenuID = 1;
// Check Flags
if ((uFlags & (CMF.CMF_VERBSONLY|CMF.CMF_DEFAULTONLY|CMF.CMF_NOVERBS)) == 0 ||
(uFlags & CMF.CMF_EXPLORE) != 0) {
//
// Create Popup Menu
AppMenu = Helpers.CreatePopupMenu();
// Append SubMenus
Helpers.AppendMenu(AppMenu, MFMENU.MF_OWNERDRAW|MFMENU.MF_ENABLED,
new IntPtr(idCmdFirst + NewMenuID++), null);
Helpers.InsertMenu(hmenu, 3, MFMENU.MF_BYPOSITION|MFMENU.MF_POPUP|MFMENU.MF_ENABLED, AppMenu.handle, "MediaExplorer");
}
return NewMenuID;
}

#region IContextMenu2 Members

public int HandleMenuMsg(uint Msg, IntPtr LParam, IntPtr WParam) {
//
return 0;
}

#endregion

--------------------------------

>Smile | :)
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
Wraith29-Feb-05 1:33
Wraith29-Feb-05 1:33 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
LoKi_za9-Feb-05 1:42
LoKi_za9-Feb-05 1:42 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
Wraith29-Feb-05 2:26
Wraith29-Feb-05 2:26 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
LoKi_za9-Feb-05 2:35
LoKi_za9-Feb-05 2:35 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
Wraith29-Feb-05 3:10
Wraith29-Feb-05 3:10 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
LoKi_za9-Feb-05 4:08
LoKi_za9-Feb-05 4:08 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
Wraith29-Feb-05 4:28
Wraith29-Feb-05 4:28 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
LoKi_za9-Feb-05 4:34
LoKi_za9-Feb-05 4:34 
GeneralRe: IContextMenu Shell Extension - HandleMenuMsg Pin
Wraith29-Feb-05 4:50
Wraith29-Feb-05 4:50 
GeneralVideo in mpeg Pin
ongo8-Feb-05 19:28
ongo8-Feb-05 19:28 
GeneralRe: Video in mpeg Pin
Heath Stewart9-Feb-05 14:53
protectorHeath Stewart9-Feb-05 14:53 
Generalmultithreading Pin
Titli8-Feb-05 18:59
Titli8-Feb-05 18:59 
GeneralRe: multithreading Pin
Dave Kreskowiak9-Feb-05 6:25
mveDave Kreskowiak9-Feb-05 6:25 
QuestionHow to get Paragraph leading? Pin
sachinkalse8-Feb-05 18:23
sachinkalse8-Feb-05 18:23 
AnswerRe: How to get Paragraph leading? Pin
sachinkalse9-Feb-05 13:29
sachinkalse9-Feb-05 13:29 
GeneralI'm having trouble adding records to Access Pin
Bill Prada8-Feb-05 17:09
Bill Prada8-Feb-05 17:09 
GeneralRe: I'm having trouble adding records to Access Pin
Luis Alonso Ramos8-Feb-05 19:00
Luis Alonso Ramos8-Feb-05 19:00 

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.