Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Lordmonkus

Recommended Posts

@JoeViking245 Could you help me with something? I think it's the last issue I should need help with.

I have problems with launchbox covering the taskbar when I launch certain games, most likely because they're a different resolution than desktop which is 1920 x 1080. Even though when I quit the game and the resolution reverts back to 1080p launchbox still covers the taskbar. I am able to use a hotkey to make the taskbar show as minimizing it and reactivating it solves the issue.

 

Hotkey, Insert, LaunchUpdate
return

LaunchUpdate: 
WinMinimize ahk_exe launchbox.exe 
WinActivate ahk_exe launchbox.exe 

 

But I want to do it on a loop instead that does it automatically if it happens however only if the script can tell launchbox is covering the taskbar because if not it'll just be winminimizing and activating constantly. Could you help with that?

Edited by Jayinem
Link to comment
Share on other sites

51 minutes ago, Jayinem said:

I have problems with launchbox covering the taskbar when I launch certain games

What happens if you set the LB window to NOT fullscreen, then grab the edges and 'stretch' to where you want the window to be?  aka, it looks fullscreen, but it's technically not.

Link to comment
Share on other sites

7 minutes ago, JoeViking245 said:

What happens if you set the LB window to NOT fullscreen, then grab the edges and 'stretch' to where you want the window to be?  aka, it looks fullscreen, but it's technically not.

You know what it is remember how I was running scripts to keep launchbox fullscreen and where if I minimize or hit the middle winrestore button it would still stay fullscreen (but show taskbar) that script is causing the issue I just figured out.  Because to do what you asked make it not fullscreen I had to close that script, and when I dragged it to cover the entire screen except taskbar, and changed the resolution it did not cover the taskbar. However as soon as I ran the script and changed the resolution it covered the taskbar. Problem is I kind of like the script maybe it could be fixed? This is what I have

 #SingleInstance force
#Persistent

Loop
{
   if WinActive("ahk_exe LaunchBox.exe")
      WinMaximize
}

  

So for some reason this makes it maximize as in cover the taskbar if I change resolutions, but if not it does not which is odd to me.

 

Link to comment
Share on other sites

42 minutes ago, Jayinem said:

So for some reason this makes it maximize as in cover the taskbar if I change resolutions, but if not it does not which is odd to me.

Sounds like you have too many scripts and they're tripping all over themselves. lol

Change your old script to not maximize then.  Try WinRestore instead.

Link to comment
Share on other sites

8 hours ago, JoeViking245 said:

Sounds like you have too many scripts and they're tripping all over themselves. lol

Change your old script to not maximize then.  Try WinRestore instead.

When I do that, it makes it cover the taskbar at all times, even if I click the box in the top right it won't allow it to not cover the taskbar. 😟

I've never had success with the WinRestore command, it's almost like they're backwards restore maximizes and maximize restores. As soon as I change it back to WinMaximize it's back to showing taskbar, unless of course I change resolution.

You having me drag the size of launchbox did seem to help somewhat though. If I change the resolution to 720p it does cover the taskbar, but at least when I change it back to 1080p it no longer does, so is helpful for games that would effect the resolution. I do use 720p for one thing though to stream my PC to my Nintendo Switch, but I don't use it very often.

Edited by Jayinem
  • Like 1
Link to comment
Share on other sites

In case anyone else has that problem of Launchbox covering the taskbar at different times when you don't want it to (because I've seen lots of threads on this forum but no real answers) it's a driver issue. I believe I have it solved by going into Display Settings then choosing Graphic settings and it'll say Graphics performance preference Choose between better performance or battery life when choosing an app. Choose an app to set the preference. Choose your launchbox.exe and in my case I have two GPUs Intel and Nvidia, I choose Nvidia and when it wakes from sleep or when I change resolutions it does not budge from fullscreen with taskbar showing. I even close all ahk scripts which I tried to use to remedy the problem. I've had this issue for several years and could never resolve until (I think/hope) now.

 

Edited by Jayinem
Link to comment
Share on other sites

