
E1M1
Active Members-
Posts
1,096 -
Joined
-
Last visited
Everything posted by E1M1
-
EasyCodeIt - cross-platform AutoIt implementation
E1M1 replied to TheDcoder's topic in AutoIt Projects and Collaboration
That would allow others to see how far have you get with this project. I mean not eveyone who is interested in project is interested enough to try it out for themselves. It's kinda like with YouTube - It allows me to quickly check out new interesting and fun Doom mods without having to install and play these myself. And so is with examples - it helps you to get more "views". Which means better chance that someone would actually try to do something with your language and upload their script to their github which in return ends up in more click on your project. I understand how busy you are - I would probably also feel that way. But you also dont want to end up having 100% implementation of Autoit and only then star to figure out how to get user base. And These example scripts could also serve as some sort of unit tests - you refactor something and then see which example scripts start to print something else than they used to. -
EasyCodeIt - cross-platform AutoIt implementation
E1M1 replied to TheDcoder's topic in AutoIt Projects and Collaboration
Would be cool to have examples directory in your git where with every new feature you also post example code. Like if you add switch statement then also add switch.au3 to your examples that does simple printing or something. you could also just add it in form of md file so that code is in code tags and output is in some preformat tags. -
EasyCodeIt - cross-platform AutoIt implementation
E1M1 replied to TheDcoder's topic in AutoIt Projects and Collaboration
Wine user base has left the building. -
EasyCodeIt - cross-platform AutoIt implementation
E1M1 replied to TheDcoder's topic in AutoIt Projects and Collaboration
Technically you could just build compiler that packs wine and autoit exe both is single executable Of course hello world would be 200MB download and 10 sec startup time but thanks to modern frameworks everyone are already used to it that simple apps are large and slow -
It is good that you added screenshot. Yes it is exactly what I was looking for. On my work and home computers both it displays like this: I am not sure what is wrong.
-
EasyCodeIt - cross-platform AutoIt implementation
E1M1 replied to TheDcoder's topic in AutoIt Projects and Collaboration
I agree that window automation wouldnt be something that you do everyday. But then again, if you want to make GUI applications you still need ws_popup or ws_child be the same on both linux and windows. Because in AutoIt every advanced GUI application has some (ex)styles, some messages and so on. -
EasyCodeIt - cross-platform AutoIt implementation
E1M1 replied to TheDcoder's topic in AutoIt Projects and Collaboration
Interesting project. I think some rewarding challenge would be to get window interaction to work. What I mean is if you could make some translator that translates SendMessage and other such stuff to linux. That if I call WinGetState it would translate linux states to corresponding windows states and vice versa. And also that if I call _WinAPI_SetWindowLong to set style or exstyle it would translate styles like ws_child or ws_popup to styles that xserver can understand that visually look similar. And that if I call _WinAPI_GetWindowLong then it would translate linux states to windows states. I mean that is a lot of work to do but if you could get this work then it would really be interesting project. I mean send and mouseclick are already implemented in java but window automation would be something that is actually new. At least I am not aware that someone has done it yet. -
Is there any way to get it work with white background? I tried to play around with CombineRgn in hope that I could somehow just exclude the buttons and other controls from blur so that they would be displayed normally, but it did not seem to work. I also tried to put them in child window but once I gave it $WS_C_HILD and set parent the child also inherited blur. I am looking to have something like win 10 calculator app that has blur but also black text on buttons.
-
Hi, sorry I wasn't clear enough. Yes, the problem was their background color, not clicking on them. As this thing removes black. by unusable I meant that input has no real use if it is white on white. Would like to keep black as text color.
-
Hi! I have script that blurs GUI on window 10. But button and input are unusable. In other words I want text to be black on them. How do I fix it? #include <GUIConstants.au3> #include <WinAPI.au3> #include <WinAPIGdi.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> If _WinAPI_DwmIsCompositionEnabled() Then $iHasDWM=1 Local $iHeight=300 Local $iWidth=300 $hGUI = GUICreate("Windows 10 Blur", $iWidth, $iHeight,-1,-1) GUICtrlCreateButton("test", 10,10, 75, 25) GUICtrlCreateInput("test", 10,40, 75, 25) GUISetBkColor(0x000000) GUISetState() If $iHasDWM Then Local $hRgn = _WinAPI_CreateRoundRectRgn(0,0,$iWidth+1,$iHeight+1,50,50) Local $hFormRgn=_WinAPI_CreateRectRgnIndirect(_WinAPI_GetClientRect($hGUI)) Local $hRgnTest=_WinAPI_CreateNullRgn() _WinAPI_CombineRgn($hRgnTest,$hRgn,$hFormRgn,$RGN_XOR) _WinAPI_DwmEnableBlurBehindWindow($hGUI,1,1,$hRgnTest) _WinAPI_DwmEnableBlurBehindWindow10($hGUI) EndIf While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinAPI_DwmEnableBlurBehindWindow10 ; Description ...: Enables Aero-like blurred background in Windows 10. ; Syntax ........: _WinAPI_DwmEnableBlurBehindWindow10($hWnd[, $iMode = $ACCENT_ENABLE_BLURBEHIND]) ; Parameters ....: $hWnd - Window handle. ; $bEnable - [optional] Enable or disable the blur effect. ; Return values .: 1 on success, 0 otherwise. Call _WinAPI_GetLastError on failure for more information. ; Author ........: scintilla4evr ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: http://vhanla.codigobit.info/2015/07/enable-windows-10-aero-glass-aka-blur.html and http://undoc.airesoft.co.uk/user32.dll/SetWindowCompositionAttribute.php ; Example .......: Yes ; =============================================================================================================================== Func _WinAPI_DwmEnableBlurBehindWindow10($hWnd, $bEnable = True) Local $tAccentPolicy = DllStructCreate("int AccentState; int AccentFlags; int GradientColor; int AnimationId") Local $tAttrData = DllStructCreate("dword Attribute; ptr DataBuffer; ulong Size") $tAccentPolicy.AccentState = $bEnable ? 3 : 0 $tAttrData.Attribute = 19 ; WCA_ACCENT_POLICY $tAttrData.DataBuffer = DllStructGetPtr($tAccentPolicy) $tAttrData.Size = DllStructGetSize($tAccentPolicy) Local $aResult = DllCall("user32.dll", "bool", "SetWindowCompositionAttribute", "hwnd", $hWnd, "ptr", DllStructGetPtr($tAttrData)) If @error Then Return SetError(@error, @extended, 0) Return $aResult[0] EndFunc
-
How to disable high DPI scaling for autoit GUI?
E1M1 replied to E1M1's topic in AutoIt GUI Help and Support
Thanks! Just in case anyone arrives here from search engine. The solution was: DllCall("User32.dll", "bool", "SetProcessDPIAware") -
Hi! When I use my autoit GUI with high DPI monitor, it gets blurry because of faulty scaling. How do I disable scaling for my GUI? I tried SetProcessDPIAwareness but it does not seem to work. $__eDPIAWARNESS_Process_DPI_Unaware = 0 $__eDPIAWARNESS_Process_System_DPI_Aware = 1 $__eDPIAWARNESS_Process_Per_Monitor_DPI_Aware = 2 Func _WinAPI_SetProcessDPIAwareness($iPROCESS_DPI_AWARENESS) Return DllCall('Shcore.dll', 'int', 'SetProcessDPIAwareness', 'int', $iPROCESS_DPI_AWARENESS) EndFunc ;==>_WinAPI_SetProcessDPIAwareness _WinAPI_SetProcessDPIAwareness($__eDPIAWARNESS_Process_Per_Monitor_DPI_Aware) $gui = GUICreate("Title") GUICtrlCreateLabel("Hello World", 10, 10) GUISetState(@SW_SHOW) while GUIGetMsg() <> -3 WEnd
-
How to preven my scrollable tabs from grabbing focus?
E1M1 replied to E1M1's topic in AutoIt General Help and Support
Thanks! It took me a while to figure out why simply updating window styles didnt fix it. Does anyone know why this new code requires GUICtrlCreateTab to be width = 0 and height = 0? And why now windows appear below it if I make it size 100,100 for example? Like previously they appeared on top of tab container. -
Hi! My goal is to make tabs that I can scroll. As I understand there there is no correct way of doing it so I have to use trick that uses child windows to do this. I use M23's code for my include: #include <GUIConstantsEx.au3> #include "GUIScrollbars_Ex.au3" Dim $tabWindows[2] $hGui = GUICreate("Scrollable tabs", 640, 480, -1, -1, $WS_CLIPCHILDREN + $WS_MINIMIZEBOX + $WS_CAPTION + $WS_POPUP + $WS_SYSMENU) GUICtrlCreateLabel("Label on main gui", 5, 5, Default, 20) $tabs = GUICtrlCreateTab(5, 25, 630, 450) $tab1 = GUICtrlCreateTabItem("Tab 1") $tab2 = GUICtrlCreateTabItem("Tab 2") $pos = ControlGetPos($hGui, "", $tabs) $tabWindows[0] = GUICreate("test", $pos[2] - 10, $pos[3] - 30, 7, 50, $WS_POPUP, $WS_EX_MDICHILD, $hGui) GUISetBkColor(0xffffff) GUICtrlCreateLabel("Hello World!",10,10) $tabWindows[1] = GUICreate("test", $pos[2] - 10, $pos[3] - 30, 7, 50, $WS_POPUP, $WS_EX_MDICHILD, $hGui) GUISetBkColor(0xffffff) GUICtrlCreateLabel("Label", 10, 10, 25, 25) GUICtrlSetTip(-1, "Label hint") GUISetState(@SW_SHOW, $hGui) _GUIScrollbars_Generate($tabWindows[1], 500, 1000) ; This is the current active tab $iLastTab = GUICtrlRead($tabs) GUISetState(@SW_SHOW, $tabWindows[$iLastTab]) $lastLabelIndex = -1 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $tabs $currentTab = GUICtrlRead($tabs) If $currentTab <> $iLastTab Then GUISetState(@SW_HIDE, $tabWindows[$iLastTab]) GUISetState(@SW_SHOW, $tabWindows[$currentTab]) $iLastTab = $currentTab ; EndIf EndSwitch WEnd However when I click on labels under tabs then those child windows grab focus from parent. And whenever I switch tabs, parent window flashes focus. Is there way to prevent this or even better, add scrollbars directly to tabs instead of using GUIs to wrap content?
-
How to correctly DllCall atoi ( char const* _Str ) ?
E1M1 replied to E1M1's topic in AutoIt General Help and Support
Thanks! @jchd, would be interesting to know how you found out that it was cdecl ? For example: DllCall ( "kernel32.dll", "int", "GetTickCount" ) works fine with stdcall. -
How to correctly DllCall atoi ( char const* _Str ) ?
E1M1 replied to E1M1's topic in AutoIt General Help and Support
Hi! I also have 64 bit Win 10. How do you exactly run it in 64 bit mode? I tried adding #AutoIt3Wrapper_UseX64=y but it still crashes. The funny thing is that if I do the same thing in 64bit node.js using ffi-napi then it works. If I call it from autoit without args it also works - it just returns 0. But if I call it autoit with argument then it crashes. Even if I compile it in 64 bit mode. What version of autoit were you using? I guess I could try it although I believe they haven't changed DllCall for at least last 10 years or so -
Hi! I would like to call atoi from ntdll.dll If I call it without arguments it returns 0 and sets @error 0 so the function exists $converted = DllCall ( "ntdll.dll", "int", "atoi") ConsoleWrite(@error & @CRLF) ConsoleWrite($converted[0] & @CRLF) But I would like to call it with real arguments of course $converted = DllCall ( "ntdll.dll", "int", "atoi", "str", "1234") ConsoleWrite(@error & @CRLF) ConsoleWrite($converted[0] & @CRLF) But when I call this, autoit.exe simply crashes. It doesn't even reach to ConsoleWrite anymore. What am I doing wrong?
-
Hi! I am trying to read https intranet page at work that has bad/selfsigned certificate. I use this code: InetRead($url, $INET_FORCERELOAD + $INET_IGNORESSL) It works just fine is $url is http://something.lan but if I change it to https://something.lan:8443 then it gives me @error13. Since it is my work computer, I would like to know if any group policy settings or other settings override $INET_IGNORESSL? The url works fine when I visit it with firefox so the server must be working correctly and url must also be correct.
-
Hi! I want to draw controls on glass? I found this example: https://www.autoitscript.com/forum/topic/105764-tab-control-interferes-with-aero-glass/ However, when I added my own controls to this example GUICtrlCreateCheckbox("Do stuff", 248, 20, 113, 17) GUICtrlSetBkColor(-1, 0x0) GUICtrlCreateButton("click", 448, 20, 113, 17) But now checkbox has no text and button has white text. Is there some way to make this glass dynamically work for all controls that are added to gui so that when I add new gui controls, glass code wouldnt have to be changed? Full code: #include <Constants.au3> #include <Date.au3> #include <EditConstants.au3> #include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <GUITab.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) If Not IsDeclared("tagBP_PAINTPARAMS") Then Global Const $tagBP_PAINTPARAMS = "uint Size;uint Flags;" & $tagRECT & ";ptr BlendFunction;" If Not IsDeclared ("tagDWM_BLURBEHIND") Then Global Const $tagDWM_BLURBEHIND = "uint Flags;int Enable;hwnd RgnBlur;int TransitionOnMaximized;" If Not IsDeclared("tagPAINTSTRUCT") Then Global Const $tagPAINTSTRUCT = "hwnd hDC;int Erase;" & $tagRECT & ";int Restore;int IncUpdate;ubyte Reserved[32]" If Not IsDeclared("tagDTTOPTS") Then Global Const $tagDTTOPTS = _ "uint Size;uint Flags;uint clrText;uint clrBorder;uint clrShadow;int TextShadowType;" & $tagPOINT & _ ";int BorderSize;int FontPropId;int ColorPropId;int StateId;int ApplyOverlay;int GlowSize;ptr DrawTextCallback;int lParam;" Global Enum $BPBF_COMPATIBLEBITMAP, $BPBF_DIB, $BPBF_TOPDOWNDIB, $BPBF_TOPDOWNMONODIB Global Const $PRF_CHECKVISIBLE = 0x00000001 Global Const $PRF_NONCLIENT = 0x00000002 Global Const $PRF_CLIENT = 0x00000004 Global Const $PRF_ERASEBKGND = 0x00000008 Global Const $PRF_CHILDREN = 0x00000010 Global Const $PRF_OWNED = 0x00000020 Global Const $DWM_BB_ENABLE = 0x00000001 Global Const $DWM_BB_BLURREGION = 0x00000002 Global Const $DWM_BB_TRANSITIONONMAXIMIZED = 0x00000004 Global Const $DTT_GRAYED = 0x00000001 Global Const $DTT_FLAGS2VALIDBITS = $DTT_GRAYED Global Const $DTT_TEXTCOLOR = 0x00000001 Global Const $DTT_BORDERCOLOR = 0x00000002 Global Const $DTT_SHADOWCOLOR = 0x00000004 Global Const $DTT_SHADOWTYPE = 0x00000008 Global Const $DTT_SHADOWOFFSET = 0x00000010 Global Const $DTT_BORDERSIZE = 0x00000020 Global Const $DTT_FONTPROP = 0x00000040 Global Const $DTT_COLORPROP = 0x00000080 Global Const $DTT_STATEID = 0x00000100 Global Const $DTT_CALCRECT = 0x00000200 Global Const $DTT_APPLYOVERLAY = 0x00000400 Global Const $DTT_GLOWSIZE = 0x00000800 Global Const $DTT_CALLBACK = 0x00001000 Global Const $DTT_COMPOSITED = 0x00002000 Global Const $DTT_VALIDBITS = BitOR($DTT_TEXTCOLOR, $DTT_BORDERCOLOR, $DTT_SHADOWCOLOR, $DTT_SHADOWTYPE, $DTT_SHADOWOFFSET, $DTT_BORDERSIZE, _ $DTT_FONTPROP, $DTT_COLORPROP, $DTT_STATEID, $DTT_CALCRECT, $DTT_APPLYOVERLAY, $DTT_GLOWSIZE, $DTT_COMPOSITED) Global $hUxTheme = DllOpen("uxtheme.dll") Global $hGUI = GUICreate('GUI Window', 800, 600) Global $hTheme = _WinAPI_OpenThemeData($hGUI, "globals", $hUxTheme) ; Initialize buffered painting for the current thread. _WinAPI_BufferedPaintInit($hUxTheme) GUICtrlCreateCheckbox("Do stuff", 248, 20, 113, 17) GUICtrlSetBkColor(-1, 0x0) GUICtrlCreateButton("click", 448, 20, 113, 17) Global $tab = GUICtrlCreateTab(0, 20, 200, 100) Global $tab0 = GUICtrlCreateTabItem("tab0") Global $tab1 = GUICtrlCreateTabItem("tab1") Global $htab = GUICtrlGetHandle($tab) Global $DWM_Margins = DllStructCreate('int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;') DllStructSetData($DWM_Margins, 'cyTopHeight', 60) If _WinAPI_DwmIsCompositionEnabled() Then _WinAPI_DwmExtendFrameIntoClientArea($hGUI, $DWM_Margins) EndIf Global $hTabProc = DllCallbackRegister("_TabProc", "int", "hwnd;uint;wparam;lparam") Global $hWndProc = _WinAPI_SetWindowLong($htab, $GWL_WNDPROC, DllCallbackGetPtr($hTabProc)) GUIRegisterMsg($WM_ERASEBKGND, "_WM_ERASEBKGND") GUIRegisterMsg($WM_NCHITTEST, "_WM_NCHITTEST") GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _WinAPI_CloseThemeData($hTheme, $hUxTheme) _WinAPI_SetWindowLong($htab, $GWL_WNDPROC, $hWndProc) DllCallbackFree($hTabProc) ;Closes down buffered painting for the current thread. _WinAPI_BufferedPaintUnInit($hUxTheme) GUIDelete() Exit Func _TabProc($hWnd, $iMsg, $iwParam, $ilParam) Local $hDC, $hBufferedDC, $hPaintBuffer Local $tPS, $pPS Local $tRect Switch $iMsg Case $WM_PAINT $tPS = DllStructCreate($tagPAINTSTRUCT) $pPS = DllStructGetPtr($tPS) $hDC = _WinAPI_BeginPaint($hWnd, $pPS) $tRect = DllStructCreate($tagRECT) For $i = 1 To 4 DllStructSetData($tRect, $i, DllStructGetData($tPS, $i+2)) Next $hPaintBuffer = _WinAPI_BeginBufferedPaint($hDC, DllStructGetPtr($tRect), $BPBF_TOPDOWNDIB, 0, $hBufferedDC, $hUxTheme) _SendMessage($hWnd, $WM_PRINTCLIENT, $hBufferedDC, $PRF_CLIENT) _WinAPI_BufferedPaintSetAlpha($hPaintBuffer, 0, 255, $hUxTheme) ; Tweak to get the desired region to fill ;~ Local $hRgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) ;~ Local $iItems = _GUICtrlTab_GetItemCount($hWnd) ;~ Local $iCurrItem = _GUICtrlTab_GetCurSel($hWnd) ;~ Local $aRect ;~ ;~ For $i = 0 To $iItems-1 ;~ $aRect = _GUICtrlTab_GetItemRect($hWnd, $i) ;~ For $i = 0 To UBound($aRect)-1 ;~ ConsoleWrite($aRect[$i] & " ") ;~ Next ;~ ConsoleWrite(@CRLF) ;~ If $i = $iCurrItem Then ;~ $aRect[0] -= 1 ;~ $aRect[1] -= 2 ;~ $aRect[2] += 1 ;~ If $i = 0 Then ;~ $aRect[0] -= 1 ;~ $aRect[2] += 1 ;~ EndIf ;~ If $i = $iItems-1 Then $aRect[2] += 1 ;~ ;~ Else ;~ $aRect[2] -= 1 ;~ If $i = $iItems-1 Then $aRect[2] -= 1 ;~ EndIf ;~ ;~ Local $hTabRgn = _WinAPI_CreateRectRgn($aRect[0], $aRect[1], $aRect[2], $aRect[3]) ;~ _WinAPI_CombineRgn($hRgn, $hRgn, $hTabRgn, $RGN_OR) ;~ _WinAPI_DeleteObject($hTabRgn) ;~ Next ;~ $tRect = _WinAPI_GetClientRect($hWnd) ;~ Local $hFillRgn = _WinAPI_CreateRectRgn(DllStructGetData($tRect, "Left"), DllStructGetData($tRect, "Top"), DllStructGetData($tRect, "Right"), DllStructGetData($tRect, "Bottom")) ;~ _WinAPI_CombineRgn($hFillRgn, $hFillRgn, $hRgn, $RGN_DIFF) ;~ _WinAPI_SelectClipRgn($hBufferedDC, $hFillRgn) ;~ Local $hBrush = _WinAPI_CreateSolidBrush(0) ;~ _WinAPI_FillRgn($hBufferedDC, $hFillRgn, $hBrush) ;~ _WinAPI_DeleteObject($hBrush) ;~ _WinAPI_DeleteObject($hFillRgn) ;~ _WinAPI_DeleteObject($hRgn) If $hPaintBuffer Then _WinAPI_EndBufferedPaint($hPaintBuffer, True, $hUxTheme) _WinAPI_EndPaint($hWnd, $pPS) Return 0 EndSwitch Return _WinAPI_CallWindowProc($hWndProc, $hWnd, $iMsg, $iwParam, $ilParam) EndFunc Func _WinAPI_SelectClipRgn($hDC, $hRgn) Local $aResult = DllCall("gdi32.dll", "int", "SelectClipRgn", "hwnd", $hDC, "hwnd", $hRgn) If @error Then Return SetError(@error, @extended, 0) Return SetError(0, 0, $aResult[0]) EndFunc Func _WinAPI_FillRgn($hDC, $hRgn, $hBrush) Local $aResult If IsPtr($hBrush) Then $aResult = DllCall("gdi32.dll", "int", "FillRgn", "hwnd", $hDC, "hwnd", $hRgn, "hwnd", $hBrush) Else $aResult = DllCall("gdi32.dll", "int", "FillRgn", "hwnd", $hDC, "hwnd", $hRgn, "int", $hBrush) EndIf If @error Then Return SetError(@error, @extended, 0) Return SetError(0, 0, $aResult[0] <> 0) EndFunc Func _WM_ERASEBKGND($hWnd, $iMsg, $iwParam, $ilParam) Local $hDC = $iwParam Local $tClientRect = _WinAPI_GetClientRect($hWnd) Local $hBrush = _WinAPI_GetStockObject($BLACK_BRUSH) DllStructSetData($tClientRect, "Bottom", 60) _WinAPI_FillRect($hDC, DllStructGetPtr($tClientRect), $hBrush) _WinAPI_DeleteObject($hBrush) $tClientRect = _WinAPI_GetClientRect($hWnd) DllStructSetData($tClientRect, "Top", 60) $hBrush = _WinAPI_CreateSolidBrush(_WinAPI_GetSysColor($COLOR_BTNFACE)) _WinAPI_FillRect($hDC, DllStructGetPtr($tClientRect), $hBrush) _WinAPI_DeleteObject($hBrush) Return 1 EndFunc Func _WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) Return $HTCAPTION EndFunc Func _WinAPI_DwmExtendFrameIntoClientArea($hWnd, ByRef $tMargins) Local $aResult = DllCall("dwmapi.dll", "int", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($tMargins)) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndFunc Func _WinAPI_DwmIsCompositionEnabled() Local $aResult = DllCall("dwmapi.dll", "int", "DwmIsCompositionEnabled", "int*", 0) If @error Then Return SetError(@error, @extended, -1) Return SetError($aResult[0], 0, $aResult[1]) EndFunc Func _WinAPI_BeginPaint($hWnd, $pPaintStruct) Local $aResult = DllCall("user32.dll", "hwnd", "BeginPaint", "hwnd", $hWnd, "ptr", $pPaintStruct) If @error Then Return SetError(@error, @extended, 0) Return SetError(0, 0, $aResult[0]) EndFunc Func _WinAPI_EndPaint($hWnd, $pPaintStruct) Local $aResult = DllCall("user32.dll", "int", "EndPaint", "hwnd", $hWnd, "ptr", $pPaintStruct) If @error Then Return SetError(@error, @extended, 0) Return SetError(0, 0, $aResult[0]) EndFunc Func _WinAPI_OpenThemeData($hWnd, $sClassList, $hDll = "uxtheme.dll") Local $aResult = DllCall($hDll, "hwnd", "OpenThemeData", "hwnd", $hWnd, "wstr", $sClassList) If @error Then Return SetError(@error, @extended, 0) Return SetError(0, 0, $aResult[0]) EndFunc Func _WinAPI_CloseThemeData($hTheme, $hDll = "uxtheme.dll") Local $aResult = DllCall($hDll, "int", "CloseThemeData", "hwnd", $hTheme) If @error Then Return SetError(@error, @extended, 0) Return SetError(0, $aResult[0], $aResult[0] = 0) EndFunc Func _WinAPI_BufferedPaintInit($hDll = "uxtheme.dll") Local $aResult = DllCall($hDll, "int", "BufferedPaintInit") If @error Then Return SetError(@error, @extended, 0) Return SetError(0, $aResult[0], $aResult[0] = 0) EndFunc Func _WinAPI_BufferedPaintUnInit($hDll = "uxtheme.dll") Local $aResult = DllCall($hDll, "int", "BufferedPaintUnInit") If @error Then Return SetError(@error, @extended, 0) Return SetError(0, $aResult[0], $aResult[0] = 0) EndFunc Func _WinAPI_BeginBufferedPaint($hDC, $pRc, $iBufferFormat, $pPaintParams , ByRef $phDC, $hDll = "uxtheme.dll") Local $tHDC = DllStructCreate("hwnd") Local $aResult = DllCall($hDll, "hwnd", "BeginBufferedPaint", "hwnd", $hDC, "ptr", $pRc, "int", $iBufferFormat, "ptr", $pPaintParams, "ptr", DllStructGetPtr($tHDC)) If @error Then Return SetError(@error, @extended, 0) $phDC = DllStructGetData($tHDC, 1) Return SetError(0, 0, $aResult[0]) EndFunc Func _WinAPI_EndBufferedPaint($hPaintBuffer, $fUpdateTarget = True, $hDll = "uxtheme.dll") Local $aResult = DllCall($hDll, "int", "EndBufferedPaint", "hwnd", $hPaintBuffer, "int", $fUpdateTarget) If @error Then Return SetError(@error, @extended, 0) Return SetError(0, $aResult[0], $aResult[0] = 0) EndFunc Func _WinAPI_BufferedPaintSetAlpha($hPaintBuffer, $pRc, $bAlpha = 255, $hDll = "uxtheme.dll") Local $aResult = DllCall($hDll, "int", "BufferedPaintSetAlpha", "hwnd", $hPaintBuffer, "ptr", $pRc, "ubyte", $bAlpha) If @error Then Return SetError(@error, @extended, 0) Return SetError(0, $aResult[0], $aResult[0] = 0) EndFunc
-
How to replace placeholder in rtf file and put it to clipboard? I still get contents with {name} instead of Some Replacement. Note that last char of this rtf file is NUL. #include <Clipboard.au3> #include <String.au3> _Example() Func _Example() Local $sRTF_FileFullPath = @ScriptDir & '\outfile.rtf' Local $hFile = FileOpen($sRTF_FileFullPath) Local $sRTF_Content = FileRead($hFile) $sRTF_Content = StringReplace($sRTF_Content,"\{name\}", "Some Replacement") FileClose($hFile) Local $iClipboardFormat = _ClipBoard_RegisterFormat("Rich Text Format") Local $hMemory = _ClipBoard_SetData($sRTF_Content, $iClipboardFormat) EndFunc outfile.rtf
-
Would it change anything? If I remeber correctly, nothing happens.
-
Hello. I am trying to call 64 bit dll from 64 bit autoit, but I get @error = 3. My autoit code: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** DllCall("test.dll", "int", "MyMessageBoxW", _ "hwnd", 0, _ ; Handle to the parent window "wstr", "Some text", _ ; The text of the message box "wstr", "Some title", _ ; The title of the message box "int", 0) ; Flags for the message box. MsgBox(0,0,@error) And my C++ code: #undef UNICODE #include <windows.h> #include <cstdio> INT APIENTRY DllMain(HMODULE hDLL, DWORD Reason, LPVOID Reserved) { switch(Reason) { case DLL_PROCESS_ATTACH: MessageBox(0,"","Loaded",0); break; case DLL_PROCESS_DETACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: break; } return TRUE; } int WINAPI MyMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uiType) { int retValue = MessageBoxW(hWnd, lpText, lpCaption, uiType); return retValue; }The message box that says "Loaded" pops up so the problem cant be in loading dll.
-
Thanks.
-
I mean when you don't drag it but click it.
-
When I click on slider, it always overruns the right position. I was wondering if there's any more precise slider available. Like UDF or something. GUICreate("slider", 220, 100, 100, 200) $slider1 = GUICtrlCreateSlider(10, 10, 200, 30) GUICtrlSetLimit(-1, 200, 0) ; change min/max value GUICtrlSetData($slider1, 45) ; set cursor GUISetState() Do $msg = GUIGetMsg() Until $msg = -3