News:

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

Main Menu

Recent posts

#61
Assembly discussions / Re: Enumerating top level wind...
Last post by Vortex - December 03, 2025, 09:23:22 PM
Hi Timo,

Thanks, I will take care of it.
#62
Expert questions / Re: Controls 'extra data'
Last post by John Z - December 03, 2025, 02:14:31 PM
Yes, that is where if figured out the extra magic.  It looks like it is only incorporated into the subclassed control to me.  However I'm not well versed in that so I'm not positive it actually exists without subclassing and therefore is not available to use without subclassing.

I've never needed to subclass a control so I'm quite the novice.

John Z
#63
Expert questions / Re: Controls 'extra data'
Last post by TimoVJL - December 03, 2025, 01:40:32 PM
Just check Pelle's resizer.
#64
Expert questions / Controls 'extra data'
Last post by John Z - December 03, 2025, 01:37:34 PM
I see the need to add a few more options to my resizing effort.  Before adding a second configuration array or methods, I would like to know if the 'extra data' inserted by the IDE dialog designer is accessible without subclassing, or is it only incorporated in a subclassed control?

To add more flexibility to the resizer Lib is the extra data available without subclassing?

Example:
CONTROL "VR-HN", 4002, "Button", WS_TABSTOP, 28, 28, 50, 14 { 0xC0DE, 0x0001, 0x0008 } ->{ Magic# , version, code  }

I know none == 00, Resize == 10, Move == 11 (binary)
and Vertical is in upper bits XX-- while horizontal is in lower bits --XX

so 0x0008 means vertical is resize, horizonal is none i.e. 1000 (binary)
   0x000F means vertical is move, and horizontal is move i.e. 1111

Is there a way to access this when it exists? Resize 'none, none' means there is no magic.  :)

John Z
#65
Tips & tricks / Testing Console
Last post by TimoVJL - December 03, 2025, 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);
}
#66
Assembly discussions / Re: Enumerating top level wind...
Last post by TimoVJL - December 03, 2025, 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.
#67
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
#68
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.
#69
General discussion / Re: Pellesc site down?
Last post by italofutura - December 01, 2025, 03:06:56 PM
Thank you John Z
#70
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