Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3596064
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:56:07+00:00 2026-05-18T19:56:07+00:00

I am hooking the ExtTextOut GDI API. There I want to retrieve the exact

  • 0

I am hooking the ExtTextOut GDI API.
There I want to retrieve the exact location of the output String.

BOOL ExtTextOut( 
  __in  HDC hdc, 
  __in  int X, 
  __in  int Y, 
  __in  UINT fuOptions, 
  __in  const RECT *lprc, 
  __in  LPCTSTR lpString, 
  __in  UINT cbCount, 
  __in  const INT *lpDx 
); 

In a specific case I am getting ETO_CLIPPED for the fuOptions param which mean I can get the location of the string from the RECT param or from the X,Y params.
However when I use the LPtoDP API for translating the location (RECT or X,Y) I get wrong location (before translating I get negative values).

I guess it has a wrong offset, however when I check the followings I see no indicaton for that:

Map Mode is MM_TEXT (default)
GetWindowOrgEx is 0,0
GetViewportOrgEx is 0,0
GetWindowExtEx is 1,1
GetViewportExtEx is 1,1

Does anyone have any idea, any help will be appreciated.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T19:56:07+00:00Added an answer on May 18, 2026 at 7:56 pm

    Apparently, specifying ETO_CLIPPED in the ExtTextOut fuOptions param
    does not imply that the text will be output to that clip, meaning that it is not guaranteed that the device context is of type display device context, and the device context that is used can be a memory device context, as in my case, and therefore do not contains the right coordinates.

    msdn: ETO_CLIPPED The text will be clipped to the rectangle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am hooking the ExtTextOut GDI API. There I want to retrieve the exact
I am Hooking the GDI API ExtTextOut BOOL ExtTextOut( __in HDC hdc, __in int
Does anyone know about system-wide API hooking with Delphi? I downloaded madCodeHook, but it
I want to detect when my application is sent to the background. There are
I am following this guide (http://devcenter.heroku.com/articles/omniauth-and-force-com) in hooking up Salesforce.com REST API with ruby
I have a problem hooking int 09h I've changed the pointer to my new
I am working on printer driver. In this driver I am hooking to GDI
Does anyone have experience in hooking onto events. so we can modify there behavior
I'm trying to do some basic hooking with microsoft detours and I can't get
In the application I am creating, I am hooking an Editor up directly to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.