News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Recent posts

#81
User contributions / Github-kuba miniz for Pelles C
Last post by John Z - November 25, 2025, 12:01:37 PM
11/25/2025

This is GitHub-kuba miniz 3.0.2 with minor modifications for Pelles C

Minor changes to compile in Pelles C Version 13 (and probably earlier versions)
All changes annotated with //ZZ

Build Notes:
If file time&date/functions are NOT needed define MINIZ_NO_TIME
If time&date is wanted then the /Go (Define compatibility names) option in Pelles
must be used.

Many build warnings - no errors of course.  Tested zip a file, unzip a file, also
a miniz zipped file was able to be unzipped with Windows itself as well as 7z.
Tested unzip to memory as well.

Did not try using any Pelles C optimizations.  Suggest using
#pragma optimize( none ) in the three source files if using optimizations elsewhere


Also example usages are included from kuba.

John Z
#82
Work in progress / Re: New resizer discussion
Last post by TimoVJL - November 24, 2025, 02:05:33 PM
Proves, that generic resizer code might be difficult and needs lot of code.
#83
General discussions / Re: smorgasbordet.com/pellesc/...
Last post by Cbeginner - November 23, 2025, 10:34:53 PM
Quote from: John Z on November 23, 2025, 10:21:13 PMShould be able to get it from here:


https://web.archive.org/web/20250801041730/smorgasbordet.com/pellesc/ 

Click on Download as usual.

John Z

Yes thank you!
Installed and working now  :D
#84
General discussions / Re: smorgasbordet.com/pellesc/...
Last post by John Z - November 23, 2025, 10:21:13 PM
Should be able to get it from here:


https://web.archive.org/web/20250801041730/smorgasbordet.com/pellesc/ 

Click on Download as usual.

John Z
#85
General discussions / Re: smorgasbordet.com/pellesc/...
Last post by MrBcx - November 23, 2025, 10:09:31 PM
Quote from: Cbeginner on November 23, 2025, 05:49:24 PMHopefully the domain get's renewed soon but could a moderator post V13 to the downloads section?

I was about to install on a new PC but I guess not right now  :'(


Unfortunately, Moderators do not have enough site permissions to upload a file of that size:

Your file is too large. The maximum attachment size allowed is 1,024 KB.

#86
General discussions / Re: smorgasbordet.com/pellesc/...
Last post by Vortex - November 23, 2025, 06:02:45 PM
Hello,

I can confirm the issue. http://smorgasbordet.com/pellesc/ is not available at the moment.
#87
General discussions / smorgasbordet.com/pellesc/ has...
Last post by Cbeginner - November 23, 2025, 05:49:24 PM
Hopefully the domain get's renewed soon but could a moderator post V13 to the downloads section?

I was about to install on a new PC but I guess not right now  :'(
#88
Work in progress / Re: ChatGPT examples
Last post by Quin - November 23, 2025, 12:25:46 PM
Very nice, Vortex!
#89
Work in progress / Re: ChatGPT examples
Last post by Vortex - November 23, 2025, 10:53:24 AM
Retrieving boot time with COM \ ( Component Oject Modeling ) :

/*
    boot_time_wmi_local.c
    Display Windows boot time and uptime (local time)
    Works with Pelles C, uses WMI (Win32_OperatingSystem.LastBootUpTime)
*/

#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <stdio.h>
#include <wbemidl.h>
#include <wchar.h>

#pragma comment(lib, "wbemuuid.lib")

// Convert WMI "yyyymmddHHMMSS.mmmmmmsUUU" to SYSTEMTIME (local)
BOOL ParseWmiTime(LPCWSTR wmiTime, SYSTEMTIME *st)
{
    if (!wmiTime || wcslen(wmiTime) < 14)
        return FALSE;

    swscanf(wmiTime, L"%4hu%2hu%2hu%2hu%2hu%2hu",
            &st->wYear, &st->wMonth, &st->wDay,
            &st->wHour, &st->wMinute, &st->wSecond);
    st->wMilliseconds = 0;
    return TRUE;
}

