These are the functions we have to call using P/Invoke because we can't find anything in the .NET library to do this. I'm asking here in case we missed something. So is there a way to do any of the following in managed code? Preferable in .NET 3.5 because
a couple fo our DLLs are J# and so we can't go to .NET 4.0.
- Get the DPI of the video display - we presently do CreateDC("DISPLAY", ...
- Get the 8.3 form of a filename.
- Play & stop a MIDI file.
- Set a window as the foreground window.
- Determine if a string can be displayed with a given font (ie are all the needed glyphs in it) - we use GetGlyphIndices()
- Set a Form owner and/or parent to a non .NET Window (ie pass an IntPtr) - we need this because we are on Office AddIn and need to set the parent/owner to be the main Office window at times.
- Get the window rectangle of a non .NET window - ie we have an IWin32Window, not a Control.
- Make a MessageBox topmost
- Get the Icon for a file extension - we fine the default app int he registry and then call ExtractIconEx()
- Enum all windows (not just .NET ones) to find one by class and caption? We use this to find the main Word/Excel/PPT window our AddIn is running in.
- Read a file from a share that requires a username & password. We presently use LogonUser().
View Complete Post