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 3666148
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:50:44+00:00 2026-05-19T01:50:44+00:00

I want to use the windows detours library to detour a non win api

  • 0

I want to use the windows detours library to detour a non win api function. The function is part of the Qt library (QtGui4.dll). I am wondering how I would set up the function signature for :

void QPainter::drawText ( const QPointF & position, const QString & text )

I had a go with this and it received my usual share of errors, a little explanation of requirements would be interesting as well:

void (QPainter * real_drawText)(const QPointF & position, const QString & text) = drawText

This is what they look like for TextOut, under the windows API:

BOOL (WINAPI * Real_TextOut)(HDC a0, int a1, int a2, LPCWSTR a3, int a4) = TextOutW;
BOOL WINAPI Mine_TextOut(HDC hdc,int X,int Y,LPCWSTR text,int textLen)
{
BOOL rv = Real_TextOut(hdc, X, Y, text, textLen);

HWND hWindow = WindowFromDC(hdc);

SendTextMessage(hWindow, text);

return rv;
}

So, following on from Gene’s suggestion I tried:

typedef void (QPainter::* Real_qp_drawText)(const QPointF & position, const QString & text);

void Mine_drawText(const QPointF & position, const QString & text)
{

    Real_qp_drawText(position,text);

}

But got the error, ‘a function-style conversion to a built-in type can only take one parameter.

So anyway, they say a little public humiliation is good for the soul, my soul must be having the best time…

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-19T01:50:44+00:00Added an answer on May 19, 2026 at 1:50 am

    The type of your functions is FnType:

    typedef void (QPainter::*FnType)(const QPointF &, const QString &);
    

    but it looks like what they expect is a WINIAPI = __stdcall C function instead. You might think if you can wrap your function into a C function.

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

Sidebar

Related Questions

First, please forgive my bad english ;) I want to use the windows function
Hi i want to use windows form application in way like an api from
I want to use windows apis in JRuby. Please suggest any api that can
I want to use WPF windows in a legacy win32 application. I'd like to
When I want to use multiple windows in my code, I normally do it
I'm new to emacs and I want to use ensime in Windows. I had
I want to use modal pop-up windows in our web app in Ruby on
I want to use delayed signing for my windows mobile compact framework assemblies. When
I want to use blob-leasing mechanism in my Windows Azure cloud app. I am
I want to use gestures on a windows mobile phone. For example (using .net

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.