Search found 4287 matches

by jeeswg
Yesterday, 23:53
Forum: Ask For Help
Topic: Copy file name from inactive window title
Replies: 3
Views: 42

Re: Copy file name from inactive window title

One way:

Code: [Select all]GeSHi © Codebox Plus

q:: ;get active window title (a path is expected), split path to get name/name no ext
WinGetTitle, vWinTitle, A
SplitPath, vWinTitle, vName, vDir, vExt, vNameNoExt, vDrive
MsgBox, % vName
MsgBox, % vNameNoExt
return
by jeeswg
Yesterday, 22:28
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 2
Views: 78

Re: C++: C++ to machine code via TDM-GCC

- A further point: - Why do WStr and Ptr not work here as expected? ;stringlen := MCode("2,x86:i0wkBDPAOAF0B0CAPAgAdfnD,x64:M8A4AXQKSP/B/8CAOQB19vPD") ;equivalent to line below stringlen := MCode("2,x86:i1QkBDHAgDoAdBCQjXQmAIPAAYA8AgB19/PD88M=,x64:gDkAdBpIg8EBMcAPH0QAAEiDwQGDwAGAef8Ad...
by jeeswg
Yesterday, 18:59
Forum: Ask For Help
Topic: Simple File Explorer Fix
Replies: 5
Views: 162

Re: Simple File Explorer Fix

Here's a script which plays a sound every time an Explorer window is activated. #Persistent ;plays a sound every time an Explorer window is activated OnExplorerActive(hWinEventHook, vEvent, hWnd) { ;EVENT_SYSTEM_FOREGROUND := 0x3 static _ := DllCall("user32\SetWinEventHook", UInt,0x3, UInt...
by jeeswg
Yesterday, 18:11
Forum: Ask For Help
Topic: Code won't type letters Topic is solved
Replies: 7
Views: 138

Re: Code won't type letters Topic is solved

tRy ThIs. ChEeRs. ;switch between upper/lower case letters when typing lower case letters ;put at the top the of script (in the auto-execute section) Loop, 26 Hotkey, % "$" Chr(96+A_Index), SubInvertLetter return ;q:: ;w:: ;e:: SubInvertLetter: vLetter := SubStr(A_ThisHotkey, StrLen(A_This...
by jeeswg
Yesterday, 16:14
Forum: Scripts and Functions
Topic: MCode4GCC -- C/C++ to MCode Generator
Replies: 48
Views: 7582

Re: MCode4GCC -- C/C++ to MCode Generator

I've tried to create a stand-alone script for C++ to machine code:

C++: C++ to machine code via TDM-GCC - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=23&t=49554
by jeeswg
Yesterday, 16:07
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 2
Views: 78

C++: C++ to machine code via TDM-GCC

Based on the code and tutorials here (thanks joedf and nnnik): MCode4GCC -- C/C++ to MCode Generator - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=6&t=4642 MCode Tutorial (Compiled Code in AHK) - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=7&t=32...
by jeeswg
Yesterday, 12:57
Forum: Scripts and Functions
Topic: MCode4GCC -- C/C++ to MCode Generator
Replies: 48
Views: 7582

Re: MCode4GCC -- C/C++ to MCode Generator

- Hmm, so I used gcc and it produced machine code that works with both x64 and x32. Cf. the examples which were about half as long, and were either x64 or x32 only. - Do you mean to replace 'gcc' with 'gcc -m64'/'gcc -m32' in the GUI, or to edit the 'flags' variable in the script directly. (Since th...
by jeeswg
23 May 2018, 19:59
Forum: Scripts and Functions
Topic: MCode4GCC -- C/C++ to MCode Generator
Replies: 48
Views: 7582

Re: MCode4GCC -- C/C++ to MCode Generator

tl;dr x32 MCode works but is overly long, x64 no MCode output - I installed tdm64-gcc-5.1.0-2.exe to C:\TDM-GCC-64. TDM-GCC : Download http://tdm-gcc.tdragon.net/download - I used 'TheAnswerToEverything.c' as the target file. The function returns 42. - I used an x32 version of AutoHotkey. - I based ...
by jeeswg
23 May 2018, 16:11
Forum: Ask For Help
Topic: InBuf function currently 32-bit only (machine code binary buffer searching)
Replies: 19
Views: 1685

Re: InBuf function currently 32-bit only (machine code binary buffer searching)

- Hello Helgef. I'm thinking of coming back to this topic, working on and compiling various simple examples. I might do a tutorial. - I was interested to know which version of Visual Studio you use (hopefully it would make no difference to the hex for basic machine code examples, but one wonders), a...
by jeeswg
23 May 2018, 15:25
Forum: Ask For Help
Topic: beginner problem - Sendraw doesn't work Topic is solved
Replies: 5
Views: 62

Re: beginner problem - Sendraw doesn't work Topic is solved

Which program are you using SendRaw on?
by jeeswg
23 May 2018, 13:32
Forum: Ask For Help
Topic: object classes: coding style
Replies: 18
Views: 460

Re: object classes: coding style

- @Helgef: He explains the straightforward mindset and the OOP mindset. I want the computer to put a red dot here, how do I do that? versus: Oh do I need to abstract the concept of a screen, and red, should red be an object that, oh what is this, is a pixel an object or is it a group of objects, is ...
by jeeswg
23 May 2018, 03:03
Forum: Ask For Help
Topic: object classes: coding style
Replies: 18
Views: 460

Re: object classes: coding style

- Look nnnik, if I take something seriously, you should take it seriously too. - At the higher level: OOP projects start off with an elegant structure which then becomes a Rube Goldberg machine or is replaced entirely (multiple times). - At the lower level (including AHK): simple projects become blo...
by jeeswg
22 May 2018, 23:56
Forum: Ask For Help
Topic: FileRead & binary data Topic is solved
Replies: 3
Views: 93

Re: FileRead & binary data Topic is solved

- Some ideas are: - Loop through each byte using NumGet, use NumPut on any null bytes. - Binary data to hex string, edit hex string (use RegEx to put a separator character between every pair of hex digits, replace any 00s, remove the separator character), hex string to binary data. - Write a machine...
by jeeswg
22 May 2018, 18:39
Forum: Ask For Help
Topic: [COM] How to enumerate IEnumNetworkConnections in a more "native" way?
Replies: 10
Views: 593

Re: [COM] How to enumerate IEnumNetworkConnections in a more "native" way?

- I installed Visual Studio which created this folder: C:\Program Files (x86)\Windows Kits\8.1, with lots of .h files in it.
- You can search the .h files for names and numbers. Note however that the numbers, commonly separated by hyphens, could be separated in different ways.
by jeeswg
21 May 2018, 22:46
Forum: Ask For Help
Topic: pasting raw text into an array without fixing escape characters Topic is solved
Replies: 7
Views: 54

Re: pasting raw text into an array without fixing escape characters Topic is solved

- Well, I had in mind perhaps putting text in front of each line, to indicate the key names. Then using a parsing loop on each line. E.g. 'abc' -> 'key1:abc', then use the first colon as an indicator to where the key name ends and the value text begins while parsing. - You could also use StrSplit an...
by jeeswg
21 May 2018, 21:38
Forum: Ask For Help
Topic: pasting raw text into an array without fixing escape characters Topic is solved
Replies: 7
Views: 54

Re: pasting raw text into an array without fixing escape characters Topic is solved

- If you want to put verbatim text into a script, and assign that text to a variable, you could use a continuation section, or use FileRead to read text from a file. - For a continuation section example see: ANSI (CP-1252) CHARACTERS (VERBATIM), here: jeeswg's characters tutorial - AutoHotkey Commun...
by jeeswg
21 May 2018, 16:59
Forum: Ask For Help
Topic: How to retrieve the hwnd of the window to which a control belongs? Topic is solved
Replies: 5
Views: 92

Re: How to retrieve the hwnd of the window to which a control belongs? Topic is solved

- Windows and controls both have hWnds: WinGet-ID and ControlGet-Hwnd.
- WinGetPos, for example, is good for use on controls also. All these subtle points and hacks!
by jeeswg
21 May 2018, 16:10
Forum: Ask For Help
Topic: object classes: coding style
Replies: 18
Views: 460

Re: object classes: coding style

@nnnik: Are there any programming languages or paradigms/books etc that closely align with your preferred vision of OOP?
by jeeswg
21 May 2018, 14:45
Forum: Ask For Help
Topic: How to retrieve the hwnd of the window to which a control belongs? Topic is solved
Replies: 5
Views: 92

Re: How to retrieve the hwnd of the window to which a control belongs? Topic is solved

- I'm not sure what exactly you're asking. [EDIT:] 'child' is of the form 'ComboBoxNN', 'grandchild' is its child, 'child' is the parent of 'grandchild', so I would expect class1 to be 'ComboBox'. - One thing I would point out is that GA_ROOT is pretty useful. If you apply WinGet-ControlList to an h...
by jeeswg
21 May 2018, 11:54
Forum: Ask For Help
Topic: How to retrieve the hwnd of the window to which a control belongs? Topic is solved
Replies: 5
Views: 92

Re: How to retrieve the hwnd of the window to which a control belongs? Topic is solved

Perhaps this. Cheers. q:: ;window get parent (e.g. test on Notepad) ControlGet, hCtl, Hwnd,, Edit1, A hWnd := DllCall("user32\GetAncestor", Ptr,hCtl, UInt,1, Ptr) ;GA_PARENT := 1 WinGetClass, vWinClass, % "ahk_id " hWnd MsgBox, % vWinClass return ;for the owner: hWnd := DllCall(&...

Go to advanced search