40,7 → 40,38 |
HCURSOR hCurHandQuestion; |
HICON hIconCautionSign; |
|
// This method will register the "slider" class used in dialogs. |
typedef void(__stdcall* f_InitCommonControls)(); |
typedef BOOL(__stdcall* f_InitCommonControlsEx)(const INITCOMMONCONTROLSEX* picce); |
void RegisterMsTrackbar() { |
f_InitCommonControls fInitCommonControls; |
f_InitCommonControlsEx fInitCommonControlsEx; |
HMODULE libComctl32; |
|
libComctl32 = LoadLibraryA("Comctl32.dll"); |
if (!libComctl32) return; |
fInitCommonControlsEx = (f_InitCommonControlsEx)(void*)GetProcAddress(libComctl32, "InitCommonControlsEx"); |
if (fInitCommonControlsEx != 0) { |
INITCOMMONCONTROLSEX icce; |
icce.dwSize = sizeof(INITCOMMONCONTROLSEX); |
icce.dwICC = ICC_BAR_CLASSES; |
fInitCommonControlsEx(&icce); |
FreeLibrary(libComctl32); |
return; |
} |
else { |
fInitCommonControls = (f_InitCommonControls)(void*)GetProcAddress(libComctl32, "InitCommonControls"); |
if (fInitCommonControls != 0) { |
fInitCommonControls(); |
FreeLibrary(libComctl32); |
return; |
} |
else { |
return; |
} |
} |
} |
|
// PLUGIN.DLL Sliders: This method will register the "slider" class used in dialogs. |
typedef int(__cdecl* f_RegisterSlider)(HINSTANCE hInstanceDll, DWORD* MessageID); |
int RegisterSlider(HINSTANCE hInstanceDll, DWORD* MessageID) { |
f_RegisterSlider fRegisterSlider; |
55,7 → 86,7 |
} |
} |
|
// This method will unregister the "slider" class used in dialogs. |
// PLUGIN.DLL Sliders: This method will unregister the "slider" class used in dialogs. |
typedef int(__cdecl* f_UnregisterSlider)(HINSTANCE hInstanceDll); |
int UnregisterSlider(HINSTANCE hInstanceDll) { |
f_UnregisterSlider fUnregisterSlider; |
70,6 → 101,7 |
} |
} |
|
// PLUGIN.DLL Sliders: Set slider range (min/max) |
typedef int(__cdecl* f_SetSliderRange)(HWND hWnd, int nMin, int nMax); |
int SetSliderRange(HWND hWnd, int nMin, int nMax) { |
f_SetSliderRange fSetSliderRange; |
84,6 → 116,7 |
} |
} |
|
// PLUGIN.DLL Sliders : Sets slider position |
typedef int(__cdecl* f_SetSliderPos)(HWND hWnd, int nPos, BOOL bRepaint); |
int SetSliderPos(HWND hWnd, int nPos, BOOL bRepaint) { |
f_SetSliderPos fSetSliderPos; |
98,6 → 131,7 |
} |
} |
|
// PLUGIN.DLL Sliders : Get slider position |
typedef int(__cdecl* f_GetSliderPos)(HWND hWnd, BOOL bPixelPosition); |
int GetSliderPos(HWND hWnd, BOOL bPixelPosition) { |
f_GetSliderPos fGetSliderPos; |
427,7 → 461,10 |
dbg(s); |
} |
} |
else if (GetClassInfo(hDllInstance, "msctls_trackbar32", &clx) != 0) { |
else { |
RegisterMsTrackbar(); |
|
if (GetClassInfo(hDllInstance, "msctls_trackbar32", &clx) != 0) { |
// We couldn't get the sliders from PLUGIN.DLL (probably not running in Photoshop) |
// Try the Microsoft Trackbar Control instead |
clx.lpszClassName = "FoundrySlider"; |
459,6 → 496,7 |
dbg(s); |
} |
} |
} |
|
// For the preview image and caution symbols, we register a class, so that we can assign a mouse cursor to this class. |
GetClassInfo(hDllInstance, "STATIC", &clx); |