aboutsummaryrefslogtreecommitdiff
path: root/Src/auth/Loginbox/common.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/auth/Loginbox/common.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/auth/Loginbox/common.h')
-rw-r--r--Src/auth/Loginbox/common.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/Src/auth/Loginbox/common.h b/Src/auth/Loginbox/common.h
new file mode 100644
index 00000000..92b68063
--- /dev/null
+++ b/Src/auth/Loginbox/common.h
@@ -0,0 +1,96 @@
+#ifndef NULLSOFT_AUTH_LOGINBOX_COMMON_HEADER
+#define NULLSOFT_AUTH_LOGINBOX_COMMON_HEADER
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#include <wtypes.h>
+
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(blah) (sizeof(blah)/sizeof(*blah))
+#endif
+
+#define CSTR_INVARIANT MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)
+
+#ifndef LONGX86
+#ifdef _WIN64
+ #define LONGX86 LONG_PTR
+#else /*_WIN64*/
+ #define LONGX86 LONG
+#endif /*_WIN64*/
+#endif // LONGX86
+
+#ifdef __cplusplus
+ #define SENDMSG(__hwnd, __msgId, __wParam, __lParam) ::SendMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
+#else
+ #define SENDMSG(__hwnd, __msgId, __wParam, __lParam) SendMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
+#endif // __cplusplus
+
+#define MSGRESULT(__hwnd, __result) { SetWindowLongPtrW((__hwnd), DWLP_MSGRESULT, ((LONGX86)(LONG_PTR)(__result))); return TRUE; }
+
+#ifndef GetWindowStyle
+#define GetWindowStyle(__hwnd) ((UINT)GetWindowLongPtr((__hwnd), GWL_STYLE))
+#endif //GetWindowStyle
+
+#ifndef GetWindowStyleEx
+#define GetWindowStyleEx(__hwnd) ((UINT)GetWindowLongPtr((__hwnd), GWL_EXSTYLE))
+#endif //GetWindowStyleEx
+
+
+LPWSTR LoginBox_MallocString(size_t cchLen);
+void LoginBox_FreeString(LPWSTR pszString);
+void LoginBox_FreeStringSecure(LPWSTR pszString);
+
+LPWSTR LoginBox_ReAllocString(LPWSTR pszString, size_t cchLen);
+LPWSTR LoginBox_CopyString(LPCWSTR pszSource);
+LPSTR LoginBox_MallocAnsiString(size_t cchLen);
+LPSTR LoginBox_CopyAnsiString(LPCSTR pszSource);
+void LoginBox_FreeAnsiString(LPSTR pszString);
+void LoginBox_FreeAnsiStringSecure(LPSTR pszString);
+size_t LoginBox_GetAllocSize(void *memory);
+size_t LoginBox_GetStringMax(LPWSTR pszString);
+size_t LoginBox_GetAnsiStringMax(LPSTR pszString);
+
+HRESULT LoginBox_WideCharToMultiByte(UINT codePage, DWORD dwFlags, LPCWSTR lpWideCharStr, INT cchWideChar, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar, LPSTR *ppResult);
+HRESULT LoginBox_MultiByteToWideChar(UINT codePage, DWORD dwFlags, LPCSTR lpMultiByteStr, INT cbMultiByte, LPWSTR *ppResult);
+
+HRESULT LoginBox_GetWindowText(HWND hwnd, LPWSTR *ppszText, UINT *pcchText);
+
+HRESULT LoginBox_GetConfigPath(LPWSTR pszConfig, BOOL fEnsureExist);
+HRESULT LoginBox_EnsurePathExist(LPCWSTR pszDirectory);
+
+BOOL LoginBox_PrintWindow(HWND hwnd, HDC hdc, UINT flags);
+
+BOOL LoginBox_MessageBeep(UINT beepType);
+
+HRESULT LoginBox_IsStringEqualEx(LCID locale, BOOL ignoreCase, LPCWSTR str1, LPCWSTR str2);
+
+#define LoginBox_IsStrEq(str1, str2)\
+ LoginBox_IsStringEqualEx(LOCALE_USER_DEFAULT, FALSE, str1, str2)
+
+#define LoginBox_IsStrEqI(str1, str2)\
+ LoginBox_IsStringEqualEx(LOCALE_USER_DEFAULT, TRUE, str1, str2)
+
+#define LoginBox_IsStrEqInv(str1, str2)\
+ LoginBox_IsStringEqualEx(CSTR_INVARIANT, FALSE, str1, str2)
+
+#define LoginBox_IsStrEqInvI(str1, str2)\
+ LoginBox_IsStringEqualEx(CSTR_INVARIANT, TRUE, str1, str2)
+
+UINT LoginBox_GetCurrentTime();
+HRESULT LoginBox_GetCurrentLang(LPSTR *ppLang);
+
+HDWP LoginBox_LayoutButtonBar(HDWP hdwp, HWND hwnd, const INT *buttonList, UINT buttonCount, const RECT *prcClient, LONG buttonHeight, LONG buttonSpace, BOOL fRedraw, RECT *prcResult);
+
+BYTE LoginBox_GetSysFontQuality();
+INT LoginBox_GetAveStrWidth(HDC hdc, INT cchLen);
+INT LoginBox_GetAveCharWidth(HDC hdc);
+BOOL LoginBox_GetWindowBaseUnits(HWND hwnd, INT *pBaseUnitX, INT *pBaseUnitY);
+INT LoginBox_GetWindowTextHeight(HWND hwnd, INT paddingDlgUnit);
+BOOL LoginBox_GetWindowTextSize(HWND hwnd, INT idealWidth, INT *pWidth, INT *pHeight);
+
+BOOL LoginBox_OpenUrl(HWND hOwner, LPCWSTR pszUrl, BOOL forceExternal);
+
+
+#endif //NULLSOFT_AUTH_LOGINBOX_COMMON_HEADER \ No newline at end of file