Página 1 de 1

Hwgui Atualizações 07-09-2026

Enviado: 07 Set 2026 09:44
por Itamar M. Lins Jr.
Olá!
Atualização massiva, foco em remover código velho win98 16Bit! Compiladores antigos, padronizando 64Bit, unicode.
Uma serie de bugs encontrado. Passagem de parâmetro errada, e por ai vai.
Por exemlo:
Removed obsolete `ChangeMenu()` function (16-bit Windows API, replaced by `ModifyMenu()`).
- **draw.c**: removed obsolete compiler support for Digital Mars C
(`__DMC__`) and Borland C++ 5.5 (`__BORLANDC__`); removed unnecessary
`HB_LONG_PCOUNT` conditional for 64-bit pointer returns; removed
`#include "missing.h"` header.

Código: Selecionar todos

2026-09-06 03:51 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **cfuncs.c**: fixed Unicode/ANSI string handling in `HWG_RUNCONSOLEAPP`,
    `HWG_CHDIR`, and `HWG_REDIRON` – replaced `hb_parc()` with `HB_PARSTR()`
    for proper TCHAR/Unicode support; added `_wfreopen`/`_wchdir` for
    Unicode builds.
  - **cfuncs.c**: fixed `HWG_STRREV()` buffer overflow – replaced fixed
    512-byte stack buffer with dynamic allocation based on input string length.
  - **cfuncs.c**: simplified conditional includes for better portability.

026-09-06 03:36 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **video.prg**: fixed coordinate handling – removed undefined constants
    `VID_CHARPIX_H` and `VID_CHARPIX_W`, and corrected `nWidth`/`nHeight`
    assignment to use pixel values directly instead of adding offsets.
  - **video.prg**: fixed `Play()` method – removed unnecessary fourth
    parameter (`::oParent:handle`) because `::oMci:Play()` expects only
    `nFrom` and `nTo`.
  - **video.prg**: fixed `Initiate()` method – corrected `SetWindow()` call
    to pass the parent window (`::oParent`) instead of `Self`, and removed
    invalid `::Super:Init()` call (HControl does not have an Init method).

2026-09-06 03:28 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **window.c**: fixed 64-bit compatibility – replaced `GetWindowLong()` and
    `SetWindowLong()` with `GetWindowLongPtr()` and `SetWindowLongPtr()` in
    `HWG_WINDOWSETRESIZE()`.
  - **window.c**: fixed GDI resource leak in `GetFontDialogUnits()` – removed
    `DeleteObject()` call on stock font (ANSI_VAR_FONT) which should not be
    deleted.
  - **window.c**: removed obsolete compiler support – eliminated `__DMC__`
    (Digital Mars C) conditional code and MSVC 6.0 workarounds for
    `CreateMDIWindow()`.
  - **window.c**: replaced Portuguese comments with English comments for
    better maintainability.

2026-09-06 03:11 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **shellapi.c**: fixed Unicode/ANSI string handling – replaced
    `HB_PARSTRDEF()` with `HB_PARSTR()` in `HWG_SELECTFOLDER()` and
    `HWG_SHELLEXECUTE()` for proper TCHAR/Unicode support.
  - **shellapi.c**: fixed `HWG_SHELLEXECUTE()` return value – changed from
    `HB_RETHANDLE()` to `hb_retnint()` because `ShellExecute` returns an
    integer status, not a window handle.
  - **shellapi.c**: added safety check in `HWG_SHELLNOTIFYICON()` to only
    copy tooltip text if the parameter is a valid string.

2026-09-06 03:01 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **richedit.c**: fixed `HWG_RE_SETCHARFORMAT()` superscript/subscript
    parameter handling – corrected to use parameter 11 instead of parameter 9.
  - **richedit.c**: fixed 64-bit safety in `RichSubclassProc()` – replaced
    `hb_vmPushLong()` with `HB_PUSHITEM()` for `wParam` and `lParam`
    parameters.
  - **richedit.c**: added `NULL` checks for memory allocation in
    `HWG_RE_GETTEXTRANGE()` and `HWG_RE_GETLINE()` to prevent crashes.
  - **richedit.c**: changed return values of `HWG_SAVERICHEDIT()` and
    `HWG_LOADRICHEDIT()` from file handle to boolean (`TRUE`/`FALSE`) for
    better Harbour usage.
  - **richedit.c**: removed obsolete compiler support for Digital Mars C
    (`__DMC__`) and unnecessary inclusion of `<prsht.h>`.

