Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
GeneralRe: OK, what do make of this? Reloading an assembly Pin
leppie26-Nov-02 12:31
leppie26-Nov-02 12:31 
GeneralRe: OK, what do make of this? Reloading an assembly Pin
David Stone27-Nov-02 16:24
sitebuilderDavid Stone27-Nov-02 16:24 
QuestionConverting a HIMAGELIST to an ImageList? Pin
Zombies with Coffee, LLC26-Nov-02 9:21
professionalZombies with Coffee, LLC26-Nov-02 9:21 
AnswerRe: Converting a HIMAGELIST to an ImageList? Pin
NormDroid26-Nov-02 10:05
professionalNormDroid26-Nov-02 10:05 
GeneralRe: Converting a HIMAGELIST to an ImageList? Pin
Zombies with Coffee, LLC26-Nov-02 10:10
professionalZombies with Coffee, LLC26-Nov-02 10:10 
GeneralReboot a Server with C# Pin
athomas421926-Nov-02 9:14
athomas421926-Nov-02 9:14 
GeneralRe: Reboot a Server with C# Pin
NormDroid26-Nov-02 10:02
professionalNormDroid26-Nov-02 10:02 
GeneralRe: Reboot a Server with C# Pin
J.Liss26-Nov-02 13:47
J.Liss26-Nov-02 13:47 
GeneralRe: Reboot a Server with C# Pin
athomas421927-Nov-02 3:39
athomas421927-Nov-02 3:39 
GeneralRe: Reboot a Server with C# Pin
thematt27-Nov-02 7:03
thematt27-Nov-02 7:03 
GeneralRe: Reboot a Server with C# Pin
athomas42192-Dec-02 3:27
athomas42192-Dec-02 3:27 
GeneralSNMP Provider for WMI Pin
thematt26-Nov-02 7:20
thematt26-Nov-02 7:20 
GeneralRe: SNMP Provider for WMI Pin
J.Liss26-Nov-02 13:58
J.Liss26-Nov-02 13:58 
GeneralRe: SNMP Provider for WMI Pin
thematt27-Nov-02 7:10
thematt27-Nov-02 7:10 
GeneralRe: SNMP Provider for WMI Pin
J.Liss27-Nov-02 7:29
J.Liss27-Nov-02 7:29 
Generalowner draw of listview and treeview Pin
Shaun Wilde26-Nov-02 3:21
Shaun Wilde26-Nov-02 3:21 
GeneralRe: owner draw of listview and treeview Pin
Matze26-Nov-02 5:29
Matze26-Nov-02 5:29 
GeneralRe: owner draw of listview and treeview Pin
Stephane Rodriguez.26-Nov-02 5:36
Stephane Rodriguez.26-Nov-02 5:36 
Questioncan c# have object* ? Pin
Anonymous26-Nov-02 2:49
Anonymous26-Nov-02 2:49 
AnswerRe: can c# have object* ? Pin
leppie26-Nov-02 6:26
leppie26-Nov-02 6:26 
AnswerRe: can c# have object* ? Pin
Eric Gunnerson (msft)26-Nov-02 9:38
Eric Gunnerson (msft)26-Nov-02 9:38 
GeneralRe: can c# have object* ? Pin
Anonymous26-Nov-02 14:51
Anonymous26-Nov-02 14:51 
GeneralRe: can c# have object* ? Pin
Eric Gunnerson (msft)27-Nov-02 12:46
Eric Gunnerson (msft)27-Nov-02 12:46 
AnswerRe: can c# have object* ? Pin
Andy Smith27-Nov-02 16:24
Andy Smith27-Nov-02 16:24 
GeneralNONCLIENTMETRICS marshalling Pin
Matze25-Nov-02 20:31
Matze25-Nov-02 20:31 
Hi all,
I desperately need a hint guiding me the right direction...
I want to retrieve the NCM information using SystemParametersInfo. Well, to define the function call is rather easy, and the structure itself does not make lots of problems, too:

[StructLayout(LayoutKind.Sequential)]
public class NONCLIENTMETRICS
{
public int cbSize;
public int iBorderWidth;
public int iScrollWidth;
public int iScrollHeight;
public int iCaptionWidth;
public int iCaptionHeight;
public LOGFONT lfntCaptionFont;
public int iSMCaptionWidth;
public int iSMCaptionHeight;
public LOGFONT lfntSMCaptionFont;
public int iMenuWidth;
public int iMenuHeight;
public LOGFONT lfntMenuFont;
public LOGFONT lfntStatusFont;
public LOGFONT lfntMessageFont;

public NONCLIENTMETRICS()
{
cbSize = 340;
}
}

[StructLayout(LayoutKind.Sequential)]
public struct LOGFONT
{
public int lfHeight;
public int lfWidth;
public int lfEscapement;
public int lfOrientation;
public int lfWeight;
public byte lfItalic;
public byte lfUnderline;
public byte lfStrikeOut;
public byte lfCharSet;
public byte lfOutPrecision;
public byte lfClipPrecision;
public byte lfQuality;
public byte lfPitchAndFamily;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst=32)]
public string lfFaceName;

public static LOGFONT Empty
{
get
{... }
}
}

[DllImport("User32.dll"]
public static extern bool SystemParametersInfo(int Action, int Param, NONCLIENTMETRICS Param, int WinIni);

The call is

NONCLIENTMETRICS ncm = new NONCLIENTMETRICS();
bool b = SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, ncm, 0);


And now I'm getting confused:
b is true, that means the call succeeded, but ncm has not been touched. Is there anything wrong with the structure layout?? At the end I tried all combinations, instead of a class I declared NCM as a structure and used ref, I tried the IntPtr version... nothing didn't help. And I know that it works since MS does similar to build the SystemInformation members (Menufont is contained in NCM, too).

Somewhere I'm blocked. Can anybody help??
Thanks and bye
Matze

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.