Click here to Skip to main content
15,397,729 members
Home / Discussions / C#
   

C#

 
GeneralRe: starting other apps? Pin
Guillermo Rivero5-Jan-04 7:22
MemberGuillermo Rivero5-Jan-04 7:22 
QuestionBest code for this multithreading issue? Pin
profoundwhispers5-Jan-04 6:32
Memberprofoundwhispers5-Jan-04 6:32 
AnswerRe: Best code for this multithreading issue? Pin
HAHAHA_NEXT5-Jan-04 7:22
MemberHAHAHA_NEXT5-Jan-04 7:22 
AnswerRe: Best code for this multithreading issue? Pin
Heath Stewart5-Jan-04 7:28
protectorHeath Stewart5-Jan-04 7:28 
Generalcustom save/open file dialog Pin
misterbear5-Jan-04 6:31
Membermisterbear5-Jan-04 6:31 
GeneralRe: custom save/open file dialog Pin
Heath Stewart5-Jan-04 7:13
protectorHeath Stewart5-Jan-04 7:13 
GeneralRe: custom save/open file dialog Pin
misterbear5-Jan-04 8:43
Membermisterbear5-Jan-04 8:43 
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
MemberGuinness4Strength5-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
MemberNiels Penneman5-Jan-04 10:11 
GeneralRun a External EXE File Pin
hxxbin5-Jan-04 6:16
Memberhxxbin5-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
Memberhxxbin5-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
Memberhxxbin5-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
Memberhxxbin5-Jan-04 11:33 
GeneralCryptography Question Pin
Mazdak5-Jan-04 4:09
MemberMazdak5-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
MemberMazdak5-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
MemberMazdak5-Jan-04 10:03 
QuestionHow can I find resource values like Cut/Copy/Paste names in Win? Pin
A.Wegierski5-Jan-04 1:57
MemberA.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 

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.