Muscle Posted April 5, 2007 Share Posted April 5, 2007 Hi @all! I´ve got a problem. I want to a script to minimze icq when it starts. But I only find exit functions for that. The script should look if there is the process "ICQLite.exe" and then minimizes the icq-programm. How can I realize that? Thanks for every help! Muscle Link to comment Share on other sites More sharing options...
The Kandie Man Posted April 5, 2007 Share Posted April 5, 2007 It is easier just to use WinSetState("ICQ Window Title","",@SW_MINIMIZE) to minimize windows. If you are hellbent on using a process name, you can use this function to get the name of the window by providing the process. Then once you use the below function to get the name, use WinSetState() to minimize the window. A function for determining the window title based on a process: Func _ProcessGetWin($aPID, $i_ReturnArray = 0) Local $aWinList = WinList() Local $aReturnValue = '' $aPID = ProcessExists($aPID) For $icount = 1 To $aWinList[0][0] If WinGetProcess($aWinList[$icount][0]) = $aPID And BitAND($aWinList[$icount][1], 2) = 2 Then $aReturnValue = $aWinList[$icount][0] & @LF EndIf Next If $i_ReturnArray = 0 Then Return $aReturnValue ElseIf $i_ReturnArray = 1 Then Return StringSplit(StringTrimRight($aReturnValue, 1), @LF); Returns an Array Else SetError(1) Return 0 EndIf EndFunc "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Muscle Posted April 5, 2007 Author Share Posted April 5, 2007 thanks for the fast answer, but i don´t understand how to use it. could you show me an example, please? thanks muscle Link to comment Share on other sites More sharing options...
Muscle Posted April 5, 2007 Author Share Posted April 5, 2007 that´s the way i did it: $example = _ProcessGetWin("ICQLite.exe") MsgBox(0, "", $example) The result was a "M". I think that´s wrong. muscle Link to comment Share on other sites More sharing options...
The Kandie Man Posted April 5, 2007 Share Posted April 5, 2007 What is the title of the ICQ window? "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Muscle Posted April 5, 2007 Author Share Posted April 5, 2007 i mean the main programm of icq, there is only the logo and the text icq, not more Link to comment Share on other sites More sharing options...
Muscle Posted April 5, 2007 Author Share Posted April 5, 2007 is there any function like "processminimze" or something else? Link to comment Share on other sites More sharing options...
The Kandie Man Posted April 5, 2007 Share Posted April 5, 2007 This is the best way to do it: Opt("WinTitleMatchMode",2) WinSetState("ICQ","",@SW_MINIMIZE) oÝ÷ Øí«]¡ë'ßÛp¢¹-¯+aÆî´hm«Þ¶)¶²Ì"¶aƧv+b±» &®¶s`¢b33c¶5õvçFFÆW2Òõ&ö6W74vWEvâgV÷C´5ÆFRæWRgV÷C²Ã ¤f÷"b33c¶ô6÷VçBÒFòT&÷VæBb33c¶5õvçFFÆW2Ó bb33c¶5õvçFFÆW5²b33c¶ô6÷VçEÒfÇC²fwC²÷"b33c¶5õvçFFÆW5²b33c¶ô6÷VçEÒfÇC²fwC²gV÷C²gV÷C²FVâvå6WE7FFRb33c¶5õvçFFÆW5²b33c¶ô6÷VçEÒÂgV÷C²gV÷C²Ä5uôÔäÔ¤R¤æW@ ¤gVæ2õ&ö6W74vWEvâb33c¶BÂb33c¶õ&WGW&ä'&Ò¢Æö6Âb33c¶väÆ7BÒväÆ7B¢Æö6Âb33c¶&WGW&åfÇVRÒb33²b33°¢b33c¶BÒ&ö6W74W7G2b33c¶B¢f÷"b33c¶6÷VçBÒFòb33c¶väÆ7E³Õ³Ð¢bvävWE&ö6W72b33c¶väÆ7E²b33c¶6÷VçEÕ³ÒÒb33c¶BæB&DäBb33c¶väÆ7E²b33c¶6÷VçEÕ³ÒÂ"Ò"FVà¢b33c¶&WGW&åfÇVRÒb33c¶väÆ7E²b33c¶6÷VçEÕ³ÒfײÄ`¢VæD`¢æW@¢bb33c¶õ&WGW&ä'&ÒFVà¢&WGW&âb33c¶&WGW&åfÇVP¢VÇ6Tbb33c¶õ&WGW&ä'&ÒFVà¢&WGW&â7G&æu7ÆB7G&æuG&Õ&vBb33c¶&WGW&åfÇVRÂÂÄb²&WGW&ç2â'&¢VÇ6P¢6WDW'&÷"¢&WGW&â¢VæD`¤VæDgVæ0 -The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Muscle Posted April 5, 2007 Author Share Posted April 5, 2007 thanks for your help, but it doesn´t works sry there must be a way muscle Link to comment Share on other sites More sharing options...
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