; Proof-of-Concept for a net-send-based messenger program ; CyberSlug: Original code 3 July 2004 ; Revised for new GUI syntax 10 December 2004 ; Gui Recode to 3.1.1 15 August 2005 ; Update with own code by evod510 2005 #include RunWait("net start messenger","",@SW_HIDE) ;Make sure messenger service is running Opt("WinWaitDelay", 10) ;speeds things up a little $MyGui = GuiCreate("NetSend", 450,359,(@DesktopHeight-392)/2, (@DesktopHeight-359)/2 , 0x04CF0000) ;Controls might have word-wrap and/or read-only styles... maybe also styles to always show scroll bar... $txt_output = GuiCtrlCreateEdit("", 10, 10, 433, 170, 0x50231904, 0x00000200) ;$txt_input = GuiCtrlCreateEdit("Message goes here.", 10, 230, 370, 70, 0x50231104) $txt_input = GuiCtrlCreateEdit("Message goes here.", 10, 230, 370, 40, 0x50231104) GuiCtrlSetState($txt_input, $GUI_FOCUS) ;default control with focus $button_send = GUICtrlCreateButton("{Enter} == Send", 20, 300, 150, 30) $checkbox_topmost = GuiCtrlCreateCheckbox("Always On Top", 210, 190, 150, 30, $BS_PUSHLIKE) ;looks like button.... GuiCtrlSetState($checkbox_topmost, $GUI_CHECKED) ;checkbox will be pushed in by default $button_sendclear = GUICtrlCreateButton("Clear", 10, 190, 100, 30) ;;;;;;;;;;;;;;;;;;;;;;CHECHBOX USERLIST NAME START;;;;;;;;;;;;;;;;;;;; $checkCN = GUICtrlCreateCheckbox ("jack", 280, 280, 100, 20) $checkCN2 = GUICtrlCreateCheckbox ("jerry", 385, 320, 100, 20) $checkCN3 = GUICtrlCreateCheckbox ("shelly", 385, 300, 100, 20) $checkCN4 = GUICtrlCreateCheckbox ("jones", 280, 300, 100, 20) $checkCN5 = GUICtrlCreateCheckbox ("noel", 385, 280, 100, 20) $checkCN6 = GUICtrlCreateCheckbox ("nick", 385, 240, 100, 20) $checkCN7 = GUICtrlCreateCheckbox ("lyan", 385, 340, 100, 20) $checkCN8 = GUICtrlCreateCheckbox ("betty", 280, 320, 100, 20) $checkCN9 = GUICtrlCreateCheckbox ("david", 280, 340, 100, 20) $checkCN10 = GUICtrlCreateCheckbox ("fisher", 385, 260, 100, 20) ;$MainCheck = GUICtrlCreateCheckbox("Select/Unselect", 390, 130, 120, 20) ;;;;;;;;;;;;;;;;;;;;;;CHECHBOX USERLIST NAME END;;;;;;;;;;;;;;;;;;;;; GuiSetState(@SW_SHOW) GUICtrlSendMsg($txt_input, 0xB1, 0, 99999) ;I want the sample text message to be highlighted upon start WinSetOnTop($MyGui, "", 1) ;always on top by default... ;MAIN MESSAGE LOOP While 1 sleep(5) ;sleep to prevent maxing out the CPU ; I want to trap the Enter key (but only when this GUI is active) so that it causes ; the message in the textbox to be send If WinActive($MyGui) Then HotKeySet("{Enter}", "EnterSends") ;register hotkey when our GUI messenger window is active Else HotKeySet("{Enter}") ;un-register hotkey otherwise EndIf ; Constantly poll to see if a Net Send Popup has appeared. If so, grab its contents and close it. If WinExists("Messenger Service", "Message from") Then Local $i, $t = "" $text = StringSplit( StringReplace(WinGetText("Messenger Service","Message from"),@CRLF,@LF) , @LF) WinClose("Messenger Service", "Message from") $sender = StringMid($text[2], 14, StringInStr($text[2]," to ")-14 ) $t = "" For $i = 4 to $text[0] $t = $t & $text[$i] & @CRLF Next $t = StringStripWS($t, 2) ;strip trailing whitespace ; Display contents from the Popup in the form '