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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:43:01+00:00 2026-05-15T00:43:01+00:00

Here is my .mm file #include windowmanagerutils.h #ifdef Q_OS_MAC #import </System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGWindow.h> QRect WindowManagerUtils::getWindowRect(WId windowId)

  • 0

Here is my .mm file

#include "windowmanagerutils.h"

#ifdef Q_OS_MAC
#import </System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGWindow.h>

QRect WindowManagerUtils::getWindowRect(WId windowId)
{
    CFArrayRef windows = CGWindowListCreate(kCGWindowListOptionOnScreenOnly, kCGNullWindowID);
    return QRect();
}

QRect WindowManagerUtils::getClientRect(WId windowId)
{
    return QRect();
}

QString WindowManagerUtils::getWindowText(WId windowId)
{
    return QString();
}

WId WindowManagerUtils::rootWindow()
{
    QApplication::desktop()->winId();
}

WId WindowManagerUtils::windowFromPoint(const QPoint &p, WId parent, bool(*filterFunction)(WId))
{
    return NULL;
}

void WindowManagerUtils::setTopMostCarbon(const QWidget *const window, bool topMost)
{
    if (!window)
    {
        return;
    }

    // Find a Cocoa equivalent for this Carbon function
    // [DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
    // OSStatus ret = HIViewSetZOrder(this->winId(), kHIViewZOrderAbove, NULL);
}
#endif

The linker is telling me “_CGWindowListCreate” is undefined. What libraries must I link to? Apple’s documentation is not very helpful on telling what to include or link to, like MSDN is. Also I couldn’t just do #import <CGWindow.h>, I had to specify the absolute path to it… any way around that?

  • 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-15T00:43:02+00:00Added an answer on May 15, 2026 at 12:43 am

    The CGWindowListCreate function is part of the Quartz Window Services. The corresponding framework is ApplicationServices which is located under /System/Library/Frameworks/.

    So, you can just include <ApplicationServices/ApplicationServices.h> at the top of the file and link with the -framework ApplicationServicesoption.

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

Sidebar

Related Questions

Here's my library Lib.c file: #include <stdio.h> int helloworld(){ printf(Hello World DLL); } Here's
Here is a simple program to output to a text file: #include <iostream> #include
Here is my code which checks if the file exists : #include<stdio.h> #include<zlib.h> #include<unistd.h>
Here is my code: #include <stdio.h> int main(void) { FILE *fp; unsigned int i;
Here is my code: //test file #include <iostream> #include stat.h #include frequency.h using namespace
I have a bit of a mess of a file system here at work,
Here is my code: //Connect to config file include(dirname(__FILE__)./../config.php); //Connect to the database $db
So, here's my code (for simplicity I put it all into one file): #include
Here's a simple C file: #include <stdio.h> #include <stdlib.h> int main() { printf(hi there!\n);
Here is my Matrix.cpp file. (there's a separate Matrix.h file) #include <iostream> #include <stdexcept>

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.