mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 04:34:16 +01:00
move detour into function
This commit is contained in:
parent
b0fac2bc47
commit
e641cac71c
1 changed files with 7 additions and 6 deletions
|
|
@ -333,12 +333,7 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
if (ImGui.Button("Create"))
|
if (ImGui.Button("Create"))
|
||||||
{
|
{
|
||||||
this.messageBoxMinHook = Hook<MessageBoxWDelegate>.FromSymbol(
|
this.messageBoxMinHook = Hook<MessageBoxWDelegate>.FromSymbol(
|
||||||
"User32", "MessageBoxW",
|
"User32", "MessageBoxW", MessageBoxWDetour);
|
||||||
(wnd, text, caption, type) =>
|
|
||||||
{
|
|
||||||
Log.Information("[DATAHOOK] {0} {1} {2} {3}", wnd, text, caption, type);
|
|
||||||
return this.messageBoxMinHook.Original(wnd, text, caption, type);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Button("Enable")) this.messageBoxMinHook?.Enable();
|
if (ImGui.Button("Enable")) this.messageBoxMinHook?.Enable();
|
||||||
|
|
@ -380,6 +375,12 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
ImGui.EndChild();
|
ImGui.EndChild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int MessageBoxWDetour(IntPtr hwnd, string text, string caption, NativeFunctions.MessageBoxType type)
|
||||||
|
{
|
||||||
|
Log.Information("[DATAHOOK] {0} {1} {2} {3}", hwnd, text, caption, type);
|
||||||
|
return this.messageBoxMinHook.Original(hwnd, text, caption, type);
|
||||||
|
}
|
||||||
|
|
||||||
private void DrawServerOpCode()
|
private void DrawServerOpCode()
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted(this.serverOpString);
|
ImGui.TextUnformatted(this.serverOpString);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue