[.net] SaveFileDialog hook and FILEOKSTRING Notification

Started by
1 comment, last by CodeReaver 17 years, 6 months ago
Does anyone know how to use this in C#? http://windowssdk.msdn.microsoft.com/en-us/library/ms646870(VS.80).aspx I've looked on msdn and google and there's nothing on how to use it in C#. I can't find the value to use for FILEOKSTRING and I also tried putting a break point by the notify message in the hook procedure. The only message that gets sent because of clicking OK is the OK message.
Advertisement
Why not just overried the fileok method. Double click on the component and you will get an event that is hooked up automatically...

this.saveFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog1_FileOk);

here is the event ...

private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
{
}


You might be able to use something in the canceleventargs


Otherwise I would say that you will need to create an inherited class and override the wndproc method or something, though I see that does not work as it appears the savefiledialog is a sealed class.
Thanks for that one! It's much simpler than what I was trying to do.

EDIT: Ah... I still need to get the file names into that function somehow. Maybe I should cast sender to a SaveFileDialog.
EDIT 2: Yeah, that did it.

[Edited by - CodeReaver on October 15, 2006 5:54:16 PM]

This topic is closed to new replies.

Advertisement