CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2013
    Posts
    2

    DrawText get real location from HDC

    Hi,
    I hooked DrawText of another process and try to get the location that the text is going to be drawn.
    Not the internal rectangle of the device but the real location on the screen.

    Is there a way to do this using the HDC?

    Also i'm targeting the VCL labels in this process so i dont have a handle to a window.

    Thanks

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: DrawText get real location from HDC

    ClientToScreen() ?

    or you'll have to explain more detailed what you want to get.

  3. #3
    Join Date
    Dec 2013
    Posts
    2

    Re: DrawText get real location from HDC

    I'm writeing an automated test tool.
    I'm trying to check if a label was written to the screen in a vcl application.
    The label has no window in VCL so i cant get a handle to it but i want to know that the text was written in the right place.

    i hooked to drawtext and font the text was written to the screen but in the point param i get 0,0 that is the where in the rectangle of the label the text was writen but i need to know where on the screen is that rectangle located.
    My guess is that it has to with the HDC parameter but i cant get the info from it.

    I hope this clears it.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: DrawText get real location from HDC

    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured