Swift Posted March 27, 2008 Share Posted March 27, 2008 I have a problem with IE7, it doesn't like to close when I hit the X, it slowly closes, like after a minute it will close. (No, im not changing browsers) I cannot use If ProcessExists() because the process is still there while it's taking its time closing...Is there something I can use like get the handle and stuff, and wait for the X to be hit, and then if it's hit ProcessClose()? Link to comment Share on other sites More sharing options...
weaponx Posted March 27, 2008 Share Posted March 27, 2008 Did you actually try to run ProcessClose() on the browser to see if it was any faster? Link to comment Share on other sites More sharing options...
Swift Posted March 27, 2008 Author Share Posted March 27, 2008 Did you actually try to run ProcessClose() on the browser to see if it was any faster?Yeah, processClose() closed it instantly, pressing the x it takes about 1 minute... Link to comment Share on other sites More sharing options...
weaponx Posted March 27, 2008 Share Posted March 27, 2008 Yeah, processClose() closed it instantly, pressing the x it takes about 1 minute...This sounds like maybe you have a large cache that may be set to empty on exit. Link to comment Share on other sites More sharing options...
Swift Posted March 27, 2008 Author Share Posted March 27, 2008 This sounds like maybe you have a large cache that may be set to empty on exit.I have CCleaner run on startup everyday. Link to comment Share on other sites More sharing options...
weaponx Posted March 27, 2008 Share Posted March 27, 2008 It looks like IE7 addons could be the problem, you will have to disable them all and enable them one at a time until you find the problematic one:http://www.microsoft.com/communities/newsg...xplorer.general Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 27, 2008 Share Posted March 27, 2008 You could hook the window messages and wait for WM_CLOSE. Link to comment Share on other sites More sharing options...
Swift Posted March 27, 2008 Author Share Posted March 27, 2008 Hmm..Now with no add-ons whatsoever, it takes about 10 seconds...I think im better off just doing what RichardRobertson said.. How exactly would I 'hook' the window messages? Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 27, 2008 Share Posted March 27, 2008 I'm afraid I don't know how to perform hooks. I'm sure that if you search Microsoft long enough, you'll find it. Link to comment Share on other sites More sharing options...
Swift Posted March 27, 2008 Author Share Posted March 27, 2008 I'm afraid I don't know how to perform hooks. I'm sure that if you search Microsoft long enough, you'll find it.Hmm, ok thanks! Link to comment Share on other sites More sharing options...
FreeFry Posted March 27, 2008 Share Posted March 27, 2008 From my experience you can't hook into other windows "Window Procedure"(kind of what GUIGetMsg does for AutoIt created GUIs) without a DLL file, as it requires the Hooks Callback procedure to be in a DLL(so it can get loaded by the external application..) Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 27, 2008 Share Posted March 27, 2008 I know it's possible because Spy++ (part of the Visual Studio package) can read the messages. I didn't think it would require a dll unless you are referring to AutoIt's capabilities. Link to comment Share on other sites More sharing options...
FreeFry Posted March 27, 2008 Share Posted March 27, 2008 (edited) I know it's possible because Spy++ (part of the Visual Studio package) can read the messages. I didn't think it would require a dll unless you are referring to AutoIt's capabilities. hMod [in] Handle to the DLL containing the hook procedure pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the code associated with the current process.Source: http://msdn2.microsoft.com/en-us/library/m...990(VS.85).aspx The only hooks that you can make that doesn't require a dll(as far as my smurfing has proved me that is) is the low level keyboard and mouse hooks, saddly. :/ Edit: btw. if you want a good(if not better) alternative to Spy++, check out Winspector: http://www.windows-spy.com/ Edited March 27, 2008 by FreeFry Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 28, 2008 Share Posted March 28, 2008 That's really stupid. Just goes to show why Microsoft programs are resource hogs. And no, I don't need Spy++ to begin with. I just know it can intercept the messages. Link to comment Share on other sites More sharing options...
Swift Posted March 28, 2008 Author Share Posted March 28, 2008 That's really stupid. Just goes to show why Microsoft programs are resource hogs.And no, I don't need Spy++ to begin with. I just know it can intercept the messages.I think im just going to have a hotkey...its getting way too deep.. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 28, 2008 Moderators Share Posted March 28, 2008 Source: http://msdn2.microsoft.com/en-us/library/m...990(VS.85).aspxThe only hooks that you can make that doesn't require a dll(as far as my smurfing has proved me that is) is the low level keyboard and mouse hooks, saddly. :/Edit:btw. if you want a good(if not better) alternative to Spy++, check out Winspector: http://www.windows-spy.com/The link you provided there (MSDN2), I would personnally look at WH_GETMESSAGE, and use a method that you used before: http://www.autoitscript.com/forum/index.ph...st&p=493478 (Don't know how you expect to do anything without a native windows dll/api call anyway)Or even look Siao's (Windowdestroyed) http://www.autoitscript.com/forum/index.ph...c=56536&hl= Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Swift Posted March 28, 2008 Author Share Posted March 28, 2008 The link you provided there (MSDN2), I would personnally look at WH_GETMESSAGE, and use a method that you used before: http://www.autoitscript.com/forum/index.ph...st&p=493478 (Don't know how you expect to do anything without a native windows dll/api call anyway)Or even look Siao's (Windowdestroyed) http://www.autoitscript.com/forum/index.ph...c=56536&hl=Thanks Smoke_N, I'll check those links out. Link to comment Share on other sites More sharing options...
FreeFry Posted March 28, 2008 Share Posted March 28, 2008 The link you provided there (MSDN2), I would personnally look at WH_GETMESSAGE, and use a method that you used before: http://www.autoitscript.com/forum/index.ph...st&p=493478 (Don't know how you expect to do anything without a native windows dll/api call anyway)Or even look Siao's (Windowdestroyed) http://www.autoitscript.com/forum/index.ph...c=56536&hl=Can you make that hook on a application you're not 'owning', without a dll? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 28, 2008 Moderators Share Posted March 28, 2008 Can you make that hook on a application you're not 'owning', without a dll? What are you talking about? What app are you "owning"? I think you are reading this SetWindowsHookEx can be used to inject a DLL into another process. A 32-bit DLL cannot be injected into a 64-bit process, and a 64-bit DLL cannot be injected into a 32-bit process. If an application requires the use of hooks in other processes, it is required that a 32-bit application call SetWindowsHookEx to inject a 32-bit DLL into 32-bit processes, and a 64-bit application call SetWindowsHookEx to inject a 64-bit DLL into 64-bit processes. The 32-bit and 64-bit DLLs must have different names.An error may occur if the hMod parameter is NULL and the dwThreadId parameter is zero or specifies the identifier of a thread created by another process.Calling the CallNextHookEx function to chain to the next hook procedure is optional, but it is highly recommended; otherwise, other applications that have installed hooks will not receive hook notifications and may behave incorrectly as a result. You should call CallNextHookEx unless you absolutely need to prevent the notification from being seen by other applications.completely wrong.Run Siao's code to get a better idea... There's no DLL injecting there, and he doesn't own any app/process other than the one he launched himself. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
FreeFry Posted March 28, 2008 Share Posted March 28, 2008 What are you talking about? What app are you "owning"? I think you are reading this completely wrong.Run Siao's code to get a better idea... There's no DLL injecting there, and he doesn't own any app/process other than the one he launched himself.Oh, I see now. I just glanced at Siaos code, and I just saw GUICreate and assumed he was hooking into his own window. sozWhat I meant was because you said you'd look at WH_GETMESSAGE instead, and that was what I where asking, if you can make that hook without a dll on a window that the autoit script doesn't "own". 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