This question is not Launchbox related, so if I'm told I can't get help for it that's okay. But I'm trying to make a command prompt into a tray icon where it stays open in the tray but I can click on it open it but if I close it it goes back to the tray. I tried every app to do this but all they seem to do is give you a keyboard shortcut to minimize to tray but when you open it you have to do the shortcut again. That's not exactly what I want. Can anyone help?

Link to comment
Share on other sites

This question is not Launchbox related, so if I'm told I can't get help for it that's okay. But I'm trying to make a command prompt into a tray icon where it stays open in the tray but I can click on it open it but if I close it it goes back to the tray. I tried every app to do this but all they seem to do is give you a keyboard shortcut to minimize to tray but when you open it you have to do the shortcut again. That's not exactly what I want. Can anyone help?

I was able to find a script maybe a year ago and modify it that does put it in the tray but it doesn't work properly as I can't open it. I also deleted part of the end of it and made it worse and can't find the original. Maybe the code could be modified.
 

#NoTrayIcon
#Persistent

/* Setup Tray icon and add item that will handle
* double click events
*/
Menu Tray, Icon
Menu Tray, Icon, C:\windows\system32\cmd.exe
Menu Tray, Add, Show / Hide "Client RS.exe", TrayClick
Menu Tray, Add, Close "Client RS.exe", CloseItem
Menu Tray, Default, Show / Hide "Client RS.exe"

;// Run program or batch file hidden
DetectHiddenWindows On
Run "Client RS.exe",, Hide, PID
WinWait ahk_pid %PID%
hBatFile := WinExist()
DetectHiddenWindows Off
return

TrayClick:
OnTrayClick()
return

;// Show / hide program or batch file on double click
OnTrayClick() {
    if DllCall("IsWindowVisible", "Ptr", hBatFile) {
        WinHide ahk_id %hBatFile%

    }
}

CloseItem() {

       DetectHiddenWindows On
       WinWait ahk_class ConsoleWindowClass
       Process, Close, cmd.exe
       DetectHiddenWindows Off
       ExitApp

}

 

Edited by Jayinem
Link to comment
Share on other sites

15 hours ago, JoeViking245 said:

Right-click the file and send it to the Task Bar.

image.thumb.png.bc00dbddd5e54ab6de030da4cd4a0d61.png

Thanks but the app I'm using cmd for is already available on the taskbar. I was wanting it as a tray icon so it would be hidden.

 

Edit: I'm all set, finally found a free app that does what  I want making anything into a tray icon permanently.

Edited by Jayinem
Link to comment
Share on other sites

  • 3 weeks later...
On 11/26/2024 at 2:53 PM, Jayinem said:

@JoeViking245 in RPCS3 how do I have a ahk script that runs a custom configuration for an individual game? I think this was covered somewhere in this thread but it's a long thread.

Wouldn't you instead use command-line parameters to load a custom config?  I don't really use that emulator and would have to look it up if it's even possible.  But I'll let you practice your Googling. ;) 

Pro tip, At the top of this thread, if you type something in the Search box, the default search location is "This Topic".  That should narrow things down.

Pro tip #2, instead of searching the 'regular' Forums, you can Google "LaunchBox what_you're_looking_for".  i.e.  LaunchBox RPCS3 ahk script

Link to comment
Share on other sites

On 11/26/2024 at 4:53 PM, Jayinem said:

@JoeViking245 in RPCS3 how do I have a ahk script that runs a custom configuration for an individual game? I think this was covered somewhere in this thread but it's a long thread.

use the native feature within the emulator. RPCS3 already can do game specific configs and will load them automatically. all it takes is right clicking on a game in the game list and then saving the type of custom config you want

Link to comment
Share on other sites

14 hours ago, skizzosjt said:

use the native feature within the emulator. RPCS3 already can do game specific configs and will load them automatically. all it takes is right clicking on a game in the game list and then saving the type of custom config you want

I know how to make custom configs dude, I just didn't know if RPCS3 was loading them when a game is lauching from Launchbox. This is a Launchbox forum I obviously don't want to load the game through RPCS3 I want to load the game through Launchbox.

