-
Posts
12 -
Joined
-
Last visited
About Christos
- Birthday 09/15/1970
Profile Information
-
Location
Germany
Christos's Achievements

Seeker (1/7)
0
Reputation
-
I was so close to the solution but I gave up yesterday. Prog@ndy Thank you very much, you are fantastic . It's now working and is not blocked by DEP on the Windows 2003/2008 servers. I identified only a spelling error in line 132 --> Seterror instead of Seterrot
-
It's working with activated DEP, and is also working in compiled status.
-
LOL .... DEP was preventing the execution. I did some tests on the 2003/2008 Servers. The example below is working without deactivating DEP (I have use monoceres UDF and one of his examples) But it's only working if you use it with F5 in SciTE, It´s not working if you compile it (deactivated DEP). The Examples of wraithdu are working only if you deactivate DEP, and only if you used with F5 in SciTE. ;~ #include <apihook.au3> #include <winapi.au3> Global $IMAGE_DIRECTORY_ENTRY_IMPORT = 1 Global $PAGE_READWRITE = 0x04 Global $IMAGE_IMPORT_DESCRIPTOR = "dword DUMMYUNIONNAME;dword TimeDateStamp;dword ForwarderChain;dword Name;dword FirstThunk" Global $IMAGE_THUNK_DATA = "dword u1" Global $MEMORY_BASIC_INFORMATION = "ptr BaseAddress;ptr AllocationBase;ptr AllocationProtect;ulong RegionSize;dword State;dword Protect;dword Type;" $GetProcAddress=DllCallbackRegister("GetProcAddress","ptr","ptr;ptr") $GetProcAddressPtr=DllCallbackGetPtr($GetProcAddress) $virtualprotect=_GetProcAddress(_WinAPI_GetModuleHandle("Kernel32.dll"), "VirtualProtect") $LockWorkStation=_GetProcAddress(_WinAPI_GetModuleHandle("user32.dll"),"LockWorkStation") $hook = _AddHookApi("Kernel32.dll", "GetProcAddress", $GetProcAddressPtr) DllCall("kernel32.dll","int",String($LockWorkStation)) Func GetProcAddress($ptr,$str) $string = DllStructCreate("char[255]", $str) if DllStructGetData($string,1)="VirtualProtect" Then Return $virtualprotect Elseif DllStructGetData($string,1)="VirtualQuery" Then Return $virtualquery Else Return DllStructGetData($string,1) EndIf Return 0 EndFunc Func _AddHookApi($ModuleName, $FunctionName, $NewProcAddress) ; Get base address of our app $hInstance = _WinAPI_GetModuleHandle(0) ;; Get module of the module that the function resides in $Module = _WinAPI_GetModuleHandle($ModuleName) ; Get the original function address $call = DllCall("Kernel32.dll", "ptr", "GetProcAddress", "ptr", $Module, "str", $FunctionName) $OrigAddress = $call[0] ;; Get the address of the Import directory $call = DllCall("Dbghelp.dll", "ptr", "ImageDirectoryEntryToData", "ptr", $hInstance, "int", 1, "ushort", $IMAGE_DIRECTORY_ENTRY_IMPORT, "ulong*", "") $ptrtoiid = $call[0] ; Create a struct from the pointer $iid = DllStructCreate($IMAGE_IMPORT_DESCRIPTOR, $ptrtoiid) ;; Loop through all loaded modules. While DllStructGetData($iid, "Name") ; get the name... $str = DllStructCreate("char[255]", $hInstance + DllStructGetData($iid, "Name")) ; If the name matches, we've found what we're looking for. If DllStructGetData($str, 1) = $ModuleName Then ExitLoop ; Move to the next directory item $ptrtoiid += DllStructGetSize($iid) $iid = DllStructCreate($IMAGE_IMPORT_DESCRIPTOR, $ptrtoiid) WEnd $ptrtoitd = $hInstance + DllStructGetData($iid, "FirstThunk") $itd = DllStructCreate($IMAGE_THUNK_DATA, $ptrtoitd) While DllStructGetData($itd, 1) ; We have found where the original address is stored If DllStructGetData($itd, 1) = $OrigAddress Then ;; Prepare the memory for writing $mbi = DllStructCreate($MEMORY_BASIC_INFORMATION) DllCall("Kernel32.dll", "ulong", "VirtualQuery", "ptr", DllStructGetPtr($itd, 1), "ptr", DllStructGetPtr($mbi), "ulong", DllStructGetSize($mbi)) DllCall("Kernel32.dll", "int", "VirtualProtect", "ptr", DllStructGetData($mbi, "BaseAddress"), "ulong", DllStructGetData($mbi, "RegionSize"), "dword", $PAGE_READWRITE, "ptr", DllStructGetPtr($mbi, "Protect")) ;; Here's where the magic happens DllStructSetData($itd, 1, $NewProcAddress) $randomdword = DllStructCreate("dword") DllCall("Kernel32.dll", "int", "VirtualProtect", "ptr", DllStructGetData($mbi, "BaseAddress"), "ulong", DllStructGetData($mbi, "RegionSize"), _ "dword", DllStructGetPtr($mbi, "Protect"), "ptr", DllStructGetPtr($randomdword, 1)) ExitLoop EndIf $ptrtoitd += DllStructGetSize($itd) $itd = DllStructCreate($IMAGE_THUNK_DATA, $ptrtoitd) WEnd Return $itd EndFunc ;==>_AddHookApi Func _GetProcAddress($hModule, $FunctionName) $call = DllCall("Kernel32.dll", "ptr", "GetProcAddress", "ptr", $hModule, "str", $FunctionName) Return $call[0] EndFunc ;==>_GetProcAddress Func _ChangeHookApi($ITDSTRUCT, $NewProc) ;; Prepare the memory for writing $mbi = DllStructCreate($MEMORY_BASIC_INFORMATION) DllCall("Kernel32.dll", "ulong", "VirtualQuery", "ptr", DllStructGetPtr($ITDSTRUCT, 1), "ptr", DllStructGetPtr($mbi), "ulong", DllStructGetSize($mbi)) DllCall("Kernel32.dll", "int", "VirtualProtect", "ptr", DllStructGetData($mbi, "BaseAddress"), "ulong", DllStructGetData($mbi, "RegionSize"), "dword", $PAGE_READWRITE, "ptr", DllStructGetPtr($mbi, "Protect")) ;; Here's where the magic happens DllStructSetData($ITDSTRUCT, 1, $NewProc) $randomdword = DllStructCreate("dword") DllCall("Kernel32.dll", "int", "VirtualProtect", "ptr", DllStructGetData($mbi, "BaseAddress"), "ulong", DllStructGetData($mbi, "RegionSize"), _ "dword", DllStructGetPtr($mbi, "Protect"), "ptr", DllStructGetPtr($randomdword, 1)) EndFunc ;==>_ChangeHookApi
-
I have tried with the latest beta and v3.2.12.1, both with the same result. I have here a screenshot of my Desktop.
-
@ corgano your function is still not working for me! Is crashing after 8 10 seconds if I move the mouse. My screen 1920x1200 is not complete black, I see a small stripe of my desktop on the right side. @ UEZ your function is working for me.
-
@monoceres I use 32bit server editions. I will try tomorrow your UDF. I discovered the same problem here http://www.autoitscript.com/forum/index.ph...55120&st=49
-
It's working on Windows2000 Workstation and Server, XP and Vista. But why is this not working on Server2003 and Server 2008?! I get in the SciTE console this code 0x773DDD0D for the first example and this >Exit code: -1073741819 for the second example. After I have compiled the second example it's displaying the GUI and the msgbox but the "hide taskbar button" checkbox is doing nothing. Any idea how to get it working on the servers or how to find out what is wrong?
-
Very nice....until I tried to move the mouse to the second monitor. It causes a bug! 90 100% CPU load until I got killed the script, tested on Vista 32bit.
-
Very useful UDF and working perfect on Vista, XP and Windows 2000 Server & Workstation. But the UDF is not working on Server 2003! Any idea how to get it working on server 2003? I have created a GUI that looks like the Office2007 GUI, using your "Experimental version". Code (very small version) with pics here Compiled version here
-
You have to add the #include <StaticConstants.au3> in the _ButtonHover.au3.
-
Hi Valuater, Did I get it right, includes the new function the possibility to hold the button in the pushed status? Can you show me how I can use the __HoverWaitButtonUp function?! Thank you very much Christos
-
How about a progressbar like this?
Christos replied to RobertKipling's topic in AutoIt GUI Help and Support
Greenhorn your example looks very good. I have integrated this in one my scripts. But I retrieve two problems I cant set the progress back to the original state (0%) after I have used the Function one time. And if you use also ModermenuRAW.au3 in your script you will get the error message that the DeleteObject() function is already defined. I have use Greenhorns example to show what the problem is. #NoTrayIcon #Region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=G:\AutoIT\sdoc_icon\Sdoc1.ico #AutoIt3Wrapper_outfile=progr.exe #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Language=1031 #AutoIt3Wrapper_Run_After=C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe -add %out%, %out%, 1.bmp, bitmap, 1, 1031 #AutoIt3Wrapper_Run_After=C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe -add %out%, %out%, 2.bmp, bitmap, 2, 1031 #AutoIt3Wrapper_Run_After=C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe -add %out%, %out%, 3.bmp, bitmap, 3, 1031 #AutoIt3Wrapper_Run_After=C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe -add %out%, %out%, 4.bmp, bitmap, 4, 1031 #AutoIt3Wrapper_Run_After=C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe -add %out%, %out%, 5.bmp, bitmap, 5, 1031 #AutoIt3Wrapper_Run_After=C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\ResHacker.exe -add %out%, %out%, 6.bmp, bitmap, 6, 1031 #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** ;#AutoIt3Wrapper_Run_After=C:\Programme\AutoIt3\Aut2Exe\upx.exe --best --compress-resources|1 "%out%" #include-once #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ProgressBar.au3> Global Const $SS_CENTER = 1 ; Wichtig ! s. Funktion. Opt('OnExitFunc', 'Terminate') ; Array with Bitmaps from Disk !!! Global $aPics[6] = ['1.bmp', '2.bmp', '3.bmp', '4.bmp', '5.bmp', '6.bmp'] ; Array with Bitmaps from comp. exe !!! ;Global $aPics[6] = [1, 2, 3, 4, 5, 6] ; Testfenster erstellen. $hWnd = GUICreate('ProgressBar mit Bitmaps - Demo', 500, 300, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPCHILDREN)) GUISetBkColor(0xFFFFFF) GUISetFont(10, 800, 0, 'SegoeUI') GUICtrlCreateLabel('Progressbar Test', 0, 80, 500, 20, $SS_CENTER) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetFont(-1, 12, 800, 0, 'SegoeUI') $Run = GUICtrlCreateButton("RUN", 200, 220, 91, 25, 0) $aProgressBar1 = ProgressBarCreate(100, 150, 300, $aPics, $hWnd) ProgressBarSetState($aProgressBar1) GUISetState(@SW_SHOW, $hWnd) While True Switch GUIGetMsg() Case $Run TestProgress($aProgressBar1) Case -3 Exit EndSwitch WEnd Func TestProgress($aProgress) For $i = 1 To 100 ProgressBarSetData($aProgress, $i) Sleep(1) Next MsgBox(64, "Finished!", "Done! ") Terminate() EndFunc Func Terminate() ; muss vor Programmende aufgerufen werden, ; um mit den Resourcen aufzuräumen. ProgressBarDelete($aProgressBar1) ;~ ProgressBarSetData($aProgressBar1, 0) ProgressBarSetState($aProgressBar1) EndFunc Greets Christos