NeMoD Posted October 6, 2006 Posted October 6, 2006 (edited) edit: I messed up the title of the post Theres much more, but I'd post the only part that doesn't work $Stringname = InputBox("Person's Name", "Put the username that displays in the chat window here", "") Opt("WinTitleMatchMode", 1) WinActive ($Stringname) I'm trying to make it able accept a persons name, then it activate the users chat window, since most chat programs have the username in the title. But I the string doesn't work in WinActive? Edited October 6, 2006 by NeMoD
cppman Posted October 6, 2006 Posted October 6, 2006 (edited) That is because I highly doubt any chat program has ONLY the user name in the title... Try something like this $sWinName = InputBox("Chat", "Enter the user's name!") $sWindows = WinList() For $i = 1 to $sWindows[0][0] if (StringInStr($sWindows[$i][0], $sWinName)) Then ;Put your code here: WinActivate($sWindows[$i][1]) Else EndIf Next Edited October 6, 2006 by CHRIS95219 Miva OS Project
Moderators SmOke_N Posted October 6, 2006 Moderators Posted October 6, 2006 (edited) edit: I messed up the title of the post Theres much more, but I'd post the only part that doesn't work $Stringname = InputBox("Person's Name", "Put the username that displays in the chat window here", "") Opt("WinTitleMatchMode", 1) WinActive ($Stringname) I'm trying to make it able accept a persons name, then it activate the users chat window, since most chat programs have the username in the title. But I the string doesn't work in WinActive? You'll find this more difficult than you think in IM applications... but I would do Opt('WinTitleMatchMode', 2) (1 is default btw, no need for an Opt). Edited October 6, 2006 by SmOke_N 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.
NeMoD Posted October 6, 2006 Author Posted October 6, 2006 (edited) You'll find this more difficult than you think in IM applications... but I would do Opt('WinTitleMatchMode', 2) (1 is default btw, no need for an Opt).oh I thought 0 was default, maybe I misread, thanks for the replies I'll try it out now edit: thanks CHRIS95219 works perfectly Edited October 6, 2006 by NeMoD
cppman Posted October 6, 2006 Posted October 6, 2006 oh I thought 0 was default, maybe I misread, thanks for the replies I'll try it out now edit: thanks CHRIS95219 works perfectly your welcome, glad i could help Miva OS Project
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