I'm patching an old game, and I want the retrieve the toggle fullscreen functionality it's supposed to have.

In the menu, in the display tab, there is a disabled option of fullscreen mode that you can either click on or press ALT+ENTER and it should toggle fullscreen and windowed screen.

Currently the button is disabled like this:

enter image description here

At first, I thought the button is disabled because of inaccurate flags were sent to the ModifyMenu function, but it doesn't seem to be the case.

After that, I looked for an accelerator table in the resource section but there wasn't one, not even an external one. Every function related the accelerators got passed on or return NULL.

It got me thinking, what about the other supposed accelerator keys in different parts of the menu, how are they handled?

enter image description here

So I looked for the scalars 0x71 and 0x72 which are the virtual key codes to F2 and F3 keys and sure enough, I found a function that checks for these values and handle them like the game behaves:

enter image description here

My problem is that I'm not sure how to proceed from here because the function that calls the one I found now was being call way too often and I can't debug it properly.

Do I just need to add my own condition that checks for the ALT+ENTER virtual key code and handle it accordingly? If so, what are the best way of doing it?

Or maybe I'm missing something else entirely?

Please let me know if you have any other leads!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.