Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. winapi

    Log in to post
    • All categories
    • bibasmall

      Solved Child NativeWindow blocks nativeEvent messages for a NativeWindow parent
      General and Desktop • qt6 nativeevent framelesswindow winmigrate winapi • • bibasmall

      3
      0
      Votes
      3
      Posts
      110
      Views

      bibasmall

      The problem was that every child widget of the native widnow got it's own window descriptor (HWND), so, for example, if I hit the menubar, in nativeEvent I saw that the message had a different descriptor than the main window had.
      This is what solved my problem:

      QApplication a(argc, argv); a.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); //... CEventFilter e{ &w }; a.installNativeEventFilter(&e);
    • artwaw

      Solved Compile binary works standalone, doesn't from QtCreator (Windows API)
      General and Desktop • winapi mingw 64 bit • • artwaw

      10
      0
      Votes
      10
      Posts
      534
      Views

      artwaw

      @JoeCFD No, I refuse to. I tried once, perfectly healthy code that I maintained for 3 years on MingW didn't even want to compile (it was Qt only, no external libs), I refused to waste my time on Microsoft shenanigans.

      Anyway, I got it to work. I was missing one thing in MinGW. For the record:

      to use WinAPI with MinGW (I do it via Msys2) two packages are needed (I was missing the latter): msys2-w32api-headers and msys2-w32api-runtime. .pro file in the end looks like I was expecting: LIBS += -LC:/msys64/usr/lib/w32api/ -liphlpapi LIBS += -LC:/msys64/usr/lib/w32api/ -lws2_32 INCLUDEPATH += C:/msys64/usr/include/w32api DEPENDPATH += C:/msys64/usr/lib/w32api

      Thank you everyone who contributed, thanks to your input I was able to trace and find my error. As always, your help is much appreciated.

    • CybeX

      Unsolved Get file path in Qt from winapi file HANDLE as QString, QFileInfo or something similiar
      General and Desktop • qt5 qt5.13.1 winapi handles • • CybeX

      3
      0
      Votes
      3
      Posts
      303
      Views

      aha_1980

      Hi @CybeX,

      and to add to @JKSH: you probably want to use GetFinalPathNameByHandleW as this is the UNICODE version.

      Regards

    • Q

      Solved QT + WinApi, Callback function return bad pointer address
      General and Desktop • winapi notifyservicest • • QT5 user

      3
      0
      Votes
      3
      Posts
      340
      Views

      Q

      @Chris-Kawa
      wow, so simple :)
      and so fast answer!! woooow
      Thank you very much!
      Its works!

      void MainWindow::onStatusChanged(PVOID p) { qDebug() << "void *p address" << p; SERVICE_NOTIFY_2A* temp_pNotifyBuffer = static_cast<SERVICE_NOTIFY_2A*>(p); //MainWindow* ptr_mainWindow = static_cast<MainWindow*>(p); //qDebug() << ptr_mainWindow->m_test_string; qDebug() << temp_pNotifyBuffer->pContext; qDebug() << static_cast<MainWindow*>(temp_pNotifyBuffer->pContext)->m_test_string; }

      Service man opened
      pcontext address 0x8ff6a0
      void *p address 0x8ff6bc
      0x8ff6a0
      "look it"

      I was misled that in Visual studio the example with "direct" transformation worked. And I went the wrong way ..

    • T

      Unsolved WinApi and QT - how use
      General and Desktop • winapi createwindow getmodulehandle • • TomNow99

      3
      0
      Votes
      3
      Posts
      308
      Views

      T

      I know that I can use QDialog to create Window instead of WinApi. But I think this example is very easy, so I think there is another way...

    • T

      Unsolved Hide Window by CreateProcess WinApi
      General and Desktop • winapi hide window createprocess • • TomNow99

      1
      0
      Votes
      1
      Posts
      886
      Views

      No one has replied

    • aarelovich

      Unsolved How to create and compile a windows native application where I can still you QtLibraries?
      General and Desktop • winapi msvc2017 • • aarelovich

      3
      0
      Votes
      3
      Posts
      179
      Views

      aarelovich

      Maybe I expressed myself incorrectly. By native I meant that uses the WinMain function as an entry point, for example. Something like the code in the link I've poste.

      But If you can provide some example code on HOW I can use Qt and the win32 APi and Direct X 11, I'd appreaciate it. I have not been able to find ANYTHING online.

      Just a simple open a window and draw a circle or something will do. I want to know how con configure the .pro so that it will find all the appropriate libraries and the code will compile.

    • P

      Unsolved App crashes when Qt core calls WinAPI's "DispatchMessage" function
      General and Desktop • windows qtcore winapi qtcreator • • psi-1

      3
      0
      Votes
      3
      Posts
      932
      Views

      P

      @kshegunov said in App crushes when Qt core calls WinAPI's "DispatchMessage" function:

      This address is rather suspicious. Please tell me you don't have global QWidgets?

      No, I have only a dll with function

      extern "C" CORE_SHARED_API QMainWindow * svCreateMainWindow() { return new MainWindow; }

      (CORE_SHARED_API is __declspec(dllexport))

      @kshegunov said in App crushes when Qt core calls WinAPI's "DispatchMessage" function:

      Btw, 0xc0000409 is stack overflow, so be on the lookout for endless recursion.

      As I said, QWindowsGuiEventDispatcher::processEvents() is called twice, and I believe those calls are on the same stack level (crush happens in the second call).

    • A

      Unsolved How to restore the QT window minimized into system tray from other process?
      General and Desktop • python pyside winapi windows • • Azure Sun

      3
      0
      Votes
      3
      Posts
      2752
      Views

      A

      Thanks, SGaist.
      QtSingleApplicaiton is an alternative solution to singleton , I will make a try.

    • RIVOPICO

      Solved Error converting string to LPCTSTR with Qt
      3rd Party Software • winapi • • RIVOPICO

      17
      0
      Votes
      17
      Posts
      5800
      Views

      RIVOPICO

      @Chris-Kawa Thanks a lot your answer solve my dude thanks a lot. The system of resources of Qt is awesome and more easy to use so it's better. Anyways i was trying to understand more about windows api and with these explications i understand now thanks.

    • T

      Unsolved Doing a QList::append while using KBDLLHOOKSTRUCT (WinAPI) results in segmentation fault. :(
      General and Desktop • crash sigsegv winapi qt 5.7 • • Thynome

      6
      0
      Votes
      6
      Posts
      2768
      Views

      kshegunov

      @Thynome
      Hi,
      Well, you're stuck with C when working with the WinApi. It sucks, I know, but you need to transfer the context (the object) through a global variable. You can look here for some inspiration - WindowsCtrlDispatcher::instance is the context that's transferred to the VOID WINAPI ServiceMain(DWORD, LPTSTR *) function. I hope that helps.

      Kind regards.

    • Uncle Kris

      Unsolved How to use CreateFont API function in Qt5
      General and Desktop • createfont api winapi • • Uncle Kris

      19
      0
      Votes
      19
      Posts
      4941
      Views

      kshegunov

      @SGaist said:

      Indeed, but I wouldn't be surprised if that changed at some point :D

      Perhaps, perhaps. Although, judging from the time it took MS to introduce the x64 compiler, if it were to change, it'd take decades. And since it hasn't changed for over 30 years, I really doubt that it ever will. :D