Solved Changing fonts in specific windows

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

snorble

Newbie
Full Member
Jan 30, 2016
9
52
0
This question is not about games, but about a regular Windows program. Specifically about a program that has many windows, like Visual Studio or Photoshop or something like that. This app I'm thinking of has several places where sub-windows use variable-width fonts, and when we put notes in the app it doesn't line up. So the fix for this app would be if we could replace the variable-width font with a fixed-width font.

It's only a few windows out of the whole program that we want to change, so I can't just change the font file to trick the app into using a different font, because it would use it everywhere in the app (and other apps on the system).

I am thinking I would need to do this:

  1. Find a way to identify the "interesting" windows where we want to change the font
  2. Hook the DrawText function (if that's what the app is using), and then use SelectObject to change the font
  3. Then call the regular DrawText function
  4. Change the font back to the original font with SelectObject

My questions are:

  1. Does this seem like the right approach?
  2. Does this seem like a realistic goal?

I think the hard part will be identifying the interesting windows that we want to change. I'm not sure they will have a caption, and there may be several windows with the same class. I also think the app was developed using some third-party GUI library or something, because some of the windows are not using regular windows controls, like some text boxes are not just text boxes that you can read the contents of by sending WM_GETTEXT.

But hey there is always a way right? What do you guys think?
 

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,294
37,938
269
I'd do option #2 , but instead of changing their current font just create your own one once and use it for that single draw, otherwise use the regular font.

Yeah, seems good and viable.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods