CPWizard Sub Screen Causing MAME to Lose Focus

gooch

Member
Supporter
RL Member
I'm using CPWizard's Sub Screen to display a slideshow of artwork from the MAME collection on my second marquee screen (Control Panels, Cabinets, Marquees, etc). I have it launching from HyperLaunch's built-in support, but when it appears on the second screen MAME loses focus and I have to manually refocus using Alt+Tab or a click.

Does anyone know the best way to keep MAME in focus? I've tried a WinActivate in User Functions.ahk but CPWizard launches after this unfortunately.

HyperLaunch log below.

http://pastebin.com/ZvXYk5f5
 

djvj

Administrator
Staff member
Developer
cpwizard runs before even the module is built so I find it odd it is taking so long to start. Do you happen to have an ssd that you can try throwing it on and see if you can get it to start faster?

You can also try:
WinSet, Bottom,, cpwizard
But I'm not sure that will work. Also you might have to change cpwizard to match it's correct title and/or ahk_class name.

You can try running that outside in it's own script just to see if it works. If if works outside, and not in the user script funtion, you can try making a timer to have it keep running for 10 seconds or so while the emu launches.
 
Last edited:

gooch

Member
Supporter
RL Member
Thanks for the suggestions, I am running everything off a 240GB SSD already (OS, HS, HL, Media, ROMs, Emulators). I also tried various commands in the User Functions to perform a WinSet (the sub-screen window is called "Preview" BTW).

What I think the problem is is how CPWizard's sub-screen works. CPWizard.exe is fully loaded into RAM fairly quickly like you suggest (1-3 seconds), but the sub-screen doesn't appear until CPWizard (running in the background) detects MAME running. For this reason "Preview" is always loaded last and grabs focus.

To test, I turned off all HLHQ support for CPWizard and ran "CPWizard.exe -minimized" 30 seconds before launching a MAME game. Once MAME appears, the "Preview" window appears and grabs focus.

I am going to to try the outside script like you mentioned now.

EDIT: All fixed thanks to your suggestions.

I wrote a small AHK EXE and called it from the User Function.ahk.

Code:
SetTitleMatchMode 1
Sleep, 10000
IfWinExist, MAME
	WinActivate
Exit
 
Last edited:

djvj

Administrator
Staff member
Developer
I still don't like that you have to go to this extent at all. And it would mean every person using CP wizard would be having the same exact problem. Have you searched around and possibly ask if other users have this issue?

Sent from my Samsung S3 using Tapatalk
 

gooch

Member
Supporter
RL Member
Most people using CPWizard are not using the sub screen feature I would imagine because most people do not have dual monitors. I have searched around a lot and don't see anything, but development has really stalled since 2011 or so.

I'm not really liking it either and will probably continue to work on it, but it's working for me right now so I'm better off than I was yesterday.
 

djvj

Administrator
Staff member
Developer
I don't think the dual monitors has anything to do with it. Focus doesn't care if it's on the second monitor or the 10th. Probably has something to do with this sub screen feature you talk of . The best solution would be to deactivate CP wizard and not have anything tied to system or emulator names.

Sent from my Samsung S3 using Tapatalk
 

gooch

Member
Supporter
RL Member
I don't think the dual monitors has anything to do with it. Focus doesn't care if it's on the second monitor or the 10th.

What I mean is, if people only have one screen and the sub screen comes up only the only screen it's assumed MAME wouldn't be in focus because it's behind the sub screen window on the only screen the viewer can see. But since I'm sending the sub screen to the second monitor (or the 10th or whatever) the viewer can see MAME and CPWizard at once, and the sub screen loads after MAME so it always becomes in focus.

Probably has something to do with this sub screen feature you talk of.

It absolutely has to do with the sub screen feature, I'd love to not have to use it but it's the only way to display a slideshow of MAME artwork (flyers, actual CP's and cabinet photos, etc). I do not have window focus issue when not using the sub screen.

The best solution would be to deactivate CP wizard and not have anything tied to system or emulator names.

Are you saying to deactivate in HLHQ and start and stop CPWizard another way? I will try this regardless.
 

djvj

Administrator
Staff member
Developer
Never mentioned hlhq. I just mean to deactivate (make not active) the cpwizard window. Which should put focus back to the last window in theory.

Sent from my Samsung S3 using Tapatalk
 
Top