bucky002 Posted June 12, 2006 Posted June 12, 2006 I'm trying out this game called Knight Online.(fullscreen) And tried to make a script to minimize it, but it didn't work. I tried WinMinimizeAll and this. HotKeySet("^m", "Mini") HotKeySet("{ESC}", "End") Opt("WinTitleMatchMode", 2) While 1 Sleep(250) WEnd Func Mini() WinSetState("Knight Online Client", "", @SW_HIDE) EndFunc Func End() Exit EndFunc To no avail. What else can I do?
james3mg Posted June 12, 2006 Posted June 12, 2006 I tried WinMinimizeAllRarely, when nothing else works with fullscreen games, Windows key + m will be a more effective minimize all (I think because the windows key will break focus of the fullscreen program) - have you tried this key combination while in the game? If it ends up working, you could Send() this combination...Sometimes also just a windows key up and down to toggle the Start menu will cause a fullscreen game to minimize on its own - but it's usually a tempermental minimize, eg if you click on the desktop to release any other window's focus, it will go ahead and maximize on its own again.Also, have you tried running the AutoIt Window Info program while the game is running? Maybe the title is different than you thought. It might not show up once the game is running because it's probably set to "always on top" as well, but you should still be able to Ctrl+Alt+F to freeze it, then exit the game and see the result.Just some thoughts - sounds like you've tried the stuff that should have worked already. "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Nomad Posted June 12, 2006 Posted June 12, 2006 (edited) I'm trying out this game called Knight Online.(fullscreen) And tried to make a script to minimize it, but it didn't work. I tried WinMinimizeAll and this. HotKeySet("^m", "Mini") HotKeySet("{ESC}", "End") Opt("WinTitleMatchMode", 2) While 1 Sleep(250) WEnd Func Mini() WinSetState("Knight Online Client", "", @SW_HIDE) EndFunc Func End() Exit EndFunc To no avail. What else can I do?Have you checked to see if the hotkey even works? For the game I have been writing programs for, you can't assign a hotkey while the game is run full screen. The way this is scripted, if the hotkey isn't assigned it isn't even going to call your function. Try putting a MsgBox in the function and see if it is even called. Nomad Edited June 12, 2006 by Nomad
Nomad Posted June 12, 2006 Posted June 12, 2006 or if hotkey doesn't work try _ispressed That's how I got around it, but the problem with using it is that in order for it to work instantly, like a hotkey, you have to put the _IsPressed everywhere throughout your script, which I don't like. But until I find a new option...
bucky002 Posted June 12, 2006 Author Posted June 12, 2006 Also, have you tried running the AutoIt Window Info program while the game is running? Maybe the title is different than you thought. It might not show up once the game is running because it's probably set to "always on top" as well, but you should still be able to Ctrl+Alt+F to freeze it, then exit the game and see the result.Indeed I have. As for everyones recommendations I will give it a go. Have you checked to see if the hotkey even works? For the game I have been writing programs for, you can't assign a hotkey while the game is run full screen.Ahhhhh, infact you are right. When I tried exiting that didn't even work. I'll let you know how it's worked out.Thanks for the help.
Nomad Posted June 12, 2006 Posted June 12, 2006 Indeed I have. As for everyones recommendations I will give it a go. Ahhhhh, infact you are right. When I tried exiting that didn't even work. I'll let you know how it's worked out.Thanks for the help. No problem
bucky002 Posted June 12, 2006 Author Posted June 12, 2006 I did _IsPressed...Made progress, start menu shows up now, but no minimized window. But I can live with the start menu comming up I guess. If there isn't another way. Thinking maybe it can't be minimized?
Nomad Posted June 12, 2006 Posted June 12, 2006 I did _IsPressed...Made progress, start menu shows up now, but no minimized window. But I can live with the start menu comming up I guess. If there isn't another way. Thinking maybe it can't be minimized? Possibly. I haven't ever tried to minimize a full screen window, but it could possibly refuse to accept the new parameters just as it refuses to accept the hotkeys. There could still be a way to do it, but I'm not familiar with the method, if there is one.I do know that when a MsgBox from my script pops up it automatically minimizes the full screen window and shifts focus to the MsgBox. Maybe something similar to this could be used to minimize the window for you if no other options are presented.Nomad
bucky002 Posted June 12, 2006 Author Posted June 12, 2006 (edited) Possibly. I haven't ever tried to minimize a full screen window, but it could possibly refuse to accept the new parameters just as it refuses to accept the hotkeys. There could still be a way to do it, but I'm not familiar with the method, if there is one.I do know that when a MsgBox from my script pops up it automatically minimizes the full screen window and shifts focus to the MsgBox. Maybe something similar to this could be used to minimize the window for you if no other options are presented.Nomad So maybe try adding a msgbox to my script?Edit: Still just the start menu Edited June 12, 2006 by bucky002
bucky002 Posted June 12, 2006 Author Posted June 12, 2006 ;(0x01)= F1 Opt("WinTitleMatchMode", 2) While 1 If _IsPressed(0x01) then Minimize() Else Sleep(100) EndIf WEnd Func _IsPressed($hexKey) Local $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($ar[0], 0x8000) = 0x8000 Then Return True Else Return False EndIf EndFunc Func Minimize() WinSetState("Knight Online Client", "", @SW_HIDE) EndFunc Give that a shot I suppose.Still no luck
Nomad Posted June 13, 2006 Posted June 13, 2006 So maybe try adding a msgbox to my script?Edit: Still just the start menu Was just a suggestion to try if all else fails. You could also try sending {ALT} & {TAB}, or WinActivate("Your GUI window") in your minimize function. Find a solution that works for you.
AceLoc Posted June 13, 2006 Posted June 13, 2006 I'm trying out this game called Knight Online.(fullscreen) And tried to make a script to minimize it, but it didn't work. I tried WinMinimizeAll and this. HotKeySet("^m", "Mini") HotKeySet("{ESC}", "End") Opt("WinTitleMatchMode", 2) While 1 Sleep(250) WEnd Func Mini() WinSetState("Knight Online Client", "", @SW_HIDE) EndFunc Func End() Exit EndFunc To no avail. What else can I do? you cant hide that totally but you are able to move the window out the screen put this at the top of your code Opt("RunErrorsFatal", 0) Run(@ProgramFilesDir & '\THIS\IS\A\PATH "' & @ProgramFilesDir & '\THIS\IS\A\PATH"') WinWait('Classname') WinMove('Classname', '', @DesktopWidth, 200) sleep(5000) [quote name='AceLoc']I gots new sunglasses there cool.[/quote]
bucky002 Posted June 13, 2006 Author Posted June 13, 2006 Still nothing. I think this window is just unmovable. Thank you for all the help. I'll let you all know if I do find away to minimize it.
Sardith Posted June 14, 2006 Posted June 14, 2006 Opt("WinTitleMatchMode", 2) HotKeySet("{INSERT}", "Show") While 1 If Winactive("Knight OnLine Client") Then If _IsPressed('12') = 1 then WinSetState("Knight OnLine Client", "", @SW_HIDE) Else Sleep(100) EndIf EndIf WEnd Func Show() WinSetState("Knight OnLine Client", "", @SW_SHOW) EndFunc Func _IsPressed($hexKey) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc ;==>_IsPressed First off, the other code I gave you worked. So don't tell me this doesn't work, I just downloaded the client and tryed. Hit ALT to minimize the client. Then hit insert to bring it back Ie. Show. Secondly, that is poor coded game... 86% CPU usage with nothing else running. [font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]
AceLoc Posted June 14, 2006 Posted June 14, 2006 Opt("WinTitleMatchMode", 2) HotKeySet("{INSERT}", "Show") While 1 If Winactive("Knight OnLine Client") Then If _IsPressed('12') = 1 then WinSetState("Knight OnLine Client", "", @SW_HIDE) Else Sleep(100) EndIf EndIf WEnd Func Show() WinSetState("Knight OnLine Client", "", @SW_SHOW) EndFunc Func _IsPressed($hexKey) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc;==>_IsPressed First off, the other code I gave you worked. So don't tell me this doesn't work, I just downloaded the client and tryed. Hit ALT to minimize the client. Then hit insert to bring it back Ie. Show. Secondly, that is poor coded game... 86% CPU usage with nothing else running. jeah that could work [quote name='AceLoc']I gots new sunglasses there cool.[/quote]
bucky002 Posted June 15, 2006 Author Posted June 15, 2006 (edited) Opt("WinTitleMatchMode", 2) HotKeySet("{INSERT}", "Show") While 1 If Winactive("Knight OnLine Client") Then If _IsPressed('12') = 1 then WinSetState("Knight OnLine Client", "", @SW_HIDE) Else Sleep(100) EndIf EndIf WEnd Func Show() WinSetState("Knight OnLine Client", "", @SW_SHOW) EndFunc Func _IsPressed($hexKey) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc;==>_IsPressed First off, the other code I gave you worked. So don't tell me this doesn't work, I just downloaded the client and tryed. Hit ALT to minimize the client. Then hit insert to bring it back Ie. Show. Secondly, that is poor coded game... 86% CPU usage with nothing else running.I don't know why your other code didn't work for me. I'll try this one once I re-download the game.( The launcher.exe and uninstall file disapeared.) I'm sorry I don't play WoW or Diablo 2, two top notch computer games. Thanks for the code though. I'll give it a go! Edited June 15, 2006 by bucky002
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now