Jump to content

Zehir

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Zehir

  1. Also I am unable to use the native AutoIT MouseClick(), MouseMove() and ControlClick() functions while the user mouse is blocked, even with #RequireAdmin.
  2. It always hard-crashes for me IF I use a window handle and IF I'm trying to move the blocked mouse just before the unblock (_BlockInputEx(0)). I modified the __BlockInputEx_UnhookWinHooks_Proc() function just a bit and it now works fine for me when I use a window handle : Original : ;Releases callbacks and Unhook Windows hooks Func __BlockInputEx_UnhookWinHooks_Proc() ;Release KeyBoard callback function If $ah_MouseKeyboard_WinHooks[0] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[0]) $ah_MouseKeyboard_WinHooks[0] = 0 EndIf ;Release Mouse callback function If $ah_MouseKeyboard_WinHooks[1] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[1]) $ah_MouseKeyboard_WinHooks[1] = 0 EndIf ;Release KeyBoard Window hook If IsPtr($ah_MouseKeyboard_WinHooks[2]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[2]) $ah_MouseKeyboard_WinHooks[2] = 0 EndIf ;Release Mouse Window hook If IsPtr($ah_MouseKeyboard_WinHooks[3]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[3]) $ah_MouseKeyboard_WinHooks[3] = 0 EndIf Return 1 EndFunc Modified : ;Releases callbacks and Unhook Windows hooks Func __BlockInputEx_UnhookWinHooks_Proc() ;Release KeyBoard Window hook If IsPtr($ah_MouseKeyboard_WinHooks[2]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[2]) $ah_MouseKeyboard_WinHooks[2] = 0 EndIf ;Release Mouse Window hook If IsPtr($ah_MouseKeyboard_WinHooks[3]) Then _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[3]) $ah_MouseKeyboard_WinHooks[3] = 0 EndIf ;Release KeyBoard callback function If $ah_MouseKeyboard_WinHooks[0] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[0]) $ah_MouseKeyboard_WinHooks[0] = 0 EndIf ;Release Mouse callback function If $ah_MouseKeyboard_WinHooks[1] > 0 Then DllCallbackFree($ah_MouseKeyboard_WinHooks[1]) $ah_MouseKeyboard_WinHooks[1] = 0 EndIf Return 1 EndFunc It seems that the window hooks must be released before the callbacks are. Your oldest changelog entry mentioning a hard-crash with winhandles related to window hooks not being released gave me a clue.
  3. Melba23, I'm sorry if I missed something. I'm not talking about the possibility to expand the GUI beyond the screen width, but the possibility to display an unbroken string wider than the screen. Is it possible? Do you have a working example of this? I want to use _ExtMsgBox() to make a user function, then I would like to use it while being able to forget details like the max width of an unbroken string. Maybe before calling _ExtMagBox() I could call _StringSize() on every single word in the Text parameter, if the word width is too big then break it at 50% of its lenght, call _StringSize() again on the same word, then try to break it to 75% or 25% and so on.
  4. Melba23, I have modified your example to show the error. It happens when the unbroken string is wider than the screen or almost. #pragma compile(Icon, C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v11_256x256_RGB-A.ico) #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 #include "ExtMsgBox.au3" Global $aText[] = ["Short text", _ "Medium_text_Medium_text_Medium_text", _ "Long_text_Long_text_Long_text_Long_text_Long_text_Long_text_Long_text_Long_text", _ "Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text"] $aText[3] = $aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3] For $i = 0 to 3 ; Determine text width $aSize = _StringSize($aText[$i]) ; Set max size of the ExtMsgBox _ExtMsgBoxSet(0, Default, Default, Default, Default, Default, Default, $aSize[2] + 40) ; Note use of 0 and not Default for the first parameter - read the function header to see why !!!! ; Add 40 to the text width to allow for the dialog borders, etc ; Display ExtMsgBox which will now expand to allow the text to display $iRet = _ExtMsgBox(0, 0, "Width: " & $aSize[2], $aText[$i]) ConsoleWrite("@error = " & @error&@CRLF) Next
  5. Thanks for this great UDF it is super useful 👍 However I have a problem with the max width of a word. If it's wider than the GUI it won't break the word into multiple lines, but return an error instead... I am very scared of using it with unknow text variables, so I can't use it to make functions that use it. Am I doing something wrong? Edit : Also it would be very convenient if the buttons could have different sizes, so if we have a button with a long text the GUI doesn't have to be enormous to fit 4 buttons, and we could have more buttons. Thanks
  6. Nevermind it works now : Local $String = "int;uint" Local $Struct = DllStructCreate($String) DllStructSetData($Struct, 1, 5) DllStructSetData($Struct, 2, 10) Local $bin = SaveDllStruct($Struct) Local $Struct2 = LoadDllStruct($bin, $String) _WinAPI_DisplayStruct($Struct, $String) _WinAPI_DisplayStruct($Struct2, $String) Func SaveDllStruct($Struct) Local $bs1 = DllStructCreate("byte[" & DllStructGetSize($Struct) & "]", DllStructGetPtr($Struct)) Return DllStructGetData($bs1, 1) EndFunc Func LoadDllStruct($bin, $String) Local $bs1 = DllStructCreate($String) Local $bs2 = DllStructCreate("byte[" & BinaryLen($bin) & "]", DllStructGetPtr($bs1)) DllStructSetData($bs2, 1, $bin) Return $bs1 EndFunc
  7. Hi I want to do the same and I couldn't get it to work. Here is what I understood I should do from reading this post : Local $sStruct = 'int' Local $tStruct = DllStructCreate($sStruct) DllStructSetData($tStruct, 1, 10) Local $bin = SaveDllStruct($tStruct) $tStruct2 = LoadDllStruct($bin, $sStruct) _WinAPI_DisplayStruct($tStruct, $sStruct) _WinAPI_DisplayStruct($tStruct2, $sStruct) Func SaveDllStruct($tStruct) Local $bs1 = DllStructCreate("byte[" & DllStructGetSize($tStruct) & "]", DllStructGetPtr($tStruct)) Return DllStructGetData($bs1, 1) EndFunc Func LoadDllStruct($bin, $sStruct) Local $bs1 = DllStructCreate("byte[" & BinaryLen($bin) & "]") DllStructSetData($bs1, 1, $bin) Return DllStructCreate($sStruct, DllStructGetPtr($bs1)) EndFunc But the _WinAPI_DisplayStruct() always shows me different content for the 2 structures. Would someone have an idea how to do that correctly ? Thanks
  8. Thank you I was looking for exactly that !
×
×
  • Create New...