sd333221 Posted December 17, 2005 Share Posted December 17, 2005 Is there a way to change f.ex. the windowtitle of "Battlefield 2" to "Bimboshield 2", in a compiled program? I don't want a script with changes it manually. I want to change the .exe itself... Thank you Link to comment Share on other sites More sharing options...
sd333221 Posted December 17, 2005 Author Share Posted December 17, 2005 I am using this atm: Link to comment Share on other sites More sharing options...
Valuater Posted December 18, 2005 Share Posted December 18, 2005 only way i know is to put it in a wrapper exe file ; Compile this to a new exe ; place program into the exe $Program_1 = @TempDir & "\Temp.exe" FileInstall("C:\Program Files\?FOLDER?\?NAME?.exe", $Program_1) Run($Program_1) WinWaitActive("") WinSetTitle("?OLD TITLE?","", "?NEW TITLE?") thats it 8) Link to comment Share on other sites More sharing options...
sd333221 Posted December 18, 2005 Author Share Posted December 18, 2005 This wont work, the program changes/refreshes it's title over time Hexing the program doesnt work. Link to comment Share on other sites More sharing options...
erebus Posted December 18, 2005 Share Posted December 18, 2005 Try to refresh your changed titlebar too then and see if it works. If it doesn't, it doesn't. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 18, 2005 Moderators Share Posted December 18, 2005 Hexing the program doesnt work. So why not just run something that makes sure it's changed constantly with a 10 millesecond time delay using WinSetTitle()? I mean, If you used a hexing method, and the program constantly checks to make sure it still has it's title intact, and if it doesn't... it changes it back... after you did the hexing... what makes you think without dissasembling it you'd be able to do it without using a constant loop? $ApplicationTitle = 'Blah Blah Cookies' While 1 If WinExists($ApplicationTitle) Then WinSetTitle($ApplicationTitle, '', 'Ice Cream Is Better!') Sleep(10) Wend Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sd333221 Posted December 19, 2005 Author Share Posted December 19, 2005 Try to refresh your changed titlebar too then and see if it works. If it doesn't, it doesn't.Yes, i already thought of that, but it makes cpu usage 60%, on an 1gb ram computer Link to comment Share on other sites More sharing options...
LxP Posted December 19, 2005 Share Posted December 19, 2005 CPU and RAM are entirely different things. You have not provided any code so a perfect solution cannot be offered. Perhaps this will be close: Opt('WinWaitDelay', 0) While 1 WinWait('Battlefield 2') WinSetTitle('Battlefield 2', '', 'Bimboshield 2') WEnd Link to comment Share on other sites More sharing options...
LxP Posted December 19, 2005 Share Posted December 19, 2005 Perhaps this will be better again: Opt('WinTitleMatchMode', 2) Opt('WinWaitDelay', 0) Local $PartTitle = 'Battlefield 2' While 1 WinWait($PartTitle) Local $FullTitle = WinGetTitle($PartTitle) Local $NewTitle = StringReplace($FullTitle, 'Battlefield', 'Bimboshield') WinSetTitle($FullTitle, '', $NewTitle) WEnd Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 19, 2005 Moderators Share Posted December 19, 2005 Blah@WinWait() , I always skip over that option... nice catch Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
erebus Posted December 19, 2005 Share Posted December 19, 2005 Yes, i already thought of that, but it makes cpu usage 60%, on an 1gb ram computer Yes but if you think a little more over it, you will understand that this has to do with time - and nothing more. Try not to query your CPU every 1ms. There are a lot of ways to do this. P.S. Provide some code if you want to help you more please. Link to comment Share on other sites More sharing options...
Sardith Posted December 19, 2005 Share Posted December 19, 2005 (edited) ;Changes the title of a program of your choice. CODE#include <GuiConstants.au3> HotKeySet("{ESC}", "Terminate") Opt("OnExitFunc", "_ScriptClose") $hWnd = WinGetHandle("Windows Media Player");Name of the programs' title while 1 WinSetTitle($hWnd, "", Random(100, 10000, 1)) sleep(10000) WEnd Func Terminate() WinSetTitle($hWnd, "", "Windows Media Player") Exit EndFunc Func _ScriptClose() WinSetTitle($hWnd, "", "Windows Media Player") Exit EndFunc expandcollapse popup;Changes your script title CODE#include <GuiConstants.au3> #NoTrayIcon HotKeySet("{ESC}", "Terminate") Opt("GUICloseOnESC", 0) Opt("OnExitFunc", "_ScriptClose") Opt("GuiOnEventMode", 1) ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $hWnd = WinGetHandle("MSN");Name of the programs' title ; Script title, random title changer $gui = GUICreate(Random(100, 10000, 1), 135, 60, (@DesktopWidth-135)/2, (@DesktopHeight-75)/2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS - $WS_MAXIMIZEBOX - $WS_SIZEBOX) GUISetOnEvent($GUI_EVENT_CLOSE, "_ScriptClose") GUISetState() $timer = TimerInit() ;title changes every 10 seconds (>=10000) While WinExists($hWnd) If TimerDiff($timer) >= 10000 Then WinSetTitle($gui, "", Random(100, 10000, 1)) $timer = TimerInit() EndIf If Not WinActive($hWnd) Then Sleep(100) EndIf Sleep(10) WEnd MsgBox(64, WinGetTitle($gui), "Program will now terminate.", 15) _ScriptClose() ;;;; Body of program would go here;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func _ScriptClose() Exit 0 EndFunc Func Terminate() Exit EndFunc Edited December 19, 2005 by Sardith [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 More sharing options...
Moderators SmOke_N Posted December 19, 2005 Moderators Share Posted December 19, 2005 Are you and sardith the same person? http://www.autoitscript.com/forum/index.ph...ndpost&p=132413 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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