Skip to content

Commit

Permalink
Fix adding WndProc and get structure return
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Oct 1, 2024
1 parent 277679d commit 68a9385
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7225
#define BUILD_NUMBER 7226
1 change: 1 addition & 0 deletions GDI/WndProc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ WndProc::DATASTRUCT* WndProc::GetWndProctStruct(HWND hWnd)
return entry->GetDataStruct();
}
}
return nullptr;
}

LRESULT CALLBACK WndProc::Handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROCSTRUCT* AppWndProcInstance)
Expand Down
6 changes: 3 additions & 3 deletions ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,9 +1701,6 @@ HRESULT m_IDirectDrawX::SetCooperativeLevel(HWND hWnd, DWORD dwFlags, DWORD Dire
Utils::WaitForWindowActions(DisplayMode.hWnd, 100);
}

// Hook WndProc before creating device
WndProc::AddWndProc(hWnd, true);

// Set exclusive mode resolution
if (ExclusiveMode && DisplayMode.Width && DisplayMode.Height && DisplayMode.BPP)
{
Expand Down Expand Up @@ -2973,6 +2970,9 @@ HRESULT m_IDirectDrawX::CreateD9Device(char* FunctionName)
// Store new focus window
hFocusWindow = hWnd;

// Hook WndProc before creating device
WndProc::AddWndProc(hWnd, true);

// Get current resolution and rect
bool SetResolution = true;
DWORD CurrentWidth = 0, CurrentHeight = 0;
Expand Down

0 comments on commit 68a9385

Please sign in to comment.