Author Topic: Canary Bay Visual Studio C++ 64-bit source code (WV2B)  (Read 3877 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Canary Bay Visual Studio C++ 64-bit source code (WV2B)
« on: June 29, 2020, 01:50:38 pm »
Voici le lien pour télécharger le projet complet au format Visual Studio 2019.
Here is the link to download the full project written with Visual Studio 2019.
WV2B source code

Attention, ce code est modifié en profondeur pour permettre son utilisation en mode autonome ou sous le contrôle d'une autre application.
Warning, this code has been heavily changed to run as a standalone or under control of another application.

Le code peut être compilé avec la version gratuite de Visual Studio (Community version).
You can compile the code with the free Visual Studio Community version.

LoadConfig est la fonction qui permet de lire les paramètres de lancement de WV2.B.exe sous le contrôle d'une autre application.
LoadConfig is the config function to read the starting parameters of WV2B.exe when running under control of another application.
Code: [Select]
BOOL LoadConfig(OUT DWORD &ExStyle, OUT DWORD &Style, OUT HWND &hParent, OUT LONG &x, OUT LONG &y, OUT long &w, OUT LONG &h) {
    BOOL bRet = FALSE;
    DWORD dwBytes = 0;
    SETBIN cfg = { 0 };
    ExStyle = 0; Style = 0; hParent = 0;
    x = 0; y = 0; w = 0; h = 0;
    if (FileExist(EXEconfig())) {
        if (FileSize(EXEconfig()) == sizeof(cfg)) {
            HANDLE hFile = CreateFile(EXEconfig(), GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
            if (hFile != INVALID_HANDLE_VALUE) {
                if (ReadFile(hFile, &cfg, sizeof(cfg), &dwBytes, NULL)) {
                    ExStyle = cfg.ExStyle; Style = cfg.Style; hParent = cfg.hParent;
                    x = cfg.x; y = cfg.y; w = cfg.w; h = cfg.h;
                    BrowserParent(hParent);
                    BrowserOnTabClose(cfg.onTABclose);
                    BrowserUseThisURL(cfg.defaultURL);
                    BrowserMsg();
                    bRet = TRUE;
                }
                CloseHandle(hFile);
                DeleteFile(EXEconfig());
            }
        }
    }
    return bRet;
}

La taille de la structure SETBIN doit être absolument identique dans l'application maître et dans WV2B.exe.
The SETBIN structure size must be exactly the same in the leading and the slave application.
Code: [Select]
struct SETBIN {
    DWORD ExStyle;
    DWORD Style;
    HWND hParent;
    LONG x;
    LONG y;
    LONG w;
    LONG h;
    WCHAR onTABclose[MAX_PATH];
    WCHAR defaultURL[MAX_PATH];
};

Lorsque WV2B.exe fonctionne en tant qu'application indépendante, son interface est skinnée avec un thème WinLIFT spécifique, alors que sous contrôle d'une autre application l'abscence de la zone "Non-Client-Area" vous permet de lui donner l'apparence de votre choix.
When WV2B.exe is running in standalone mode, it uses a Skinned GUI based on a WinLIFT theme, while under control of another application the lack of NC_AREA allows you to give it the look of your choice.

WV2B.exe, étant une application 64-bit native, la vitesse d'exécution du code Direct 3D est indépendante du conteneur, même dans une application p-code Windev.
WV2B.exe, being a native 64-bit application, the processing speed of the Direct 3D code is unaffected by the bottle neck of its container, even when used from a Windev p-code window.


Note:
Ce projet représente un travail important, merci de respecter le travail de ceux qui partagent généreusement leur code avec vous.
Une donation, même modeste, est le meilleur moyen de montrer votre reconnaissance et aide à payer le coût de fonctionnement de ce forum.
This project represents an important work, thank you for respecting the work of those who generously share their code with you.
A donation, even small, is the best way to show your appreciation and help pay the cost of running this forum.


« Last Edit: March 18, 2021, 04:16:18 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)