Search found 1968 matches

by HotKeyIt
24 Feb 2020, 19:19
Forum: Ask For Help
Topic: While typing, I need to capitalize letters if they follow a digit
Replies: 2
Views: 81

Re: While typing, I need to capitalize letters if they follow a digit

This might speed it up a little:

Code: Select all

SetBatchLines -1
Loop {
input, oVar1, V L1, {F12}
if oVar1 is not integer
	continue
input, oVar2, V L1, {F12}
if oVar2 is alpha
	sendinput % "{bs}" DllCall("CharUpper", "Str", oVar2,"Str")
} until errorlevel~="EndKey:"
return
by HotKeyIt
24 Feb 2020, 18:40
Forum: Ask For Help
Topic: Error when calling ComObjCreate
Replies: 6
Views: 142

Re: Error when calling ComObjCreate

Dynacall makes the code shorter, easier to use and faster. string:=" ( Send:=DynaCall(A_AhkPath ""\ahkPostFunction"",[""i=sssssssssss"",2,3,4,5,6,7,8,9,10,11],""SendFunc"") Send[""Outlook"",""more"",""params""] return )" dll0:=ahkthread(string) While dll0.ahkReady() Sleep 100 return SendFunc(t1,t2,t...
by HotKeyIt
23 Feb 2020, 17:47
Forum: Ask For Help
Topic: Error when calling ComObjCreate
Replies: 6
Views: 142

Re: Error when calling ComObjCreate

Simply replace ahkFunction with ahkPostFunction. Here is the example using DynaCall: string:=" ( Send:=DynaCall(A_AhkPath ""\ahkPostFunction"",[""i=sssssssssss"",2],""SendFunc"") Send[""Outlook""] return )" dll0:=ahkthread(string) While dll0.ahkReady() Sleep 100 return SendFunc(Text){ msgbox % Text ...
by HotKeyIt
23 Feb 2020, 15:52
Forum: Ask For Help
Topic: Error when calling ComObjCreate
Replies: 6
Views: 142

Re: Error when calling ComObjCreate

This is by design in Windows, google the error + multi threading.
You will need to use postfunction or settimer.
by HotKeyIt
23 Feb 2020, 12:09
Forum: Ask For Help
Topic: Which data structure to use Topic is solved
Replies: 6
Views: 140

Re: Which data structure to use Topic is solved

Try this:

Code: Select all

arr:=[1,2,3]
i:=0

a::
While KeyWait(A_ThisHotkey, "D T0.25")
    i++
ToolTip % i
Loop
    for k,v in arr {
        Send % v
        if !(--i)
            return
    }
Return

KeyWait(key,options=""){
    KeyWait, %key%, %options%
    err:=!ErrorLevel
    KeyWait, %key%
    return err
}
by HotKeyIt
18 Feb 2020, 16:53
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 513

Re: How to distinguish between many types of object?

I have added HasMethod to Struct.
Note that not all objects (COM) will support __Enum/for loop.
by HotKeyIt
17 Feb 2020, 16:23
Forum: Ask For Help
Topic: ObjShare() example Topic is solved
Replies: 3
Views: 172

Re: ObjShare() example Topic is solved

The example was for an older AHK_H v2, here for v1, just changed to ObjShare(" lresult ") : Gui,Add,Slider,vSlider,50 Gui,Add,CheckBox Gui,Show,w200 h100 t:=new Test lresult := ObjShare(t) ; Create lresult to use in a different thread AhkThread(" ( t := ObjShare(" lresult ") ; Create IDispatch proxy...
by HotKeyIt
16 Feb 2020, 15:37
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 513

Re: How to distinguish between many types of object?

Actualy it is easier to add __Enum to object class:

Code: Select all

Class test{
  __Enum(*) => this.OwnProps()
}
t:=test.new()
t.1:=1
t.a:=2
for k, v in t
    MsgBox k "`n" v
by HotKeyIt
16 Feb 2020, 13:43
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 513

Re: How to distinguish between many types of object?

Probably:

Code: Select all

Class test{
}
t:=test.new()
t.1:=1
t.a:=2
for k, v in (t.hasMethod("__Enum")?t:t.OwnProps())
  MsgBox k "`n" v
EDIT: fixed code
by HotKeyIt
16 Feb 2020, 11:34
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 513

Re: How to distinguish between many types of object?

Code: Select all

Class test{
}
t:=test.new()
MsgBox t.base.base.__Class ;Object
MsgBox Type(t) ;test
by HotKeyIt
16 Feb 2020, 09:00
Forum: Ask For Help
Topic: Strange MouseClick behavior Topic is solved
Replies: 7
Views: 223

Re: Strange MouseClick behavior Topic is solved

Works fine for me, it always clicks at the coordinates.
Make also sure the old script was closed.

Edit: thanks @gregster , did not think about that.
by HotKeyIt
16 Feb 2020, 08:58
Forum: AutoHotkey_H
Topic: How to distinguish between many types of object?
Replies: 12
Views: 513

Re: How to distinguish between many types of object?

Code: Select all

Class test{
}
MsgBox Type(test) ;Class
MsgBox test.prototype.__Class ;test
by HotKeyIt
16 Feb 2020, 08:51
Forum: AutoHotkey_H
Topic: function return Multiple values
Replies: 4
Views: 186

Re: function return Multiple values

You can use a simple function to convert obj to parameter: O2P(fun(),a,b,c) MsgBox A "`n" B "`n" C fun(){ return [1,2,3] } O2P(O,ByRef _1:="",ByRef _2:="",ByRef _3:="",ByRef _4:="",ByRef _5:="",ByRef _6:="",ByRef _7:="",ByRef _8:="",ByRef _9:="",ByRef _10:="",ByRef _11:="",ByRef _12:="",ByRef _13:="...
by HotKeyIt
16 Feb 2020, 04:00
Forum: Ask For Help
Topic: Strange MouseClick behavior Topic is solved
Replies: 7
Views: 223

Re: Strange MouseClick behavior Topic is solved

Code: Select all

CoordMode, Mouse, Screen
f4::
  MouseClick, left, 1265, 758
Return
by HotKeyIt
15 Feb 2020, 15:11
Forum: AutoHotkey_H
Topic: function return Multiple values
Replies: 4
Views: 186

Re: function return Multiple values

arcticir wrote:
15 Feb 2020, 06:53
obj - t()=>[1,2]
Its disadvantage is that it is too tedious, and value needs to be written multiple times.
Why is this tedious and what do you mean by needs to be written multiple times?

There is another way:

Code: Select all

fun(ObjByRef(p1,p2))
MsgBox p1 "`n" p2
fun(p) => (p.p1:="Test1",p.p2:="Test2",p)
by HotKeyIt
14 Feb 2020, 14:59
Forum: AutoHotkey_H
Topic: Issue with ahkexec/installation
Replies: 6
Views: 230

Re: Issue with ahkexec/installation

This has been fixed now, thanks for reporting and example ;)
by HotKeyIt
13 Feb 2020, 20:13
Forum: Ask For Help
Topic: Please help me with ending some code
Replies: 6
Views: 267

Re: Please help me with ending some code

Hellbent wrote:
13 Feb 2020, 16:32
@HotKeyIt press the hotkey rapidly.
In that case 3 would not help, even 10, try:

Code: Select all

#SingleInstance,Force
#MaxThreadsPerHotkey, 255
#MaxThreads 255
return
*ESC::ExitApp


Numpad1::
	Tog:=!Tog
      While(Tog){
          ToolTip, % A_Index
          sleep, 1000
      }
    ToolTip,
return
by HotKeyIt
13 Feb 2020, 20:03
Forum: AutoHotkey_H
Topic: Memory leak
Replies: 6
Views: 350

Re: Memory leak

You forgot to releas Alias variable out ! Also I have fixed another memory leak ;) RegExMatch(fileread(A_LineFile),"s);\!(.*)",r) (t:=ahkload()).DefineMethod('__Call', func("pin_call")) t.new("#Persistent`n#NoTrayIcon`nr:=object(" (&t) "),r.hwnd:=A_ScriptHwnd`ntt:=[1,2,3,4]`n`nreturn`n" r.1) loop 10...

Go to advanced search