How to program a ONE TIME event

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello Everyone:

    I need to know if there is a way of programming a ONE TIME event in a Windows CF2.5 app.

    I know how to program a one time event that repeats each time the app is opened. What I need to learn, is how to program a FOREVER ONE TIME event. Do I explain?

    For example, I open the app and hit a button, and the background paints in a random color (let's say green). Then, if a close the app and reopen it, there is no color choosing button and the background is still green. If the user shuts down Windows and opens the app again in a week, the background is still green and there is no color choosing button.

    Please let me know if I explained myself and if this is possible.

    Thanks a lot!

  • You could use a global value for this.

    If global value = 0, open background color selection. Then after the color has been chosen, set the global value to anything other than 0.
    Then the next time the app is opened, the global value won't be 0 and the event won't start.

    Oh and don't forget to save the global value after changing it. Haven't quite gotten the hang of this yet myself but you're supposed to be able to do this with the ini object.

  • or use an encrypted INI, write to the registry, write the preference to serverside using a unique hardware ID... plenty of available options. Just depends how fierce you want to protect this value.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Sure, attached.

    This will check on first run if the user has the INI created. It then sets an MD5 stamp based on the users 'user directory' along with a string, you can change this string to something more unique for yourself. In this example it is "123456789" you can change it to anything of almost any length too.

    After the first run, restart the application to see it detects it is not the first run and the strings compare.

    Close the app, try modifying the INI string, relaunch the app and it will detect it has been modified.

    Note: You will need the Global Value 'switch' in there. If not, it will parse all the following events after creating the INI file and setting the initial data.

    Files

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • You need to ensure you have the latest beta installed which comes with the unicode version of the File Object...

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

    Edited once, last by Danny (December 22, 2016 at 2:09 PM).

  • You can implement a "one-time event" in a Windows CF 2.5 application by storing the state using persistent storage, such as the registry or a file. Here’s a brief example in C#:In your form, create a button that changes the background color and hides itself once clicked. On initialization, check the registry to see if the color has already been changed. If it has, set the background color accordingly and hide the button.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!