Jump to content

ReFran

Active Members
  • Posts

    548
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ReFran

  1. In addition to Jos answer: To simple show/print PDFs embedded in your GUI, you need no Reader, no MuPdf, ... or other special com objects. You can simply use webview to show the pdf in any embedded browser environmental. br, Reinhard
  2. @BrewManNH Wonderful link. Saved it for later use under stackoverflow (google-maps-api or acrobat-sdk). Do you have some tips about the use? Reinhard
  3. "You cannot save a graphic context directly - only bitmaps / images." Hi, thought could be done more direct. Thanks for the working example. Maybe I work with "_GDIPlus_BitmapCreateFromFile" to load a background image and then draw on it. Also I don't need the transparent GUI really . So maybe I change that in order to get a white background. Have to play around with your example. Thanks for your help and have a nice (rest-) evening. Gute Nacht, Reinhard
  4. Hi, this is my first try with GdiPlus. I write a polyline on a transparent GUI (that works) and want to save it as bmp. But I don't get it saved. Only blank bmp. A little bit help would be fine, Reinhard #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <windowsconstants.au3> ;track data Bernepark (distance, elevation in meter) (x,y) $s = '' $s &= '0.0001,72;276,70;375,70;473,71;663,73;827,75;956,74;1556,74;1736,75;' $s &= '1954,76;2146,77;2449,77;2556,77;3000,75;3737,66;4124,56;4454,51;4686,47;4877,46;' $s &= '5243,39;5390,36;5478,34;5996,31;6886,35;7776,31;8565,34;8687,33;9298,35;9336,34;' $s &= '10379,34;10789,34;11095,33;11375,33;11491,35;11545,35;12129,37;12489,35;13034,35;13242,35;' $s &= '13421,36;13503,36;13606,34;13647,34;13718,35;14467,39;14625,46;15011,49;15154,58;15244,56;' $s &= '15358,56;15622,59;15704,63;15796,66;15838,69;15876,67;15921,68;15953,69;15986,71;16058,73;' $s &= '16083,73;16104,72;16124,72;16149,72;16171,72;16193,71;16375,70;16418,69;16439,70;16455,70;' $s &= '16499,72;16596,69;16717,65;16756,64;16805,64;16846,65;16886,68;16977,70;17046,70;17198,74;' $s &= '17245,74;17267,73;17295,72;17376,68;17427,66;17490,66;17566,68;17592,69;17763,70;17785,70;' $s &= '17846,70;18042,72;18076,73;18236,76;18306,76;18385,76;18544,76;18571,75;18709,75;18790,75' $s = stringstripWS($s,8) $ga = stringsplit($s,";") Dim $maxEle = 80 ;ytop Dim $minEle = 25 ;y0 Dim $maxMtr = 18790 Dim $minMtr = 0 Dim $gui_x = 205 Dim $gui_y = 60 Example() Func Example() Local $hGUI, $trkGraphic, $hPen ; Create transparent GUI $hGUI = GUICreate("GDI+", $gui_x, $gui_y, 41, 325, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST) GUISetBkColor(0x01, $hgui) _WinAPI_SetLayeredWindowAttributes($hgui, 0x01, 255) ;works with$WS_EX_LAYERED GUISetState(@SW_SHOW) ; Draw line _GDIPlus_Startup() $trkGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPen = _GDIPlus_PenCreate(0x55000099,1) ;pen for frame $hPen2 = _GDIPlus_PenCreate(0xFFFF8060,3) ;pen for polyline ;draw a line in the middle ;;_GDIPlus_GraphicsDrawLine ( $trkGraphics, $nX1, $nY1, $nX2, $nY2 [, $hPen = 0] ) _GDIPlus_GraphicsDrawLine($trkGraphic, 0, $gui_y/2, $gui_x, $gui_y/2, $hPen) ;draw a frame _GDIPlus_GraphicsDrawLine($trkGraphic, 0, 0, $gui_x, 0, $hPen) _GDIPlus_GraphicsDrawLine($trkGraphic, 0, $gui_y-1, $gui_x, $gui_y-1, $hPen) _GDIPlus_GraphicsDrawLine($trkGraphic, $gui_x-1, $gui_y-1, $gui_x-1, 0, $hPen) _GDIPlus_GraphicsDrawLine($trkGraphic, 0, $gui_x-1, 1, 0, $hPen) ;draw the polyline for the track for $i = 1 to $ga[0]-2 $af = stringsplit($ga[$i], ",") $at = stringsplit($ga[$i+1], ",") $yf = (1 - (($af[2]-$minele) / ($maxele - $minele))) * $gui_y $xf = $af[1] / $maxMtr * ($gui_x) $yt = (1 - (($at[2]-$minele) / ($maxele-$minele))) * $gui_y $xt = $at[1] / $maxMtr * ($gui_x) ;msgbox(0,"", $xf &", " &$yf &", " &$yt &", "&$xt) _GDIPlus_GraphicsDrawLine($trkGraphic, $xf, $yf, $xt, $yt, $hPen2) next $trkImage = _GDIPlus_BitmapCreateFromGraphics ( $gui_x, $gui_y, $trkGraphic ) _GDIPlus_ImageSaveToFile($trkImage,@ScriptDir&"\test.bmp") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($trkGraphic) _GDIPlus_BitmapDispose($trkImage) _GDIPlus_Shutdown() EndFunc ;==>Example
  5. Cool effect, nice example. Thanks for sharing, Reinhard
  6. Hi, you could check the file association and get the executable. If the executable is Adobe Reader you can start it direct with the command line option /n. That means Reader will start the file in a new instance. If you find another PDF viewer you can start it also direct. If you find nothing you can give a hint or a link to a PDF viewer. br, Reinhard PS.: In cmd you can use "assoc .pdf" and then use the result in "ftype ....." to get the program, but I think I saw also examples here.
  7. Mmmh, here the simple way: in your html code set up a textfield like: <textarea id="eventMsg" style="width: 200px;height:20px;font:8pt" title="Important events"></textarea> In your html js.code put "eventMsg = document.getElementById('eventMsg');" into your startup-code. Replace your "alert" with something like: "eventMsg.value = 'myMsgToAutoIt'". Now we want to catch this event/msg in AutoIt for the embedded object Internet explorer ($oIE). So after $oIE.Navigate(....) and waitOnLoad (readyState = OK) call the following function. func addHtmlListener() DIM $mapEvent = $oIe.document.all.eventMsg objEvent($mapEvent,"mapEvent_") endfunc After the basics are done, we have to set up the mapEvent_ function in AutoIt to catch every change of the property of the html-textfield: func mapEvent_onPropertyChange() ;(text in html-eventMsg field has changed) ;; get the msg string $mapEvent_strg = $mapEvent.value ..... do something with the msg you got ..... EndFunc That's the simple solution and should work (like it works for my html page with Gmap API events). SmOke_N's example show you much more possibilities. Good luck, Reinhard @SmOke_N Thanks for the example.Saved it.
  8. no comments?? Where is the example? Only someone who need a polyglon, would take the time to set up an example (with an DB?) to see how it works. So if you have an example you may spend it also and everybody who interestest can have a short look how it works - if it*s works at all - and if he like it. best regards, Reinhard
  9. Hi, I'm not an expert for html, but belongs a style sheet not normaly to the header? In your code it hangs between header and body. You may have a look at the attached standard example. best regards, Reinhard <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>Link-Element for Stylesheets</title> <link rel="stylesheet" type="text/css" href="formate.css"> <style type="text/css"> /* ... your file specific formats ... */ </style> </head> <body> <h1>Link-Element for Stylesheets</h1> </body> </html>
  10. Hi, you can use a FDF file. That is a structured textfile, which you can write an execute using autoit. Have a look at this: bet regards, Reinhard
  11. Hi, in js/html you can choose an option via selectedIndex. So in autoit you can use something like: $index = 0 ;=first element $oIe.document.all.tegevus.selectedIndex = $index HTH, Reinhard
  12. Hi, you forgot to state the includes: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HTH, Reinhard
  13. Hi, I like Win7. Our Company will update from XP to Win7 in Sept./Oct. Because our IT want avoid problems all Notebook users will get a new one. That's exact the right time, because my Notebook is already just over 1 year old :-)) br, Reinhard PS: On my Desktop I have already Win7 (Testuser). Works fine, so far. I installed also Lotus 123 (WK4 - smartsuite '95). No problem. The only problem I see - as normal user - is to get new drivers for older Hardware.
  14. Hi, have a look in the helpfile on objEvent(). In html you may set up a (hidden) edit field with an onchange event. The onchange event you can catch, the value from the edit may tell you what happened if you have filled with html/js. There are some examples you will find here. Best regards, Reinhard Here a quick example: func mapAddListener() DIM $oMapEdit = $oIE.document.all.edit objEvent($oMapEdit,"oMapEditEvent_") endfunc func oMapEditEvent_onpropertychange() ... ... endfunc
  15. With autoIt (or other) you can communicate with HTML/JS using different methods: you can execute JS code e.g. $oIE.document.parentwindow.execScript("selBoxChangeColor()") you can get/set values e.g.: $sMapGet = $oIE.document.all.memo.value you can catch specific events, .. Is that what you wanted to know. You may have a look at the IE Management UDFs Best regards, Reinhard
  16. Hi Michael, I thought already that you get problems with that (not on the first - but on the following pages). I would prefer to control the IE with title bar from autoIt (check min/max/exit). However if you want to go on with this you may try the semi-embedded style from this discussion: For the AutoIt GUI you may use "$WS-Caption" or play a little bit around with GUI-Styles. Best regards, Reinhard
  17. Hi, I used the IE Object direct only for quick testing. It's better to use the UDF, so you save time for error checks (like is object create) or completeness (like after navigate you have to set a ReadyState loop not a sleep). Hower it's mostly not a problem to mix it up. Attached above script with _IENavigate. Good luck with your script, Reinhard #include <IE.au3> $oIe = ObjCreate("InternetExplorer.Application") ;$oIe.navigate("[url="http://domino.s-web.de/ib-demo/login/login.htm?BLZ=&1"]http://domino.s-web.de/ib-demo/login/login.htm?BLZ=&1[/url]=") ;sleep(2000) _IENavigate ( $oIe, "[url="http://domino.s-web.de/ib-demo/login/login.htm?BLZ=&1"]http://domino.s-web.de/ib-demo/login/login.htm?BLZ=&1[/url]=") with $oIE .fullscreen = true ; kiosk mode .statusBar = false .document.ParentWindow.document.body.style.borderStyle = "outset" .document.ParentWindow.document.body.style.borderWidth= "10px" .visible = True endwith WinMove ("Ihr pers", "", 50, 50 , 900, 800)
  18. Hi, with _IEAttach() you can set a new object (like $oIE_sub) to the new IE-Window/Instance and control it. I think you don't can deactivate minimize if you show the title bar. The simple way would be to check latest with gui event exit ($GUI_EVENT_CLOSE) if the IE_Window is closed and if not kill it. Another way would be to use IE kiosk mode in connection with WinMove, then you get a IE-Window without any bar and you can close/move/.. it only by script or with alt+f4. But I wouldn't use that. HTH, Reinhard Quick example for IE Kiosk mode (same as iexplore -k) $oIe = ObjCreate("InternetExplorer.Application") $oIe.navigate("http://domino.s-web.de/ib-demo/login/login.htm?BLZ=&1=") sleep(2000) with $oIE .fullscreen = true ; kiosk mode .statusBar = false .document.ParentWindow.document.body.style.borderStyle = "outset" .document.ParentWindow.document.body.style.borderWidth= "10px" .visible = True endwith WinMove ("Ihr pers", "", 50, 50 , 900, 800)
  19. "Why doesn't that work that way in the embedded window of my gui?" Without access to the URL, I can only asume that IE creates a new instance for the print-out. You can try to catch it using IE_attach. But for homebanking I would use IE external - not embedded. So you can more easy access and control and also save much time on scripting. In the german forum you will find some scripts for different banks. Attached a script which works with a testpage of "(Stadt)Sparkasse". Use DebugBar to see what you want/can use. If your bank supports HBCI, you may try the freeware online banking tool "hibiscus" or - if you want to have better control - a tool with command line support like "FinTS". HTH, Reinhard ;; homebanking testpage ;;;;;;;;;;;;;;;;;; <snip>
  20. At lest for DeleteItem you have to use the handle (not the control ID). $hWndListView2 = GUICtrlGetHandle($testselection) _GUICtrlListView_DeleteItem($hWndListView2 , $inde) HTH, Reinhard
  21. Mmmh, I would start with table UDF from AndyBiochem: Here a discussion, where I tested some functions: HTH, Reinhard
  22. " proxy BUT.. with out closing I.E down ..." Mmmh, that may be only possible if you use "Internetoptions" direct. You can try: rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4 in combination with controlsend (and move it out of the visible screen). I did something like that with regional settings, to change from point to comma and back. But that was only for me, as IT-Guy I would avoid solutions like that. HTH, Reinhard
  23. Hi, you can complicate it in any order, depending on how often you use it and ... The basic way would be to assign the directory to a variable: $FileDir = "C:UsersrobertDocumentsRainmeterSkinsGIFDownloadFileEarthTemperatureDownloadFileEarthTemperature" or one for $fileDirbase and $fileDirTarget. That already save some typewriting, but your finally solution depends on your task. best regards, Reinhard Edit: If you really ment the "current path" (where the script is in) you can leave out the path
  24. Mmmh, I work with the WSH documentation: http://www.microsoft.com/download/en/details.aspx?id=2764 In that helpfile you have: Windows Scripting Host (WSH) documentation (inkl. File System Object) VBS documentation and Java Script documentation. What I like is that there are (at least) some examples, which shows how it works in VBS and how it's written in JS. best regard, Reinhard
  25. Hi, search for "Haversine". That gives you the distance between 2 latLon (geo-) points. HTH, Reinhard
×
×
  • Create New...