2026-09-06 02:56 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **resource.c**: fixed `HWG_FINDRESOURCE()` to support both numeric and
    string resource IDs/types – previously only numeric IDs were handled
    due to incorrect `IS_INTRESOURCE()` usage.
  - **resource.c**: fixed `HWG_LOADRESOURCE()` to return the module handle
    on success instead of returning nothing.
  - **resource.c**: removed unnecessary `#include <prsht.h>` (property sheet
    header not needed for resource operations).

2026-09-06 02:41 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **pager.c**: fixed `HWG_PAGERGETBUTTONSTATE()` parameter handling –
    corrected to read the button index from the second parameter (`hb_parni(2)`)
    instead of incorrectly reading the window handle again.
  - **pager.c**: simplified conditional compilation – removed obsolete
    `#ifndef __GNUC__` fallbacks and use standard `Pager_*` macros directly
    (available in modern MinGW-w64 and MSVC headers).
  - **pager.c**: removed obsolete compiler support for Digital Mars C
    (`__DMC__`) and Watcom C (`__WATCOMC__`).

2026-09-06 02:41 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **nice.c**: fixed 64-bit compatibility – replaced `GetWindowLong()`
    with `GetWindowLongPtr()` in `HWG_GETWINDOWLONG()`.
  - **nice.c**: fixed potential crash when `GradientFill` is not available –
    added `NULL` checks for `s_pGradientfill` in `Draw_Gradient()` and
    `Gradient()` functions.
  - **nice.c**: removed obsolete compiler support for Watcom C (`__WATCOMC__`)
    and Digital Mars C (`__DMC__`) – `GRADIENT_RECT` and `TRIVERTEX`
    definitions are already provided by modern Windows headers.

2026-09-06 02:32 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **misc.c**: fixed Unicode/ANSI string handling in clipboard, ShellAbout,
    and debug functions – replaced `HB_PARSTRDEF()` and `hb_parc()` with
    `HB_PARSTR()` for proper TCHAR/Unicode support.
  - **misc.c**: fixed `HWG_EDIT1UPDATECTRL()` and `HWG_BUTTON1GETSCREENCLIENT()`
    crash – replaced uninitialized `RECT*` pointer with a stack-allocated
    `RECT` variable.
  - **misc.c**: fixed GDI resource leak in `HWG_HEDITEX_CTLCOLOR()` – added
    check to avoid deleting stock brushes.
  - **misc.c**: modernized version detection functions (`HWG_ISWIN7`,
    `HWG_ISWIN10`, `HWG_GETWINMAJORVERS`, `HWG_GETWINMINORVERS`) – replaced
    deprecated `GetVersionEx()` with `VersionHelpers` API.
  - **misc.c**: replaced obsolete `WinExec()` with `CreateProcess()` in
    `HWG_WINEXEC()` and `HWG_RUNAPP()` for better security and 64-bit
    compatibility.

2026-09-06 02:19 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **message.c**: fixed Unicode/ANSI string handling in message box functions –
    replaced ANSI-only `HB_PARSTRDEF()` with `HB_PARSTR()` for proper
    TCHAR/Unicode support in `s_msgbox()`.
  - **message.c**: fixed debug function `HWG_MSGTEMP()` Unicode compilation
    errors – replaced unsafe `sprintf()` with `wsprintf()` for wide-string
    formatting; increased buffer size from 60 to 128 `TCHAR`s; removed
    obsolete Harbour version check and unnecessary manual Unicode conversion.
  - **message.c**: fixed `MessageBeep()` default parameter – changed from
    `0xFFFFFFFF` to `(UINT)-1` for better 64-bit compatibility.

2026-09-06 02:07 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **menu_c.c**: fixed `HWG_GETMENUCAPTION()` buffer handling – changed to
    call `GetMenuItemInfo()` twice (first to get required size, second to
    retrieve data) instead of guessing buffer size.
  - **menu_c.c**: fixed GDI resource leak in `HWG_SETMENUBACKCOLOR()` – added
    `DeleteObject()` to destroy the brush created with `CreateSolidBrush()`.
  - **menu_c.c**: removed obsolete `ChangeMenu()` function (16-bit Windows
    API, replaced by `ModifyMenu()`).
  - **menu_c.c**: removed obsolete compiler support for Digital Mars C
    (`__DMC__`).

2026-09-06 01:59 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **media_c.c**: fixed `HWG_MCISENDCOMMAND()` parameter handling – replaced
    `hb_parc()` with `hb_parptr()` to correctly pass a pointer to the MCI
    parameter block structure.
  - **media_c.c**: fixed `HWG_NMCIOPEN()` MCI flag logic – `MCI_OPEN_TYPE`
    is now set when `lpstrDeviceType` is provided, and `MCI_OPEN_ELEMENT` is
    set when `lpstrElementName` is provided.

