MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / DialogProc

Function DialogProc

src/windows/OptionsDialog.cpp:788–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786}
787
788static INT_PTR CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
789{
790 switch (uMsg)
791 {
792 case WM_INITDIALOG:
793 {
794 OnPreferenceDialogInit(hWnd);
795 break;
796 }
797 case WM_NOTIFY:
798 {
799 LPNMHDR hdr = (LPNMHDR)lParam;
800 return OptionsOnNotify(hdr->hwndFrom, hWnd, lParam);
801 }
802 case WM_DESTROY:
803 {
804 DialogHeader* pData = (DialogHeader*) GetWindowLongPtr(hWnd, GWLP_USERDATA);
805 if (pData)
806 delete pData;
807
808 // fallthrough
809 }
810 case WM_COMMAND:
811 {
812 // The non-simplified interface can't handle commands.
813 if (!NT31SimplifiedInterface())
814 return 0L;
815
816 // Just do it for every page... if it doesn't recognize the button ID then it just does nothing
817 for (int i = PG_FIRST; i < PG_PAGE_COUNT; i++)
818 OptionsHandleCommand(hWnd, hWnd, i, uMsg, wParam, lParam);
819
820 break;
821 }
822 case WM_CLOSE:
823 {
824 EndDialog(hWnd, OPTIONS_RESULT_OK);
825 break;
826 }
827 }
828
829 return 0L;
830}
831
832int ShowOptionsDialog()
833{

Callers

nothing calls this directly

Calls 3

OnPreferenceDialogInitFunction · 0.85
OptionsOnNotifyFunction · 0.85
OptionsHandleCommandFunction · 0.85

Tested by

no test coverage detected