Search found 62 matches

by wpb
28 Jan 2016, 15:41
Forum: Ask For Help
Topic: Detecting long key presses in a hotstring
Replies: 1
Views: 770

Re: Detecting long key presses in a hotstring

I revisited this today and came up with a solution, so I thought I'd post it here. I admit it's not overly pretty, but it does work. :*://`t:: HotKey, Tab, KeyKill, On KeyWait, Tab, T1 ; One second press to do different things If ErrorLevel { DifferentBehaviour := True KeyWait, Tab ; Wait for Tab to...
by wpb
28 Jan 2016, 02:45
Forum: Ask For Help
Topic: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text
Replies: 10
Views: 1392

Re: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text

Oh, that's wonderful. Thank you - I will investigate that. Makes perfect sense. Yes, I see your point about A_IsUnicode. I think (but can't remember - it's been a while) that SCI_GETCURRENTPOS is giving me a byte-index into the Scintilla buffer, so I should be good just to use the difference between...
by wpb
28 Jan 2016, 02:33
Forum: Ask For Help
Topic: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text
Replies: 10
Views: 1392

Re: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text

Sorry, should have said. The control belongs to an external program. The preceding messages (SCI_GETCURRENTPOS etc.) are working, so I know I have the control name, window handle, etc. correct, and good values for StartPos and EndPos.
by wpb
28 Jan 2016, 02:24
Forum: Ask For Help
Topic: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text
Replies: 10
Views: 1392

SCI_GETTEXTRANGE fails to retrieve Scintilla control's text

Hello, I've searched and found various similar threads, but most seem quite old, and although I've read them extensively, I'm still stuck. I am trying to read a text range from a Scintilla control, so I move to the start of the current paragraph by sending SCI_PARAUP, get the current position there ...
by wpb
27 Jan 2016, 16:32
Forum: Scripts and Functions
Topic: GetActiveObjects - Get multiple active COM objects
Replies: 23
Views: 14041

Re: GetActiveObjects - Get multiple active COM objects

Thanks, Lexikos, that's very informative.
by wpb
27 Jan 2016, 02:41
Forum: Scripts and Functions
Topic: GetActiveObjects - Get multiple active COM objects
Replies: 23
Views: 14041

Re: GetActiveObjects - Get multiple active COM objects

"the same" does not mean "equal or lower". No, quite, I totally took your point, it just seems like a strange OS model that processes with higher integrity level can't see those with same or lower. Obviously the opposite makes sense, but this to me seems odd. Seems like there must be some way aroun...
by wpb
26 Jan 2016, 23:15
Forum: Scripts and Functions
Topic: GetActiveObjects - Get multiple active COM objects
Replies: 23
Views: 14041

Re: GetActiveObjects - Get multiple active COM objects

I think you are right - this is to do with UAC. Unfortunately, it's a script that is working fine on my system and on others' but not this particular Win 8 system, but it makes debug harder. Nevertheless, I would have expected when running this script as admin, it would be able to "see" all running ...
by wpb
26 Jan 2016, 17:06
Forum: Scripts and Functions
Topic: GetActiveObjects - Get multiple active COM objects
Replies: 23
Views: 14041

Re: GetActiveObjects - Get multiple active COM objects

Actually, it seems this is only happening on Win 8, if that gives a clue. I'm looking at adding some debug output to the function to see where it fails. Lexikos, any pointers on where to start? (It's over my level of understanding atm, but I'll start reading!)
by wpb
26 Jan 2016, 12:41
Forum: Scripts and Functions
Topic: GetActiveObjects - Get multiple active COM objects
Replies: 23
Views: 14041

Re: GetActiveObjects - Get multiple active COM objects

Sorry, I mean when running as admin an ahk script containing this function, and the first example code above ("Show the item monikers and (default) interface names of all active objects:"). I don't think network paths come into it in this case, but thanks for the suggestion.
by wpb
26 Jan 2016, 07:59
Forum: Scripts and Functions
Topic: GetActiveObjects - Get multiple active COM objects
Replies: 23
Views: 14041

Re: GetActiveObjects - Get multiple active COM objects

Any idea why this might not return any results when running as Administrator on Win7/8, but does return results when run with normal privileges?
by wpb
18 Jan 2016, 08:12
Forum: Ask For Help
Topic: Possible to stop "Not responding" message from Windows in another app?
Replies: 0
Views: 419

Possible to stop "Not responding" message from Windows in another app?

Hi there, I am using AHK to automate some tasks in a 3rd party app. When that app loads a file, sometimes it can take quite a while, during which the usual "(Not responding)" message appears in its title bar. I would like to stop that happening, as I control the loading of the file, and I know it's ...
by wpb
14 Jan 2016, 08:45
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

Do you also handle/block WM_ENTERMENULOOP as in SKAN's code? I'd suppose that you must if you're using OnMessage, otherwise AutoHotkey would detect that a menu is showing and would prevent any new threads from launching. I don't think it blocks RegisterCallback callbacks, though. Yes, I pick that u...
by wpb
12 Jan 2016, 02:08
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

I define the menu as normal, use the standard method for getting its handle (attaching it as a submenu to a fake menu attached to an unused GUI - which I believe you came up with first), then simply call TrackPopupMenu and handle the WM_MENUSELECT messages. Most of that came from various forum posts...
by wpb
11 Jan 2016, 14:55
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

Thank you, lexikos, for all your pointers and advice. My current implementation works on top of the Menu command - I like the simplicity of the AHK Menu command, and it suits my needs well. Majkinetor's MMenu library is great, but overkill for what I'm trying to achieve. So I think I'll stick with t...
by wpb
09 Jan 2016, 14:55
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

It's definitely possible - I have it working. Just ironing out the details and figuring the best way to specify the tooltip strings for each menu item. Atm I am autogenerating AHK code from an Excel file that defines the menus and submenus in an Excel sheet. The tooltip strings get saved in an assoc...
by wpb
09 Jan 2016, 06:57
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

The menu is not created until it is shown or added to a GUI, but this is irrelevant because you have to do one of those things to get the handle anyway. MenuGetHandle in the latest test build also causes the menu to be created. Sub-menus are created when the parent menu is created. Unless you are c...
by wpb
09 Jan 2016, 06:56
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

Thanks, Shadowpheonix. Unforunately, I don't think A_ThisMenu will be set up at the point when I need it. I am adding tooltips to my menu, and trying to store the tooltip strings in an associative array keyed by menu name and menu position. I need to extract that data when I get a callback from WM_M...
by wpb
08 Jan 2016, 16:48
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

Thanks, lexikos.

Are the underlying Win23 menus created as soon as the first Menu, <name>, Add is encountered, or only after a Menu, <name>, Show?

Also, is there a way of specifying the Command ID of a menu item when you add it, or do you have to use SetMenuItemInfo?

TIA, WPB
by wpb
07 Jan 2016, 15:27
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Getting a menu name from its handle

Hello all, I am looking for a way to get a menu name (as used in the AHK command Menu, <name>, Add... etc.) from its handle as received from, say, WM_MENUSELECT. Is this doable? I can't see anything in the Win32 API that looks promising. The only way I can think of is to start at the top of the menu...
by wpb
20 Dec 2015, 06:20
Forum: Ask For Help
Topic: COM objects lingering?
Replies: 2
Views: 748

Re: COM objects lingering?

Thanks for the reply. It turns out after quite a bit of digging that this is being caused by something else (still not sure what - but I've now managed to rule out AHK). But I've had all kinds of problems getting a reliable com handle on an existing and open Excel workbook. I'll post another thread ...

Go to advanced search