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 Vortex - December 06, 2025, 09:46:31 PM
Reading Timo's and John's messages, here is the new version :

include    EnumWnd.inc

.data

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

.data?

buffer      db 256 dup(?)
buffer2    db 256 dup(?)

.code

start:

    invoke  EnumWindows,ADDR EnumWndProc,0
    invoke  ExitProcess,0

EnumWndProc PROC hwnd:DWORD,lParam:DWORD

    invoke  GetWindowText,hwnd,ADDR buffer,255
    mov    edx,OFFSET msg
    test    eax,eax
    cmovz  edx,DWORD PTR [ZeroPtr]
    invoke  printf,edx,ADDR buffer
    mov    eax,1
    ret

EnumWndProc ENDP

END start
#32
Work in progress / Re: New resizer discussion
Last post by John Z - December 06, 2025, 03:15:30 PM
Here is an early look at adding 'Auto Font Sizing' to the resizer library.

Still has some, maybe many, issues to work out but is a working preview.  Just don't know how much interest there would be in having this feature.  Is nice for visually impaired as full screen window has big text.

To test click the "Toggle Auto Font" button in lower right, then drag the window larger or smaller to see effects. Toggling 'Button resize' will also inhibit font resize for buttons since the button is not larger.

A few obvious issues: not working with custom control, Owner Draw sometimes double vision, restore of original is not yet implemented well.  Not implemented globally yet so not for the child windows in this tester.

Just the tester at this point - no sources

John Z

Still just same three functions -
#33
Tips & tricks / Re: Testing Console
Last post by John Z - December 06, 2025, 11:00:38 AM
Quote from: TimoVJL on December 04, 2025, 10:35:47 PMWindows 11 Home 25H2


I think you are now ahead of most of the rest, including me....  good hunting!

John Z
#34
Assembly discussions / Re: Enumerating top level wind...
Last post by John Z - December 06, 2025, 10:58:46 AM
A fun fact - the maximum 'displayable' text in the title bar is 255 characters so while that length would be unusual just 64 characters might only be 1/4th of the text.  Also the text can be much longer than 255 but only 255 are displayed. ;D


John Z
#35
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
@@:
#36
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
#37
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.
#38
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

#39
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
#40
Expert questions / Re: Controls 'extra data'
Last post by Robert - December 05, 2025, 03:14:17 AM
Hi John Z:

Thanks. Got it.