
Clouds
Members-
Posts
18 -
Joined
-
Last visited
Clouds's Achievements

Seeker (1/7)
0
Reputation
-
IEcreate a maximized yet invisible window (solved)
Clouds replied to Clouds's topic in AutoIt General Help and Support
Well sometimes simply explaining an issue gives new ideas and solutions, right? I change my code to create just a single browser window, maximize and hide it, and then use that window all the time. At first I was afraid (I was petrified) that my script would not be able to detect whether the page had already fully loaded, as most of the contents of the page are injected into the elements after IE and Autoit think the page has fully loaded. That's why I closed the browser window and created a new one every time. But it turns out using a single browser object works good anyway. Thanks for your attention!- 1 reply
-
- iecreate
- invisible window
-
(and 2 more)
Tagged with:
-
Hi, I'm writing a script that interacts with a webpage. The contents of the webpage depend on the size of the browser window. To get the (for me) correct contents from the page, the browser window must be maximized. However, I also don't need or want to see the browser window when the script creates it, so it should be invisible. At first I created the browser window with simply this: $oIE = _IECreate ($url ,0 ,0 ,1 ,0) However, from the results I can see that the invisible browser window isn't maximized. So I changed the code to maximize the window, but then it becomes visible. Now I have this: $oIE = _IECreate ($url ,0 ,0 ,1 ,0) $hIE = _IEPropertyGet($oIE, "hwnd") WinSetState($hIE, "", @SW_MAXIMIZE) WinSetState($hIE, "", @SW_HIDE) ...but then I do see the browser window shortly when it is maximized. I could live with that if it were just a single browser window. But the script is opening (and closing) quite a few browser windows, and I don't wait to see them flicker, nor do I want to (be able to accidentally) interact with these windows. Any ideas on how to create and invisible yet maximized IE windows?
- 1 reply
-
- iecreate
- invisible window
-
(and 2 more)
Tagged with:
-
So, after some tinkering I have it working like I want to. Thanks GEOSoft for helping me out >_< If someone else needs hinting in a search field: #include <GuiRichEdit.au3> #include <GUIConstants.au3> #include <Array.au3> Global $hRichEdit Global $employeelist[20] = ["Corina Reagan","Melissa Corina","Debra Corina","Diana Brianne","Elise Tamela","Reagan Jonquil","Deidra April","Kayleah Christmas","Zoe Amber","Zoe Bess","Lexy Tanya","Tamela Melissa","Selina Kailey","Mabel Louisa","Opal Sophie"] Global $hint, $hint1, $hint2 _ArraySort($employeelist) Main() ; Search in an array for a matching pattern and display this as a hint Func WriteHint($searchval) ; The contents of the edit are partly hinted, but we want to search only based on what the user actually typed ; So based on hints from the previous call to this function we delete the hinted part if stringlen($hint1) <> 0 then $searchval = StringMid($searchval, StringLen($hint1)+1) if stringlen($hint2) <> 0 then $searchval = StringLeft($searchval,StringLen($searchval) - StringLen($hint2)) ; Search the array for something that matches what was typed $result = _ArrayFindAll($employeelist, $searchval, 0 , 0, 0, 1) $hint = "" if IsArray($result) then $hint = $employeelist[$result[0]] ; Create the first part of the hint (to be displayed in front of what user typed) $hint1 = StringLeft($hint, StringInStr($hint, $searchval)-1) ; Create second part of the hint (to be displayed behind what user typed) $hint2 = StringRight($hint, Stringlen($hint)-Stringlen($hint1 & $searchval)) ; Create an RTF-string composed of hints and user input $txt = "{\rtf1\ansi{\colortbl;\red128\green128\blue128;}\cf1\f0\fs20 "& $hint1 &"\cf0\b "& $searchval &"\cf1\b0 "& $hint2 &"}" _GuiCtrlRichEdit_SetText($hRichEdit,$txt) ; Set cursor to correct location (where user was typing) _GuiCtrlRichEdit_GotoCharPos($hRichEdit,Stringlen($hint1&$searchval)) EndFunc ;==>WriteHint Func Main() Local $hGui, $iMsg $hGui = GUICreate("Rich Edit Example", 500, 550, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 480, 25, _ BitOR($WS_VSCROLL, $ES_AUTOVSCROLL, $ES_NOHIDESEL)) GUISetState() $old = "" While True ; If contents of the edit changed we want to see if we can show a hint... $new = StringUpper(_GuiCtrlRichEdit_GetTextInLine($hRichEdit,1)) if $old <> $new then WriteHint($new) ; $old = $new $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd EndFunc ;==>Main Best regards, Clouds
-
LOL@self... With my previous posting it occurred to me that I did search the forums before, but not for 'multiple colors in edit' and the like. Searching again led me to posts with 'use rich edit controls' etc... Why didn't I think of that before? :-p Anyway, looking into rich edit controls now... Regards, Clouds
-
Hi GEOSoft, Thanks for your reply. I guess matching what is typed to the list of possible value wasn't the hard part... But how to make the input field display the hinted part in a different color? Is that even possible? Regards, Clouds
-
Hi there, For a program I'm writing I'd like to use an input with something that functions like Google hints, but a lot more complicated... Requirements: - While typing in the input field, the first result is picked from a list of possible values (using pattern matching, e.g. typing 'Do' matches 'John Doe'). - No mouse can be used, so the hint has to be displayed in the same input field as where the user is typing. - The part that is hinted is displayed in grey, the typed part in black (e.g. when 'Do' is typed: 'John Doe') My questions: - Does this seem possible to make at all? - If so, any hints on how to do this? - Can you see alternative/better ways to standardize typed input or match it to a list of values without using a mouse? Thanks in advance for your response! Best regards, Clouds PS: Here the background for what I'm asking: I'm writing something to register attendance at my work. This is to be able to see if everyone is safe in case of emergency. The program is goin to run on a machine with keyboard and RFID-scanner (with keyboard emulation to keep it simple ;-) but no mouse. Employees have an RFID-tag to check in or out and don't use the keyboard at all. Guests will also check in or out with tags, but the program will ask the guest to enter his name, company name and whom they are visiting. For this last part (whom are they visiting) I'd like to be able to use hinting. So when something is typed in the input field it is compared to all employee names, and the best matching one is displayed. The guest can then complete/accept with ENTER or just continue typing.
-
$oIE.navigate disables other IE window?
Clouds replied to Clouds's topic in AutoIt General Help and Support
Indeed, after hiding/showing the GUI both browserwindows are visible with their contents. Strange.... Well, I'll just use what you provided then. Thanks again! Best regards, Clouds® -
$oIE.navigate disables other IE window?
Clouds replied to Clouds's topic in AutoIt General Help and Support
Hi Nahuel, Works great, thanks a lot! I'll use your example to build my app. Still wondering though why my code won't behave the way I'd expect? Regards, Clouds® -
Hey guys, I'm building something that needs (preferably) 2 rich edits. For these rich edits I'm using embedded webbrowser objects. However, when I use $oIE.navigate on one object, the other one blanks out, and vice versa. See example CODE; Create main window $Form1 = GUICreate("Form1",500,500) GUISetState(@SW_SHOW) ; Create embedded browser no.1 $oIE1 = ObjCreate("Shell.Explorer.2") $win1 = GUICtrlCreateObj($oIE1, 1, 1, 248, 498) GUICtrlSetResizing($win1, 0x0001) ; Create embedded browser no.2 $oIE2 = ObjCreate("Shell.Explorer.2") $win2 = GUICtrlCreateObj($oIE2, 251, 1, 248, 498) GUICtrlSetResizing($win2, 0x0001) ; Show unwanted behavior $oIE1.navigate("about:Window 1") sleep(2000) $oIE2.navigate("about:Window 2<br>argl window 1 blanked out???") sleep(2000) $oIE1.navigate("about:Window 1<br>argl now window 2 blanked out???") sleep(2000) Does anyone have a clue why this happens? Is there something I can do to prevent this from happening? BTW I'm running this on XP.... Best regards, Clouds®
-
Extracting hyperlinks from a website
Clouds replied to knight666's topic in AutoIt General Help and Support
Isn't this easier (in FF): -Press ctrl+U (show page source) -Do some hyperlink searching voodoo -Press ctrl+F4 Guess that is only works when the page has no frames though... -- Clouds® -
WM_KEYUP not working in MouseHook script...?
Clouds replied to Clouds's topic in AutoIt General Help and Support
@Toady: Ok, thanks, I just didn't get what you meant (not a wonder Friday past 5pm ). Have tried your solution but it's not fast enough to detect all keystrokes, not even when reducing the sleep time in the main loop. Thanks anyway for the suggestion! @Larry: Thanks a lot! Works perfectly now.... -- Clouds® -
WM_KEYUP not working in MouseHook script...?
Clouds replied to Clouds's topic in AutoIt General Help and Support
Toady, Thanks for the reaction, but I'm not sure how this helps? My script already works, I know which keys were pressed. Only thing is that WM_KEYUP in the MouseHook script doesn't do what I expect it do to.... -- Clouds® -
Hey all, I've just created a script that monitors keystrokes, and when a certain sequence comes by, it starts a program. (No, I'm not trying to get help building a key-logger ) The specific sequence is entered using a barcode scanner, and with this script there is no need to start an application before a barcode is scanned. Just scan a barcode, and the application will start if not yet active. The script works OK already, but one thing is still bugging me. 99% of the script is from Larry's MouseHook example script (thanks Larry!), but it doesn't seem to act on key up events properly. In fact, if I take the example script, delete this line GUIRegisterMsg($WM_KEYUP,"myKeyfunc")every keypress still shows 2 messages in the tooltip...I would expect only 1 message (for keydown only). It looks like the KEYDOWN message is firing on both keydown and keyup events? Or am I just wrong? For now, I just made a counter that ignores every 2nd key event to get it working, but I prefer the better way where KEYDOWN isn't reacting to a key being released... Anyone have a clue what can be done to solve this? -- Clouds®
-
Error when using ScreenCap functions...
Clouds replied to Clouds's topic in AutoIt General Help and Support
Thanks! That was just it....works fine now... -- Clouds® -
Aloha all! I'm a little confused here....what I'm trying to do is capture part of the screen and save it to a file (later there's some more to come, but first things first ;-)) This is the code I have (and this is all of it): #include <A3LScreenCap.au3> $sFileName = "C:\ShootMe.bmp" _ScreenCap_Capture($sFileName,1,1,50,50,false)oÝ÷ Ùh^»§)à~º&IȶØb±ê뢷(è]4ÓK)j{-ÊWoÝ÷ ÙjÂ'yçm¢Æ¯zØ^~)^"ÚâyÛaÆ®¶sb6æ6ÇVFRfÇC´4Å67&VVä6æS2fwC°¢b33c·4fÆTæÖRÒgV÷C´3¢b3#µ6ö÷DÖRæ&×gV÷C°¢b33c¶&׿FÆRÒõ67&VVä6ô6GW&RgV÷C²gV÷C²ÃÃÃSÃSÆfÇ6R¥õ67&VVä6õ6fT&FÖb33c·4fÆTæÖRÂb33c¶&׿FÆRoÝ÷ ض§¶«{l¶®º+j¢Ê%¢ºM4ÒÊZËrthen there's this error: C:\Program Files\AutoIt3\Include\A3LWinAPI.au3 (1154) : ==> Variable must be of type "Object".: $tCursor.Size = $iCursor $tCursor^ ERROR I'm using AutoIt 3.2.2.0 and Au3Lib....anyone has a clue as what is wrong here? -- Clouds®