5rings Posted January 26, 2014 Posted January 26, 2014 I'm looking for a way to embed "file.txt" rather than open the doc in new gui i would prefer to view it i at a spec location such as (01, 600, 01, 800) Ive searched the help files but not found a way yet thank you
BrewManNH Posted January 26, 2014 Posted January 26, 2014 Explain what you mean by "view it at a spec location". Also, you can't embed a text file, although you can put the contents of it in an Edit control. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
5rings Posted January 26, 2014 Author Posted January 26, 2014 Specific or specify location in the GUi So are you saying that if i had a folder of 20 documents I could not scroll or aka back next to open the documents as the are. or even just open the doc with a drop down menu, with out a new window? If the answer is no what would the next best thing be to easily access and edit data with out logging into ftp or web server? the scope of the project is for me to keep track of contacts and call backs generated through out the day the primary requirement is that contacts are organized by city and state as well as editable Here is the code i have as of now expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <Constants.au3> ;#RequireAdmin // uncomment this line to require admin aproval to run on this computer ;WinWaitActive("RequireAdmin") ; *** Start added by AutoIt3Wrapper *** #include <DateTimeConstants.au3> #include <StructureConstants.au3> ; *** End added by AutoIt3Wrapper *** #include <GuiMonthCal.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FTPEx.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <ScreenCapture.au3> #include <StaticConstants.au3> #include <Process.au3> #include <Array.au3> #include <Date.au3> #Include <WinAPI.au3> #include <FontConstants.au3> ;#include-once #include <IE.au3> Opt('MustDeclareVars', 0) $Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work _Main() Func _Main() Local $hCombo, $input, $rec, $i, $doc, $bolet1, $radio_1, $de_select, $about, $back, $edit, $save, $delete, $help, $background, $oIE, $zip, $name Local $bizname, $phone, $keyword2, $sg, $dncadd, $IE, $adddir, $addtodir, $GUIActiveX, $pic1, $sHTML, $msg ;$msg, $msg2, $wait, $s, $m, $in, $oP, $case1 Global $sFile, $hFile, $sText, $nBytes, $tBuffer ; Create GUI $oIE = ObjCreate("Shell.Explorer.2") GUICreate("This is Call Pro 2000 &dedicated", 800, 600) $GUIActiveX = GUICtrlCreateObj ($oIE, 10, 50, 775, 478) ;$oIE = _IECreate () ;$sHTML = "<h1>Hello World!</h1>" $pic1 = GUICtrlCreatePic("E:\DnCO=true_then_blocked\basegraphimg.png", 25, 25, 60, 60) $oIE.navigate("http://123.com") ;$oIE.navigate("E:\DnCO=true\basegraphimg.png") $hCombo = GUICtrlCreateCombo("", 2, 2, 396, 296) $input = GUICtrlCreateInput("This is Input control where you can enter any keyword special keyword name biz phone zip and select your radio button for search type to process querry add or remove from your personalized callbacks or dnc. it may soon be available for Posible commands or macros definintion searches with in this program", -1, 559, 800, 40) $rec = GUICtrlCreateButton("Go To Record|", 420, 1, 90, 21) $doc = GUICtrlCreateButton("Go To Doc|", 511, 1, 90, 21) $sg = GUICtrlCreateButton("Go To Sales Genie|", 605, 1, 120, 21) $IE = GUICtrlCreateButton("IE|", 760, 1, 25, 21) $i = $input() $bolet1 = GUICtrlCreateButton("search, %|", 704, 23, 90, 21) $de_select = GUICtrlCreateRadio("radio clear", 350, 23, 90, 21) $radio_1 = GUICtrlCreateRadio("Key Word", 445, 23, 90, 21) $zip = GUICtrlCreateRadio("Zip", 277, 23, 50, 21) $name = GUICtrlCreateRadio("Name", 194, 23, 75, 21) $bizname = GUICtrlCreateRadio("Biz Name", 106, 23, 75, 21) $phone = GUICtrlCreateRadio("Phone", 545, 23, 75, 21) $keyword2 = GUICtrlCreateRadio("KeyW.2", 10 , 23, 75, 21) $about = GUICtrlCreateButton("About", 5 , 535, 70, 21) $back = GUICtrlCreateButton("Back", 90 , 535, 70, 21) $edit = GUICtrlCreateButton("Edit", 270 , 535, 70, 21) $save = GUICtrlCreateButton("Save", 185 , 535, 70, 21) $delete = GUICtrlCreateButton("delete sR", 355 , 535, 70, 21) $help = GUICtrlCreateButton("help", 445 , 535, 70, 21) $dncadd = GUICtrlCreateButton("add to Dnc", 533 , 535, 70, 21) $adddir = GUICtrlCreateButton("CreateDir@ScriptDir", 610 , 535, 110, 21) $addtodir = GUICtrlCreateButton("AddToDir", 725 , 535, 70, 21) $background = GUICtrlCreatePic("E:\DnCO=true_then\dycb.png", -1, -1, 600, 600) ;$oP = _IETagNameGetCollection($oIE, "p", 0) ;$msg = GUICtrlCreatePic("E:\DnCO=true\dycb.png", 50, 50, 600, 600) $oIE = ObjCreate("Shell.Explorer.2") ;$oIE.navigate("E:\DnCO=true_\dycb.png", 200, 200) GUISetState() ;_IEDocInsertText($oP, "(Text beforebegin)", "beforebegin") ;ConsoleWrite(_IEBodyReadHTML($oIE) & @CRLF) ; Add files _GUICtrlComboBox_BeginUpdate($hCombo & $rec) _GUICtrlComboBox_AddDir($hCombo, @ScriptDir & "\*.exe") _GUICtrlComboBox_EndUpdate($hCombo) _GUICtrlComboBox_BeginUpdate($i & $doc) _GUICtrlComboBox_EndUpdate($i & $doc) _GUICtrlComboBox_BeginUpdate($bolet1 & $radio_1) _GUICtrlComboBox_EndUpdate($bolet1 & $radio_1) _GUICtrlComboBox_BeginUpdate($de_select & $about) _GUICtrlComboBox_EndUpdate($de_select & $about) _GUICtrlComboBox_BeginUpdate($back & $edit) _GUICtrlComboBox_EndUpdate($back & $edit) _GUICtrlComboBox_BeginUpdate($save & $delete) _GUICtrlComboBox_EndUpdate($save & $delete) _GUICtrlComboBox_BeginUpdate($help & $background) _GUICtrlComboBox_EndUpdate($help & $background) _GUICtrlComboBox_BeginUpdate($oIE & $zip) _GUICtrlComboBox_EndUpdate($oIE & $zip) _GUICtrlComboBox_BeginUpdate($name & $phone) _GUICtrlComboBox_EndUpdate($name & $phone) _GUICtrlComboBox_BeginUpdate($bizname & $keyword2) _GUICtrlComboBox_EndUpdate($bizname & $keyword2) _GUICtrlComboBox_BeginUpdate($sg & $dncadd) _GUICtrlComboBox_EndUpdate($sg & $dncadd) _GUICtrlComboBox_BeginUpdate($IE & $adddir) _GUICtrlComboBox_EndUpdate($IE & $adddir) _GUICtrlComboBox_BeginUpdate($addtodir & $oIE) _GUICtrlComboBox_EndUpdate($addtodir & $oIE) _GUICtrlComboBox_BeginUpdate($GUIActiveX & $pic1) _GUICtrlComboBox_EndUpdate($GUIActiveX & $pic1) _GUICtrlComboBox_BeginUpdate($msg) _GUICtrlComboBox_EndUpdate($msg) _IEBodyWriteHTML ($oIE, $sHTML) Select Case $help MsgBox(0, "", "First Case expression was true") Do $msg = GUIGetMsg() If $msg = $help Then GUICtrlSetData($help, "Pause") For $about = $phone To 1 If GUICtrlRead($about) = True Then MsgBox(0, "", "box box") GUICtrlSetData($back, " open?") $zip = GUIGetMsg() If $name = true Then ExitLoop If $msg = $save Then GUICtrlSetData($save, " quit?") ;$phone = $edit ExitLoop Else $edit = 1 GUICtrlSetData($about, $adddir) GUICtrlSetData($help, (100 - $edit)) Sleep($addtodir) EndIf Next If $save & $about > 1 Then GUICtrlSetData($save, "#soon") ;GUICtrlSetData($about, "#try") EndIf EndIf Until $msg = $help EndSelect ; 1) create file and write data to it $sFile = @ScriptDir & '\testchoice.txt' $sText = '$Special Thanks to Jeremy for approving this doc--for the complete help file search _WinAPI_CreateFile' $tBuffer = DllStructCreate("byte[" & StringLen($sText) & "]") DllStructSetData($tBuffer, 1, $sText) $hFile = _WinAPI_CreateFile($sFile, 1) _WinAPI_WriteFile($hFile, DllStructGetPtr($tBuffer), StringLen($sText), $nBytes) _WinAPI_CloseHandle($hFile) ConsoleWrite('1) ' & FileRead($sFile) & @CRLF) ;for the complete help file serch _WinAPI_CreateFile ;_WinAPI_CreateFile ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() ;Exit EndFunc ;==>_Main feel free to critigue Thanks
BrewManNH Posted January 26, 2014 Posted January 26, 2014 I never said you couldn't open the file, what I said was you can't embed it. You need to take the contents of the file and use GUICtrlSetData to put it into an edit control. You don't need a new GUI for that if your current one has one, or you create one on it. BTW, your _GUICtrlComboBox_BeginUpdate code is written wrong, you can't do whatever it is you're trying to do the way you're trying to do it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
5rings Posted January 30, 2014 Author Posted January 30, 2014 Thanks I am learning about GUICtrlComboBox_BeginUpdate and will focus on that in a while. I have experimented a little with $oIE = ObjCreate("Shell.Explorer.2") and $oIE.navigate("myfile.txt", 200, 200) or $oIE = ObjCreate("myfile.txt") but nothing has worked would you be kind enough to show me how to open a .txt in a gui with out opening a new window
BrewManNH Posted January 30, 2014 Posted January 30, 2014 (edited) This is what I was referring to. #include <GUIConstantsEx.au3> GUICreate("Test") $hEditControl = GUICtrlCreateEdit("", 10, 10, 380, 350) GUISetState() $sText = FileRead("myfile.txt") GUICtrlSetData($hEditControl, $sText) While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd Edited January 30, 2014 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
5rings Posted February 21, 2014 Author Posted February 21, 2014 I am really struggling with this, I see the realivence in your last post on how this should work below #include <GUIConstantsEx.au3> GUICreate("Test") $hEditControl = GUICtrlCreateEdit("", 10, 10, 380, 350) GUISetState() $sText = FileRead("myfile.txt") GUICtrlSetData($hEditControl, $sText) While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd But having trouble with functions and missing wend. All i need is to be able to select the .txt file from the only drop down menu then click button $doc = GUICtrlCreateButton("Go To Doc|", 511, 1, 90, 21) and hopfully appear the selected .txt replacing IE Thanks for your help expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <Constants.au3> ;#RequireAdmin // uncomment this line to require admin aproval to run on this computer ;WinWaitActive("RequireAdmin") ; *** Start added by AutoIt3Wrapper *** #include <DateTimeConstants.au3> #include <StructureConstants.au3> ; *** End added by AutoIt3Wrapper *** #include <GuiMonthCal.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FTPEx.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <ScreenCapture.au3> #include <StaticConstants.au3> #include <Process.au3> #include <Array.au3> #include <Date.au3> #Include <WinAPI.au3> #include <FontConstants.au3> ;#include-once #include <IE.au3> Opt('MustDeclareVars', 0) $Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work _Main() Func _Main() Local $hCombo, $input, $rec, $i, $doc, $bolet1, $radio_1, $de_select, $about, $back, $edit, $save, $delete, $help, $background, $oIE, $zip, $name Local $bizname, $phone, $keyword2, $sg, $dncadd, $IE, $adddir, $addtodir, $GUIActiveX, $pic1, $sHTML, $msg ;$msg, $msg2, $wait, $s, $m, $in, $oP, $case1 Global $sFile, $hFile, $sText, $nBytes, $tBuffer ; Create GUI $oIE = ObjCreate("Shell.Explorer.2") GUICreate("This is Call Pro 2000 & |>| DedîcÄted, Ju§t to reach Ü |'operator'| pîped with VZ Fios prefered |@|", 800, 600) $GUIActiveX = GUICtrlCreateObj ($oIE, 10, 50, 775, 478) ;$oIE = _IECreate () $sHTML = "<h1>Hello World!</h1>" $pic1 = GUICtrlCreatePic("E:\DnCO=true_then_blocked or _no_match=allow_dial\Debug\basegraphimg.png", 25, 25, 60, 60) $oIE.navigate("http://www.autoitscript.com/forum/") ;$oIE.navigate("E:\DnCO=true_then_blocked or _no_match=allow_dial\Debug\basegraphimg.png") $hCombo = GUICtrlCreateCombo("", 2, 2, 396, 296) $input = GUICtrlCreateInput("This is Input control where you can enter any keyword special keyword name biz phone zip and select your radio button for search type to process querry add or remove from your personalized callbacks or dnc. it may soon be available for Posible commands or macros definintion searches with in this program", -1, 559, 800, 40) $rec = GUICtrlCreateButton("Go To Record|", 420, 1, 90, 21) $doc = GUICtrlCreateButton("Go To Doc|", 511, 1, 90, 21) $sg = GUICtrlCreateButton("Go To Sales Genie|", 605, 1, 120, 21) $IE = GUICtrlCreateButton("IE|", 760, 1, 25, 21) $i = $input() $bolet1 = GUICtrlCreateButton("search, %|", 704, 23, 90, 21) $de_select = GUICtrlCreateRadio("radio clear", 350, 23, 90, 21) $radio_1 = GUICtrlCreateRadio("Key Word", 445, 23, 90, 21) $zip = GUICtrlCreateRadio("Zip", 277, 23, 50, 21) $name = GUICtrlCreateRadio("Name", 194, 23, 75, 21) $bizname = GUICtrlCreateRadio("Biz Name", 106, 23, 75, 21) $phone = GUICtrlCreateRadio("Phone", 545, 23, 75, 21) $keyword2 = GUICtrlCreateRadio("KeyW.2", 10 , 23, 75, 21) $about = GUICtrlCreateButton("About", 5 , 535, 70, 21) $back = GUICtrlCreateButton("Back", 90 , 535, 70, 21) $edit = GUICtrlCreateButton("Edit", 270 , 535, 70, 21) $save = GUICtrlCreateButton("Save", 185 , 535, 70, 21) $delete = GUICtrlCreateButton("delete sR", 355 , 535, 70, 21) $help = GUICtrlCreateButton("help", 445 , 535, 70, 21) $dncadd = GUICtrlCreateButton("add to Dnc", 533 , 535, 70, 21) $adddir = GUICtrlCreateButton("CreateDir@ScriptDir", 610 , 535, 110, 21) $addtodir = GUICtrlCreateButton("AddToDir", 725 , 535, 70, 21) $background = GUICtrlCreatePic("E:\DnCO=true_then_blocked or _no_match=allow_dial\Debug\dycb.png", -1, -1, 600, 600) ;$oP = _IETagNameGetCollection($oIE, "p", 0) ;$msg = GUICtrlCreatePic("E:\DnCO=true_then_blocked or _no_match=allow_dial\Debug\dycb.png", 50, 50, 600, 600) $oIE = ObjCreate("Shell.Explorer.2") ;$oIE.navigate("E:\DnCO=true_then_blocked or _no_match=allow_dial\Debug\dycb.png", 200, 200) GUISetState() ;_IEDocInsertText($oP, "(Text beforebegin)", "beforebegin") ;ConsoleWrite(_IEBodyReadHTML($oIE) & @CRLF) ; Add files _GUICtrlComboBox_BeginUpdate($hCombo & $rec) _GUICtrlComboBox_AddDir($hCombo, @ScriptDir & "\*.txt") _GUICtrlComboBox_EndUpdate($hCombo) _GUICtrlComboBox_BeginUpdate($i & $doc) _GUICtrlComboBox_EndUpdate($i & $doc) _GUICtrlComboBox_BeginUpdate($bolet1 & $radio_1) _GUICtrlComboBox_EndUpdate($bolet1 & $radio_1) _GUICtrlComboBox_BeginUpdate($de_select & $about) _GUICtrlComboBox_EndUpdate($de_select & $about) _GUICtrlComboBox_BeginUpdate($back & $edit) _GUICtrlComboBox_EndUpdate($back & $edit) _GUICtrlComboBox_BeginUpdate($save & $delete) _GUICtrlComboBox_EndUpdate($save & $delete) _GUICtrlComboBox_BeginUpdate($help & $background) _GUICtrlComboBox_EndUpdate($help & $background) _GUICtrlComboBox_BeginUpdate($oIE & $zip) _GUICtrlComboBox_EndUpdate($oIE & $zip) _GUICtrlComboBox_BeginUpdate($name & $phone) _GUICtrlComboBox_EndUpdate($name & $phone) _GUICtrlComboBox_BeginUpdate($bizname & $keyword2) _GUICtrlComboBox_EndUpdate($bizname & $keyword2) _GUICtrlComboBox_BeginUpdate($sg & $dncadd) _GUICtrlComboBox_EndUpdate($sg & $dncadd) _GUICtrlComboBox_BeginUpdate($IE & $adddir) _GUICtrlComboBox_EndUpdate($IE & $adddir) _GUICtrlComboBox_BeginUpdate($addtodir & $oIE) _GUICtrlComboBox_EndUpdate($addtodir & $oIE) _GUICtrlComboBox_BeginUpdate($GUIActiveX & $pic1) _GUICtrlComboBox_EndUpdate($GUIActiveX & $pic1) _GUICtrlComboBox_BeginUpdate($msg) _GUICtrlComboBox_EndUpdate($msg) _IEBodyWriteHTML ($oIE, $sHTML) ;Select ;Case $help ;MsgBox(0, "", "First Case expression was true") Do $msg = GUIGetMsg() If $msg = $help Then GUICtrlSetData($help, "$'s Genie") For $about = $phone To 1 If GUICtrlRead($about) = True Then MsgBox(0, "", "box box") GUICtrlSetData($back, " open?") $zip = GUIGetMsg() If $name = true Then ExitLoop If $msg = $save Then GUICtrlSetData($save, " quit?") ;$phone = $edit ExitLoop Else $edit = 1 GUICtrlSetData($about, $adddir) GUICtrlSetData($help, (100 - $edit)) Sleep($addtodir) EndIf Next If $save & $about > 1 Then GUICtrlSetData($save, "#X-light") ;GUICtrlSetData($about, "#try") EndIf EndIf Until $msg = $help ;EndSelect ; 1) create file and write data to it $sFile = @ScriptDir & '\testchoice.txt' $sText = ' add back button and address bar for IE then we fixed open .exe vs .txt$Special Thanks to Jeremy for approving this doc--for the complete help file search _WinAPI_CreateFile' $tBuffer = DllStructCreate("byte[" & StringLen($sText) & "]") DllStructSetData($tBuffer, 1, $sText) $hFile = _WinAPI_CreateFile($sFile, 1) _WinAPI_WriteFile($hFile, DllStructGetPtr($tBuffer), StringLen($sText), $nBytes) _WinAPI_CloseHandle($hFile) ConsoleWrite('1) ' & FileRead($sFile) & @CRLF) ;for the complete help file serch _WinAPI_CreateFile ;_WinAPI_CreateFile ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() ;Exit EndFunc ;==>_Main
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