Search found 78 matches
- 30 Dec 2019, 18:05
- Forum: C/C++
- Topic: How to Access Members of a Vector from a Pointer Topic is solved
- Replies: 1
- Views: 2872
How to Access Members of a Vector from a Pointer Topic is solved
I'm trying to write code where I point to a vector rather than directly include it in a struct. How would I access the elements of the vector pointed to in this way? Here's some code to give an idea of what I'm trying to do. #include <iostream> #include <vector> typedef struct { __int64 size; vector...
- 30 Dec 2019, 16:49
- Forum: C/C++
- Topic: Function Always Returns Zero
- Replies: 0
- Views: 1892
Function Always Returns Zero
I'm trying write a function that will solve the following problem: Suppose you have a deck of n cards, some of which belong to certain classes. What is the probability of drawing c_i cards out of the total s_i in the deck for each of these classes i , given that you are allowed to draw k cards from ...
- 27 Dec 2019, 21:20
- Forum: Ask For Help
- Topic: Menu Command Throwing Error
- Replies: 3
- Views: 350
Re: Menu Command Throwing Error
Can someone please explain this error, too? --------------------------- Main Script.ahk --------------------------- Error: Nonexistent menu item. Specifically: Enter System Desktop Mode Line# 691: { 692: Case EnterDesktopUser: 693: if PowerRequestObject 694: DllCall("PowerClearRequest", "Ptr", Power...
- 27 Dec 2019, 16:12
- Forum: Ask For Help
- Topic: Menu Command Throwing Error
- Replies: 3
- Views: 350
Menu Command Throwing Error
A menu command seems to be throwing an error for no reason. Here's the message it gave me. --------------------------- Main Script.ahk --------------------------- Error: Target label does not exist. Specifically: User Desktop Mode Active Line# 061: Menu,Tray,Add 062: Menu,Tray,Add,Execute Command,In...
- 11 Dec 2019, 17:18
- Forum: Ask For Help
- Topic: PostMessage Not Working on 64-bit Windows 7
- Replies: 3
- Views: 661
PostMessage Not Working on 64-bit Windows 7
My system is running a fresh install of Windows 7 Ultimate SP1 64-bit. The hotkeys in the script right below always operate on a non-active window if the active window belongs to a 32-bit process and may operate on a non-active window if the active window belongs to a 64-bit process. #NoEnv SetBatch...
- 05 Dec 2019, 22:21
- Forum: Scripts and Functions
- Topic: GetClassNN()
- Replies: 3
- Views: 1090
Re: GetClassNN()
can you give some examples of when would we want a ClassNN rather than a hwnd? The hWnd of a control varies with its host application instance, but the ClassNN is often (but not always) consistent between instances, making it suitable for working with applications whose control makeup is consistent...
- 05 Dec 2019, 21:18
- Forum: Scripts and Functions
- Topic: GetClassNN()
- Replies: 3
- Views: 1090
GetClassNN()
Here is a function that will determine the ClassNN for a control from its hWnd. Unlike another version I have posted, this version won't fail if it is interrupted, and then called again by the interrupting thread. It sets ErrorLevel. The codes are: 0: Success 1: No window with the specified hWnd cou...
- 04 Dec 2019, 09:58
- Forum: Wish List
- Topic: HasKey(): Support for Multidimensional Arrays
- Replies: 5
- Views: 2396
Re: HasKey(): Support for Multidimensional Arrays
Thanks.
Here's a single line solution:
Here's a single line solution:
Code: Select all
ArrayHasKey(Array, Key, MultiDimKey*) {
return IsObject(Array) and Array.HasKey(Key) and (MultiDimKey.Length() == 0 or ArrayHasKey(Array[Key], MultiDimKey*))
}
- 01 Dec 2019, 08:25
- Forum: Wish List
- Topic: HasKey(): Support for Multidimensional Arrays
- Replies: 5
- Views: 2396
Re: HasKey(): Support for Multidimensional Arrays
I actually wrote my own workaround before posting my question:
Code: Select all
ArrayHasKey(Array, MultiDimKey*) {
If !IsObject(Array)
return
For each, key in MultiDimKey {
If !Array.HasKey(key)
return false
Array := Array[key]
} return true
}
- 30 Nov 2019, 08:42
- Forum: Wish List
- Topic: HasKey(): Support for Multidimensional Arrays
- Replies: 5
- Views: 2396
HasKey(): Support for Multidimensional Arrays
Can the HasKey() method be extended to support multidimensional arrays? For example: Array := [1, [2, 3, [4, 5]], 6, 7] ; These calls currently return blank values. MsgBox % Array.HasKey(2, 3, 2) ; I want this to return true. . " " Array.HasKey(2, 3) ; I want this to return true also. . " " Array.Ha...
- 25 Nov 2019, 22:28
- Forum: Ask For Help
- Topic: Help with Probability Function
- Replies: 0
- Views: 353
Help with Probability Function
Suppose you have a deck of n cards, and you want to draw c_1 out of one group of s_1 cards in the deck, as well as c_2 of s_2 , and so on, up until some c_m of s_m . You are allowed to draw k cards from the deck, and if you don't get all of the cards you are looking for the first time, you can put a...
- 04 Oct 2019, 19:53
- Forum: Ask For Help
- Topic: ePSXe Doesn't Load Plugins When Started With AutoHotkey
- Replies: 2
- Views: 466
- 04 Oct 2019, 10:57
- Forum: Ask For Help
- Topic: Help with Legend of Dragoon Script
- Replies: 0
- Views: 324
Help with Legend of Dragoon Script
I've reached the Phantom Ship in Legend of Dragoon, and I am trying to find the optimal guessing strategy for opening the locked chest. I created a script to help me find it, but it doesn't seem to be working. Can someone help? #NoEnv SetBatchLines -1 Permutations := ListPermutations(4, true) For ea...
- 21 Sep 2019, 19:20
- Forum: Ask For Help
- Topic: ePSXe Doesn't Load Plugins When Started With AutoHotkey
- Replies: 2
- Views: 466
ePSXe Doesn't Load Plugins When Started With AutoHotkey
[Moderator's note: Topic moved from Bug Reports.] I don't know if this counts as a bug since another program is malfunctioning, but ePSXe 2.0.5 doesn't load any external plug-ins when opened with the AutoHotkey Run command. Executing the following line also causes the bug: Run cmd /c start /high %P...
- 19 Jun 2019, 08:01
- Forum: Ask For Help
- Topic: Problem with Dynamic Script Function
- Replies: 17
- Views: 2231
Re: Problem with Dynamic Script Function
Changing the share mode to 7 didn't work. I changed the code so that I only get Error at line 0. errors. Here it is. RunDynamicScript(script, scriptname := "", WorkingDir := "") { static scriptdir := A_MyDocuments "\AutoHotkey\Dynamic Scripts", defaults := "#NoEnv`nSetBatchLines -1`nSendMode Input`n...
- 19 Jun 2019, 07:45
- Forum: Ask For Help
- Topic: Ctrl + RButton = Enter
- Replies: 2
- Views: 540
Re: Ctrl + RButton = Enter
I tried your hotkeys. They seem to be working fine on my computer. What version of AutoHotkey are you using?
- 18 Jun 2019, 17:09
- Forum: Ask For Help
- Topic: Problem with Dynamic Script Function
- Replies: 17
- Views: 2231
Re: Problem with Dynamic Script Function
Was anyone able to get my function to work?
- 14 Jun 2019, 08:35
- Forum: Ask For Help
- Topic: Problem with Dynamic Script Function
- Replies: 17
- Views: 2231
Re: Problem with Dynamic Script Function
File.Close() wouldn't do anything. From the documentation for FileOpen() : Flag h Indicates that Filename is a file handle to wrap in an object. Sharing mode flags are ignored and the file or stream represented by the handle is not checked for a byte order mark. The file handle is not closed automa...
- 13 Jun 2019, 22:44
- Forum: Ask For Help
- Topic: Can't Understand Source Code
- Replies: 2
- Views: 833
Can't Understand Source Code
I downloaded the source code and performed a search through it, but I can't seem to find a main() method. Am I missing something?
- 13 Jun 2019, 18:13
- Forum: Ask For Help
- Topic: Send {Ctrl} Not Suppressing Start Menu
- Replies: 0
- Views: 354
Send {Ctrl} Not Suppressing Start Menu
I was trying to help this guy out when I discovered something I didn't expect. For whatever reason, while the below script is active, the Start Menu will appear when the left Windows key is lifted after KeyWait times out and the script sends a Ctrl keystroke. #NoEnv SetBatchLines -1 SendMode Input r...