
eEniquEe
Active Members-
Posts
68 -
Joined
-
Last visited
eEniquEe's Achievements

Wayfarer (2/7)
0
Reputation
-
[SOLVED] Rounded corner and Border Label
eEniquEe replied to eEniquEe's topic in AutoIt GUI Help and Support
Thanks everyone very much for your kind support. Thanks rover, I really like the final output of your code. I'll try to apply that to my project, though it looks a little bit complicated. But I think I can figure it out, every line is commented carefully. And I also want to thank funkey, I also love your approach. It's a creative, easy and nice way to tackle the problem. I think I do learn something new today. Thank you guys very much for your kind help. -
[SOLVED] Rounded corner and Border Label
eEniquEe replied to eEniquEe's topic in AutoIt GUI Help and Support
Yes, I did try it, but it didn't work. When I use _Gui_RoundCorners() func on bordered labels, the 4 bordered corners disappear (making it looks a little bit ugly), then I tried setting Bkcolor for the labels, and it reveals that the corner hasn't been rounded at all. -
Hi, I'm searching for a way to round the 4 corner surrounding a label. After doing some searching, I came across a way to round corners of a GUI using GDI32.dll. I use it for my GUI, and it works like a charm. So I try using it for my label, but, unfortunately it doesn't work out. I thought GDI32.dll also has some function to do this, so I tried searching for a list of function in GDI32.dll on MSDN, and it gives me like thousands of articles with some being so general, and some other talking about some other stuff, and only mention GDI32.dll one time in the whole article. I think I should practice searching on MSDN much much more. Then I try using Google, but again, I didn't succeed. Can anyone please help me out with this? Here's my testing code. Thanks guys very much in advance, And have a good day, #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\vietdtq\desktop\projects\treasure hunter\form1.kxf $Form1 = GUICreate("Testing", 790, 405, -1, -1, BitOR($WS_MINIMIZEBOX,$WS_POPUP,$WS_GROUP)) _Gui_RoundCorners(WinGetHandle("Testing"), 0, 0, 30, 30) $Label = GUICtrlCreateLabel("A", 100, 100, 44, 49, BitOR($SS_CENTER,$SS_CENTERIMAGE,$WS_BORDER)) ;_Gui_RoundCorners(GUICtrlGetHandle($Label), 0, 0, 10, 10) GUICtrlSetFont(-1, 16, 800, 0, "Georgia") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case 0 Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Gui_RoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Local $XS_pos, $XS_ret, $XS_ret2 $XS_pos = WinGetPos($h_win) $XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3) If $XS_ret[0] Then $XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1) EndIf EndFunc
-
InetRead, and InetGet caching problem
eEniquEe replied to eEniquEe's topic in AutoIt General Help and Support
Well, yes. I think, if the extension is not .txt, then everything is just fine. I tried to change the extension to .emt (some random extension that I came up with). And it did work. ^^! Thank you a lot, Spammer. Btw, does anyone know why caching problems happen with .txt files, but not with other extensions? It seems strange to me. -
InetRead, and InetGet caching problem
eEniquEe replied to eEniquEe's topic in AutoIt General Help and Support
I've just tried setting the download in the background, but it still doen't work. It seems to me that, if I use Firefox to get the file, then I'll get the latest one at once. But if I use InetGet, I'll be able to get the file, but only after the file has been updated like 15 mins or more. I can also use _FTP_FileGet to get the newest one, but this is not convenient because before using _FTP_FileGet, I have to use _FTP_Connect, but this requires the Password for the site; hence, if the user decodes my .exe file, then my password will be shown. Do anyone knowns a way to work around this problem? This is driving me real mad... =(( Thanks everyone a lot. -
Hi, I don't know why, but lately I've come across some caching problems when using InetGet, and InetRead to download a text file from the Internet. Although, I did set the option flag to 1, i.e: 1 = Forces a reload from the remote site, but still, the programme still used the cache file, hence it cannot get the latest file. I could get the latest file using Firefox though. To tell the truth, I haven't had this problem before. Hence I thought it was some of the new bug in the Beta test version, so I tried downloading and installing the stable version again. Then run the code again, but no luck. So I thought it should be something wrong with my laptop's settings. But to tell the truth, I haven't changed any configurations/settings for a long long time. Has anyone ever had the same problem? What should I do now? When searching the forums, I came across this thread. The problem can be solved by using _FTP command, but this command works really slowly. Is there any way to circumvent this problem? Thanks everyone a lot, And have a good day,
-
How to change $ES_PASSWORD style of an Input?
eEniquEe replied to eEniquEe's topic in AutoIt General Help and Support
Sorry for my late respond. Thank you very much smartee. Your way is very elegant, and neat. Thanks, -
How to change $ES_PASSWORD style of an Input?
eEniquEe replied to eEniquEe's topic in AutoIt General Help and Support
OMG... I feel ssssssoooooo guilty for not noticing that Search Box. :D :D I'm sorry... Thank you very very much, that solves it. I'll search carefully before creating new thread from now on, I promise. -
Hello everyone, I wonder if there's a way to change the $ES_PASSWORD style of an Input without having to delete, and re-create it? I did try to use the GUICtrlSetStyle() function, but it doesn't seem to work. For the convinience, I'll put what I have here. So basically, what I want is that the $ES_PASSWORD style of $Input2 will change in according with the user checking the checkbox. I can do it by deleting and re-creating the $Input2. But this seems not very covenient. Is there some other way to work around? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Program Files\AutoIt3\SciTE\Koda\Forms\Travian Log-In.kxf Global $Blank[5] $Form1 = GUICreate("Log-in Form", 633, 130, -1, -1) $Label1 = GUICtrlCreateLabel("Please enter your log-in information below. If you forget your password, please click on the Forget Password button.", 8, 8, 545, 17) $Label2 = GUICtrlCreateLabel("Username:", 152, 40, 55, 17) $Label3 = GUICtrlCreateLabel("Pass:", 152, 64, 30, 17) $Input1 = GUICtrlCreateInput("Please enter your username here", 208, 37, 241, 21) GUICtrlSetFont(-1, 8, 400, 2, "MS Sans Serif") GUICtrlSetColor(-1, 0x808080) $Input2 = GUICtrlCreateInput("", 208, 61, 241, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("Log In", 136, 96, 113, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("Forget Password", 264, 96, 113, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("Exit", 392, 96, 113, 25, $WS_GROUP) $Checkbox1 = GUICtrlCreateCheckbox("Show Password", 472, 64, 97, 17) GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetState(@SW_SHOW) For $Temp = 0 To 4 $Blank[$Temp] = 0 Next #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button3 Exit Case $Checkbox1 CheckCheckBox() EndSwitch WEnd Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) $nNotifyCode = BitShift($wParam, 16) $nID = BitAND($wParam, 0xFFFF) $hCtrl = $lParam If $nID = $Input1 Then If $nNotifyCode = $EN_SETFOCUS Then If $Blank[0] = 0 Then GUICtrlSetData($Input1, "") GUICtrlSetFont($Input1, 8, 400, 0, "MS Sans Serif") GUICtrlSetColor($Input1, 0x000000) EndIf Else If $nNotifyCode = $EN_KILLFOCUS Then $a = GUICtrlRead($Input1) If $a <> "" And $a <> "Please enter your username here" Then $Blank[0] = 1 Else $Blank[0] = 0 GUICtrlSetData($Input1, "Please enter your username here") GUICtrlSetFont($Input1, 8, 400, 2, "MS Sans Serif") GUICtrlSetColor($Input1, 0x808080) EndIf EndIf EndIf EndIf Return $GUI_RUNDEFMSG EndFunc Func CheckCheckBox() If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then $a = GUICtrlRead($Input2) GUICtrlDelete($Input2) $Input2 = GUICtrlCreateInput($a, 208, 61, 241, 21) Else $a = GUICtrlRead($Input2) GUICtrlDelete($Input2) $Input2 = GUICtrlCreateInput($a, 208, 61, 241, 21, $ES_PASSWORD) EndIf EndFunc Thanks everyone in advance,
-
Ah yes, thanks for your reponse. I didn't look in the Help File thoroughly, that's my bad. I'm sorry. Thanks again, ---------------- So one problem left is, is it possible to catch the RETURN key when some InputBox is focused? Thanks, ---------------- P.S: OMG, my Internet connection today is sssssooooo sssssssllloooowwwwww. I'm very sorry. But I have one more question. I'm pretty new to these Message Handler, so please bear with me. I'm making some Mathematical Game, it's about fast calculation, i.e, to sharpen your calculation ability. Students in my country relies on calculators more and more heavily these recent years. And as a teacher, I think I should do something to make this situation better. So the Game basically will go like this: It'll create label with random expression, and the label will fly up as time goes by.The student' will have to click on the label, then supply the correct result for that expression.My question is that, when moving labels up, they'll blink; is there any way to tell the window to stop redrawing until I tell it to do so? On searching the Help File, I come up with this: $tagWINDOWPOS, it has one flas saying that '$SWP_NOREDRAW - Does not redraw changes' but I don't know how to apply it. Should I use DllStructCreate? Thanks you guys very much.
-
Hi Melba, Thanks for your explanation. I think I get it now. I'm sorry, I thought that it's my handler making some kind of extra loops, and so it delays the closing time. But well, now I got it. Btw, I still have some more questions regarding Message Handling Process. I hope you guys can help me out. First of all, I'd like to determine if some specific Inputbox is focus, and the user hit the RETURN key. I can do this with a combination of the above process (for checking which InputBox's currently being focused) and _IsPressed function. But is there anyway that I can achieve that using MessageHandler purely?Secondly, is there any way that I can catch a Message when the mouse is over some Label (like MouseOver event in Visual Basic)? For somehow I just cannot find this piece information in the Help File. Thanks very much for your help,
-
I'm very sorry, but I'm still unsatisfied with that answer. And btw, I'm asking about GUIRegisterMsg, not GUIGetMsg... What if my Main Loop needs some Sleep(), like pausing between Loops to do some image animation? And yes, I don't know how GUIRegisterMsg works either, so I'm asking about that. I'm still not sure what you mean by 'why questioning that'? I don't know something, and I want to learn it, so I'm asking questions. Am I violating something here? I'm asking one thing, and you're replying another thing, and tell me to accept that answer. How come? It seems to me that GUIRegisterMsg drives my program to continue looping for like 50-60 times before actually execute my Closing command. It's up to 60 times, don't you see that it's a little bit too much?
-
But putting a Sleep(100) there slows the terminating process by 5-6 seconds. I think there must be something wrong here, a 1/10 second sleep cannot add up that much amount.
-
Hi everyone, I've found which concerns about formatting numbers as the user's inputing it. And to tell the truth, I find it very very interesting. One way to solve that problem is to use GUIRegisterMsg(). I really want to play around with GUIRegisterMsg a bit, so I come up with this little piece of code: ; Credit to Valik for the DllCall lines #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Global $State Global $hGUI = GUICreate("Test", 500, 500) Global $hInput = GUICtrlCreateInput ("", 10, 20, 300, 20) Global $hInput2 = GUICtrlCreateInput ("", 10, 40, 300, 20) GuiSetState(@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") $State = 0 While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit ;Sleep(100) WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord Local $iCode = BitShift($wParam, 16) ;HiWord If $iIDFrom = $hInput Then If $iCode = $EN_KILLFOCUS Then If GUICtrlRead($iIDFrom) = "" Then GUICtrlSetFont($iIDFrom, 8.5, 400, 2) GUICtrlSetData($iIDFrom, "Please enter your input here...") $State = 0 Else $State = 1 EndIf Else If $iCode = $EN_SETFOCUS Then If $State = 0 Then GUICtrlSetFont($iIDFrom, 8.5, 400, 0) GUICtrlSetData($iIDFrom, "") EndIf EndIf EndIf EndIf EndFunc;==>_WM_COMMAND The basic idea is that, if the user leave the first inputbox blank, the text will be change to 'Please enter your input here...'; and if otherwise, nothing is done. What I want to ask is that, that piece of code runs smoothly if I commence out the Sleep(100) part. But if I don't, then when I try to close the window, it usually takes up to 5-6 seconds to do so. I wonder what has really happened? I did read the Help File and it points out that: "blocking of running user functions which executes window messages with commands such as "Msgbox()" can lead to unexpected behavior, the return to the system should be as fast as possible !!!" And I think this may be the reason, but there's no part in the code that may cause a block, except from that Sleep statement, but again, the Sleep statement is not placed inside the function. Maybe I'm missing something here. Thanks a lot in advance, And have a good day,