int main(void)
{
    HRESULT hr;
    IWbemLocator *pLoc = NULL;
    IWbemServices *pSvc = NULL;
    IEnumWbemClassObject *pEnum = NULL;
    IWbemClassObject *pObj = NULL;
    ULONG ret;
    VARIANT vt;
    SYSTEMTIME stBoot;
    FILETIME ftBoot, ftNow;
    ULONGLONG boot64, now64, diff64, diffSec;
    ULONGLONG days, hrs, mins, secs;

    // Initialize COM
    hr = CoInitializeEx(0, COINIT_MULTITHREADED);
    if (FAILED(hr)) {
        printf("CoInitializeEx failed: 0x%lx\n", hr);
        return 1;
    }

    // Initialize COM security
    hr = CoInitializeSecurity(NULL, -1, NULL, NULL,
                              RPC_C_AUTHN_LEVEL_DEFAULT,
                              RPC_C_IMP_LEVEL_IMPERSONATE,
                              NULL, EOAC_NONE, NULL);
    if (FAILED(hr)) {
        printf("CoInitializeSecurity failed: 0x%lx\n", hr);
        CoUninitialize();
        return 1;
    }

    // Create WMI locator
    hr = CoCreateInstance(&CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER,
                          &IID_IWbemLocator, (LPVOID *)&pLoc);
    if (FAILED(hr)) {
        printf("CoCreateInstance failed: 0x%lx\n", hr);
        CoUninitialize();
        return 1;
    }

    // Connect to ROOT\CIMV2
    hr = pLoc->lpVtbl->ConnectServer(pLoc,
                                    L"ROOT\\CIMV2",
                                    NULL, NULL, 0, 0, 0, 0,
                                    &pSvc);
    if (FAILED(hr)) {
        printf("ConnectServer failed: 0x%lx\n", hr);
        pLoc->lpVtbl->Release(pLoc);
        CoUninitialize();
        return 1;
    }

    // Set proxy security levels (cast to IUnknown for Pelles C)
    hr = CoSetProxyBlanket((IUnknown *)pSvc,
                          RPC_C_AUTHN_WINNT,
                          RPC_C_AUTHZ_NONE,
                          NULL,
                          RPC_C_AUTHN_LEVEL_CALL,
                          RPC_C_IMP_LEVEL_IMPERSONATE,
                          NULL,
                          EOAC_NONE);
    if (FAILED(hr)) {
        printf("CoSetProxyBlanket failed: 0x%lx\n", hr);
        pSvc->lpVtbl->Release(pSvc);
        pLoc->lpVtbl->Release(pLoc);
        CoUninitialize();
        return 1;
    }

    // Query LastBootUpTime
    hr = pSvc->lpVtbl->ExecQuery(pSvc, L"WQL",
                                L"SELECT LastBootUpTime FROM Win32_OperatingSystem",
                                WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
                                NULL, &pEnum);
    if (FAILED(hr)) {
        printf("ExecQuery failed: 0x%lx\n", hr);
        pSvc->lpVtbl->Release(pSvc);
        pLoc->lpVtbl->Release(pLoc);
        CoUninitialize();
        return 1;
    }

    // Read result
    hr = pEnum->lpVtbl->Next(pEnum, WBEM_INFINITE, 1, &pObj, &ret);
    if (SUCCEEDED(hr) && ret) {
        VariantInit(&vt);
        hr = pObj->lpVtbl->Get(pObj, L"LastBootUpTime", 0, &vt, 0, 0);
        if (SUCCEEDED(hr) && vt.vt == VT_BSTR) {
            if (ParseWmiTime(vt.bstrVal, &stBoot)) {
                SystemTimeToFileTime(&stBoot, &ftBoot);

                printf("Boot time (local): %04u-%02u-%02u %02u:%02u:%02u\n",
                      stBoot.wYear, stBoot.wMonth, stBoot.wDay,
                      stBoot.wHour, stBoot.wMinute, stBoot.wSecond);

                // Compute uptime
                GetSystemTimeAsFileTime(&ftNow);
                boot64 = ((ULONGLONG)ftBoot.dwHighDateTime << 32) | ftBoot.dwLowDateTime;
                now64  = ((ULONGLONG)ftNow.dwHighDateTime << 32) | ftNow.dwLowDateTime;

                if (now64 > boot64) {
                    diff64 = now64 - boot64;
                    diffSec = diff64 / 10000000ULL;
                    days = diffSec / 86400;
                    hrs  = (diffSec % 86400) / 3600;
                    mins = (diffSec % 3600) / 60;
                    secs = diffSec % 60;

                    printf("Uptime: %llu days, %llu hours, %llu minutes, %llu seconds\n",
                          days, hrs, mins, secs);
                }
            } else {
                printf("Could not parse WMI time.\n");
            }
        } else {
            printf("Failed to read LastBootUpTime property.\n");
        }
        VariantClear(&vt);
        pObj->lpVtbl->Release(pObj);
    }

    // Cleanup
    pEnum->lpVtbl->Release(pEnum);
    pSvc->lpVtbl->Release(pSvc);
    pLoc->lpVtbl->Release(pLoc);
    CoUninitialize();
    return 0;
}
#90
Work in progress / Re: New resizer discussion
Last post by Vortex - November 23, 2025, 10:50:39 AM
Hi John,

Please don't worry, everything is OK. Keep up the good work.