DustinBowers Posted February 5, 2010 Share Posted February 5, 2010 Hi all. Thanks for taking time to view my topic. I have tried to write a script using GUICtrlSetImage to display a Pdf file, is this possible in auto it? or am i working with the wrong command? Thanks for any input you can offer. : ) Link to comment Share on other sites More sharing options...
DustinBowers Posted February 5, 2010 Author Share Posted February 5, 2010 Shameless bump :| ==> Im just trying to find out if there is something in autoit which would allow me to view/manipulate a pdf file within my own script without calling for the execution of an outside program. I've searched the help files for any reference and cannot seem to find it, I did try a setimage call but that didn't show anything what so ever. Thanks again for any advise you can offer. Link to comment Share on other sites More sharing options...
water Posted February 5, 2010 Share Posted February 5, 2010 I think you'll always need a external program to render the PDF file.If the PDF reader offers a COM interface you can use this to access the program. This link its a good place to start for Acrobat Reader or this link for Foxit. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
trancexx Posted February 5, 2010 Share Posted February 5, 2010 Main problem is your misunderstanding of what PDF file is. That makes it impossible to give you any sensible advice. ...maybe to learn about PDF. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
KaFu Posted February 5, 2010 Share Posted February 5, 2010 GUICtrlSetImage is definitly the wrong way. Search the forum for custom PDF solutions. Embed an IE instance to display the PDF is anoter way, though this requires an apropriate reader to be associated with the browser... tested it and found that the GUI is behaving a little strange, GUIGetMsg() does not work at all and if you use GUIOnEventMode e.g. the ESC key does not trigger $GUI_EVENT_CLOSE... Put a test.pdf in the source directory and try this (dirty and quickly thrown together ) example: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> Opt("GUIOnEventMode", 1) _IEErrorHandlerRegister() $oIE = _IECreateEmbedded() GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUISetOnEvent($GUI_EVENT_CLOSE, "GUIEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "GUIEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "GUIEvents") $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360) $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30) $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30) $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30) $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30) GUISetState() ;Show GUI _IENavigate($oIE, @ScriptDir & "\test.pdf") While Sleep(10) WEnd _exit() Func _exit() GUIDelete() Exit EndFunc ;==>_exit Func GUIEvents() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE MsgBox(0, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) _exit() Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE MsgBox(0, "Window Minimized", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) Case @GUI_CtrlId = $GUI_EVENT_RESTORE MsgBox(0, "Window Restored", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) EndSelect EndFunc ;==>GUIEvents 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...
DustinBowers Posted February 5, 2010 Author Share Posted February 5, 2010 KaFu - Thanks for the IE idea to display the pdf. Thats probably the best solution. I will work out the kinks with the gui not recognizing commands. Thanks for the quick help its very much appreciated : ) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2010 Moderators Share Posted February 5, 2010 DustinBowers, If you have Adobe Acrobat or Reader installed, you can use their COM objects to display the PDF within an AutoIt GUI. Here is an example I found on the forum and have modified to work with the current version of AutoIt: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; Install a custom error handler Global $oMyError = ObjEvent("AutoIt.Error","_ComErrFunc") _Show_PDF() Func _Show_PDF() ; Get file to display Local $sFile = FileOpenDialog("Choose PDF", "M:\Documents", "PDF Files(*.pdf)", 3) ; put your own start folder here If @error Then MsgBox(0, "Error", "No file selected") Return EndIf ; Declare objects Local $oPDF = ObjCreate("AcroPDF.PDF.1"); $oPDF.src = $sFile ; Create GUI GUICreate("AutoIt PDF Reader", 800, 570) Local $GUI_ActiveX = GUICtrlCreateObj($oPDF, 10, 10, 780, 550) GUICtrlSetStyle($GUI_ActiveX, $WS_VISIBLE) GUICtrlSetResizing($GUI_ActiveX, $GUI_DOCKAUTO) ; Auto Resize Object GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Clear up $oPDF = "" $GUIActiveX = "" Exit EndFunc M23 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...
DustinBowers Posted February 5, 2010 Author Share Posted February 5, 2010 Thanks M23, This option works very well also. I'm just writing a simple program which requires my being able to view pdfs and both the last two options work great. Thanks for all the quick help. : ) Link to comment Share on other sites More sharing options...
Zedna Posted February 5, 2010 Share Posted February 5, 2010 (edited) DustinBowers, If you have Adobe Acrobat or Reader installed, you can use their COM objects to display the PDF within an AutoIt GUI. Here is an example I found on the forum and have modified to work with the current version of AutoIt: GUICreate("AutoIt PDF Reader", 800, 570) Nice example. But I have problem when I add sizing to main GUI like this: GUICreate("AutoIt PDF Reader", 800, 570, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX)) GUI form is not shown :-( EDIT: Tried with 3.2.12.1 and latest beta 3.3.5.1 Edited February 5, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2010 Moderators Share Posted February 5, 2010 Zedna, Perhaps if you tried: GUICreate("AutoIt PDF Reader", 800, 570, -1, -1, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX)) You do need those position parameters! M23 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...
Zedna Posted February 5, 2010 Share Posted February 5, 2010 You do need those position parameters! M23Of course you are right :-)Unfortunatelly it doesn't work as expected when I use correct parametres as you wrote :-(When I resize/maximize GUI with such embeded COM PDF object this PDF has refresh problems and it doesn't resize correctly with main GUI. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2010 Moderators Share Posted February 5, 2010 (edited) Zedna,Yes, I just realised that the PDF does not resize and tried to use WM_SIZE to WinMove the Obj GUI - but that is not working either: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; Install a custom error handler Global $oMyError = ObjEvent("AutoIt.Error","_ComErrFunc") Global $iGUIWidth = 800, $iGUIHeight = 570, $fResized = False _Show_PDF() Func _Show_PDF() ; Get file to display Local $sFile = FileOpenDialog("Choose PDF", "M:\Documents", "PDF Files(*.pdf)", 3) ; put your own start folder here If @error Then MsgBox(0, "Error", "No file selected") Return EndIf ; Declare objects Local $oPDF = ObjCreate("AcroPDF.PDF.1"); $oPDF.src = $sFile ; Create GUI GUICreate("AutoIt PDF Reader", 800, 570, -1, -1, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX)) Local $GUI_ActiveX = GUICtrlCreateObj($oPDF, 10, 10, 780, 550) GUICtrlSetStyle($GUI_ActiveX, $WS_VISIBLE) GUICtrlSetResizing($GUI_ActiveX, $GUI_DOCKAUTO) ; Auto Resize Object GUISetState() ; When window is resized, run this function GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch If $fResized = True Then ConsoleWrite($iGUIWidth & " - " & $iGUIHeight & @CRLF) $fResized = False WinMove($GUI_ActiveX, "", Default, Default, $iGUIWidth - 20, $iGUIHeight - 20) EndIf WEnd ; Clear up $oPDF = "" $GUIActiveX = "" Exit EndFunc Func MY_WM_SIZE($hWnd, $Msg, $wParam, $lParam) $iGUIWidth = BitAND($lParam, 0xFFFF) $iGUIHeight = BitShift($lParam, 16) $fResized = True Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_SIZE Func _ComErrFunc() Local $HexNumber = Hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) EndFuncI also left out the COM error handler last time - that is 15-all! Any ideas from anyone else?M23Edit: No luck with GUICtrlSetPos either. Edited February 5, 2010 by Melba23 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...
Zedna Posted February 5, 2010 Share Posted February 5, 2010 @Melba I have seen some discussion about that already on forum or on Bug trac but I can't remember the details. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ReFran Posted February 5, 2010 Share Posted February 5, 2010 Hi, does this quick extract help? HTH, Reinhard #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Test Webbrowser", 400,300,400,300, _ BitOr($GUI_SS_DEFAULT_GUI, $WS_SYSMENU ,$WS_SIZEBOX, $WS_MAXIMIZEBOX)) $Obj = ObjCreate("Shell.Explorer.2") $browser = GUICtrlCreateObj($Obj, 0, 0, 400, 300) GUICtrlSetResizing ( -1, $GUI_DOCKRIGHT ) $Obj.Navigate('C:\Test.pdf') GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2010 Moderators Share Posted February 5, 2010 ReFran, Nice try! . I will raise you with this (stops the flickering on resizing ): #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Test Webbrowser", 400,300,400,300, _ BitOr($GUI_SS_DEFAULT_GUI, $WS_SYSMENU ,$WS_SIZEBOX, $WS_MAXIMIZEBOX), $WS_EX_COMPOSITED) $Obj = ObjCreate("Shell.Explorer.2") $browser = GUICtrlCreateObj($Obj, 0, 0, 400, 300) GUICtrlSetResizing ( -1, $GUI_DOCKRIGHT ) $Obj.Navigate("M:\Data\Manuals\Philips GC6103.pdf") GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit M23 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...
ReFran Posted February 5, 2010 Share Posted February 5, 2010 Y-e-a-h, with that thing (...pdf) you knocked me clearly over I think there is no better solution for this challenge. Have a nice evening, Reinhard Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2010 Moderators Share Posted February 5, 2010 ReFran, Und Sie auch! M23 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...
Yoriz Posted February 6, 2010 Share Posted February 6, 2010 I found this nice lightweight pdf viewer called Sumatra PDF that ive embeded into an autoit window for one of my own projectsWhat is Sumatra PDF? Sumatra PDF is a slim, free, open-source PDF viewer for Windows. Portable out of the box.Why another PDF reader? Sumatra has a minimalistic design. Simplicity has a higher priority than a lot of features.It's small and starts up very fast.It's designed for portable use: only one file so you can run it from external USB drive. Doesn't write to registry.Goto to the website to download it here is the LinkAnd the code follows , i have made it so the menu's and toolbar are hiden but if you want them just comment out those partsexpandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GuiMenu.au3> FileDelete(@ScriptDir & '\sumatrapdfprefs.dat') ; Deletes the defualt setting file that is created when SumatraPDF.exe is closed $sPDFFile = "Your.pdf" $sPDFFileToOpen = ' -reuse-instance "' & FileGetShortName(@ScriptDir & '\' & $sPDFFile & '"') ShellExecute("SumatraPDF.exe", $sPDFFileToOpen, @ScriptDir, "",@SW_HIDE) WinWait($sPDFFile) $hWnd1 = WinGetHandle($sPDFFile) $hMain = _GUICtrlMenu_GetMenu($hWnd1) $hView = _GUICtrlMenu_GetItemSubMenu($hMain, 1) WinMenuSelectItem($sPDFFile,"","&View","Continuous") ; sets view to continuos page If _GUICtrlMenu_GetItemChecked($hView,11) Then WinMenuSelectItem($sPDFFile,"","&View","Show toolbar") ; hides the toolbar _GUICtrlMenu_SetMenu($hWnd1,0) ; hides the menu _WinAPI_SetWindowLong ($hWnd1,$GWL_STYLE,BitOR($WS_CLIPCHILDREN,$WS_CLIPSIBLINGS,$WS_VISIBLE)) ; removes borders from SumatraPDF.exe $hGUI = GUICreate("Pdf Test", @DesktopWidth/2,@DesktopHeight/2, -1, -1, BitOr($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN,$WS_SIZEBOX)) $aWinSize = WinGetClientSize($hGUI) _WinAPI_SetParent($hWnd1, $hGUI) ; parent the SumatraPDF.exe window into an autoit window _WinAPI_SetWindowPos($hWnd1,$HWND_TOP,0,0,$aWinSize[0],$aWinSize[1],$SWP_SHOWWINDOW) ; size SumatraPDF.exe window to fit inside the autoit window ;~ ControlSend($hWnd1,"","","^p") ; can be use to open print dialog box GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop If $msg = $GUI_EVENT_RESIZED Or $GUI_EVENT_MINIMIZE Or $GUI_EVENT_MAXIMIZE Then ; resize the SumatraPDF.exe window if the autoit window changes size $aWinSize = WinGetClientSize($hGUI) _WinAPI_SetWindowPos($hWnd1,$HWND_TOP,0,0,$aWinSize[0],$aWinSize[1],$SWP_SHOWWINDOW ) EndIf WEnd GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. Link to comment Share on other sites More sharing options...
martin Posted February 12, 2010 Share Posted February 12, 2010 That's good Yoriz. The resizing works better if you resize like this expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GuiMenu.au3> FileDelete(@ScriptDir & '\sumatrapdfprefs.dat') ; Deletes the defualt setting file that is created when SumatraPDF.exe is closed $sPDFFile = "some.pdf" $sPDFFileToOpen = ' -reuse-instance "' & FileGetShortName(@ScriptDir & '\' & $sPDFFile & '"') ShellExecute(@ProgramFilesDir & "\SumatraPDF\SumatraPDF.exe", $sPDFFileToOpen, @ScriptDir, "",@SW_HIDE) WinWait($sPDFFile) $hWnd1 = WinGetHandle($sPDFFile) $hMain = _GUICtrlMenu_GetMenu($hWnd1) $hView = _GUICtrlMenu_GetItemSubMenu($hMain, 1) WinMenuSelectItem($sPDFFile,"","&View","Continuous") ; sets view to continuos page If _GUICtrlMenu_GetItemChecked($hView,11) Then WinMenuSelectItem($sPDFFile,"","&View","Show toolbar") ; hides the toolbar _GUICtrlMenu_SetMenu($hWnd1,0) ; hides the menu _WinAPI_SetWindowLong ($hWnd1,$GWL_STYLE,BitOR($WS_CLIPCHILDREN,$WS_CLIPSIBLINGS,$WS_VISIBLE)) ; removes borders from SumatraPDF.exe $hGUI = GUICreate("Pdf Test", @DesktopWidth/2,@DesktopHeight/2, -1, -1, BitOr($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN,$WS_SIZEBOX)) $aWinSize = WinGetClientSize($hGUI) _WinAPI_SetParent($hWnd1, $hGUI) ; parent the SumatraPDF.exe window into an autoit window _WinAPI_SetWindowPos($hWnd1,$HWND_TOP,0,0,$aWinSize[0],$aWinSize[1],$SWP_SHOWWINDOW) ; size SumatraPDF.exe window to fit inside the autoit window ;~ ControlSend($hWnd1,"","","^p") ; can be use to open print dialog box GUIRegisterMsg($WM_SIZE,"resize") GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop WEnd Func resize($h,$m,$w,$p) if $h = $hGui Then $aWinSize = WinGetClientSize($hGUI) winmove($hWnd1,"",0,0,$aWinSize[0],$aWinSize[1]) EndIf EndFunc Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Yoriz Posted February 13, 2010 Share Posted February 13, 2010 Thanks martin i'll have a look at the differances you've made GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. 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