Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to run AHK code in QM, can you add a function?
#6
Thank you very much, the code test runs successfully.  Smile

I searched for some information about python using ahk. (Please see the attached picture)

https://autohotkey.com/board/topic/49656...th-python/
https://autohotkey.com/board/topic/39588-autohotkeydll/

VC code:

#include <windows.h>
#include <stdio.h>

typedef int (*ahkdll)(wchar_t *, wchar_t *, wchar_t *) ;
typedef int (*ahkReady)();
int main()
{
   
   // Load DLL file
   HINSTANCE hinstLib = LoadLibrary("AutoHotkey.dll");
   if (hinstLib == NULL)
   {
      printf("ERROR: unable to load DLL/n");
      return 1;
   }
   
   // Get function pointer
   ahkdll ahkdll_ = (ahkdll)GetProcAddress(hinstLib, "ahkdll");
   ahkReady ahkReady_ = (ahkReady)GetProcAddress(hinstLib, "ahkReady");
   
   if (ahkdll_ == NULL || ahkReady_ == NULL)
   {
      printf("ERROR: unable to find DLL function/n");
      FreeLibrary(hinstLib);
      return 1;
   }
   
   // Call function.
   ahkdll_(L"D://MyScript.ahk", L"", L"");
   
   // Wait for script to finish
   while (ahkReady_())
      Sleep(50);
   // Unload DLL file
   FreeLibrary(hinstLib);
   return 0;
}


can I get the return value of the AHK code in the QM code?  How to use dll in function Ahkexec?  Is it easier to use dll?  Can you provide an example? thank you very much  Smile

dll download:
https://codeload.github.com/HotKeyIt/ahk...zip/master


Attached Files Image(s)
   


Messages In This Thread
RE: How to run AHK code in QM, can you add a function? - by win - 08-14-2018, 01:51 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)