txj Posted July 15, 2004 Share Posted July 15, 2004 When someone send you message using NET SEND <your_computer_name> message_text at command prompt , a message box will be popped up on your desktop. in general, you cannot copy text in message box, this script can do it, and has ability to copy multi line text. the following command line can generate multi line message on your desktop, NET SEND <your_computer_name> Hello^TWord ! ^T means pressing CTRL+T. This script developed and tested only under Simplified Chinese Win2K, if you cannot get message under english WinNT/2K/XP/2K3, change statement global $strMsgSvcTitle = "Messenger service", $strNotepadTitle = "Untitled - Notepad" to be good. wish you good luck script name is GetMsgText.au3, code is: expandcollapse popupOpt("TrayIconHide", 1) ;0=show, 1=hide tray icon if $CmdLine[0] >= 1 then DispHelp( ) exit endif AutoItSetOption("WinTitleMatchMode", 4) Opt("ExpandEnvStrings", 1) ;0=don't expand, 1=do expand ; 0804 = Simplified Chinese, 0409 = English_United_States if @OSLang = 0804 then global $strMsgSvcTitle = "信使服务", $strNotepadTitle = "未定标题 - 记事本" elseif @OSLang = 0409 then global $strMsgSvcTitle = "Messenger service", $strNotepadTitle = "Untitled - Notepad" endif if not WinExists($strMsgSvcTitle, "") then MsgBox( 16, "Error", "No message received by Messenger service.") exit endif ; $text contans message text global $text ;get text from messenger service pop-up window created by NET SEND command. $text = ControlGetText($strMsgSvcTitle, "", "Static1") Run("%windir%\notepad.exe", "", @SW_HIDE) Sleep(500) ;handle of Notepad.exe global $NotepadHandle $NotepadHandle = WinGetHandle($strNotepadTitle, "") ControlSetText ( "handle=" & $NotepadHandle, "", "Edit1", $text ) WinActivate("handle=" & $NotepadHandle) WinWaitActive( "handle=" & $NotepadHandle, "", 1) Send("{DOWN}{DOWN}{SHIFTDOWN}{CTRLDOWN}{END}{SHIFTUP}{CTRLUP}{CTRLDOWN}c{CTRLUP}") WinClose( "handle=" & $NotepadHandle ) MsgBox(64, "Info", "Message text has been in clipboard.", 3 ) Func DispHelp( ) MsgBox(0, "Help", "GetMsgText 1.0, TanXiaoJun 2004-7-15, All Rights Reserved." & @CRLF & @CRLF & _ "Function: Get Messenger service text created using NET SEND command under WinNT/2K/XP/2K3." & @CRLF & @CRLF & _ "Only programmed and tested under Simplified Chinese Win2K, maybe get correct text under english WinNT/2K/XP/2K3." & @CRLF & @CRLF & _ "Usage: When message popped up, run this utility to send text to clipboard." & @CRLF & @CRLF & _ "Syntx: GetMsgText [/?]" & @CRLF & @CRLF & _ " /?: display this help message.") Endfunc 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