[Solved] App only works for some people?

Everything else that doesn't fall into one of the other PB categories.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

[Solved] App only works for some people?

Post by Dude »

One of my apps is getting lots of comments that it "doesn't work" from new users. It starts in the system tray, and the app's main GUI can be opened by clicking the system tray icon, or by pressing a hotkey that the user sets when the app is first run. However, a fair few people are emailing me and saying that clicking the icon does nothing, and that they can't set the hotkey to *anything* of their choice (my app says "unavailable" if RegisterHotKey_() fails).

On the flipside, I get dozens of counter-comments saying that the app is great and they love it! Even had some sales for it, so it's obviously working; but it really confuses me as to why it's "not" working for some. This makes it hard to diagnose, and the fact that it works for some would leave me to believe that my hotkey and systray routines are coded correctly.

Both the people who say it fails, and those who say it works, are using the same OS versions (XP, 7, 10, doesn't matter).

If this scenario was happening to you, how would you go about trouble-shooting it? Thanks for any advice.
Last edited by Dude on Sun Oct 30, 2016 1:58 am, edited 1 time in total.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: App only works for some people?

Post by Keya »

Dude wrote:If this scenario was happening to you, how would you go about trouble-shooting it? Thanks for any advice.
perhaps cut it down to a minimal app that does nothing but minimize to systray with a registered keyhook (or whatever is just enough to test your particular problem), and send that minimal build to somebody who was having problems to confirm that they're still having the issue with that, or suggest that the problem is perhaps a conflict elsewhere in your code. And in the meantime you could post the source code of the minimal build here for PBers to test and dissect
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: App only works for some people?

Post by Dude »

Keya wrote:cut it down to a minimal app that does nothing but minimize to systray with a registered keyhook
I thought of that, but if RegisterHotKey_() is working for most people, why would it fail for others? I don't think making a snippet would "fix" that. Unless maybe that API call changed from XP to 10 or something, but MSDN doesn't say anything like that.

[Edit] OMG... when reading MSDN again, it seems RegisterHotKey_() requires VISTA or higher! WTF? Since when? I bet those users are XP ones. I'm sure I've used RegisterHotKey_() on XP in the past... this is weird! :shock:

[Edit 2] And it seems the #MOD_NOREPEAT flag is NOT supported on Vista at all... it requires Windows 7 and higher or it actually BREAKS RegisterHotKey_() from working. Yes, I was using it. I bet this was also the problem! :)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: App only works for some people?

Post by IdeasVacuum »

Would AddKeyboardShortcut() be better across the Windows Versions?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: App only works for some people?

Post by Dude »

IdeasVacuum wrote:Would AddKeyboardShortcut() be better across the Windows Versions?
No, that only works for your current app; it's not global and won't trigger across any other app being used at the time.

Anyway, I discovered the problem: #MOD_NOREPEAT isn't supported on Windows Vista, and I was setting that flag with RegisterHotKey_(). Another website mentioned that setting it on Vista actually breaks the actual hotkey from even registering, so I replaced my code with this, and it works:

Code: Select all

Global MOD_NOREPEAT=0 ; Must be 0 for Vista and less, otherwise RegisterHotKey_() will fail.
If OSVersion()>#PB_OS_Windows_Vista : MOD_NOREPEAT=16384 : EndIf ; Windows 7 and higher only.

hotkey=RegisterHotKey_(app,hotkeyid,hotkeymods|MOD_NOREPEAT,hotkeykey) ; WORKS with Vista!
Previously, I was just doing this, which was causing the failure:

Code: Select all

hotkey=RegisterHotKey_(app,hotkeyid,hotkeymods|#MOD_NOREPEAT,hotkeykey) ; Fails on Vista.
And here's an email I got last night showing that one user that is happy with the fix: https://i.imgur.com/mfjySgZ.png :)
Post Reply