This thread feels dead to me no one really posts here I'm like the only one asking for help with anything and now I'm starting to get "just google it" answers. Almost feels like why would you even ask for help with an AHK script in an AHK script thread. The guy I'm quoting was guilty of that too just google it I read the entire thread a couple of months ago and never saw that reply until now twice. I think I'm good anyway won't be asking for anymore help here or helping others. Peace out.

Edited by Jayinem
Link to comment
Share on other sites

59 minutes ago, Jayinem said:

I know how to make custom configs dude,

How Rude. 

1 hour ago, Jayinem said:

I just didn't know if RPCS3 was loading them when a game is lauching from Launchbox. This is a Launchbox forum I obviously don't want to load the game through RPCS3 I want to load the game through Launchbox.

We have no idea if you had done any research (i.e. Just Google It) prior to your posting. There was also no indication you had any inclining of how to create per-game configs.  You didn't note that you had them set up already and just wasn't sure if they were actually loading or not.

The answer @skizzosjt gave seemed to me that once you save it to the game, it'll load with that game automatically. Had it been known that your intent was somehow verify they were indeed being loaded, I suspect the answer would have been different.

1 hour ago, Jayinem said:

This thread feels dead to me no one really posts here I'm like the only one asking for help with anything and now I'm starting to get "just google it" answers. Almost feels like why would you even ask for help with an AHK script in an AHK script thread. The guy I'm quoting was guilty of that too just google it

The guy you quoted (me) offered you up to "just Google it" because as expressed, I don't use that emulator. 

As mentioned, you weren't as specific in your original question as you were in your rebuttal.  We can only respond to you based on the information provided.

A possible resulting outcome of your initial query would be for me to 'just Google it' (most likely using the tips provided), figure out how to get it to work and then "just give you the answer" [for something I'll never use myself].  The answer being, either set the config in the emulator, add the appropriate command-line parameter(s) if applicable or [last resort] devise a script that will run the emulator with command-line parameters.

But I really didn't have an interest in learning that, thus provided the tools that I'd have used to help you in your quest.

If you hadn't have quoted (tagged) me, I wouldn't have responded because I didn't know the answer. Then quite possibly, instead of anyone/everyone waiting for me to respond, a response may have come sooner. More back-and-forth details could have been exchanged and a communal resolution developed for you and future readers.  (BTW was out of town the last week, so a later response than my typical)

1 hour ago, Jayinem said:

I think I'm good anyway won't be asking for anymore help here or helping others. Peace out.

Sounds like you may have found your answer.  Good to hear.

Peace.

  • Like 1
Link to comment
Share on other sites

10 hours ago, Erics9382 said:

does anyone have script to exit xenia emulator?

I don't have anything in my Running Script section for Xenia and it exits fine using the controller button-combo I have assigned to "Exit Game" (LaunchBox) / "Close the Active Window" (BigBox).

aka: You shouldn't need any script for exiting Xenia.

Is it simply not doing anything when pressing your button(-combo)?

Link to comment
Share on other sites

Hi,

Can any of you AHK wizards show me how to close an already running program then load a emulator then reload the closed program, I've tried and then googled now my head hurts 🫣

Even did try a basic batch file i found online then altered the file paths and ran that outside of LB - 

taskkill /IM Lichtknarre.exe /F

Pause

start/wait "Dolphin" /B  "G:\LaunchBox\Emulators\Dolphin\Dolphin.exe" %1

Pause

start "Lichtknarre" /B "C:\Program Files\Lichtknarre\Lichtknarre.exe"

Pause

exit

but that give this error -

C:\Users\Retro-pc\Desktop>taskkill /IM Lichtknarre.exe /F
ERROR: The process "Lichtknarre.exe" with PID 8752 could not be terminated.
Reason: Access is denied.

Thanks in advance for any help :)

Edited by -neo-
Link to comment
Share on other sites

1 hour ago, -neo- said:

C:\Users\Retro-pc\Desktop>taskkill /IM Lichtknarre.exe /F
ERROR: The process "Lichtknarre.exe" with PID 8752 could not be terminated.
Reason: Access is denied.

May look at moving (installing?) \Lichtknarre\ to anywhere but C:\Program Files\.  Perhaps to somewhere like G:\Lightguns\Lichtknarre\...

\Program Files\ can be a stickler for allowing/denying access.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...