HeaderPane
Main
Hide
Share Link
Print

RegisterApp

Registers an application with SftBox/DLL.

C

BOOL WINAPI SftBox_RegisterApp(HINSTANCE hInst);

C++

static BOOL CSftBox::RegisterApp();

Parameters

hInst

The instance handle of the application which will use SftBox/DLL controls. CSftBox::RegisterApp uses the instance handle of the MFC application (AfxGetInstanceHandle).

Returns

The return value is TRUE if SftBox/DLL has been initialized for this application, otherwise FALSE is returned.

Comments

The RegisterApp function registers an application with SftBox/DLL.

This call initializes SftBox/DLL for the calling application and the calling thread. When the static library is used, it also registers all required window classes. This call has to be made before any combo box controls are created.

If an application has multiple threads which create controls, each thread must also call RegisterApp to initialize support for SftBox/DLL. If only the main thread of a process creates controls (even if other threads communicate with the control), no additional calls to RegisterApp are required. At most 64 threads can be registered at the same time; RegisterApp returns FALSE if this limit is exceeded.

An application should call UnregisterApp once the application no longer uses SftBox/DLL controls. In addition, each thread that called RegisterApp during initialization must call UnregisterApp before the thread terminates.

Examples

C View entire sample code

/*                              WinMain                               */
/**********************************************************************/

int PASCAL WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpszCmdLine, int cmdShow)
{
    g_hInst = hinst;

    SftDarkMode_Init();                 /* Dark mode support */
    SftBox_RegisterApp(hinst);          /* Register with SftBox/DLL */

    DialogBox(g_hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDialogProc);

    SftBox_UnregisterApp(hinst);        /* Unregister from SftBox/DLL */

    return 0;
}

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.