1
0

Options.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef NULLSOFT_OPTIONSH
  2. #define NULLSOFT_OPTIONSH
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C"
  6. {
  7. #endif
  8. #include <shlobj.h>
  9. typedef struct { int id, id2; } hi;
  10. typedef struct { UINT id; WNDPROC proc; } multiPage;
  11. HWND _dosetsel(HWND hwndDlg, HWND subwnd, int* last_page, multiPage* pages, int numpages);
  12. INT_PTR CALLBACK PlaybackProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  13. //INT_PTR CALLBACK StationInfoProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  14. INT_PTR CALLBACK DspProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  15. INT_PTR CALLBACK GenProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  16. INT_PTR CALLBACK VisProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  17. INT_PTR CALLBACK VideoProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  18. INT_PTR CALLBACK PlaybackOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  19. INT_PTR CALLBACK TitleProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  20. INT_PTR CALLBACK SetupProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  21. INT_PTR CALLBACK FtypeProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  22. INT_PTR CALLBACK SkinProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  23. INT_PTR CALLBACK classicSkinProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  24. INT_PTR CALLBACK OutputProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  25. INT_PTR CALLBACK InputProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  26. INT_PTR CALLBACK PlugProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  27. INT_PTR CALLBACK LangProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  28. void do_help(HWND hwnd, UINT id, HWND hTooltipWnd);
  29. #ifdef DO_COLORS
  30. #define C_BLAH \
  31. if (uMsg == WM_CTLCOLORDLG) return GetStockObject(DKGRAY_BRUSH); \
  32. if (uMsg == WM_CTLCOLORSTATIC) { \
  33. SetTextColor(wParam,RGB(220,220,220)); SetBkColor(wParam,RGB(64,64,64)); \
  34. return GetStockObject(DKGRAY_BRUSH);} \
  35. if (uMsg == WM_CTLCOLORLISTBOX) { \
  36. SetTextColor(wParam,RGB(0,220,0)); SetBkColor(wParam,RGB(0,0,0)); \
  37. return GetStockObject(BLACK_BRUSH);} \
  38. if (uMsg == WM_CTLCOLOREDIT) { \
  39. SetTextColor(wParam,RGB(0,220,0)); SetBkColor(wParam,RGB(0,0,0)); \
  40. return GetStockObject(BLACK_BRUSH);}
  41. #else
  42. #define C_BLAH
  43. #endif
  44. #define DO_HELP() \
  45. static HWND hTooltipWnd; \
  46. C_BLAH \
  47. if (uMsg == WM_HELP) { \
  48. HELPINFO *hi=(HELPINFO *)(lParam); \
  49. if (hi->iContextType == HELPINFO_WINDOW) { do_help(hwndDlg,hi->iCtrlId,hTooltipWnd);} \
  50. return TRUE; \
  51. } \
  52. if (uMsg == WM_NOTIFY) { LPNMHDR t=(LPNMHDR)lParam; if (t->code == TTN_POP) { SendMessageW(hTooltipWnd,TTM_SETDELAYTIME,TTDT_INITIAL,1000); SendMessageW(hTooltipWnd,TTM_SETDELAYTIME,TTDT_RESHOW,1000); } } \
  53. if (uMsg == WM_DESTROY && IsWindow(hTooltipWnd)) { DestroyWindow(hTooltipWnd); hTooltipWnd=NULL; } \
  54. if (uMsg == WM_INITDIALOG) { \
  55. int x; \
  56. hTooltipWnd = CreateWindowW(TOOLTIPS_CLASSW,(LPCWSTR)NULL,TTS_ALWAYSTIP, \
  57. CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT, hwndDlg,NULL,GetModuleHandle(NULL),NULL); \
  58. SendMessageW(hTooltipWnd,TTM_SETMAXTIPWIDTH,0,587); \
  59. SendMessageW(hTooltipWnd,TTM_SETDELAYTIME,TTDT_INITIAL,1000); \
  60. SendMessageW(hTooltipWnd,TTM_SETDELAYTIME,TTDT_RESHOW,1000); \
  61. for (x = 0; x < sizeof(helpinfo)/sizeof(helpinfo[0]); x ++) { \
  62. TOOLINFOW ti; ti.cbSize = sizeof(ti); ti.uFlags = TTF_SUBCLASS|TTF_IDISHWND; \
  63. ti.uId=(UINT_PTR)GetDlgItem(hwndDlg,helpinfo[x].id); ti.hwnd=hwndDlg; ti.lpszText=getStringW(helpinfo[x].id2,NULL,0); \
  64. SendMessageW(hTooltipWnd,TTM_ADDTOOLW,0,(LPARAM) &ti); \
  65. } \
  66. }
  67. #define ListView_InsertColumnW(hwnd, iCol, pcol) \
  68. (int)SNDMSG((hwnd), LVM_INSERTCOLUMNW, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMNW *)(pcol))
  69. #define ListView_InsertItemW(hwnd, pitem) \
  70. (int)SNDMSG((hwnd), LVM_INSERTITEMW, 0, (LPARAM)(const LV_ITEMW *)(pitem))
  71. #define ListView_SetItemTextW(hwndLV, i, iSubItem_, pszText_) \
  72. { LV_ITEMW _macro_lvi;\
  73. _macro_lvi.iSubItem = (iSubItem_);\
  74. _macro_lvi.pszText = (pszText_);\
  75. SNDMSG((hwndLV), LVM_SETITEMTEXTW, (WPARAM)(i), (LPARAM)(LV_ITEMW *)&_macro_lvi);\
  76. }
  77. #define ListView_SetItemW(hwnd, pitem) \
  78. (BOOL)SNDMSG((hwnd), LVM_SETITEMW, 0, (LPARAM)(LV_ITEMW *)(pitem))
  79. #define ListView_GetItemW(hwnd, pitem) \
  80. (BOOL)SNDMSG((hwnd), LVM_GETITEMW, 0, (LPARAM)(LV_ITEMW *)(pitem))
  81. #define ListView_GetItemTextW(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
  82. { LV_ITEMW _macro_lvi;\
  83. _macro_lvi.iSubItem = (iSubItem_);\
  84. _macro_lvi.cchTextMax = (cchTextMax_);\
  85. _macro_lvi.pszText = (pszText_);\
  86. SNDMSG((hwndLV), LVM_GETITEMTEXTW, (WPARAM)(i), (LPARAM)(LV_ITEMW *)&_macro_lvi);\
  87. }
  88. #endif
  89. #ifdef __cplusplus
  90. }
  91. #endif