Sign in to follow this  
Guest JeffB

Can someone provide a working example of using a window

Recommended Posts

...with the SDK (C++) and pressing the buttons. I just can't seem to get this to work. It obviously does as there are many programs (Squawk Box) that uses many UI windows. If I can just get ONE working example of entering text, clicking a button (with the *.win) to close the file, I know I can take it from there.Jeff

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I'm using the the DLLEventNotice to capture any button presses, etc. I DO capture the Main menu clicks (such as File->Exit Fly!), but it doesn't appear to capture any my window BUTTON clicks!Also, I can display my own windows by capturing keystrokes. I can get text from a user entering data into an edit text area (using APIGetUIText or something like this...), so I know I'm on the right path.I just cannot press a button and capture it! I know it can be done, would someone simply provide an example of that? How do I capture a button press? If it's through the DLLEventNotice routine, would someone provide enough detail that I can work with?Jeff

Share this post


Link to post
Share on other sites

Hey Jeff-was my email helpful on this? If not, I can answer more questions if you have them... ;-)Cheers,

Share this post


Link to post
Share on other sites

Lefteris,Yes, you're email was very helpful! Thank you! I capture button presses now. However, I can't get the APIOpenFileDialog to close it's window!I can get the file name, etc. but the darn thing will not close!If I add a close window (X), it will close, but I doubt this is the correct way to close. This same dialog box appears when choosing a metar file, and it closes automatically after choosing a metar file.I can't get it to act the same way!I could use APICreateWindow2, which allows me to close using APICloseWindow2, but I'd have to add all the file functions (yech!).Have you any luck using APIOpenFileDialog?Cheers,Jeff

Share this post


Link to post
Share on other sites

Jeff-I've never used APIOpenFileDialog, but from what I see in the SDK, there is a SDLLObject* in the parameters. This means that the dialog must be passing a button press event to that DLLObject whenever the user presses the Open or the Cancel button. (I am thinking aloud here).This also means you could possibly get the window ID from that event, and try to close its corresponding window, which must be the dialog box.Would that work?

Share this post


Link to post
Share on other sites

Thanks Lefteris,I understand what you're saying. There are two APICloseWindow's. The first uses a pointer to the window object, the second uses a window ID. By capturing the window ID and using APICloseWindow2(long window id), I could try and close the APIOpenFileDialog window. Is this what you mean?Cheers,Jeff

Share this post


Link to post
Share on other sites

Jeff-either way - you could try getting the SDLLObject pointer from the DLLEventNotice that gets called with the button push, and see what the window ID for that is. Then, you could close it with CloseWindow() or CloseWindow2(). Try it out.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this