2026-09-06 01:46 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **listbox.c**: fixed `HWG_LISTBOXDELETESTRING()` to accept an item index
    parameter – previously always deleted the first item (index 0) regardless
    of the intended selection.
  - **listbox.c**: added return value to `HWG_LISTBOXADDSTRING()` – now
    returns the index of the inserted item or LB_ERR on error.
  - **listbox.c**: added `NULL` check after `CreateWindow()` in
    `HWG_CREATELISTBOX()` to prevent returning an invalid handle.
  - **listbox.c**: removed unnecessary `#include <prsht.h>` (property sheet
    header not needed for listbox operations).

2026-09-06 01:36 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **grid.c**: fixed Unicode/ANSI string handling – replaced
    `HB_PARSTRDEF()` with `HB_PARSTR()` for proper TCHAR/Unicode support
    in `HWG_LISTVIEW_ADDCOLUMN()`, `HWG_LISTVIEW_ADDCOLUMNEX()`, and
    `HWG_LISTVIEW_INSERTITEMEX()`.
  - **grid.c**: fixed sorting comparison for Unicode builds – added
    `#ifdef UNICODE` to use `wcscmp()` instead of ANSI `lstrcmp()`.
  - **grid.c**: fixed `ProcessCustomDraw()` crash – added validation
    before accessing color array elements.
  - **grid.c**: removed obsolete compiler support for Pelles C (`__POCC__`),
    xHarbour Compiler (`__XCC__`), and Digital Mars C (`__DMC__`).

2026-09-06 00:58 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **drawtext.c**: fixed `HWG_GETFONTSLIST()` device context leak – added
    `ReleaseDC()` call to release the DC obtained by `GetDC(GetDesktopWindow())`.
  - **drawtext.c**: removed unused variable `hwnd` in `HWG_GETFONTSLIST()` and
    dead code comment in `HWG_DRAWTEXT()`.

2026-09-06 00:11 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **draw.c**: fixed `HWG_OPENIMAGE()` file name handling – reverted
    unnecessary `HB_PARSTR()` conversion and kept `hb_parc()` with direct
    `fopen()` call; `hb_parc()` returns ANSI string and `fopen()` accepts
    `const char*`, so no conversion was needed.
  - **draw.c**: fixed `HWG_GDIPLUSOPENIMAGE()` Unicode/ANSI string handling –
    added `#ifdef UNICODE` conditional to use `HB_PARSTR()` as `wchar_t*`
    when compiled with Unicode, otherwise convert from ANSI using
    `MultiByteToWideChar(CP_ACP)`.
  - **draw.c**: removed obsolete compiler support for Digital Mars C
    (`__DMC__`) and Borland C++ 5.5 (`__BORLANDC__`); removed unnecessary
    `HB_LONG_PCOUNT` conditional for 64-bit pointer returns; removed
    `#include "missing.h"` header.

2026-09-06 23:51 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **dialog.c**: fixed `HWG_CREATEDLGTEMPLATE()` parameter type – changed
    `hb_parnd()` to `hb_parnl()` for proper integer handling in style
    parameter.
  - **dialog.c**: added `NULL` and `HB_IS_ARRAY` checks for `ACONTROLS` in
    `s_CreateDlgTemplate()` and `s_FixupLargeCaptions()` to prevent crashes
    when accessing invalid or empty control arrays.
  - **dialog.c**: removed obsolete compiler support for Digital Mars C
    (`__DMC__`) and Open Watcom (`__WATCOMC__`).

2026-09-06 23:25 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **cxshade.c**: fixed `HWG_SHADE_SET()` parameter mapping – rectangle
    coordinates are parameters 8-11, not 7-10 (parameter 7 is `color`).
  - **cxshade.c**: added `srand()` initialization with `time()` in
    `cxshade_New()` to properly seed the random number generator for shade
    effects; added missing headers `<stdlib.h>` and `<time.h>`.

