Radu Capan Posted May 6, 2005 Posted May 6, 2005 (edited) Hi! 1. I have an edit control, in which I only show some texts. I make it READONLY, which is great, but I would like to remove the blinking cursor from there, from the edit control. Is it possible? Maybe even to be impossible to mark the text. Specification: do not recomment me a label control, since I need to put text in a specific area, using scroll if the text is too long. So I really need the edit control, but with no cursor. 2. Also, is possible to have only a control with transparency? I think it's a stupid question . Is possible the background of the edit not to be a colour, but to see the pict background I use for all main window? (Since no answer yet, I add a 3rd question; last question?) 3. The final compiled program (with SciTe) makes an icon in systray, with "Script Paused" and "Exit". Can I disable this somehow? In the final product, final executable program, I don't need that. What directive should I use? Thanks in advance! rkn Edited May 6, 2005 by Radu Capan
steveR Posted May 6, 2005 Posted May 6, 2005 1. Its possible with the HideCaret() API call but I haven't much luck getting it to work correctly. Maybe ask the Larry, he's API pro. 2. Iv'e seen it done with VB but don't know if it's possible with Autoit. It would involve more API calls. 3. put this at the top of your program: #NoTrayIcon AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Ejoc Posted May 6, 2005 Posted May 6, 2005 #include <GUIConstants.au3> $hGUI = GUICreate("test",200,200) $hEdit = GUICtrlCreateEdit("",0,0,200,200) GUISetState() DllCall("user32.dll","int","HideCaret","int",0) While 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
steveR Posted May 6, 2005 Posted May 6, 2005 Yes that will work but only if that's the only edit control on the window. Otherwise it keeps coming back AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Ejoc Posted May 7, 2005 Posted May 7, 2005 ok How about this? #include <GUIConstants.au3> $hGUI = GUICreate("test",200,220) $hEdit = GUICtrlCreateEdit("Text",0,0,200,200,$ES_READONLY) GUICtrlSetState(-1,$GUI_DISABLE) $hInput = GUICtrlCreateInput("",0,201,200,19) ControlFocus($hGUI,"",$hInput) GUISetState() GUICtrlSetData($hEdit,"This is new data") While 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
steveR Posted May 7, 2005 Posted May 7, 2005 Yeah but now it's disabled and the text can't be right-clicked/copied. I would want it read only but no caret and text selectable/copyable I thought of how to do it but it's rather clunky. I just would like to do it with just API calls if possible. AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Ejoc Posted May 7, 2005 Posted May 7, 2005 1. I have an edit control, in which I only show some texts. I make it READONLY, which is great, but I would like to remove the blinking cursor from there, from the edit control. Is it possible? Maybe even to be impossible to mark the text. Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
GaryFrost Posted May 7, 2005 Posted May 7, 2005 (edited) you can use this on as many controls as you need to.just remember for each call to HideCaret there has to be a call to ShowCaretHiding is cumulative. If your application calls HideCaret five times in a row, it must also call ShowCaret five times before the caret is displayed.DllCall("user32.dll","long","HideCaret","hwnd",$controlID)DllCall("user32.dll","long","ShowCaret","hwnd",$controlID) Edited May 7, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Radu Capan Posted May 7, 2005 Author Posted May 7, 2005 I thank to all of you! The GUI_DISABLE solution made the edit grey, but the HideCaret solution did work! And also thanks for helping me to remove the tray icon. T H A N K S. Great forum. Great help. Great people. rkn
steveR Posted May 11, 2005 Posted May 11, 2005 (edited) Yay I got it to work! I forgot about GuiGetCursorInfo()#include <GUIConstants.au3> $hGUI = GUICreate("test",200,200) $hEdit = GUICtrlCreateEdit("",0,0,100,100) GUICtrlCreateEdit("", 5, 120, 100, 40) GUICtrlCreateButton("button", 150, 140) GUISetState() While 1 $msg = GUIGetMsg() $info = GUIGetCursorInfo() if ($info[4] = $hEdit) and $info[2] then DllCall("user32.dll","int","HideCaret","int",0) if $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Edited May 11, 2005 by steveR AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
hausl78 Posted April 20, 2014 Posted April 20, 2014 (edited) Hello, i tried the snipplet from user GaryFrost, but didnt get to work it like i thougt. So i had to use the version from user Ejoc change it a little, and just want to ask if this is a "good" way, because i hat to put the API call into the "Listener", the "endless loop" #include <GUIConstants.au3> $hGUI = GUICreate("test",400,200, -1, 200, $WS_SIZEBOX + $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) $hEdit = GUICtrlCreateEdit("",20,20,200,100, $WS_HSCROLL + $WS_VSCROLL + $ES_READONLY) $hButton = GUICtrlCreateButton("Click me!", 250, 50, 70, 30) GUISetState() While 1 ;$info = GUIGetCursorInfo() ;if ($info[4] = $hEdit) and $info[2] then DllCall("user32.dll","int","HideCaret","int",0) DllCall("user32.dll","int","HideCaret","int",0) $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then Exit EndIf if $msg = $hButton Then GUICtrlSetData($hEdit, "Thank you!" & @CRLF & @CRLF) EndIf WEnd Thanks a lot! Juergen Edited April 20, 2014 by hausl78
Moderators Melba23 Posted April 20, 2014 Moderators Posted April 20, 2014 hausl78,You do realise that the post above yours dates from nearly 9 years ago? Ejoc has not been online for 6 years and GaryFrost is not a frequent visitor. In future please do not resurrect threads from this far back - the language has changed so much that it is likely that the functionality has already been incorporated and the previously posted code will almost certainly not run in the current version of AutoIt without modification. Just open a new thread and ask your question there. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts