Results 1 to 4 of 4

Thread: Using Winapi in Qt?

  1. #1
    Join Date
    Oct 2009
    Posts
    50
    Thanks
    22
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Using Winapi in Qt?

    Is it possible to use Winapi in Qt?I found some Winapi examples on internet,then I chose "empty Qt4 project" in Qt Creator,then I added a source file,and then copied and pasted the example code into the source file(.cpp).But Qt Creator gave many errors when I try to build it.I tried with other example Winapi codes too,but again it gave many errors...

  2. #2
    Join Date
    Oct 2009
    Posts
    50
    Thanks
    22
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using Winapi in Qt?

    I tried a few other examples,and they worked.But I didn't use Wiapi code in Qt application,it worked as a seperate standard c++ file.How can I use Winapi in Qt applications(both Qt and Winapi code in the same file) ,is it possible??

    Also I wonder why I couldn't find proper information about using winapi with Qt on internet.
    Last edited by Awareness; 21st February 2010 at 03:05.

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using Winapi in Qt?

    Just include the appropriate windows header file and libraries, and it'll work as expected. For example, a lot of WinAPI functions can be defined by simply including windows.h

  4. The following user says thank you to squidge for this useful post:

    Awareness (27th February 2010)

  5. #4
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using Winapi in Qt?

    Also don't forget to include the proper libraries during linking.

Similar Threads

  1. Winapi in Qt
    By Trok in forum Qt Programming
    Replies: 1
    Last Post: 19th July 2009, 16:38
  2. Using WinAPI FindWindow with Qt
    By emostar in forum Qt Programming
    Replies: 16
    Last Post: 11th July 2009, 09:27
  3. Getting QLabel to work with WinAPI GetWindowText?
    By m.parker in forum Qt Programming
    Replies: 3
    Last Post: 22nd December 2006, 21:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.