Jex Posted October 24, 2007 Share Posted October 24, 2007 (edited) If active window in that program list then showing that window title in MSN Personal Message otherwise showing your selected text or clock. expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> #include <GuiListBox.au3> #include <File.au3> #Include <Constants.au3> Dim $Myini = "List.ini", $Showtext, $Found = False, $Timer, $Sec = 1 HotKeySet("+!t", "Title") Opt("TrayMenuMode", 1) $Status = TrayCreateItem("Hide window") TrayCreateItem("") $Exit = TrayCreateItem("Exit") TraySetState() $Form = GUICreate("FLEXY", 388, 271, 277, 314) $List = GUICtrlCreateList("", 200, 8, 169, 240) $Btn_Title = GUICtrlCreateButton("Add current active window title", 16, 16, 171, 25, 0) $Btn_Add = GUICtrlCreateButton("Add manual title name", 16, 48, 171, 25, 0) $Btn_Edit = GUICtrlCreateButton("Edit selected title from list", 16, 80, 171, 25, 0) $Btn_Delete = GUICtrlCreateButton("Remove selected title from list", 16, 112, 171, 25, 0) $Btn_Save = GUICtrlCreateButton("Save listbox", 16, 144, 171, 25, 0) $Btn_Hotkeys = GUICtrlCreateButton("Show hotkeys", 16, 176, 83, 25, 0) $Btn_Exit = GUICtrlCreateButton("Exit", 104, 176, 81, 25, 0) $Radio1 = GUICtrlCreateRadio("Show clock", 104, 216, 81, 17) GUICtrlSetState(-1, $GUI_CHECKED) $Radio2 = GUICtrlCreateRadio("Show text", 16, 216, 73, 17) $Radio3 = GUICtrlCreateRadio("Don't show anything", 16, 240, 129, 17) Load() GUISetState() While 1 $Begin = TimerInit() $msg = GUIGetMsg() Select Case $msg = $Btn_Title Title() Case $msg = $Btn_Add Add() Case $msg = $Btn_Edit Edit() Case $msg = $Btn_Delete Delete() Case $msg = $Btn_Save Save() Case $msg = $Btn_Hotkeys MsgBox("", "", "Shift + Alt + T = Add current active window title") Case $msg = $Radio2 $Showtext = InputBox(" ", "Text ?", $Showtext) Case $msg = $GUI_EVENT_MINIMIZE GUISetState(@SW_HIDE) TrayItemSetText($Status, "Show window") Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit $save = MsgBox(36, "", "You wanna save settings?") If $save = 6 Then Save() Exit EndSelect $msg = TrayGetMsg() Select Case $msg = $Status If TrayItemGetText($Status) = "Hide window" Then GUISetState(@SW_HIDE) TrayItemSetText($Status, "Show window") ElseIf TrayItemGetText($Status) = "Show window" Then GUISetState(@SW_SHOW) GUISetState(@SW_RESTORE) TrayItemSetText($Status, "Hide window") EndIf Case $msg = $Exit Exit EndSelect _Timer($Begin,10,"Check") WEnd Func _Timer($Var,$Sec,$Func) $TimerDiff = TimerDiff($Var) $Timer += $TimerDiff / 1000 If $Timer > $Sec Then $Timer = 0 Call($Func) EndIf EndFunc Func Title() $Item = WinGetTitle("") _GUICtrlListBox_AddString($List, $Item) EndFunc ;==>Title Func Add() $Item = InputBox(" ", "Title name ?") If @error <> 1 And $Item <> "" Then _GUICtrlListBox_AddString($List, $Item) EndIf EndFunc ;==>Add Func Save() $Count = _GUICtrlListBox_GetCount($List) FileDelete($Myini) For $Items = 0 To $Count - 1 IniWrite($Myini, "List", $Items, _GUICtrlListBox_GetText($List, $Items)) Next EndFunc ;==>Save Func Load() $Items = _FileCountLines($Myini) - 2 For $Index = 0 To $Items $Initem = IniRead($Myini, "List", $Index, "") _GUICtrlListBox_AddString($List, $Initem) Next EndFunc ;==>Load Func Edit() $Index = _GUICtrlListBox_GetCaretIndex($List) $Text = _GUICtrlListBox_GetText($List, $Index) $Edit = InputBox(" ", "Edit title name :", $Text) If @error <> 1 And $Edit <> "" Then _GUICtrlListBox_ReplaceString($List, $Index, $Edit) EndIf EndFunc ;==>Edit Func Delete() $Index = _GUICtrlListBox_GetCaretIndex($List) _GUICtrlListBox_DeleteString($List, $Index) EndFunc ;==>Delete Func Check() $Count = _GUICtrlListBox_GetCount($List) $Title = WinGetTitle("") For $Items = 0 To $Count - 1 If _GUICtrlListBox_GetText($List, $Items) = $Title Then ChangeMSNMessage(1, True, $Title) $Found = True ExitLoop EndIf Next If $Found = False Then If GUICtrlRead($Radio1) = $GUI_CHECKED Then ChangeMSNMessage(2, True, @HOUR & ":" & @MIN) ElseIf GUICtrlRead($Radio2) = $GUI_CHECKED Then ChangeMSNMessage(2, True, $Showtext) Else ChangeMSNMessage(2, False, "") EndIf EndIf $Found = False EndFunc ;==>Check Func ChangeMSNMessage($iType, $bEnable, $szText) Local Const $szFormat = "CoePSX\\0%s\\0%d\\0{0}\\0%s\\0\\0\\0\\0\\0" Local Const $WM_COPYDATA = 0x4A Local $szType Local $szMessage Local $iSize Local $pMem Local $stCopyData Local $hWindow ;; Format the message ;; Switch ($iType) Case 1 $szType = "Games" Case 2 $szType = "Office" Case Else $szType = "Music" EndSwitch $szMessage = StringFormat($szFormat, $szType, $bEnable, $szText) ;; Create a unicode string ;; $iSize = StringLen($szMessage) + 1 $pMem = DllStructCreate("ushort[" & $iSize & "]") For $i = 0 To $iSize DllStructSetData($pMem, 1, Asc(StringMid($szMessage, $i, 1)), $i) Next DllStructSetData($pMem, 1, 0, $iSize) ;; Create the COPYDATASTRUCT ;; $stCopyData = DllStructCreate("uint;uint;ptr") DllStructSetData($stCopyData, 1, 0x547) ;dwData = MSN magic number DllStructSetData($stCopyData, 2, ($iSize * 2)) ;cbData = Size of the message DllStructSetData($stCopyData, 3, DllStructGetPtr($pMem)) ;lpData = Pointer to the message ;; Send the WM_COPYDATA message ;; $hWindow = DllCall("user32", "hwnd", "FindWindowExA", "int", 0, "int", 0, "str", "MsnMsgrUIManager", "int", 0) While ($hWindow[0]) DllCall("user32", "int", "SendMessageA", "hwnd", $hWindow[0], "int", $WM_COPYDATA, "int", 0, "ptr", DllStructGetPtr($stCopyData)) $hWindow = DllCall("user32", "hwnd", "FindWindowExA", "int", 0, "hwnd", $hWindow[0], "str", "MsnMsgrUIManager", "int", 0) WEnd ;; Cleanup ;; $pMem = 0 $stCopyData = 0 EndFunc ;==>ChangeMSNMessage List.ini (Example) : 0=Counter-Strike Source 1=Day of Defeat Source 2=FLEXY 3=Portal 4=Team Fortress 2 5=World of Warcraft Edited November 27, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
Ibrahim Posted October 24, 2007 Share Posted October 24, 2007 Hey Hey Hey,NIIIIIIiiiiiiiiiiiice [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker Link to comment Share on other sites More sharing options...
Noobster24 Posted November 27, 2007 Share Posted November 27, 2007 (edited) Hmm looks nice, but it's not working for me, my status doesn't change at all. I manually added some programs (like Notepad, AutoIt Help etc.), but it doesn't change my status actually. Anyone got it working? (ps I got v.8.1 of WLM) Edited November 27, 2007 by Noobster24 Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. Link to comment Share on other sites More sharing options...
Pascal257 Posted November 27, 2007 Share Posted November 27, 2007 Hmm looks nice, but it's not working for me, my status doesn't change at all. I manually added some programs (like Notepad, AutoIt Help etc.), but it doesn't change my status actually.Anyone got it working?(ps I got v.8.1 of WLM)OK now you're posting twice ^^You might take a look at your settings of WLM...You have to activate the checkbox on the first page of your settings "Song-Information of WMP" Link to comment Share on other sites More sharing options...
Jex Posted November 27, 2007 Author Share Posted November 27, 2007 (edited) That script not work with last Autoit version now im updating. After update i can test for work or not. ( But very high chance will work with WLM 8.1 )Edit : Working without any problem in WLM 8.1.0178http://img253.imageshack.us/img253/5082/autoitfi4.jpg Edited November 27, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
Noobster24 Posted December 11, 2007 Share Posted December 11, 2007 Hi, thanks for the reply, I will try again. Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. 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