News:

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

Main Menu

Recent posts

#11
Tips & tricks / Testing Console
Last post by TimoVJL - Yesterday at 01:21:48 PM
Just a stupid test:#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma comment(lib, "kernel32.lib")
#pragma comment(lib, "user32.lib")

void __cdecl mainCRTStartup(void)
{
char szTmp[100], szTmp2[100];
HANDLE hConWnd = GetConsoleWindow();
HANDLE hConOut = GetStdHandle(STD_OUTPUT_HANDLE);

int nLen = wsprintf(szTmp, "hConWnd %ph\n", hConWnd);
WriteConsole(hConOut, szTmp, nLen, NULL, 0);
//FlashWindow(hConWnd, TRUE);
GetConsoleTitle(szTmp2, sizeof(szTmp2));
nLen = wsprintf(szTmp, "CTitle: %s\n", szTmp2);
WriteConsole(hConOut, szTmp, nLen, NULL, 0);

GetWindowText(hConWnd, szTmp2, sizeof(szTmp2)); // don't work in Windows 11
nLen = wsprintf(szTmp, "WTitle: %s\n", szTmp2);
WriteConsole(hConOut, szTmp, nLen, NULL, 0);

HWND hWnd = FindWindow(NULL, szTmp2);
nLen = wsprintf(szTmp, "hWnd %ph\n", hWnd);
WriteConsole(hConOut, szTmp, nLen, NULL, 0);

LONG_PTR lp = GetWindowLongPtr(hConWnd, GWLP_WNDPROC);
nLen = wsprintf(szTmp, "WndProc %ph\n", (void*)lp);
WriteConsole(hConOut, szTmp, nLen, NULL, 0);

lp = GetWindowLongPtr(hWnd, GWLP_WNDPROC);
nLen = wsprintf(szTmp, "WndProc %ph\n", (void*)lp);
WriteConsole(hConOut, szTmp, nLen, NULL, 0);

//PostMessage(hConWnd, WM_QUIT, 0, 0); // quit console and program stay running
//SendMessage(hConWnd, WM_QUIT, 0, 0); // do nothing

// stay running
MSG msg;
while(GetMessage(&msg, NULL, 0, 0)) // do nothing
//while(PeekMessage(&msg, NULL, 0, 0, 0)) // end program
{
//nLen = wsprintf("hwnd %ph\n", msg.hwnd);
//WriteConsole(hConOut, szTmp, nLen, NULL, 0);
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
ExitProcess(0);
}
#12
Assembly discussions / Re: Enumerating top level wind...
Last post by TimoVJL - Yesterday at 01:16:10 PM
Empty lines should avoid too.
Also wsprintf give count of chrs to print text, so it can be used too.
WriteFile / WriteConsole works well with wsprintf.
#13
Assembly discussions / Enumerating top level windows
Last post by Vortex - December 02, 2025, 10:00:00 PM
Here is a quick example :

include     EnumWnd.inc

.data

f1          db '%s',13,10,0

.data?

buffer      db 128 dup(?)
buffer2     db 128 dup(?)

.code

start:

    invoke  EnumWindows,ADDR EnumWndProc,0
    invoke  ExitProcess,0
   

EnumWndProc PROC hwnd:DWORD,lParam:DWORD

    invoke  GetWindowText,hwnd,ADDR buffer,64
    invoke  wsprintf,ADDR buffer2,ADDR f1,ADDR buffer
    invoke  StdOut,ADDR buffer2
    mov     eax,1
    ret

EnumWndProc ENDP

END start
#14
Assembly discussions / Re: Assigning a string to a re...
Last post by Vortex - December 01, 2025, 08:43:53 PM
Here is the 64-bit version.
#15
General discussion / Re: Pellesc site down?
Last post by italofutura - December 01, 2025, 03:06:56 PM
Thank you John Z
#16
General discussion / Re: Pellesc site down?
Last post by John Z - December 01, 2025, 02:51:09 PM
Hi italofutura,

Yes down -

However see this post if you need something -

https://forum.pellesc.de/index.php?topic=11679.msg41652#msg41652


John Z
#17
General discussion / Pellesc site down?
Last post by italofutura - December 01, 2025, 02:38:54 PM
The URL I used http://www.smorgasbordet.com/pellesc/

winget can also not install
#18
Feature requests / Re: _chsize_s
Last post by TimoVJL - December 01, 2025, 12:27:56 PM
check  _chsize64() and make a define for it.
#19
Feature requests / Re: RichEdit 4.1
Last post by TimoVJL - December 01, 2025, 12:11:13 PM
Also a "RICHEDIT60W" might be a good option, as there is a free version of dll for downloading.
Some richedit dlls have only some additional COM features.
Windows 10 and 11 have it already ?

#20
Feature requests / _chsize_s
Last post by John Z - December 01, 2025, 12:09:05 PM
Would you consider adding a _chsize_s ?  When compiling the latest miniz I ran across this being used.

I'm also a bit confused about struct __stat64  vs. struct _stat64 (/GX option) miniz uses the double underscore. 

I modified the sources to make miniz compile and work under V13 with a few __POCC__ checks so no show stoppers - just throwing out there -

John Z