News:

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

Main Menu

Recent posts

#31
Assembly discussions / Re: Enumerating top level wind...
Last post by TimoVJL - December 06, 2025, 04:32:20 AM
More fun, eliminate wsprintf and buffer2
    invoke  GetWindowText,hwnd,ADDR buffer,64
    cmp     eax,0
    je      @f
    mov     WORD PTR[buffer+eax], 0A0Dh
    add     eax, 2
    invoke  WriteFile, hStdOut, ADDR buffer, eax, 0, 0
@@:
#32
Assembly discussions / Re: Enumerating top level wind...
Last post by Vortex - December 05, 2025, 08:58:52 PM
Hi Timo,

Here is the new version eliminating the extra branching :

include     EnumWnd.inc

.data

f1          db '%s',13,10,0
ZeroVal     dd 0
ZeroPtr     dd OFFSET ZeroVal

.data?

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

.code

start:

    invoke  GetStdHandle, STD_OUTPUT_HANDLE
    mov     hStdOut,eax
    invoke  EnumWindows,ADDR EnumWndProc,0
    invoke  ExitProcess,0
   

EnumWndProc PROC USES ebx hwnd:DWORD,lParam:DWORD

    mov     ebx,OFFSET buffer2
    invoke  GetWindowText,hwnd,ADDR buffer,64
    invoke  wsprintf,ebx,ADDR f1,ADDR buffer
    cmp     eax,2
    cmovz   ebx,DWORD PTR [ZeroPtr]
    invoke  WriteFile,hStdOut,ebx,eax,0,0
    mov     eax,1
    ret

EnumWndProc ENDP

END start
#33
Tips & tricks / Re: Testing Console
Last post by TimoVJL - December 05, 2025, 10:46:12 AM
Those Windows console variations are interesting.
It seems, that they don't have normal message loop for user.
A console window handle isn't real windows handle at all.

That test is stupid, as it don't handle any errors, like empty window handle.
#34
Tips & tricks / Re: Testing Console
Last post by Vortex - December 05, 2025, 09:48:19 AM
Hi Timo,

Here is my report. Operating system at work : Windows 11 2024 H2

D:\PellesC\ConsoleTest>ConsoleTest.exe
hConWnd 00000000000708E8h
CTitle: Administrator: C:\Windows\System32\cmd.exe - ConsoleTest.exe
WTitle:
hWnd 0000000000010174h
WndProc 0000000000000000h
WndProc 0000000000000000h

#35
Assembly discussions / Re: Enumerating top level wind...
Last post by TimoVJL - December 05, 2025, 09:24:58 AM
I was after something like thisinclude     EnumWnd.inc
includelib user32.lib

STD_OUTPUT_HANDLE equ -11

GetStdHandle PROTO :DWORD
WriteFile PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD

.data

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

.data?

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

.code

start:
    invoke  GetStdHandle, STD_OUTPUT_HANDLE
    mov     hStdOut, eax
    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
    cmp     eax,2
    je      @f
invoke  WriteFile, hStdOut, ADDR buffer2, eax, 0, 0
@@:
    mov     eax,1
    ret

EnumWndProc ENDP

END start
#36
Expert questions / Re: Controls 'extra data'
Last post by Robert - December 05, 2025, 03:14:17 AM
Hi John Z:

Thanks. Got it.
#37
User contributions / Re: Simple resizer Library
Last post by Robert - December 05, 2025, 03:10:50 AM
Hi John Z:

Thank you. The demo will be very helpful for those of us trying to understand how the library is implemented.

For me, the demo is absolutely essential. Without it, I couldn't even begin.
#38
Beginner questions / Re: Different results, Debug v...
Last post by PhilG57 - December 05, 2025, 12:35:52 AM
Thanks. No debug interface demo add-on installed.  It seems that setting breakpoints and poking around at a breakpoint is what is causing problems.  I'll keep playing with it.
#39
Tips & tricks / Re: Testing Console
Last post by TimoVJL - December 04, 2025, 10:35:47 PM
Windows 11 Home 25H2
#40
Tips & tricks / Re: Testing Console
Last post by Vortex - December 04, 2025, 10:06:32 PM
Hi Timo,

What is the exact version of your Windows 11 installation ? For example, is it Windows 11 2024 H2 ?