Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/24/2017 in all areas

  1. Here a small tool to watermark any image supported by GDI+. This version is the enhanced version from AutoIt Windows Screenshooter. Screenshot: Download: AutoIt Watermark Image v0.89 beta build 2014-08-25.7z (942 download previously) Source code is too long to publish here -> PASTEBIN You are not allowed to sell this code or use it or just parts of it in a commercial project or modify it and distribute it with a different name! Some fonts may no be displayed properly because it is not GDI+ compatible! Appreciate any feedback (bugs, feature request, criticisms, etc.). @JScript: I created this on your request Coded and tested on Win7 x64 with Aero and AutoIt v3.3.12.0. Command line parameters Credits: Authenticity (GDIP.au3), funkey (_GetFontInfoFromFilePtr()), Yashied (WinAPIEx.au3) and Melba23 (NoFocusLines.au3) Thanks to (alph. order): davidkim, funkey, JScript and Myicq for active supporting this little project! Br, UEZ History
    2 points
  2. Hello. try this. Local $sFolder = _FileSelectFolder("Choose Folder") ConsoleWrite($sFolder & @CRLF) Func _FileSelectFolder($title, $root = 0, $flags = 0, $hwnd = 0) Local $ret, $pidl, $res = '' Local $ubi = DllStructCreate("hwnd;ptr;ptr;ptr;int;ptr;ptr;int") Local $utl = DllStructCreate("char[512]") Local $urs = DllStructCreate("char[260]") Local $ulf = BitOR(BitShift(BitAND($flags, 1), -9), _ BitShift(BitAND($flags, 2), -5), _ BitShift(BitAND($flags, 4), -2)) DllStructSetData($utl, 1, $title) DllStructSetData($ubi, 1, $hwnd) DllStructSetData($ubi, 3, DllStructGetPtr($urs)) DllStructSetData($ubi, 4, DllStructGetPtr($utl)) DllStructSetData($ubi, 5, $ulf) $ret = DllCall("shell32.dll", "ptr", "SHGetSpecialFolderLocation", _ "int", 0, _ "int", $root, _ "ptr", DllStructGetPtr($ubi, 2)) If $ret[0] Then Return $res $pidl = DllCall("shell32.dll", "ptr", "SHBrowseForFolder", "ptr", DllStructGetPtr($ubi)) If $pidl[0] Then $ret = DllCall("shell32.dll", "int", "SHGetPathFromIDList", _ "ptr", $pidl[0], _ "ptr", DllStructGetPtr($urs)) If $ret[0] Then $res = DllStructGetData($urs, 1) DllCall("ole32.dll", "int", "CoTaskMemFree", "ptr", $pidl[0]) EndIf DllCall("ole32.dll", "int", "CoTaskMemFree", "ptr", DllStructGetData($ubi, 2)) Return $res EndFunc ;==>_FileSelectFolder Saludos
    1 point
  3. If this is a commercially available application (as it appears to be, being an InstallShield package) how about specifying the name rather than going through all of the redacting? Perhaps some of us on the forum who have been repackaging applications for 20 years could give you some better suggestions, or try things out, based on what app you're trying to install
    1 point
  4. The setup.iss gets placed in the C:\windows directory when you use /r
    1 point
  5. That depends on the OS version, current system settings and even language packs. #include <GUIConstantsEx.au3> #include <SendMessage.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Array.au3> $hGUI = GUICreate("Example") $c_Edit = GUICtrlCreateEdit("Test", 10, 10, 200, 20) GUISetState(@SW_SHOW, $hGUI) _ArrayDisplay(_GUICtrlGetFont($c_Edit)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlGetFont ; Description ...: Gets the font of a GUI Control ; Syntax.........: _GUICtrlGetFont( [$hWnd] ) ; Parameters ....: $hWnd - [optional] ControlID or Handle of the control. Default is last created GUICtrl... (-1) ; ; Return values .: Success - Array[5] with options of font: ; [0] - FontSize (~ approximation) ; [1] - font weight (400 = normal). ; [2] - italic:2 underlined:4 strike:8 char format (styles added together, 2+4 = italic and underlined). ; [3] - The name of the font to use. ; [4] - font quality to select (PROOF_QUALITY=2 is default in AutoIt). ; ; Failure - Array[5] with empty fields, @error set to nonzero ; ; Author ........: KaFu, Prog@ndy ; ; Comments.......: The FontSize returned is an approximation of the actual FontSize used for the control. ; The height of the font returned by GetObject is the height of the font's character cell or character in logical units. ; The character height value (also known as the em height) is the character cell height value minus the internal-leading value. ; The font mapper interprets the value specified in lfHeight. The result returned by the font mapper is not easily reversible ; The FontSize calculated below is an approximation of the actual size used for the analyzed control, qualified enough to use ; in another call to the font mapper resulting in the same font size as the the original font. ; MSDN.. ........: Windows font Mapping: http://msdn.microsoft.com/en-us/library/ms969909(loband).aspx ; =============================================================================================================================== ; http://www.autoitscript.com/forum/topic/124526-guictrlgetfont Func _GUICtrlGetFont($hWnd = -1) Local $aReturn[5], $hObjOrg If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) If Not IsHWnd($hWnd) Then Return SetError(1, 0, $aReturn) Local $hFont = _SendMessage($hWnd, $WM_GETFONT) If Not $hFont Then Return SetError(2, 0, $aReturn) Local $hDC = _WinAPI_GetDC($hWnd) $hObjOrg = _WinAPI_SelectObject($hDC, $hFont) Local $tFONT = DllStructCreate($tagLOGFONT) Local $aRet = DllCall('gdi32.dll', 'int', 'GetObjectW', 'ptr', $hFont, 'int', DllStructGetSize($tFONT), 'ptr', DllStructGetPtr($tFONT)) If @error Or $aRet[0] = 0 Then _WinAPI_SelectObject($hDC, $hObjOrg) _WinAPI_ReleaseDC($hWnd, $hDC) Return SetError(3, 0, $aReturn) EndIf ; Need to extract FontFacename separately => DllStructGetData($tFONT, 'FaceName') is only valid if FontFacename has been set explicitly! $aRet = DllCall("gdi32.dll", "int", "GetTextFaceW", "handle", $hDC, "int", 0, "ptr", 0) Local $nCount = $aRet[0] Local $tBuffer = DllStructCreate("wchar[" & $aRet[0] & "]") Local $pBuffer = DllStructGetPtr($tBuffer) $aRet = DllCall("Gdi32.dll", "int", "GetTextFaceW", "handle", $hDC, "int", $nCount, "ptr", $pBuffer) If @error Then _WinAPI_SelectObject($hDC, $hObjOrg) _WinAPI_ReleaseDC($hWnd, $hDC) Return SetError(4, 0, $aReturn) EndIf $aReturn[3] = DllStructGetData($tBuffer, 1) ; FontFacename $aReturn[0] = Round((-1 * DllStructGetData($tFONT, 'Height')) * 72 / _WinAPI_GetDeviceCaps($hDC, 90), 1) ; $LOGPIXELSY = 90 => DPI aware ; ConsoleWrite("- " & _WinAPI_GetDeviceCaps($hDC, 90) & @crlf) _WinAPI_SelectObject($hDC, $hObjOrg) _WinAPI_ReleaseDC($hWnd, $hDC) $aReturn[1] = DllStructGetData($tFONT, 'Weight') $aReturn[2] = 2 * (True = DllStructGetData($tFONT, 'Italic')) + 4 * (True = DllStructGetData($tFONT, 'Underline')) + 8 * (True = DllStructGetData($tFONT, 'StrikeOut')) $aReturn[4] = DllStructGetData($tFONT, 'Quality') Return $aReturn EndFunc ;==>_GUICtrlGetFont
    1 point
  6. Try ... GUISetState(@SW_SHOW) Sleep(3000) GUICtrlSendMsg($iPic, 0x0172, 0, 0) ;should delete previous image _Image_to_pic(_Playpng(), $iPic) ...
    1 point
×
×
  • Create New...