windows::CApplication


All platform-dependent classes have been moved to Platform Package in release 10.0.0.

This class is available on Windows platform only

Corresponding class for Linux platform is here.

Corresponding class for Android platform is here.

Implementation of application for Windows platform.

You can find more information in comments below. Overrided methods can be found in corresponding base interface.

class CApplication :public virtual IApplication
    {
    public:
        // Since 7.0.0 
        void(*OnDestroyLastWindow)(); // Event called right after destroying the last window in application windows list 
    
        int getWindowCount() override;
        IWindow *getWindow(const int index) override;
        IForm *getWindowForm(const int index) override;
        IForm *getMainForm() override;
        IKeyboard *getKeyboard() override;
        IMouse *getMouse() override;
        ITranslate *getTranslate() override;
        IStyles *getStyles() override;
        IScreen *getScreen() override;
        ISystem *getSystem() override;
        IPicture *getPicture() override;
        IDialogs *getDialogs() override;
        IFileSystem *getFileSystem() override;
        const String &getApplicationFileName() const override;
        const String &getApplicationDirectory() const override;
        // Since 5.0.0 
        INetwork *getNetwork() override;
        // Since 7.0.0 
        const String &getModuleFileName() const override;
        const String &getModuleDirectory() const override;
        // Since 8.0.0 
        IEditor *getEditor() override; // Return nullptr 
        // Since 9.0.0 
        bool isUseDialogBoxes() override;
        bool isGlobal() override; // Return true 
    
        bool setMainForm(IForm *value) override;
    
        int Run() override;
        void ProcessMessages() override;
        void RepaintAll() override;
        IApplicationService *QueryService() override;
        // Since 5.0.0 
        IThread *CreateThread(const bool paused, IThreadListener *listener) override;
    
        CApplication();
        virtual ~CApplication();
    
        CLOSE_ACTION getCloseAction(IWindow *window); // Return default close action for specified window. caFree by default. But if handle belongs to form and this form isn't same as main form, than close action is hide 
        void *getPlatformData(); //  Return pointer to PT_APPLICATION structure holding platform dependent data of the application 
    };
    
    extern const String DefaultWindowClassName; // Specified default window class name. Used in window class implementation

The usage is quite simple.

void main()
    {
        CMyForm *form; // Your form(s) 
        CApplication app; // Create application 
        app.CreateForm(&form); // Create form(s) 
        app.Run(); // Run application 
    }

or

int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
        CMyForm *form; // Your form(s) 
        CApplication app; // Create application 
        app.CreateForm(&form); // Create form(s) 
        return app.Run(); // Run application 
    }
Namespace: nitisa::standard::windows
Include: Standard/Platform/Windows/Application.h