1
0

langutil.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "main.h"
  2. #include "./langutil.h"
  3. INT_PTR WADialogBoxParam(LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
  4. {
  5. INT_PTR ret(0);
  6. HINSTANCE hInst = (language_pack_instance) ? language_pack_instance : hMainInstance;
  7. while(hInst)
  8. {
  9. ret = DialogBoxParamW(hInst, lpTemplateName, hWndParent, lpDialogFunc, dwInitParam);
  10. if (-1 == ret && hInst != hMainInstance) hInst = hMainInstance;
  11. else break;
  12. }
  13. return ret;
  14. }
  15. HWND WACreateDialogParam(LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
  16. {
  17. HWND ret(NULL);
  18. HINSTANCE hInst = (language_pack_instance) ? language_pack_instance : hMainInstance;
  19. while(hInst)
  20. {
  21. ret = CreateDialogParamW(hInst, lpTemplateName, hWndParent, lpDialogFunc, dwInitParam);
  22. if (NULL == ret && hInst != hMainInstance) hInst = hMainInstance;
  23. else break;
  24. }
  25. return ret;
  26. }
  27. HBITMAP WALoadImage2(LPCWSTR pszSectionName, LPCWSTR lpImageName, BOOL bPremult)
  28. {
  29. HBITMAP ret(NULL);
  30. HINSTANCE hInst = (language_pack_instance) ? language_pack_instance : hMainInstance;
  31. while(hInst)
  32. {
  33. ret = WALoadImage(hInst, pszSectionName, lpImageName, bPremult);
  34. if (NULL == ret && hInst != hMainInstance) hInst = hMainInstance;
  35. else break;
  36. }
  37. return ret;
  38. }