Jump to content

Full screen game won't minimize?


Recommended Posts

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?

Link to comment
Share on other sites

I tried WinMinimizeAll

Rarely, 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
Link to comment
Share on other sites

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 :D

Edited by Nomad
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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. :D

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. :D

Link to comment
Share on other sites

Indeed I have. :D

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. :D

No problem :P

Link to comment
Share on other sites

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. :D

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 :D

Link to comment
Share on other sites

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 :D

So maybe try adding a msgbox to my script?

Edit: Still just the start menu

Edited by bucky002
Link to comment
Share on other sites

;(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 :D
Link to comment
Share on other sites

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. :D

Link to comment
Share on other sites

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 :D

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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 :D

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Link to comment
Share on other sites

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. :D

Thanks for the code though. :D I'll give it a go!

Edited by bucky002
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...