Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
rikky_module の colordialog が重くなる問題を修正
  • Loading branch information
hebiiro committed Jul 2, 2022
1 parent 02e7167 commit b256f96
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

## 更新履歴

* 2.0.0 - 2022/07/02 rikky_module の colordialog が重くなる問題を修正
* 1.0.0 - 2022/06/24 初版

## 動作確認
Expand Down
1 change: 1 addition & 0 deletions script_sort_patch/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")

Expand Down
59 changes: 54 additions & 5 deletions script_sort_patch/script_sort_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ AviUtlInternal g_auin;

DECLARE_HOOK_PROC(LRESULT, WINAPI, SettingDialogProc, (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam));
DECLARE_HOOK_PROC(LONG, WINAPI, SetWindowLongA, (HWND hwnd, int index, LONG newLong));
DECLARE_HOOK_PROC(INT_PTR, WINAPI, DialogBoxParamA, (HINSTANCE instance, LPCSTR templateName, HWND parent, DLGPROC dlgProc, LPARAM lParam));

HWND getComboBox(HWND settingDialog)
{
Expand Down Expand Up @@ -61,13 +62,26 @@ IMPLEMENT_HOOK_PROC_NULL(LRESULT, WINAPI, SettingDialogProc, (HWND hwnd, UINT me
{
MY_TRACE(_T("SettingDialogProc(WM_CREATE)\n"));

// script_sort.auf 内の ::SetWindowLongA() をフックする。
{
// script_sort.auf 内の ::SetWindowLongA() をフックする。

HMODULE module = ::GetModuleHandle(_T("script_sort.auf"));

HMODULE module = ::GetModuleHandle(_T("script_sort.auf"));
if (module)
{
true_SetWindowLongA = hookImportFunc(module, "SetWindowLongA", hook_SetWindowLongA);
}
}

if (module)
{
true_SetWindowLongA = hookImportFunc(module, "SetWindowLongA", hook_SetWindowLongA);
// rikky_module.dll 内の ::DialogBoxParamA() をフックする。

HMODULE module = ::LoadLibrary(_T("rikky_module.dll"));

if (module)
{
true_DialogBoxParamA = hookImportFunc(module, "DialogBoxParamA", hook_DialogBoxParamA);
}
}

break;
Expand Down Expand Up @@ -130,13 +144,48 @@ IMPLEMENT_HOOK_PROC_NULL(LONG, WINAPI, SetWindowLongA, (HWND hwnd, int index, LO
return true_SetWindowLongA(hwnd, index, newLong);
}

DLGPROC true_dlgProc = 0;
INT_PTR CALLBACK hook_dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_NOTIFY:
{
MY_TRACE(_T("WM_NOTIFY\n"));

NMHDR* nm = (NMHDR*)lParam;

MY_TRACE(_T("%d, %d, 0x%08X\n"), nm->code, nm->idFrom, nm->hwndFrom);
MY_TRACE_HWND(nm->hwndFrom);

return 0;
}
case WM_PRINTCLIENT:
{
MY_TRACE(_T("WM_PRINTCLIENT\n"));

break;
}
}

return true_dlgProc(hwnd, message, wParam, lParam);
}

IMPLEMENT_HOOK_PROC_NULL(INT_PTR, WINAPI, DialogBoxParamA, (HINSTANCE instance, LPCSTR templateName, HWND parent, DLGPROC dlgProc, LPARAM lParam))
{
MY_TRACE(_T("DialogBoxParamA(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)\n"), instance, templateName, parent, dlgProc, lParam);

true_dlgProc = dlgProc;
return ::DialogBoxParamW(instance, (LPCWSTR)templateName, parent, hook_dlgProc, lParam);
}

//---------------------------------------------------------------------
// フィルタ構造体のポインタを渡す関数
//---------------------------------------------------------------------
EXTERN_C __declspec(dllexport) FILTER_DLL* CALLBACK GetFilterTable()
{
static TCHAR g_filterName[] = TEXT("スクリプト並び替えパッチ");
static TCHAR g_filterInformation[] = TEXT("スクリプト並び替えパッチ 1.0.0 by 蛇色");
static TCHAR g_filterInformation[] = TEXT("スクリプト並び替えパッチ 2.0.0 by 蛇色");

static FILTER_DLL g_filter =
{
Expand Down

0 comments on commit b256f96

Please sign in to comment.