CodyBarrett Posted November 12, 2010 Share Posted November 12, 2010 i can't seem to get any function to work with $hwnd = _GUICtrlEdit_Create () GUIctrlsetBkColor (_WinApi_GetDLGCtrlID($hwnd),0xFF0000) ; Doesn't work. ;And _WinAPI_SetBkColor($hwnd,0xFF0000) ;Doesn't Work ;And _WinAPI_SetBkColor(_WinAPI_GetDC($hwnd),0xFF0000);Doesn't Work either...what could i use to color the background of the UDF's created EDIT? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 12, 2010 Share Posted November 12, 2010 There must be a better way, but this is what I got after reading up on WM_CTLCOLOREDIT: #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <GUIEdit.au3> $hGUI = GUICreate("Test", 400, 300) $hEdit = _GUICtrlEdit_Create($hGUI, "Test Edit control.", 20, 20, 360, 150) GUIRegisterMsg($WM_CTLCOLOREDIT, 'WM_CTLCOLOREDIT') GUISetState(@SW_SHOW) While 1 $gm = GUIGetMsg() Switch $gm Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func WM_CTLCOLOREDIT($hWnd, $iMsg, $iWParam, $iLParam) If $iLParam = $hEdit Then $hBrush = _WinAPI_CreateSolidBrush(0xFF0000) Return $hBrush Else Return $GUI_RUNDEFMSG EndIf EndFunc ;==>WM_CTLCOLOREDIT Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
CodyBarrett Posted November 12, 2010 Author Share Posted November 12, 2010 uhm. it colored the NON text area, but once text was entered it became white, sigh... [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 12, 2010 Share Posted November 12, 2010 Yeah, I saw that too. Maybe the standard API for an edit control is just not meant to support this. Now if you switch to a RichEdit control, then you can do this directly with an EM_SETBKGNDCOLOR message, which already in the UDF as _GUICtrlRichEdit_SetBkColor(). (No, that won't work on a regular Edit.) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
CodyBarrett Posted November 12, 2010 Author Share Posted November 12, 2010 why does GUICTRLCREATEEDIT () work with color and _GUICTRLEDIT_CREATE () doesn't ?? :\ just curious. [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 12, 2010 Share Posted November 12, 2010 Some of the native AutoIt controls have some funky "owner drawn" stuff going on in the background. If you poke around enough in the bug tracker you see some broken behaviors that can't be fixed until the Devs rewrite some deep stuff in the GUI code. (Which means it won't be changed for a while.) I know of some particular problems with setting colors on a button in combination with certain style options, for example.I should point out that I DON'T know that this particular problem is the same. Maybe somebody smarter than me will show us both how to easily do what you originally wanted. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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