Click here to Skip to main content
16,022,417 members

Comments by davepreston (Top 3 by date)

davepreston 22-May-24 11:42am View    
I think what's happening is as soon as I run my app it is the foreground even if it has no visible window so it doesn't appear to do anything. If I run it when coding it resizes the Visual Studio window. As Dave said, there is a Z order to windows, but not a last opened but that's a red herring, it was bad wording on my part.
I run it having just opened the target app so shouldn't be a problem.
I also tried the GetDesktopWindow option but no luck.
davepreston 22-May-24 10:42am View    
Probably bad terminology on my part. It's odd that in all the searching I did I never found that reference. Scanning it, it looks as though it refers to windows within your own application, whereas what I want to do is move and resize a window already on the desktop from my command line app?
davepreston 22-May-24 9:06am View    
My question does explain that I have got it working exactly as you describe. What I would like to achieve is make it work with whatever application was last opened, so presumably on top and active e.g Explorer, Chrome etc.