Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Missing WinApi function
Forum Updated to NodeBB v4.3 + New Features

[Solved] Missing WinApi function

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 2.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andyc
    wrote on 20 Jan 2012, 17:05 last edited by
    #1

    Maybe this isnt pure QT related problem, but i cant find out whats wrong
    i have a main.cpp file, where are, among the others, these header files included
    @#include <windows.h>
    #include <winuser.h>
    @
    then, in a callback function there is this piece of code

    @GUITHREADINFO info;
    info.cbSize = sizeof(GUITHREADINFO);
    if(GetGUIThreadInfo(0, &info))
    {
    //some action
    }@

    when i try to build this, i get this error

    bq.
    main.cpp:116: error: 'GUITHREADINFO' was not declared in this scope
    main.cpp:116: error: expected ';' before 'info'
    main.cpp:117: error: 'info' was not declared in this scope
    main.cpp:193: error: 'GetGUIThreadInfo' was not declared in this scope

    ive checked header file and i found this line
    C:\QtSDK\mingw\include\winuser.h
    @#if (WINVER >= 0x0500)
    WINUSERAPI BOOL WINAPI GetGUIThreadInfo(DWORD,LPGUITHREADINFO);
    #endif@

    so i really dont get this behavious, any help apprecieted
    AndyC

    //well, ive solved the problem just after i posted it :)
    for some strange reason, i found out, that in the windef.h file was WINVER defined as 0x0400
    so i simply had to redefined it before including ani window header file to some higher value, and problem is solved :)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 21 Jan 2012, 06:41 last edited by
      #2

      Add [Solved] to the thread's subject, then. It took me some time to read the whole post just to find the note at the end.

      (Z(:^

      1 Reply Last reply
      0

      1/2

      20 Jan 2012, 17:05

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved