LRESULT success = SendMessageTimeout(
HWND_BROADCAST,
WM_SETTINGCHANGE,
0,
(LPARAM) "Environment",
SMTO_ABORTIFHUNG,
5000,
NULL
);
< /code>
Was ich in C# getan habe, ist wie folgt und ich habe meine Probleme als Kommentare hinzugefügt: < /p>
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessageTimeout(
IntPtr hWnd,
uint Msg,
UIntPtr wParam,
IntPtr lParam,
uint fuFlags,
uint uTimeout,
out UIntPtr lpdwResult
);
SendMessageTimeout(
(IntPtr)0xFFFFFFFF, // HWND_BROADCAST
0x001A, // WM_SETTINGCHANGE
(UIntPtr)0,
(IntPtr)"Environment", // ERROR_1: can't convert string to IntPtr
0x0002, // SMTO_ABORTIFHUNG
5000,
out UIntPtr.Zero // ERROR_2: a static readonly field can not be passed ref or out
);
gemäß der Dokumentation für sendMessAgetimeout () : Ich habe den folgenden C ++ - Code, und [url=viewtopic.php?t=14917]ich möchte[/url] ihn in C#: konvertieren[code]LRESULT success = SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) "Environment", SMTO_ABORTIFHUNG, 5000, NULL ); < /code> Was ich in C# getan habe, ist wie folgt und ich habe meine Probleme als Kommentare hinzugefügt: < /p> [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern IntPtr SendMessageTimeout( IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam, uint fuFlags, uint uTimeout, out UIntPtr lpdwResult );
SendMessageTimeout( (IntPtr)0xFFFFFFFF, // HWND_BROADCAST 0x001A, // WM_SETTINGCHANGE (UIntPtr)0, (IntPtr)"Environment", // ERROR_1: can't convert string to IntPtr 0x0002, // SMTO_ABORTIFHUNG 5000, out UIntPtr.Zero // ERROR_2: a static readonly field can not be passed ref or out ); [/code]
gemäß der Dokumentation für sendMessAgetimeout () :
Ich habe den folgenden C ++ - Code, und ich möchte ihn in C#:
konvertieren LRESULT success = SendMessageTimeout(
HWND_BROADCAST,...
Ein Neuling hier habe ich die Erweiterung Python und Code Runner in VS -Code installiert und jedes Mal, wenn ich ein Python -Programm ausführe, indem ich auf den richtigen Pfeil (Run -Code) klicke,...
Ich habe Unit -Tests in JMOCK unter einer JDK 8 -Umgebung geschrieben. Jetzt, wo ich zu JDK 17 ausgewandert bin, möchte ich sie stattdessen um Mockito umwandeln. Was sind die besten KI -Tools oder...