AutoHotkey Community

It is currently May 27th, 2012, 5:49 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 563 posts ]  Go to page Previous  1 ... 16, 17, 18, 19, 20, 21, 22 ... 38  Next
Author Message
 Post subject:
PostPosted: August 28th, 2010, 8:18 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
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:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2010, 2:26 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2010, 2:25 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Merged AHK_L56

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 9:09 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Merged AHK_L58

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2010, 12:01 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Merged AHK_L59 - Download

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2010, 10:41 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 29th, 2010, 9:57 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Thanks for reporting tdeus ;)
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:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 3rd, 2010, 4:23 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
AutoHotkey_L61H25 wrote:

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2010, 7:17 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
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:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2010, 8:31 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
HotKeyIt wrote:
AutoHotkey_L61H26 wrote:
- Build in COM Interface (AutoHotkey.dll only)

I'm impressed :D
This should make using the DLL easier for users who struggle with DllCall(). Plus, the simplicity of embedding AHK in another language is amazing!

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2010, 8:52 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Thanks jethrow ;)

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2010, 3:26 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
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

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Last edited by jethrow on October 14th, 2010, 4:02 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2010, 3:52 am 
are there any code examples of using this for multithreading from an AHK script?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2010, 7:18 am 
Offline
User avatar

Joined: January 25th, 2006, 8:08 am
Posts: 225
Location: Froschtümpel
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 ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2010, 7:28 am 
Offline
User avatar

Joined: January 25th, 2006, 8:08 am
Posts: 225
Location: Froschtümpel
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?


:roll: 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 ...)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 563 posts ]  Go to page Previous  1 ... 16, 17, 18, 19, 20, 21, 22 ... 38  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group