AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AutoHotkey.dll
Goto page Previous  1, 2, 3 ... 18, 19, 20 ... 34, 35, 36  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Sat Aug 28, 2010 7:18 pm    Post subject: Reply with quote

This must be due to the latest changesAHK_L Changes History
Revision 54 wrote:
Changed: */ at the beginning of a line is ignored if there was no /*. [Discussion]

LoadFromText does not do that yet.
Code:
script := text := "text=`n(`ntext1 `n/* `nsome text `nin comments `ntags `n*/ `n`ntext2`n)`nMsgBox % text"
DllCall(A_AhkPath "\ahkExec","Str",script)
DllCall(A_AhkPath "\addScript","Str",script,"UInt",2)

EDIT:
Try latest build, I changed:
Code:
         if (in_comment_section)
         {
          if (!_tcsncmp(next_buf, _T("*/"), 2) && !in_continuation_section)
           {
             ...
           }
          else if (in_comment_section)
             continue;
         }

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Sun Aug 29, 2010 1:26 am    Post subject: Reply with quote

Thanks. I've added a !in_continuation_section check to the if that encloses that section and removed the other (now redundant) check. Multi-line comments can't be used in continuation sections (and vice versa).
Back to top
View user's profile Send private message Visit poster's website
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Sun Aug 29, 2010 1:25 pm    Post subject: Reply with quote

Merged AHK_L56
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed Sep 08, 2010 8:09 pm    Post subject: Reply with quote

Merged AHK_L58
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Mon Sep 13, 2010 11:01 pm    Post subject: Reply with quote

Merged AHK_L59 - Download
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
tdeus
Guest





PostPosted: Tue Sep 28, 2010 9:41 am    Post subject: Reply with quote

I'm using HotKeyIt's release of the dll with Python. It's working fine otherwise, but the ControlFocus command doesn't seem to do anything.

Here's a very simple example. The following script opens an Open dialog in Notepad, and focuses the file type combo box.

Code:
Run Notepad.exe
WinWait Untitled

Send ^o
WinWait Open

ControlFocus, ComboBox2, Open


Here's the same thing with Python, but ControlFocus is not working, leaving the filename box focused.

Code:
from ctypes import*

ahk = cdll.LoadLibrary("AutoHotkey.dll")
ahk.ahktextdll(c_char_p(""))

def execute(e):
   ahk.ahkExec(c_char_p(e))

execute("Run, Notepad.exe")
execute("WinWait, Untitled")

execute("Send ^o")
execute("WinWait, Open")

execute("ControlFocus, ComboBox2, Open")


Is there something wrong with my code or the ControlFocus command in the dll somehow faulty?
Back to top
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed Sep 29, 2010 8:57 pm    Post subject: Reply with quote

Thanks for reporting tdeus Wink
AutoHotkey_L60H25 wrote:
- Fixed g_MainThreadID.
- - Functions and Commands that require ATTACH_THREAD_INPUT should work now (ControlFocus,ControlGetFocus...)
- Merged AutoHotkey_L R60

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Sun Oct 03, 2010 3:23 pm    Post subject: Reply with quote

AutoHotkey_L61H25 wrote:
- Merged AutoHotkey_L R61

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed Oct 13, 2010 6:17 am    Post subject: Reply with quote

AutoHotkey_L61H26 wrote:
- Build in COM Interface (AutoHotkey.dll only)
- - All methods are called same as exported function and have same parameters. E.g. ahkdll, ahktextdll, ahkExec, ahkReady....

To use COM Interface, AutoHotkey.dll needs to be registered.
Code:
Run regsvr32.exe x:\AutoHotkey.dll ;register
Run regsvr32.exe /u x:\AutoHotkey.dll ;unregister when not required anymore

Virtual Basic example.
Code:
Sub atest()
Dim ahk As Object
Set ahk = CreateObject("AutoHotkey.Script")
ahk.ahktextdll ("MsgBox Hello World!" & Chr(13) & "ExitApp")
End Sub

Ahk example
Code:
Run regsvr32.exe /s x:\AutoHotkey.dll ;register Dll
Sleep, 2000 ;give it some time to process registration
ahk:=ComObjCreate("AutoHotkey.Script")
ahk.ahktextdll("MsgBox Hello World!`nExitApp")
While ahk.ahkReady()
   Sleep, 100
Run regsvr32.exe /s /u x:\AutoHotkey.dll ;unregister Dll


EDIT:
Small bugfix with hotkeys.
EDIT:
Merged latest AHK_L fixes.
Source updated
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Wed Oct 13, 2010 7:31 pm    Post subject: Reply with quote

