OldSchoolHack

Register / Login English

[OSHGUI] directx , reset hook minimize and maximize game

icon Thread: [Help] [OSHGUI] directx , reset hook minimize and maximize game

Join Date: Jul 2013

Posts: 5

TEXT Code:
  1. unique_ptr<Drawing::Direct3D9Renderer> gui_renderer;
  2.  
  3. void Initialize()
  4. {
  5. unique_ptr<Drawing::Direct3D9Renderer> renderer( new Drawing::Direct3D9Renderer( g_pDevice ) );
  6. gui_renderer = std::move( renderer );
  7. Application::Initialize( std::move( gui_renderer ) );
  8. auto &app = Application::Instance();
  9. Drawing::FontPtr font = Drawing::FontManager::LoadFont( "Tahoma" , 8.0f , true );
  10. app.SetDefaultFont( font );
  11. auto form = std::make_shared<form1>();
  12. app.Run( form );
  13. app.Enable();
  14. app.RegisterHotkey( Hotkey( Key::Insert , []
  15. {
  16. Application::Instance().Toggle();
  17. } ) );
  18. }
  19.  
  20. HRESULT WINAPI Hook_Reset( LPDIRECT3DDEVICE9 pDevice , D3DPRESENT_PARAMETERS* pPresentationParameters )
  21. {
  22. if ( gui_renderer )
  23. gui_renderer->PreD3DReset();
  24.  
  25. HRESULT hRes = Reset_o( pDevice , pPresentationParameters );
  26.  
  27. if ( gui_renderer )
  28. gui_renderer->PostD3DReset();
  29.  
  30. return hRes;
  31. }
  32.  
  33. HRESULT WINAPI Hook_EndScene( IDirect3DDevice9* pDevice ) { static bool InitalizeGUI = false; if ( !InitalizeGUI ) { Initialize();
  34. messageHookHandle = SetWindowsHookExW( WH_GETMESSAGE , KeyboardHook , 0 , GetCurrentThreadId() ); InitalizeGUI = true; } if ( InitalizeGUI ) { auto &app = Application::Instance(); auto &renderer = app.GetRenderer(); renderer.BeginRendering(); app.Render(); renderer.EndRendering(); } return EndScene_o( pDevice ); }
  35.  

if minimize game(csgo) and maximize game then game freeze (minimize and maximize is work) , how to fix?