2026-09-06 23:11 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **control.c**: fixed Unicode/ANSI string handling in time/date functions
    (`HWG_GETUTCTIMEDATE`, `HWG_GETDATEANSI`, `HWG_DEFUSERLANG`) –
    replaced Harbour-specific `HB_WIN_UNICODE` with standard `UNICODE` macro
    for better compiler compatibility; replaced unsafe `sprintf()` with
    `hb_snprintf()`; removed obsolete manual declaration of `GetAncestor()`
    and obsolete compiler support for Digital Mars C (`__DMC__`).
  - **control.c**: fixed `HWG_GETLOCALEINFON()` implementation – changed from
    returning `LOCALE_SLIST` buffer size to returning the correct Windows
    Locale ID (LCID) using `GetUserDefaultLCID()` as documented; added
    `HWG_GETLOCALEID()` as the recommended function name and marked the old
    name as deprecated but kept for backward compatibility.

2026-09-06 22:24 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **commond.c**: fixed Unicode/ANSI string handling – replaced obsolete
    `HB_PARSTRDEF()` with portable `HB_PARSTR()` for proper TCHAR/Unicode
    support; removed 16-bit `far` keyword and dead code; increased fixed
    buffers from 1024 to 2048 characters to reduce overflow risk; added
    `NULL` checks for `GlobalLock()` and `GetObjectVar()` calls to prevent
    crashes; added English documentation comments.

2026-09-06 21:56 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **c_ipaddr.c**: fixed `HWG_INITCOMMONCONTROLSEX()` implicit declaration
    error with Clang 22 (C99/C11 strict mode) – replaced `HB_FUNC_EXTERN()`
    macro (which declares `HB_FUN_*` Harbour function names) with standard
    `extern` declaration to properly expose the C function name to the
    compiler; removed obsolete headers for Pelles C (`__POCC__`), xHarbour
    Compiler (`__XCC__`), and Digital Mars C (`__DMC__`) as they are no
    longer needed with modern compilers.

2026-09-06 21:00 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **hownbtn.prg**: fixed potential crashes from missing `Nil` checks in
    `DrawItems()` and `Paint()` methods – added safety checks before calling
    `::oBitmap:ClassName()` and `::aStyle[n]:Draw()` to prevent runtime
    errors when bitmap or style objects are `Nil`.
  - **hownbtn.prg**: removed duplicate `lEnabled` validation in
    `Redefine()` method.

2026-09-06 20:33 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **registry.c**: fixed Unicode/ANSI string handling and compiler
    compatibility – replaced `HB_WIN_UNICODE` with standard `UNICODE` macro,
    fixed `hb_parstr_u16()` argument count (4 args) for Harbour 3.2.1 API,
    added dual-path support for xHarbour (`hb_parstr_utf8()` +
    `MultiByteToWideChar()`), added `NULL` checks after memory allocation,
    and unified memory deallocation with `hb_xfree()`.
  - **registry.c**: fixed buffer allocation – changed Unicode buffer
    allocation from `length + 2` to `length + sizeof(WCHAR)` for proper
    null-termination safety.

2026-09-06 19:46 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **winreg.c**: fixed Unicode/ANSI string handling – replaced ANSI-only
    `HB_PARSTRDEF()` with `HB_PARSTR()` for proper TCHAR/Unicode support,
    replaced `hb_storc()` with `HB_STORSTR()` for correct string return,
    and added dynamic buffer allocation in `HWG_REGENUMKEYEX()` to eliminate
    fixed 255-character buffer overflow risk.
  - **winreg.c**: fixed memory allocation safety – added `NULL` checks after
    `hb_xgrab()` calls in `HWG_REGQUERYVALUEEX()` and `HWG_REGENUMKEYEX()`
    to prevent crashes when memory allocation fails.
  - **winreg.c**: fixed `SECURITY_ATTRIBUTES` pointer handling – replaced
    incorrect `hb_parc()` cast with proper `hb_parptr()` for security
    attributes parameter in `HWG_REGCREATEKEYEX()`.
  - **winreg.c**: fixed 64-bit pointer truncation – removed obsolete
    `PtrToLong()` macro for Digital Mars C and ensured handles are stored
    correctly.
  - **winreg.c**: removed duplicate commented `HWG_REGCLOSEKEY()` function
    (already exists in `registry.c` with proper `HB_PARHANDLE()` usage).

2026-09-06 19:17 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **hdialog.prg**: fixed nested modal dialogs losing proper owner/z-order
    after repeated open/close cycles – `Hwg__EndDialog()` called Win32
    `EndDialog()` but never removed the dialog from `HDialog():aModalDialogs`,
    causing stale entries to be reused as parent for new dialogs. Now calls
    `oDlg:DelItem()` immediately after `Hwg__EndDialog()`, matching the
    cleanup already done in the `!lModal` branch.