HotKeyIt wrote:
AutoHotkey_L61H26 wrote:
- Build in COM Interface (AutoHotkey.dll only)

I'm impressed Very Happy
This should make using the DLL easier for users who struggle with DllCall(). Plus, the simplicity of embedding AHK in another language is amazing!
_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed Oct 13, 2010 7:52 pm    Post subject: Reply with quote

Thanks jethrow Wink
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Thu Oct 14, 2010 2:26 am    Post subject: Reply with quote

It might be worth mentioning that you can check if an ActiveX control (DLL) is registered by simple checking for the ProgID in the Registry:
Code:
RegRead, D, HKCR, AutoHotkey.Script
if Errorlevel ; or If D =
   MsgBox, DLL Not Registered
else
   MsgBox, DLL is Registered

One down side to the COM interface is it seems like you'd only be able to use 1 additional thread, since you can only register the ActiveX control once. Here's an example of multithreading (assuming the DLL/ActiveX Control is already registered):
Code:
code =
(
#NoTrayIcon
MsgBox, Message from COM/DLL
)

ahk := ComObjCreate("AutoHotkey.Script")
ahk.AHKtextDll(code)
MsgBox, Message from Script

Also, here's another quick example with JScript:
Code:
code = "#NoTrayIcon\n"
   +   "MsgBox Message from AHK"

ahk = new ActiveXObject("AutoHotkey.Script")
ahk.AHKtextDll(code)

while (ahk.ahkReady())
   continue

_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference


Last edited by jethrow on Thu Oct 14, 2010 3:02 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
guest3456
Guest





PostPosted: Thu Oct 14, 2010 2:52 am    Post subject: Reply with quote

are there any code examples of using this for multithreading from an AHK script?
Back to top
hoppfrosch



Joined: 25 Jan 2006
Posts: 190
Location: Froschtümpel

PostPosted: Thu Oct 14, 2010 6:18 am    Post subject: Reply with quote

HotKeyIt wrote:

To use COM Interface, AutoHotkey.dll needs to be registered.
Code:
Run regsvr32.exe x:\AutoHotkey.dll ;register
Run regsvr32.exe /u x:\AutoHotkey.dll ;unregister when not required anymore



Registering Autohotkey.dll does not work on my Win7 x64 System:
regsvr32.exe wrote:

Module X:\AutoHotKey.dll was loaded, but DllRegisterServer-Entrypoint was not found. Please make sure, that X:\AutoHotKey.dll is a valid .DLL or .OCX file and repeat the action.

(freely translated from german). For sure I used the correct path (not X:\AutoHotKey.dll as given in example)


Any hints on this?


BTW: What is needed for running AutoHotKey.dll? Is AutoHotKey_N.exe needed or is it sufficient to copy AutoHotKey.dll? Within the first topic of this thread it might be helpful to explain a bit more detailed , what prerequisites are needed for using AutoHotKey.dll ... You also mention AutoHotKey_H there - what's this variant needed for? What's the main difference to AutoHotKey_N or AutoHotKey_L?
For sure one can get this information out of the thread (or from AutoHotKey.dll-Homepage), but

  • this thread is quite lengthy - and it's difficult for a newbie to extract the desired information
  • this thread is historically grown and reflects the changes on AutoHotKey.dll-family. It's difficult to see, which properties/behaviour are currently valid for AutoHotKey.dll.


I don't expect detailled answers on this - just take it as encouragement to make your first topic of this thread more friendly for new users to gain easier entry to the world of AutoHotKey.dll ...
Back to top
View user's profile Send private message Visit poster's website
hoppfrosch



Joined: 25 Jan 2006
Posts: 190
Location: Froschtümpel

PostPosted: Thu Oct 14, 2010 6:28 am    Post subject: Reply with quote

hoppfrosch wrote:

Registering Autohotkey.dll does not work on my Win7 x64 System:
regsvr32.exe wrote:

Module X:\AutoHotKey.dll was loaded, but DllRegisterServer-Entrypoint was not found. Please make sure, that X:\AutoHotKey.dll is a valid .DLL or .OCX file and repeat the action.

(freely translated from german). For sure I used the correct path (not X:\AutoHotKey.dll as given in example)


Any hints on this?


Rolling Eyes Wrong alert on this - this happens when downloading the DLL as standalone-DLL linked from the first topic of this thread as " AutoHotkey.dll_N".

Using the AutoHotKey.dll from Binary-Package by HotkeyIt from AutoHotKey.dll-Homepage everything works ...

(One more hint to overthink the structure/contents of the first topic of this thread ...)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 18, 19, 20 ... 34, 35, 36  Next
Page 19 of 36

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group