@@ -624,8 +624,8 @@ LRESULT dialog_control::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
624
624
this ->img .reset (new Bitmap (rc.bottom - rc.top , rc.right - rc.left ));
625
625
626
626
// check if the application is implicitly routed, aka managed
627
- bootstrapper& bootstrap = *this ->parent .parent .parent .bootstrap ;
628
- this ->managed = bootstrap.is_saved_routing (this ->pid , this ->parent .get_device ());
627
+ /* bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;*/
628
+ this ->managed = false ; // bootstrap.is_saved_routing(this->pid, this->parent.get_device());
629
629
630
630
return 0 ;
631
631
}
@@ -781,105 +781,105 @@ LRESULT dialog_control::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
781
781
return 0 ;
782
782
}
783
783
784
- LRESULT dialog_control::OnPopUpSave (WORD /* wNotifyCode*/ , WORD /* wID*/ , HWND /* hWndCtl*/ , BOOL& /* bHandled*/ )
785
- {
786
- if (this ->MessageBoxW (
787
- L" This will add a new saved routing for this application. It will not " \
788
- L" replace the old saved routings for this application. Do you wish to continue?" ,
789
- L" Confirmation for Save" , MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
790
- return 0 ;
791
-
792
- bootstrapper& bootstrap = *this ->parent .parent .parent .bootstrap ;
793
-
794
- input_dialog input_dlg (2 );
795
- input_dlg.DoModal (*this );
796
- if (IsBadReadPtr (this , sizeof (dialog_control)))
797
- return 0 ;
798
- const int sel_index = input_dlg.selected_index ;
799
- if (sel_index > 0 )
800
- {
801
- app_inject::devices_t devices;
802
- app_inject::get_devices (devices);
803
- try
804
- {
805
- bootstrap.save_routing (this ->pid , devices[sel_index - 1 ]);
806
- }
807
- catch (std::wstring err)
808
- {
809
- app_inject::clear_devices (devices);
810
- this ->MessageBoxW (err.c_str (), NULL , MB_ICONERROR);
811
- return 0 ;
812
- }
813
- app_inject::clear_devices (devices);
814
-
815
- dialog_main& main = this ->parent .parent ;
816
- for (dialog_main::dialog_arrays_t ::iterator it = main.dialog_arrays .begin ();
817
- it != main.dialog_arrays .end ();
818
- it++)
819
- {
820
- for (dialog_array::dialog_controls_t ::iterator jt = (*it)->dialog_controls .begin ();
821
- jt != (*it)->dialog_controls .end ();
822
- jt++)
823
- {
824
- (*jt)->managed = bootstrap.is_saved_routing ((*jt)->pid , (*jt)->parent .get_device ());
825
- (*jt)->update_attributes ();
826
- }
827
- }
828
-
829
- this ->MessageBoxW (L" Routing saved. Restart the application for the new settings " \
830
- L" to take effect." ,
831
- L" Success" , MB_ICONINFORMATION);
832
- }
833
- else if (sel_index == 0 )
834
- this ->MessageBoxW (L" You cannot save routing to the default device!" ,
835
- NULL , MB_ICONERROR);
836
-
837
- return 0 ;
838
- }
839
-
840
-
841
- LRESULT dialog_control::OnPopUpDelete (WORD /* wNotifyCode*/ , WORD /* wID*/ , HWND /* hWndCtl*/ , BOOL& /* bHandled*/ )
842
- {
843
- bootstrapper& bootstrap = *this ->parent .parent .parent .bootstrap ;
844
-
845
- if (this ->MessageBoxW (
846
- L" This will delete all the saved routings for this application. It won't " \
847
- L" delete the routings for any other application. Proceed?" ,
848
- L" Confirmation for Delete All" , MB_OKCANCEL | MB_ICONWARNING) != IDOK)
849
- return 0 ;
850
-
851
- try
852
- {
853
- if (!bootstrap.delete_all (this ->pid ))
854
- {
855
- this ->MessageBoxW (
856
- L" This application doesn't have any saved routings." , NULL , MB_ICONERROR);
857
- return 0 ;
858
- }
859
- }
860
- catch (std::wstring err)
861
- {
862
- this ->MessageBoxW (err.c_str (), NULL , MB_ICONERROR);
863
- return 0 ;
864
- }
865
-
866
- dialog_main& main = this ->parent .parent ;
867
- for (dialog_main::dialog_arrays_t ::iterator it = main.dialog_arrays .begin ();
868
- it != main.dialog_arrays .end ();
869
- it++)
870
- {
871
- for (dialog_array::dialog_controls_t ::iterator jt = (*it)->dialog_controls .begin ();
872
- jt != (*it)->dialog_controls .end ();
873
- jt++)
874
- {
875
- (*jt)->managed = bootstrap.is_saved_routing ((*jt)->pid , (*jt)->parent .get_device ());
876
- (*jt)->update_attributes ();
877
- }
878
- }
879
-
880
- this ->MessageBoxW (L" Saved routings for this application deleted. Restart " \
881
- L" the application for the new settings to take effect." ,
882
- L" Success" , MB_ICONINFORMATION);
883
-
884
- return 0 ;
885
- }
784
+ // LRESULT dialog_control::OnPopUpSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
785
+ // {
786
+ // if(this->MessageBoxW(
787
+ // L"This will add a new saved routing for this application. It will not " \
788
+ // L"replace the old saved routings for this application. Do you wish to continue?",
789
+ // L"Confirmation for Save", MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
790
+ // return 0;
791
+ //
792
+ // bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;
793
+ //
794
+ // input_dialog input_dlg(2);
795
+ // input_dlg.DoModal(*this);
796
+ // if(IsBadReadPtr(this, sizeof(dialog_control)))
797
+ // return 0;
798
+ // const int sel_index = input_dlg.selected_index;
799
+ // if(sel_index > 0)
800
+ // {
801
+ // app_inject::devices_t devices;
802
+ // app_inject::get_devices(devices);
803
+ // try
804
+ // {
805
+ // bootstrap.save_routing(this->pid, devices[sel_index - 1]);
806
+ // }
807
+ // catch(std::wstring err)
808
+ // {
809
+ // app_inject::clear_devices(devices);
810
+ // this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR);
811
+ // return 0;
812
+ // }
813
+ // app_inject::clear_devices(devices);
814
+ //
815
+ // dialog_main& main = this->parent.parent;
816
+ // for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin();
817
+ // it != main.dialog_arrays.end();
818
+ // it++)
819
+ // {
820
+ // for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin();
821
+ // jt != (*it)->dialog_controls.end();
822
+ // jt++)
823
+ // {
824
+ // (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device());
825
+ // (*jt)->update_attributes();
826
+ // }
827
+ // }
828
+ //
829
+ // this->MessageBoxW(L"Routing saved. Restart the application for the new settings " \
830
+ // L"to take effect.",
831
+ // L"Success", MB_ICONINFORMATION);
832
+ // }
833
+ // else if(sel_index == 0)
834
+ // this->MessageBoxW(L"You cannot save routing to the default device!",
835
+ // NULL, MB_ICONERROR);
836
+ //
837
+ // return 0;
838
+ // }
839
+
840
+
841
+ // LRESULT dialog_control::OnPopUpDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
842
+ // {
843
+ // bootstrapper& bootstrap = *this->parent.parent.parent.bootstrap;
844
+ //
845
+ // if(this->MessageBoxW(
846
+ // L"This will delete all the saved routings for this application. It won't " \
847
+ // L"delete the routings for any other application. Proceed?",
848
+ // L"Confirmation for Delete All", MB_OKCANCEL | MB_ICONWARNING) != IDOK)
849
+ // return 0;
850
+ //
851
+ // try
852
+ // {
853
+ // if(!bootstrap.delete_all(this->pid))
854
+ // {
855
+ // this->MessageBoxW(
856
+ // L"This application doesn't have any saved routings.", NULL, MB_ICONERROR);
857
+ // return 0;
858
+ // }
859
+ // }
860
+ // catch(std::wstring err)
861
+ // {
862
+ // this->MessageBoxW(err.c_str(), NULL, MB_ICONERROR);
863
+ // return 0;
864
+ // }
865
+ //
866
+ // dialog_main& main = this->parent.parent;
867
+ // for(dialog_main::dialog_arrays_t::iterator it = main.dialog_arrays.begin();
868
+ // it != main.dialog_arrays.end();
869
+ // it++)
870
+ // {
871
+ // for(dialog_array::dialog_controls_t::iterator jt = (*it)->dialog_controls.begin();
872
+ // jt != (*it)->dialog_controls.end();
873
+ // jt++)
874
+ // {
875
+ // (*jt)->managed = bootstrap.is_saved_routing((*jt)->pid, (*jt)->parent.get_device());
876
+ // (*jt)->update_attributes();
877
+ // }
878
+ // }
879
+ //
880
+ // this->MessageBoxW(L"Saved routings for this application deleted. Restart " \
881
+ // L"the application for the new settings to take effect.",
882
+ // L"Success", MB_ICONINFORMATION);
883
+ //
884
+ // return 0;
885
+ // }
0 commit comments