Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGridBoolColumn Pin
DougW4814-Jun-04 9:22
DougW4814-Jun-04 9:22 
GeneralRe: DataGridBoolColumn Pin
Heath Stewart13-Jun-04 18:54
protectorHeath Stewart13-Jun-04 18:54 
Generalhelp about print Pin
ggl16513-Jun-04 15:01
ggl16513-Jun-04 15:01 
GeneralAttachment Database Pin
The_Soul_Of_Rock13-Jun-04 14:31
The_Soul_Of_Rock13-Jun-04 14:31 
GeneralRe: Attachment Database Pin
Heath Stewart13-Jun-04 18:45
protectorHeath Stewart13-Jun-04 18:45 
GeneralRe: Attachment Database Pin
The_Soul_Of_Rock13-Jun-04 21:09
The_Soul_Of_Rock13-Jun-04 21:09 
GeneralDelete FileDialog Pin
anatsg13-Jun-04 7:49
anatsg13-Jun-04 7:49 
GeneralRe: Delete FileDialog Pin
Heath Stewart13-Jun-04 18:37
protectorHeath Stewart13-Jun-04 18:37 
There really isn't an easy way, and this will most likely be easiest in a mixed-mode Managed C++ project.

First of all, you need to P/Invoke either the GetOpenFileName or GetSaveFileName APIs, which the OpenFileDialog and SafeFileDialog components already do for you. But you must do it because you must fill-out your own OPENFILENAME struct, which must have certain fields set, as well as the hook procedure (depends on the flags you specify, one of which must be OFN_ENABLEHOOK (32)). You must P/Invoke the SetWindowText and any other APIs (like FindWindow, EnumChildWindows, etc.) to help you find the "OK" button (and for localization, don't assume it always says "OK"). This is so that you can change the caption to "Delete".

You call these from your hook proc you specified in the OPENFILENAME structure when you receive the WM_INITDIALOG (272) message. You also should handle the CDN_FILEOK (-606) message and at that point delete the file.

There's a lot to understand, so I recommend you read about the GetOpenFileName[^] and/or GetSaveFileName[^] (you're modifying the behavior, so it really doesn't matter which you use) in the Platform SDK.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Delete FileDialog Pin
anatsg14-Jun-04 9:11
anatsg14-Jun-04 9:11 
Generalsome int16[ ] arrays: OutOfMemoryException Pin
noizy13-Jun-04 7:39
noizy13-Jun-04 7:39 
GeneralRe: some int16[ ] arrays: OutOfMemoryException Pin
Colin Angus Mackay13-Jun-04 12:52
Colin Angus Mackay13-Jun-04 12:52 
GeneralMenu Images in ContextMenu Pin
gek_at13-Jun-04 7:13
gek_at13-Jun-04 7:13 
GeneralRe: Menu Images in ContextMenu Pin
Mazdak13-Jun-04 7:27
Mazdak13-Jun-04 7:27 
GeneralRe: Menu Images in ContextMenu Pin
gek_at13-Jun-04 7:34
gek_at13-Jun-04 7:34 
GeneralRe: Menu Images in ContextMenu Pin
leppie13-Jun-04 10:20
leppie13-Jun-04 10:20 
GeneralRe: Menu Images in ContextMenu Pin
gek_at13-Jun-04 11:43
gek_at13-Jun-04 11:43 
GeneralRe: Menu Images in ContextMenu Pin
gek_at13-Jun-04 11:59
gek_at13-Jun-04 11:59 
GeneralRe: Menu Images in ContextMenu Pin
leppie13-Jun-04 12:19
leppie13-Jun-04 12:19 
GeneralRe: Menu Images in ContextMenu Pin
gek_at13-Jun-04 23:20
gek_at13-Jun-04 23:20 
GeneralRe: Menu Images in ContextMenu Pin
leppie13-Jun-04 12:02
leppie13-Jun-04 12:02 
General"an error occurred while loading the document" Pin
enduro1x13-Jun-04 6:35
enduro1x13-Jun-04 6:35 
GeneralRe: "an error occurred while loading the document" Pin
leppie13-Jun-04 6:59
leppie13-Jun-04 6:59 
GeneralRe: "an error occurred while loading the document" Pin
enduro1x13-Jun-04 7:04
enduro1x13-Jun-04 7:04 
GeneralOemToAnsi in C# Pin
brunoskorepa13-Jun-04 6:24
brunoskorepa13-Jun-04 6:24 
GeneralRe: OemToAnsi in C# Pin
Colin Angus Mackay13-Jun-04 6:27
Colin Angus Mackay13-Jun-04 6:27 

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.