AU3Newbie Posted January 11, 2007 Posted January 11, 2007 HOW to share the GUI-form's information to another programs?e.g.#include <GUIConstants.au3> $Form1 = GUICreate("testGUI", 186, 174, 193, 115) $testcontent = GUICtrlCreateEdit("", 9, 8, 167, 113) GUICtrlSetData(-1, "testcontent") $Button1 = GUICtrlCreateButton("test clipborad", 56, 136, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button1 ClipPut(GUICtrlRead($testcontent)) run("notepad.exe") Sleep(100) send("^V") EndSwitch WEnd AS the example above,why the notepad cannot recieve the clipboard's content?
BigDod Posted January 11, 2007 Posted January 11, 2007 Works for me Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
AU3Newbie Posted January 11, 2007 Author Posted January 11, 2007 Works for meWithout changing anything?
BigDod Posted January 11, 2007 Posted January 11, 2007 Without changing anything?Just copied and pasted it Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
Helge Posted January 11, 2007 Posted January 11, 2007 I have a feeling that notepad didn't get time to become active before Send was executed. Try this : #include <GUIConstants.au3> Opt("WinTitleMatchMode", 4) ; added $Form1 = GUICreate("testGUI", 186, 174, 193, 115) $testcontent = GUICtrlCreateEdit("", 9, 8, 167, 113) GUICtrlSetData(-1, "testcontent") $Button1 = GUICtrlCreateButton("test clipborad", 56, 136, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button1 ClipPut(GUICtrlRead($testcontent)) run("notepad.exe") WinWaitActive("classname=Notepad") ; replaced with sleep send("^V") EndSwitch WEnd
AU3Newbie Posted January 12, 2007 Author Posted January 12, 2007 thank you very much. Maybe the problem is ACTIVE problem or my OS isn't stable. here's another,it works well. thank you. #include <GUIConstants.au3> Opt("WinTitleMatchMode", 4); added $Form1 = GUICreate("testGUI", 186, 174, 193, 115) $testcontent = GUICtrlCreateEdit("", 9, 8, 167, 113) GUICtrlSetData(-1, "testcontent") $Button1 = GUICtrlCreateButton("test clipborad", 56, 136, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button1 $content=GUICtrlRead($testcontent) run("notepad.exe") for $i=1 to StringLen($content) step 1 ClipPut(Stringleft($content,$i)&@CRLF) WinActivate("classname=Notepad"); replaced with sleep send("^V") next EndSwitch WEnd
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