Posted by BGoulette in SWF Studio V3 on Jun 10 2008, 01:57 am

I'm probably asking for something that can't be done, but I'll risk it:

Is there anyway to listen for changes in window state or size on an app launched via Shell.execute()? Or better yet, is there a way to open an app (via Shell.execute()) without the min/max or resize buttons?

Essentially, I don't want users being able to change the size of the app that gets launched: the only option should be to close it; if they do try resizing or min/maximizing, it should close.

Can it be done? Thanks for any advice! I've been trying all kinds of unholy combinations of ssCore.Win.setNotify, ssEvents.addEventListener, etc...nothing's working like I need, though :(


Posted by AGo in SWF Studio V3 on Jun 10 2008, 03:44 am


QUOTE: from Stick1337;44608
Is there anyway to listen for changes in window state or size on an app launched via Shell.execute()? Or better yet, is there a way to open an app (via Shell.execute()) without the min/max or resize buttons?

I'm afraid the answer to both of your questions is "yes, BUT"...

... you need to write a plugin for SWF Studio that wraps the WinAPI functions for that. I'm sure (as in I've done it before) you can then remove the window border and system buttons, and I'm pretty sure (as in I assume) you can get details about the visibility status of the other window (normal, maximized, minimized, hidden) as well.


hth


Posted by BGoulette in SWF Studio V3 on Jun 10 2008, 08:51 am

Blecch! :(

I appreciate your input, AGo, but I have no experience writing plugins or even what's required to do so. Any suggestions on where to look for such information?

Regrettably, I wanted to have this done by 11:00 AM EST, though that's looking less and less likely :(

:)

Again, thanks for the insight! I sincerely appreciate it!

Edit: Yeah, I looked at the SDK folder, and I know slightly less than jack about C++ or .NET or anything :(


Posted by northcode in SWF Studio V3 on Jun 10 2008, 09:00 am

You could use the forceChild flag on Shell.execute to launch the application as a child of your own window. This makes it appear to be embedded and gets rid of the border and min/max/close buttons. However, many applications don't "like" this and can behave badly. It's a risk but for some applications it can work and it's a quick fix for you :)


Posted by BGoulette in SWF Studio V3 on Jun 10 2008, 09:09 am


QUOTE: from northcode;44613
You could use the forceChild flag on Shell.execute to launch the application as a child of your own window. This makes it appear to be embedded and gets rid of the border and min/max/close buttons. However, many applications don't "like" this and can behave badly. It's a risk but for some applications it can work and it's a quick fix for you :)

Thanks, Tim: I'd actually tried that at one point, but along with everything else, it also gets rid of the close button, and (of course!) I need that button in order to allow users to exit the launched app!

*sigh* ;) Thanks though!


Posted by northcode in SWF Studio V3 on Jun 10 2008, 09:20 am

You could add your own close button (in Flash) and then use Win.sendMessage or SysTools.killApp to close the application. I admit that it's crude (definitely a "deadline solution") but it will work.


Posted by BGoulette in SWF Studio V3 on Jun 10 2008, 09:29 am


QUOTE: from northcode;44616
You could add your own close button (in Flash) and then use Win.sendMessage or SysTools.killApp to close the application. I admit that it's crude (definitely a "deadline solution") but it will work.

All right, I'm intrigued! This would actually solve a few other problems (I think). But I want to make sure I'm thinking about it properly:

What would I need to do to have this Flash-generated button sit on top of the "embedded" application? I'm assuming that once I get it there, I'll just add the requisite MouseEvent listeners and send killApp commands that way...I'm just not sure what I'd need to do to get the button on top of all of that.

I apologize for being so dense. I'd offer the excuse that I was at work till 2:30 AM EST last night, but I can't say that's necessarily what's wrong with my brain :) Thanks!!!

EDIT: Actually, I tried just embedding the app again, and because of the way I've got it set to close all instances of itself if it can't find the primary (first launched) instance, it keeps closing :( So I don't think embedding it's going to work...though I have a little time to keep trying :)

EDIT the II: I think the reason it's closing is because when the window is first launched, I'm placing its hwnd and pid in an object; with forceChild set to true, I'm assuming it effectively kills that hwnd in the process of making it a child of the main app; then, when my interval looks for the combination of hwnd and pid and doesn't find it open, it kills all instances of the secondary app (including the instance that was forced into being a child of the main app)...

I'm about to go check, but is there any kind of event that can be listened for regarding forceChild? I'm thinking I'm going to run into the same problems I had before as far as listening for events on windows that aren't my main app...