careca Posted July 26, 2014 Share Posted July 26, 2014 (edited) Hey guys, the code under works, but i have the very same code embedded in another script, and what happens is that it doesn't retrieve any error, but it doesn't move/retract the window. Wonder what can be conflicting with it. PS: If i have a sleep and then the call, it works, but that is not what i need. @error is always 0 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> AdlibRegister('Retract', 2000) Local $SlideType3 = 0x00040008 ; $AW_SLIDE_IN_BOTTOM Local $SlideType4 = 0x00050004 ; $AW_SLIDE_OUT_BOTTOM Local $hGUI = GUICreate("", 400, 100, @DesktopWidth - 401, @DesktopHeight - 101, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hGUI, "int", 800, "long", $SlideType3) GUISetState(@SW_SHOWNA, $hGUI) Func Retract() DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hGUI, "int", 600, "long", $SlideType4) Sleep(2000) Exit EndFunc While 1 Sleep(100) WEnd Edited July 26, 2014 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Malkey Posted July 27, 2014 Share Posted July 27, 2014 See "_WinAPI_AnimateWindow" function in help file for parameters, and in the include file "WinAPISys.au3" for the working DllCall(). Link to comment Share on other sites More sharing options...
careca Posted July 27, 2014 Author Share Posted July 27, 2014 (edited) Well, im sorry to say, but that doesn't help, the call is the same as mine, and the results are the same, the issue in not in the parameters of the call, it's something else, i was hoping someone has gone thru this issue that could pinpoint what could be the cause. EDIT: _WinAPI_GetLastError() says 1400. As in MSDN: ERROR_INVALID_WINDOW_HANDLE Invalid window handle.1400 (0x578) So how come it's valid going up, and not valid to go down? Edited July 27, 2014 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
BrewManNH Posted July 27, 2014 Share Posted July 27, 2014 Perhaps your variables aren't global in your real script? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
careca Posted July 27, 2014 Author Share Posted July 27, 2014 That's right, they're local, think that has to do with it? then if so, how come the first call works? Will look into that when i get to the pc. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
BrewManNH Posted July 28, 2014 Share Posted July 28, 2014 Considering I have no idea what your real script looks like, I'd have absolutely no idea where the problem might be. I was thinking that your real script has the gui creation inside a function, and you're using another function to retract the window. But it was a guess, nothing more. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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