Click here to Skip to main content
15,915,513 members
Home / Discussions / C#
   

C#

 
GeneralRe: custom save/open file dialog Pin
Heath Stewart5-Jan-04 9:52
protectorHeath Stewart5-Jan-04 9:52 
For an example of encapsulating a custom method and struct, use a decompiler like .NET Reflector[^] and see how the FileDialog and its derivative classes work. That's the best thing I can tell you.

You could just have a simple native function in a native DLL that you can call, passing parameters as necessary or use a struct like the OPENFILENAME struct, though you could cut down on the members needed for your implementation.

As for the other idea, neither the GetOpenFileName, GetSaveFileName, or the OPENFILENAME struct accept positional values. Since the FileDialogs merely use these functions and structs, it won't know either (nor does it have positional properties of its own). You'll have to get a HWND of the dialog instead, most likely using FindWindow, and you could try encapsulating this by extending the NativeWindow class (a managed wrapper for existing windows) and use AssignHandle, passing the HWND that you got from FindWindow. You could then figure out the position and track it with another window.

There might be an easier way to do this alternative, but this is just off the top of my head and without any research. You could search to see if an easier / better way exists.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralEasy Form Question Pin
Guinness4Strength5-Jan-04 6:19
Guinness4Strength5-Jan-04 6:19 
GeneralRe: Easy Form Question Pin
Heath Stewart5-Jan-04 7:04
protectorHeath Stewart5-Jan-04 7:04 
GeneralRe: Easy Form Question Pin
Niels Penneman5-Jan-04 10:11
Niels Penneman5-Jan-04 10:11 
GeneralRun a External EXE File Pin
hxxbin5-Jan-04 6:16
hxxbin5-Jan-04 6:16 
GeneralRe: Run a External EXE File Pin
Heath Stewart5-Jan-04 7:00
protectorHeath Stewart5-Jan-04 7:00 
GeneralRe: Run a External EXE File Pin
hxxbin5-Jan-04 7:07
hxxbin5-Jan-04 7:07 
GeneralRe: Run a External EXE File Pin
Heath Stewart5-Jan-04 7:37
protectorHeath Stewart5-Jan-04 7:37 
GeneralRe: Run a External EXE File Pin
hxxbin5-Jan-04 8:42
hxxbin5-Jan-04 8:42 
GeneralRe: Run a External EXE File Pin
Heath Stewart5-Jan-04 9:37
protectorHeath Stewart5-Jan-04 9:37 
GeneralRe: Run a External EXE File Pin
hxxbin5-Jan-04 11:33
hxxbin5-Jan-04 11:33 
GeneralCryptography Question Pin
Mazdak5-Jan-04 4:09
Mazdak5-Jan-04 4:09 
GeneralRe: Cryptography Question Pin
Heath Stewart5-Jan-04 5:18
protectorHeath Stewart5-Jan-04 5:18 
GeneralRe: Cryptography Question Pin
Mazdak5-Jan-04 7:46
Mazdak5-Jan-04 7:46 
GeneralRe: Cryptography Question Pin
Heath Stewart5-Jan-04 9:32
protectorHeath Stewart5-Jan-04 9:32 
GeneralRe: Cryptography Question Pin
Mazdak5-Jan-04 10:03
Mazdak5-Jan-04 10:03 
QuestionHow can I find resource values like Cut/Copy/Paste names in Win? Pin
A.Wegierski5-Jan-04 1:57
A.Wegierski5-Jan-04 1:57 
AnswerRe: How can I find resource values like Cut/Copy/Paste names in Win? Pin
Heath Stewart5-Jan-04 5:10
protectorHeath Stewart5-Jan-04 5:10 
GeneralRe: How can I find resource values like Cut/Copy/Paste names in Win? Pin
A.Wegierski5-Jan-04 20:55
A.Wegierski5-Jan-04 20:55 
GeneralSome simple C# calculator application questions. Pin
Link26004-Jan-04 22:58
Link26004-Jan-04 22:58 
GeneralRe: Some simple C# calculator application questions. Pin
Colin Angus Mackay4-Jan-04 23:09
Colin Angus Mackay4-Jan-04 23:09 
GeneralRe: Some simple C# calculator application questions. Pin
Link26004-Jan-04 23:26
Link26004-Jan-04 23:26 
GeneralRe: Some simple C# calculator application questions. Pin
Colin Angus Mackay4-Jan-04 23:50
Colin Angus Mackay4-Jan-04 23:50 
GeneralRe: Some simple C# calculator application questions. Pin
Heath Stewart5-Jan-04 5:00
protectorHeath Stewart5-Jan-04 5:00 
Questionhow can i build start menue - like in my program??? Pin
warelord4-Jan-04 21:52
warelord4-Jan-04 21:52 

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.