Search found 209 matches

by c7aesa7r
15 Aug 2023, 01:58
Forum: Ask for Help (v1)
Topic: AutoHotkey VarSetCapacity equivalent to char*/unsigned int*
Replies: 0
Views: 207

AutoHotkey VarSetCapacity equivalent to char*/unsigned int*

I'm converting the FindText lib to c++ I'm struggling with the VarSetCapacity part: VarSetCapacity(s1, k*4) VarSetCapacity(s0, k*4) VarSetCapacity(ss, 2*(w+2)*(h+2)) VarSetCapacity(allpos, allpos_max*8) PicFind(ini, j, dir, sx, sy, sw, sh, allpos_ptr) { ; ... return DllCall(&MyFunc ; ... , "Ptr",ini...
by c7aesa7r
28 Aug 2022, 22:58
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1087
Views: 570768

Re: FindText - Capture screen image into text and then find it Topic is solved

feiyue I'm getting compile warnings regarding converting double to int. In the c++ source the parameters err1 and err0 expects an int , but at the end what is being passed could be a double / floor ahk script: , e1:=(j[12] ? j[6] : Floor(j[4] * ini.err1)) , e0:=(j[12] ? j[7] : Floor(j[5] * ini.err0...
by c7aesa7r
25 Aug 2022, 17:32
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1087
Views: 570768

Re: FindText - Capture screen image into text and then find it Topic is solved

if IsFunc(k:="GetBitsFromScreen2") and %k%(bits, x-zx, y-zy, w, h) { zx:=bits.zx, zy:=bits.zy, zw:=bits.zw, zh:=bits.zh Critical, %cri% SetBatchLines, %bch% return bits } feiyue is this used somewhere? i couldn't find a definition for GetBitsFromScreen2
by c7aesa7r
24 Aug 2022, 00:12
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1087
Views: 570768

Re: FindText - Capture screen image into text and then find it Topic is solved

@feiyue I'm converting the entire findtext class to c++, I wonder if you don't already have it there?
by c7aesa7r
14 Jun 2022, 17:25
Forum: Scripts and Functions (v1)
Topic: Process Explorer
Replies: 24
Views: 8590

Re: Process Explorer

teadrinker wrote:
13 Jun 2022, 21:54
For me this always returns the main PID:

Code: Select all

WinGet, PID, PID, ahk_class Chrome_WidgetWin_1
MsgBox, % PID
And if you have multiple instances of chrome? how you would identify the main pid?
by c7aesa7r
13 Jun 2022, 13:26
Forum: Scripts and Functions (v1)
Topic: Process Explorer
Replies: 24
Views: 8590

Re: Process Explorer

You can see here: PROCESSENTRY32 Im using the function to retrieve the ParentProcessId of the browser chrome, as it launch multiple instances Using comobj it takes around 5sec to find the pid, with your function 500ms, its still a high time, taking in count when you have multiple instances of the b...
by c7aesa7r
12 Jun 2022, 12:29
Forum: Scripts and Functions (v1)
Topic: Process Explorer
Replies: 24
Views: 8590

Re: Process Explorer

Thank you teadrinker and jNizM!!! always helping a lot.
What other information is available using this method?

Code: Select all

ParentPID := NumGet(PROCESSENTRY32, 4*4 + A_PtrSize*2, "UInt")
The comobj method is very slow, and even more slow when you have a lot of process open.
by c7aesa7r
12 Jun 2022, 10:57
Forum: Scripts and Functions (v1)
Topic: Process Explorer
Replies: 24
Views: 8590

Re: Process Explorer

I couldn't find any mention in your Process Explorer lib about ParentProcessId , would like to ask if you or maybe teadrinker (someone else also welcome :D) know any faster method than: pid:=5984 for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process where ProcessId=" pid) pare...
by c7aesa7r
03 Jun 2022, 12:36
Forum: Ask for Help (v1)
Topic: How to send a pBitmap between scripts?
Replies: 43
Views: 3821

Re: How to send a pBitmap between scripts?

fabricio, thanks for pointing it, i modified the code as suggested write: Write(data:="") { NumPut(data, this.pBuf) } read: param := NumGet(this.pBuf) size := NumGet(param + A_PtrSize, "UInt") pData := NumGet(param + A_PtrSize*2) But resulted in the same thing, it works as long its written/readen fr...
by c7aesa7r
03 Jun 2022, 07:59
Forum: Ask for Help (v1)
Topic: How to send a pBitmap between scripts?
Replies: 43
Views: 3821

Re: How to send a pBitmap between scripts?

Now the script is able to 'reconstruct' the bitmap F1 to write the bitmap to the map F2 to rebuild (F2 only for test as it will dispose of the bitmap, it works correctly as long its the same script) ;====== Test script 1 ====== FM := new FileMapping() Return F1:: pToken := Gdip_Startup() WinGet, hWn...
by c7aesa7r
03 Jun 2022, 06:55
Forum: Ask for Help (v1)
Topic: How to send a pBitmap between scripts?
Replies: 43
Views: 3821

Re: How to send a pBitmap between scripts?

teadrinker what im doing wrong inside of the function Write(data:="") when I try to rebuild the bitmap from the function Read the value of size and pData doesn't match ;====== Test script 1 ====== FM := new FileMapping() Return F1:: pToken := Gdip_Startup() WinGet, hWnd, Id, ahk_exe notepad.exe pBi...
by c7aesa7r
01 Jun 2022, 19:27
Forum: Ask for Help (v1)
Topic: How to send a pBitmap between scripts?
Replies: 43
Views: 3821

Re: How to send a pBitmap between scripts?

I read the stackoverflow question, but I'm still confuse these concepts are new territory to me

To start, the way im writing the bitmap in the first script is correctly?
Shouldn't be numput? and in the second numget?
by c7aesa7r
01 Jun 2022, 09:41
Forum: Ask for Help (v1)
Topic: How to send a pBitmap between scripts?
Replies: 43
Views: 3821

Re: How to send a pBitmap between scripts?

I have been able to share strings using file mapping You can share bitmap with CreateDIBSection with file mapping. https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createdibsection could you point out how to share bitmaps as you described? this method would be a lot better as I wo...
by c7aesa7r
01 Jun 2022, 08:02
Forum: Ask for Help (v1)
Topic: generate log with opened/closed processes
Replies: 9
Views: 1978

Re: generate log with opened/closed processes

Gui, New, +hwndhGui Gui, Add, ListView, w900 h600, Event|PID|Name|Time|Command Line for k, v in ["70", "50", "100", "60"] LV_ModifyCol(k, v) Gui, Show WMI := ComObjGet("winmgmts:") ComObjConnect(createSink := ComObjCreate("WbemScripting.SWbemSink"), new EventSink("Created", hGui)) ComObjConnect(del...
by c7aesa7r
30 May 2022, 08:05
Forum: Scripts and Functions (v1)
Topic: Process Explorer
Replies: 24
Views: 8590

Re: Process Explorer

I'm using this function to constantly check for two specific processes, to detect when new ones are created or older ones are closed with a delay of just 300ms its using 0,4% of CPU (i9990k) do you think there's another alternative that could use less resource? GetProc(proc, proc2:="") { ; WTSEnumer...
by c7aesa7r
29 May 2022, 06:28
Forum: Ask for Help (v1)
Topic: How to retrieve the script 'mainwindow' title?
Replies: 3
Views: 568

Re: How to retrieve the script 'mainwindow' title?

One easy way to do this is to apply a prefix to the title, then you can easily find it and extract the code or whatever is unique about it from the title prefix := "UniquePrefix - " code := "0xFF123456" gui,show,,% prefix code ;shows a window the the title UniquePrefix - 0xFF123456 SetTitleMatchMod...
by c7aesa7r
28 May 2022, 16:32
Forum: Ask for Help (v1)
Topic: How to retrieve the script 'mainwindow' title?
Replies: 3
Views: 568

How to retrieve the script 'mainwindow' title?

i have some scripts running and they contains more than one gui, one of these guis is use to identify the script, the gui title is dynamic being changed according to some settings atm this is how im searching for the 'main' GUI: WinGet, Id, List, ahk_pid %Pid% Loop, %Id% { Id := Id%A_Index% WinGetTi...
by c7aesa7r
25 May 2022, 15:19
Forum: Ask for Help (v1)
Topic: Hide command console when using RunWaitOne() example Topic is solved
Replies: 34
Views: 3782

Re: Hide command console when using RunWaitOne() example Topic is solved

teadrinker wrote:
25 May 2022, 15:03
Yep.

Code: Select all

MsgBox, % ReadStdOut("powershell $PSVersionTable")
Im testing with powershell, Its also leaking mem:
Spoiler
by c7aesa7r
23 May 2022, 15:07
Forum: Ask for Help (v1)
Topic: How to send a pBitmap between scripts?
Replies: 43
Views: 3821

Re: How to send a pBitmap between scripts?

Thank you teadrinker! helped a lot! :salute: I did a test adding a Sleep, 99999 inside of the function CreateBitmapFromData(hHeap, pImageData) { } and when I send new wm_copydata msgs everything still works correctly I read that SetTimer launches a new thread/pseudo thread (which I have no idea what...
by c7aesa7r
23 May 2022, 12:29
Forum: Ask for Help (v1)
Topic: How to send a pBitmap between scripts?
Replies: 43
Views: 3821

Re: How to send a pBitmap between scripts?

Only by converting in the base64 string. I don't think you really need JSON in this case. All the data could be passed in one data block, including text data. Just as curiosity, why does it need to be in b64 string? I was reading the docs under dllcall to search for what data type to use for the st...

Go to advanced search