It is currently October 20th, 2019, 8:10 pm

Looking to be pointed in the right direction

Help with creating, editing & fixing problems with skins
Ferbstorm
Posts: 36
Joined: March 9th, 2019, 12:50 am

Re: Looking to be pointed in the right direction

Ferbstorm » March 27th, 2019, 7:42 am

Yincognito wrote:
March 27th, 2019, 7:32 am
I had a look at the Hotkey plugin before writing my previous reply and it won't help much, IMO, since as far as I know it doesn't simulate hotkeys, it only allows Rainmeter to detect them. Basically, it won't be able to pass a hotkey to another program, which is what you'd want to do.

I'm surprised it didn't work as well, since it should have to. I didn't test it with NirCMD, just set the hotkey and then manually press the hotkey to see if MusicBee's window shows up, and it did. If you did everything right and it still doesn't work, the only two causes I see for this is that either NirCMD doesn't pass the hotkey properly to MusicBee or that MusicBee is using a more sophisticated way of detecting hotkeys (as in it looks for actual physical press of the keys and doesn't get fooled by simulating them).

Maybe I'll give it a shot as well, to see what's going on...
I appreciate the help man, this has really stumped me. And I'm definitely not computer savvy enough to get this one working on my own. And I genuinely can't figure out why it isn't working. The code looks perfect to me, and the hotkey works fine manually. Only thing I can think of is that NirCmd isn't working right, and I don't really know how to test that

***Edit***

Is it possible that this plugin might be the answer?
https://forum.rainmeter.net/viewtopic.php?f=128&t=22868&hilit=ProgramOptions+plugin

I'll be honest, not much of it makes sense to me and I'm a bit too tired to parse it well. I'll try in the morning. But from what I can understand it seems relatively promising
Yincognito
Posts: 658
Joined: February 27th, 2015, 2:38 pm

Re: Looking to be pointed in the right direction

Yincognito » March 27th, 2019, 8:27 am

Well, I made it work, albeit not as expected. Try this and let me know if it works for you (adapt the NirCMD path if necessary):

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter="C:\Program Files\NirCMD\nircmd.exe win max process MusicBee.exe"
State=Hide
OutputType=ANSI

[MeterRun]
Meter=String
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Click to Run
LeftMouseUpAction=["C:\Program Files (x86)\MusicBee\MusicBee.exe"][!CommandMeasure MeasureRun "Run"]
It certainly works for me, for both the x86 and x64 versions of NirCMD, and both for running the program the first time and maximizing an already running instance of the program. Change max to normal if you want to restore it to its last window size. It works with activate too.

I couldn't make it work with hotkeys though, can't figure out why - I've tried multiple methods. But then, the hotkeys were not that important, since all you wanted was to restore MusicBee's window, whether that was done using hotkeys or not. By the way, you have to use RunCommand for the restore window bang, I'm guessing because the other way it can't take parameters.

Let me know how it goes.
Ferbstorm
Posts: 36
Joined: March 9th, 2019, 12:50 am

Re: Looking to be pointed in the right direction

Ferbstorm » March 27th, 2019, 8:35 am

Yincognito wrote:
March 27th, 2019, 8:27 am
Well, I made it work, albeit not as expected. Try this and let me know if it works for you (adapt the NirCMD path if necessary):

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter="C:\Program Files\NirCMD\nircmd.exe win max process MusicBee.exe"
State=Hide
OutputType=ANSI

[MeterRun]
Meter=String
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Click to Run
LeftMouseUpAction=["C:\Program Files (x86)\MusicBee\MusicBee.exe"][!CommandMeasure MeasureRun "Run"]
It certainly works for me, for both the x86 and x64 versions of NirCMD, and both for running the program the first time and maximizing an already running instance of the program. Change max to normal if you want to restore it to its last window size. It works with activate too.

I couldn't make it work with hotkeys though, can't figure out why - I've tried multiple methods. But then, the hotkeys were not that important, since all you wanted was to restore MusicBee's window, whether that was done using hotkeys or not. By the way, you have to use RunCommand for the restore window bang, I'm guessing because the other way it can't take parameters.

Let me know how it goes.
Welp, I can only assume there's something wrong with NirCmd, cause nope, your solution didn't work for me. Could me using windows 8 be an issue here? I'm heading to bed, but I'll screw with a new install of nircmd tomorrow. Hopefully that's the issue. It'd suck if I had to update for this to work for me. That'd be some expensive functionality
Yincognito
Posts: 658
Joined: February 27th, 2015, 2:38 pm

Re: Looking to be pointed in the right direction

Yincognito » March 27th, 2019, 8:48 am

Ferbstorm wrote:
March 27th, 2019, 8:35 am
Welp, I can only assume there's something wrong with NirCmd, cause nope, your solution didn't work for me. Could me using windows 8 be an issue here? I'm heading to bed, but I'll screw with a new install of nircmd tomorrow. Hopefully that's the issue. It'd suck if I had to update for this to work for me. That'd be some expensive functionality
I'm using Windows 10, so there is a difference there. However, NirCMD works with any Windows version, at least that's what they say on their site. By the way, NirCMD doesn't need to be "installed", it just needs to be copied somewhere on your hard drive - I don't even have it on C: you know...

I don't think it's anything wrong with NirCMD on this last method. I would guess you do something wrong, maybe. Like I said, it definitely works for me, and I thought I made you a nice surprise with it before you go to sleep. It's not like the previous times when I only tested a part of the solution and assumed the rest will work as well - this time every step of the procedure works.

You don't need to spend (yet) to see if it works on a different Windows version. You can install things in a virtual machine and test stuff there. Of course, since you said you're not an expert in such things, that might be unnecessary complication for you - I'm just saying that it can be done for free if it's a one time test.
Ferbstorm
Posts: 36
Joined: March 9th, 2019, 12:50 am

Re: Looking to be pointed in the right direction

Ferbstorm » March 27th, 2019, 8:50 pm

Yincognito wrote:
March 27th, 2019, 8:48 am
I'm using Windows 10, so there is a difference there. However, NirCMD works with any Windows version, at least that's what they say on their site. By the way, NirCMD doesn't need to be "installed", it just needs to be copied somewhere on your hard drive - I don't even have it on C: you know...

I don't think it's anything wrong with NirCMD on this last method. I would guess you do something wrong, maybe. Like I said, it definitely works for me, and I thought I made you a nice surprise with it before you go to sleep. It's not like the previous times when I only tested a part of the solution and assumed the rest will work as well - this time every step of the procedure works.

You don't need to spend (yet) to see if it works on a different Windows version. You can install things in a virtual machine and test stuff there. Of course, since you said you're not an expert in such things, that might be unnecessary complication for you - I'm just saying that it can be done for free if it's a one time test.
I mean to be fair, I was super stoked you did a full test before I ended up going to bed. I really do appreciate it man, even if it didn't work.. And the reason I think something might be wrong with my NirCMD is that when I tried to copy it to the directory it said that the copy failed. Now, I know that you don't need to copy it to the directory for it to work, but to me that indicates there might be something wrong with nircmd itself. And I've definitely got the file path written correctly in the skin. It occurs to me that it might help if I reboot. Unfortunately windows has been giving me problems whenever I reboot, so hopefully this will fix my problems and not break anything in the process. I'll certainly let you know. In the meantime here's the relevant code, cause it's certainly not inconceivable that I might be doing something wrong.

Edit**
Nope, restart didn't do a thing.

Code: Select all


[Musicbee]
Measure=Plugin
Plugin=RunCommand
Parameter="C:\Program Files\NirCMD\nircmd.exe win max process MusicBee.exe"
State=Hide
OutputType=ANSI

[BackGround]
Meter=Shape
Shape=Path BG | Extend BGMod
BG= (#TX#),0 | LineTo (#A#+#TX#),0 | LineTo (#A#+#TX#),(#B#) | ClosePath 1
BGMod=StrokeWidth 0 | StrokeColor 0,0,0,255 | FillColor #BaseBG#
BGMod2=StrokeWidth 0 | StrokeColor 0,0,0,255 | FillColor #BaseBG2#
MouseOverAction=[!ShowMeterGroup Hover][!ShowMeter TrackInfoArtist][!ShowMeter TrackInfoTrack][!ShowMeter TextBG][!SetOption Background Shape "Path BG | Extend BGMod2"][!Update][!Redraw]
MouseLeaveAction=[!HideMeterGroup Hover][!HideMeter TrackInfoArtist][!HideMeter TrackInfoTrack][!HideMeter TextBG][!SetOption Background Shape "Path BG | Extend BGMod"][!Update][!Redraw]
MouseScrollUpAction=[!CommandMeasure MeasurePlayer "SetVolume +5"][!Update]
MouseScrollDownAction=[!CommandMeasure MeasurePlayer "SetVolume -5"][!Update]
LeftMouseUpAction=["C:\Program Files (x86)\MusicBee\MusicBee.exe"][!CommandMeasure Musicbee "Run"]
Yincognito
Posts: 658
Joined: February 27th, 2015, 2:38 pm

Re: Looking to be pointed in the right direction

Yincognito » March 27th, 2019, 9:20 pm

Ferbstorm wrote:
March 27th, 2019, 8:50 pm
I mean to be fair, I was super stoked you did a full test before I ended up going to bed. I really do appreciate it man, even if it didn't work.. And the reason I think something might be wrong with my NirCMD is that when I tried to copy it to the directory it said that the copy failed. Now, I know that you don't need to copy it to the directory for it to work, but to me that indicates there might be something wrong with nircmd itself. And I've definitely got the file path written correctly in the skin. It occurs to me that it might help if I reboot. Unfortunately windows has been giving me problems whenever I reboot, so hopefully this will fix my problems and not break anything in the process. I'll certainly let you know. In the meantime here's the relevant code, cause it's certainly not inconceivable that I might be doing something wrong.
No need to thank me, it was my pleasure. The code seems ok to me. Some things you can do to at least know if it works might be:
- testing things at a friend, or ask him/her to do it (if the friend is from another city, TeamViewer is easy to use and free)
- reinstall Windows and do the test as soon as possible, to avoid other potential installations that might interfere with the process (just saying)
- reinstall Musicbee, maybe some Musicbee plugin/skin/addon you install is causing problems
- reinstall the most recent Rainmeter version (just covering that possibility as well)
- use another software that can simulate hotkeys, like AutoIt (I was just about to install it, before I managed to make it work in NirCMD)
Other options require more advanced skills, so I won't mention them.

Anyway, all you need to do is see that it works in a similar configuration (doesn't necessarily have to be Windows 8). Then, once you know that, it becomes easier to continue working on your skin and fix the issue at a later date (knowing that if you start things clean, you can't fail).

I could install Windows 8 in a virtual machine myself and test things, but I don't see any reason why it wouldn't work, so that would be a bit redundant. I only have Windows 7 Service Pack 1 installed in a virtual machine, and I could easily test the process there (I already have Rainmeter installed on it, since I basically use the installation to make sure my skin suite is fully Windows 7 compatible). Let me know if you want me to test the process on my W7 SP1 installation, if you think it helps. I can post a video on a sharing site to see it with your own eyes, if necessary.