charvi Posted May 3, 2009 Share Posted May 3, 2009 Sunny May's Sunday greeting you! How can I transform my thin blinking vertical cursor to a (preferably non-blinking) solid black solid block cursor? It will be used with a large monospaced font, so the block should be the size of the character. And when using the backspace key, the character over which it is, must remain visible in reversed colours. This may look old-fashioned, but when using many input fields, it is good to see where the cursor is. I have seen a Windows application before using a solid block cursor, so I believe it is possible. How can we get it in AutoIt? Cheers, charvi Link to comment Share on other sites More sharing options...
Yashied Posted May 3, 2009 Share Posted May 3, 2009 (edited) Sunny May's Sunday greeting you! How can I transform my thin blinking vertical cursor to a (preferably non-blinking) solid black solid block cursor? It will be used with a large monospaced font, so the block should be the size of the character. And when using the backspace key, the character over which it is, must remain visible in reversed colours. This may look old-fashioned, but when using many input fields, it is good to see where the cursor is. I have seen a Windows application before using a solid block cursor, so I believe it is possible. How can we get it in AutoIt? Cheers, charviMaybe this. expandcollapse popup#include <WindowsConstants.au3> #include <Constants.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) global $Button, $Input, $hInput, $hBitmap, $pHook, $hProc, $Msg, $BlinkTime = default GUICreate('Test', 400, 100) $Input = GUICtrlCreateInput("", 20, 20, 360, 20) $hInput = GUICtrlGetHandle($Input) $Button = GUICtrlCreateButton('Exit', 165, 60, 70, 23) $hBitmap = _WinAPI_CreateSolidBitmap(0, 0x66FFFF, 10, 14) $pHook = DllCallbackRegister('_InputProc', 'ptr', 'hwnd;uint;long;ptr') $hProc = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, DllCallbackGetPtr($pHook)) GUISetState() while 1 $Msg = GUIGetMsg() switch $Msg case -3, $Button exit endswitch wend func _InputProc($hWnd, $uiMsg, $wParam, $lParam) local $Res = _WinAPI_CallWindowProc($hProc, $hWnd, $uiMsg, $wParam, $lParam) switch $uiMsg case $WM_SETFOCUS DllCall('user32.dll', 'int', 'CreateCaret', 'hwnd', $hWnd, 'ptr', $hBitmap, 'int', 0, 'int', 0) DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', $hWnd) $BlinkTime = DllCall('user32.dll', 'int', 'GetCaretBlinkTime') $BlinkTime = $BlinkTime[0] DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', -1) case $WM_KILLFOCUS DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', $hWnd) DllCall('user32.dll', 'int', 'DestroyCaret') DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $BlinkTime) endswitch return $Res endfunc; _InputProc func OnAutoItExit() _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, $hProc) DllCallBackFree($pHook) if $BlinkTime <> default then DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $BlinkTime) endif endfunc; OnAutoItExit Edited May 3, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
KaFu Posted May 3, 2009 Share Posted May 3, 2009 Maybe this.Nice example, added to snippet folder OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 3, 2009 Moderators Share Posted May 3, 2009 Yashied, Поздравляю вас! M23 P.S. I hope the spelling is correct this time! 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 Link to comment Share on other sites More sharing options...
Yashied Posted May 3, 2009 Share Posted May 3, 2009 Yashied,Поздравляю вас!M23P.S. I hope the spelling is correct this time!Yes, this is absolutely correct. Thanks. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
UEZ Posted May 3, 2009 Share Posted May 3, 2009 Maybe this. expandcollapse popup#include <WindowsConstants.au3> #include <Constants.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) global $Button, $Input, $hInput, $hBitmap, $pHook, $hProc, $Msg, $BlinkTime = default GUICreate('Test', 400, 100) $Input = GUICtrlCreateInput("", 20, 20, 360, 20) $hInput = GUICtrlGetHandle($Input) $Button = GUICtrlCreateButton('Exit', 165, 60, 70, 23) $hBitmap = _WinAPI_CreateSolidBitmap(0, 0x66FFFF, 10, 14) $pHook = DllCallbackRegister('_InputProc', 'ptr', 'hwnd;uint;long;ptr') $hProc = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, DllCallbackGetPtr($pHook)) GUISetState() while 1 $Msg = GUIGetMsg() switch $Msg case -3, $Button exit endswitch wend func _InputProc($hWnd, $uiMsg, $wParam, $lParam) local $Res = _WinAPI_CallWindowProc($hProc, $hWnd, $uiMsg, $wParam, $lParam) switch $uiMsg case $WM_SETFOCUS DllCall('user32.dll', 'int', 'CreateCaret', 'hwnd', $hWnd, 'ptr', $hBitmap, 'int', 0, 'int', 0) DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', $hWnd) $BlinkTime = DllCall('user32.dll', 'int', 'GetCaretBlinkTime') $BlinkTime = $BlinkTime[0] DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', -1) case $WM_KILLFOCUS DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', $hWnd) DllCall('user32.dll', 'int', 'DestroyCaret') DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $BlinkTime) endswitch return $Res endfunc; _InputProc func OnAutoItExit() _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, $hProc) DllCallBackFree($pHook) if $BlinkTime <> default then DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $BlinkTime) endif endfunc; OnAutoItExit For what is the variable $BlinkTime? Should the cursor blink? UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Authenticity Posted May 3, 2009 Share Posted May 3, 2009 haha... kakdila Yashied, very nice example. Link to comment Share on other sites More sharing options...
Yashied Posted May 3, 2009 Share Posted May 3, 2009 (edited) For what is the variable $BlinkTime? Should the cursor blink?UEZTo restore the previous value.http://msdn.microsoft.com/en-us/library/ms648404(VS.85).aspx Edited May 3, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Valuater Posted May 3, 2009 Share Posted May 3, 2009 (edited) For what is the variable $BlinkTime? Should the cursor blink? UEZ This is with the blink and you may note the $BlinkTime attributes expandcollapse popup#Include <WindowsConstants.au3> #Include <Constants.au3> #Include <WinAPI.au3> Opt('MustDeclareVars', 1) global $Button, $Input, $hInput, $hBitmap, $pHook, $hProc, $Msg, $BlinkTime GUICreate('Test', 400, 100) $Input = GUICtrlCreateInput("", 20, 20, 360, 20) $hInput = GUICtrlGetHandle($Input) $Button = GUICtrlCreateButton('Exit', 165, 60, 70, 23) $hBitmap = _WinAPI_CreateSolidBitmap(0, 0x66FFFF, 10, 14) $pHook = DllCallbackRegister('_InputProc', 'ptr', 'hwnd;uint;long;ptr') $hProc = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, DllCallbackGetPtr($pHook)) GUISetState() while 1 $Msg = GUIGetMsg() switch $Msg case -3, $Button exit endswitch wend func _InputProc($hWnd, $uiMsg, $wParam, $lParam) local $Res = _WinAPI_CallWindowProc($hProc, $hWnd, $uiMsg, $wParam, $lParam) switch $uiMsg case $WM_SETFOCUS DllCall('user32.dll', 'int', 'CreateCaret', 'hwnd', $hWnd, 'ptr', $hBitmap, 'int', 0, 'int', 0) DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', $hWnd) ;$BlinkTime = DllCall('user32.dll', 'int', 'GetCaretBlinkTime') ;$BlinkTime = $BlinkTime[0] ;DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', -1) case $WM_KILLFOCUS DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', $hWnd) DllCall('user32.dll', 'int', 'DestroyCaret') ;DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $BlinkTime) endswitch return $Res endfunc; _InputProc func OnAutoItExit() _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, $hProc) DllCallBackFree($pHook) endfunc; OnAutoItExit 8) Edited May 3, 2009 by Valuater Link to comment Share on other sites More sharing options...
UEZ Posted May 3, 2009 Share Posted May 3, 2009 (edited) To restore the previous value.http://msdn.microsoft.com/en-us/library/ms648404(VS.85).aspxThanks, but I'm not familiar with WinAPI respectively C++. So, how can I set the blinking time? -> thanks Valuater for the response! I posted shortly after your post!Btw, very nice example Yasied!UEZ Edited May 3, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Yashied Posted May 3, 2009 Share Posted May 3, 2009 Thanks, but I'm not familiar with WinAPI respectively C++. So, how can I set the blinking time? -> thanks Valuater for the response! I posted shortly after your post!Btw, very nice example Yasied!UEZReplace (-1) to other value (in milliseconds).DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $MyBlinkTime) My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
UEZ Posted May 3, 2009 Share Posted May 3, 2009 Replace (-1) to other value (in milliseconds).DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $MyBlinkTime)Thanks, working excellent UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
charvi Posted May 3, 2009 Author Share Posted May 3, 2009 Yashied, I am truly very happy with your example! Many many thanks! And yes, it works like a charm too. Perfect with monospaced characters with adjusted width and height in the _WinAPI_CreateSolidBitmap statement. I wish I could say 'Thank You' in your language... I know in Polish it is 'dziekuje bardzo' but not yet in Russian lol. Isn't what Melba23 said to you? And also thanks to the others who were interested in the BlinkTime... I think it is now time for AutoIt to blink like the Sun, isn't it? lol Cheers! charvi Link to comment Share on other sites More sharing options...
charvi Posted May 3, 2009 Author Share Posted May 3, 2009 I was just wondering if there is also a way to get an underscore blinking cursor, to imitate the MS-DOS look & feel ?This just for completeness Link to comment Share on other sites More sharing options...
Valuater Posted May 3, 2009 Share Posted May 3, 2009 (edited) Using GUIRegisterMsg for Multiple inputs expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <WinAPI.au3> Global $hBitmap $frmGlobalDefaults = GUICreate("Edit Focus", 400, 300) $btnBrowse = GUICtrlCreateButton("&Browse", 240, 24, 60, 248, 0) $inptbxRegFileName = GUICtrlCreateInput("inptbxRegFileName " & $btnBrowse + 1, 20, 24, 200, 21) $inptbxDirBase = GUICtrlCreateInput("inptbxDirBase " & $btnBrowse + 2, 20, 80, 200, 21) $inptbxDirAlbum = GUICtrlCreateInput("inptbxDirAlbum " & $btnBrowse + 3, 20, 136, 200, 21) $inptbxDirSettings = GUICtrlCreateInput("inptbxDirSettings " & $btnBrowse + 4, 20, 192, 200, 21) $inptbxDirHP = GUICtrlCreateInput("inptbxDirHP " & $btnBrowse + 5, 20, 248, 200, 21) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ; Set the Function While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) If $hBitmap = "" Then $hBitmap = _WinAPI_CreateSolidBitmap(0, 0x66FFFF, 10, 14) Local $nNotifyCode = BitShift($wParam, 16) Switch $nNotifyCode; Edit control event messages only Case $EN_SETFOCUS; Edit (Input) control has focus DllCall('user32.dll', 'int', 'CreateCaret', 'hwnd', $lParam, 'ptr', $hBitmap, 'int', 0, 'int', 0) DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', $lParam) Case $EN_KILLFOCUS; Edit (Input) control lost focus DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', $lParam) DllCall('user32.dll', 'int', 'DestroyCaret') EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND I like the Blinking... 8) 8) Edited May 3, 2009 by Valuater Link to comment Share on other sites More sharing options...
ResNullius Posted May 3, 2009 Share Posted May 3, 2009 Kip also posted a Caret UDF that even alows you to use custom images:http://www.autoitscript.com/forum/index.ph...st&p=574055 Link to comment Share on other sites More sharing options...
UEZ Posted May 3, 2009 Share Posted May 3, 2009 I was just wondering if there is also a way to get an underscore blinking cursor, to imitate the MS-DOS look & feel ?This just for completeness Good idea but I looked at MSDN -> SetCaretPos Function but I don't know how to implement it.My try was : DllCall('user32.dll', 'int', 'SetCaretPos', 'int', 8, 'int', 15) but it isn't working.Further how can the GetCaretPos Function be implemented?UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
UEZ Posted May 3, 2009 Share Posted May 3, 2009 Kip also posted a Caret UDF that even alows you to use custom images:http://www.autoitscript.com/forum/index.ph...st&p=574055Thanks, that is the answer of my question!I really need to start to learn C++UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
charvi Posted May 4, 2009 Author Share Posted May 4, 2009 Valuater, I appreciate the easy programming example for multi-inputs. I played with your example today and could not make it working. I do not see why nor see any error. Below is my attempt. I was trying to stimulate a DOS environment, creating an invisible button so the Enter key accepts the input. But why does the input not show a block caret??? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <WinAPI.au3> #include <ButtonConstants.au3> #include <Constants.au3> Global $hBitmap, $h_WinMain, $hiddenbutton, $input ;~ $frmGlobalDefaults = GUICreate("Edit Focus", 400, 300) ;~ $btnBrowse = GUICtrlCreateButton("&Browse", 240, 24, 60, 248, 0) ;~ $inptbxRegFileName = GUICtrlCreateInput("inptbxRegFileName " & $btnBrowse + 1, 20, 24, 200, 21) ;~ $inptbxDirBase = GUICtrlCreateInput("inptbxDirBase " & $btnBrowse + 2, 20, 80, 200, 21) ;~ $inptbxDirAlbum = GUICtrlCreateInput("inptbxDirAlbum " & $btnBrowse + 3, 20, 136, 200, 21) ;~ $inptbxDirSettings = GUICtrlCreateInput("inptbxDirSettings " & $btnBrowse + 4, 20, 192, 200, 21) ;~ $inptbxDirHP = GUICtrlCreateInput("inptbxDirHP " & $btnBrowse + 5, 20, 248, 200, 21) $h_WinMain = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) GUISetBkColor(0x000000, $h_WinMain) GUISetFont(14, 800, 0, "Courier New") GUICtrlCreateLabel("AUTOIT-DOS 2009", 0, 0, 500, 20) GUICtrlSetColor(-1, 0x00ff00) GUICtrlCreateLabel(">", 0, 30, 20, 20) GUICtrlSetColor(-1, 0x00ff00) $hiddenbutton = GUICtrlCreateButton("OK", 260, 90, 100, 30, $BS_DEFPUSHBUTTON) GUICtrlSetState(-1, $GUI_HIDE) $input = GUICtrlCreateInput("", 10, 30, 500, 21, -1, 0) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetColor(-1, 0x00ff00) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND"); Set the Function While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3, $GUI_EVENT_CLOSE Exit Case $hiddenbutton GUICtrlSetState($hiddenbutton, $GUI_FOCUS) GUICtrlCreateLabel("BAD COMMAND OR FILE NAME", 0, 60, 500, 20) GUICtrlSetColor(-1, 0xff0000) Sleep(3000) Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) If $hBitmap = "" Then $hBitmap = _WinAPI_CreateSolidBitmap(0, 0x66FFFF, 10, 14) Local $nNotifyCode = BitShift($wParam, 16) Switch $nNotifyCode; Edit control event messages only Case $EN_SETFOCUS; Edit (Input) control has focus DllCall('user32.dll', 'int', 'CreateCaret', 'hwnd', $lParam, 'ptr', $hBitmap, 'int', 0, 'int', 0) DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', $lParam) Case $EN_KILLFOCUS; Edit (Input) control lost focus DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', $lParam) DllCall('user32.dll', 'int', 'DestroyCaret') EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Using GUIRegisterMsg for Multiple inputs expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <WinAPI.au3> Global $hBitmap $frmGlobalDefaults = GUICreate("Edit Focus", 400, 300) $btnBrowse = GUICtrlCreateButton("&Browse", 240, 24, 60, 248, 0) $inptbxRegFileName = GUICtrlCreateInput("inptbxRegFileName " & $btnBrowse + 1, 20, 24, 200, 21) $inptbxDirBase = GUICtrlCreateInput("inptbxDirBase " & $btnBrowse + 2, 20, 80, 200, 21) $inptbxDirAlbum = GUICtrlCreateInput("inptbxDirAlbum " & $btnBrowse + 3, 20, 136, 200, 21) $inptbxDirSettings = GUICtrlCreateInput("inptbxDirSettings " & $btnBrowse + 4, 20, 192, 200, 21) $inptbxDirHP = GUICtrlCreateInput("inptbxDirHP " & $btnBrowse + 5, 20, 248, 200, 21) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ; Set the Function While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) If $hBitmap = "" Then $hBitmap = _WinAPI_CreateSolidBitmap(0, 0x66FFFF, 10, 14) Local $nNotifyCode = BitShift($wParam, 16) Switch $nNotifyCode; Edit control event messages only Case $EN_SETFOCUS; Edit (Input) control has focus DllCall('user32.dll', 'int', 'CreateCaret', 'hwnd', $lParam, 'ptr', $hBitmap, 'int', 0, 'int', 0) DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', $lParam) Case $EN_KILLFOCUS; Edit (Input) control lost focus DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', $lParam) DllCall('user32.dll', 'int', 'DestroyCaret') EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND I like the Blinking... 8) 8) Link to comment Share on other sites More sharing options...
Yashied Posted May 4, 2009 Share Posted May 4, 2009 (edited) See closely.... $input = GUICtrlCreateInput("", 10, 30, 500, 21, -1, 0) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetColor(-1, 0x00ff00) ;GUICtrlSetState(-1, $GUI_FOCUS) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND"); Set the Function GUISetState() ...EDIT: Use GUISetCursor(16) for better DOS emulation. Edited May 4, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... 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