2026-09-06 18:38 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **window.c**: Small fix HWG_ANSITOUNICODE()
    Uses the existing `s_iVM_CP` codepage(set via `HWG_SETUTF8()`) instead
    of a fixed `CP_ACP`, so UTF-8-mode apps keep converting correctly.

2026-09-06 14:45 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Changed
  - **wprint.c**: modernized printer functions for Windows 2000 and later –
    removed deprecated `GetVersion()` and `GetVersionEx()` APIs, removed
    Windows 98/ME legacy code, replaced with `GetDefaultPrinter()` API and
    `PRINTER_INFO_4` enumeration for better compatibility with Windows 2000
    through Windows 11; added proper `NULL` checks for memory allocations.

2026-09-06 13:14 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **window.c**: fixed `HWG_ANSITOUNICODE()` buffer overflow, memory leak,
    incorrect return length, and missing `NULL` checks – replaced non-portable
    Harbour-specific API with Windows `MultiByteToWideChar()` for compatibility
    with both Harbour and xHarbour, and changed to dynamic allocation based on
    actual input length.
    Note: This function is only used in `hcomboex.prg` and `hctrlex.prg`
    (ext_controls contrib).

2026-09-06 12:11 UTC-0300 Itamar Lins  <itamarlins at gmail.com>
  ### Fixed
  - **hwindow.prg**: fixed lost `bColor` parameter in `HChildWindow:New()` –
    an extra comma before `bColor` in the call to `::Super:New()` shifted it
    past `HWindow:New()`'s 22nd (last) formal parameter, so the argument was
    silently discarded and the child window's background brush was never
    set.
  - **hwindow.prg**: fixed missing `msg` argument in the calls to
    `hwg_onTrackScroll()` from `HChildWindow:onEvent()` and
    `HMDIChildWindow:onEvent()` – the function is declared as
    `hwg_onTrackScroll( oWnd, msg, wParam, lParam )`, but only 3 arguments
    were passed, shifting `wParam`/`lParam` one position to the left and
    breaking horizontal/vertical scroll-bar tracking (`WM_HSCROLL`/
    `WM_VSCROLL`) on child and MDI child windows.

Re: Hwgui Atualizações 07-09-2026

Enviado: 07 Set 2026 10:50
por JoséQuintas
Chamou a atenção isto:
and removed
invalid `::Super:Init()` call (HControl does not have an Init method).

Código: Selecionar todos

CLASS HControl INHERIT HCustomWindow
CLASS HCustomWindow INHERIT HObject
CLASS HObject
Parece que realmente não tem, mas poderia ser classe herdada, fora de hcontrol.

Re: Hwgui Atualizações 07-09-2026

Enviado: 07 Set 2026 11:01
por Itamar M. Lins Jr.
Olá!
Eu olhei, é código do Win98, MCI...

Re: Hwgui Atualizações 07-09-2026

Enviado: 07 Set 2026 13:58
por JoséQuintas
Só comentário:
A api windows atual começou no windows vista.
O XP é considerado anterior a ele.
Na atual entra resize de imagens, uso de png dentro de ico, uso de texto + imagem em buttons, que eu me lembre

Re: Hwgui Atualizações 07-09-2026

Enviado: 07 Set 2026 21:17
por Itamar M. Lins Jr.
Olá!
Rapaz, estava estudando isso ai... Lendo aqui e aculá!
O Windows tem isso desde 2001!!! Usa PNG, etc via GDI+, e a Hwgui ativou isso tem pouco tempo.
-lgdiplus
Sou a favor de andar devagar, mais ai tambem é de mais. Tudo por conta de arrastar BCC 5x, XCC, Peles... Ai é dureza.
Vc quer um recurso, que nem é tão novo assim e não pode por conta de retrocompatibilidade.
Captura_de_tela_20260907_211141.png
Captura_de_tela_20260907_211141.png (170.11 KiB) Exibido 32 vezes

Re: Hwgui Atualizações 07-09-2026

Enviado: 08 Set 2026 08:32
por JoséQuintas
Devagar nisso, demorei pra entender.
Não precisa do gdi pra usar png, pelo menos não para uso padrão.
Ico é container, e dentro dele tanto faz se é png.
Já arquivos com extensão png, isso é outra coisa.
Parece que só no windows ico é tratado diferente de imagem.
Não é uma referência boa sobre atualizações.

Re: Hwgui Atualizações 07-09-2026

Enviado: 08 Set 2026 08:57
por Itamar M. Lins Jr.
Olá!
Isso já tem na Hwgui.
Só funciona ativando a gdiplus, Kresin que fez.
Não é uma referência boa sobre atualizações.
Não entendi essa parte.