The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘The Old New Thing’ Category

Raymond Chen on The AArch64 processor (aka arm64) in many parts

Posted by jpluimers on 2025/01/14

For my link archive: below a series of articles my Raymond Chen on “The AArch64 processor (aka arm64)” in the order of appearance from a few years back and still very relevant today.

It is part of a few more series on processors that (were) supported by Windows. A good reference to find which version supported which processor architecture is the tables in List of Microsoft Windows versions – Wikipedia.

Read the rest of this entry »

Posted in AArch64/arm64, ARM, Assembly Language, Development, History, MIPS R4000, PowerPC, Software Development, The Old New Thing, Windows Development, x64, x86 | Leave a Comment »

LockWindowUpdate function (Windows) and some OldNewThing thoughts

Posted by jpluimers on 2021/02/02

If you ever think about using [WayBack] LockWindowUpdate function (Windows), then read these first:

TL;DR:

Do not use LockWindowUpdate as the limitation is system wide: Only one Window in the system can be used for LockWindowUpdate.

Use WM_SETREDRAW if you can as LockWindowUpdate “should only to be called to disable drawing in the window beneath the cursor during a drag and drop operation”: there is only one locked window at a time: There can be only one drag/drop operation active at a time, since there is only one mouse.

Instead of LockWindowUpdate(hwnd)
Use SendMessage(hwnd, WM_SETREDRAW, FALSE, 0) or
SetWindowRedraw(hwnd, FALSE)
Instead of LockWindowUpdate(NULL)
Use SendMessage(hwnd, WM_SETREDRAW, TRUE, 0) or
SetWindowRedraw(hwnd, TRUE)

Prototype

BOOL LockWindowUpdate(
  _In_ HWND hWndLock
);

Oh, and it’s not called LockWindowUpdate everywhere: [WayBackSetting a Visual Studio breakpoint on a Win32 API function in user32.dll – The Entrian Solutions Blog.

–jeroen

Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Detecting what language or script a run of text is written in, redux – The Old New Thing

Posted by jpluimers on 2021/01/29

Interesting: [WayBack] Detecting what language or script a run of text is written in, redux – The Old New Thing.

Do not confuse language with the scripts in which one or more languages can be written, and much more is covered in it.

Related:

–jeroen

Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Not all language packs are created equal… 

Posted by jpluimers on 2021/01/12

[WayBack] Why don’t I get properly translated program output after installing the corresponding language pack? – The Old New Thing.

It means you cannot fully cover all translations when writing software.

More on translating your software at [WayBack] Where can I get the glossary of Microsoft’s standard translations for computer terms? – The Old New Thing « The Wiert Corner – irregular stream of stuff.

–jeroen

Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Some odd Windows Messages for my research list (Windows 10 with a very basic Delphi application)

Posted by jpluimers on 2020/12/22

The bold messages below inside the main message loop are on my research list because:

  • they seem to be undocumented in WinUser.h and other header files
  • they are sent to Window handles that have no corresponding VCL TWinControl bound to them
  • they are WM_TIMER messages sending to a null hwnd, without the Delphi code registering a window-less timer (note the lParam indicates they have different call back procedures attached to them)

Being inside the message loop, they are either posted or created by Windows.

The hexadecimal value for WM_TIMER is documented: [Archive.is] 0x0113 site:https://docs.microsoft.com/en-us/windows/desktop/winmsg – Google Search.

Neither of the below messages are documented in either of the Undocumented Windows books (yes, there are two; the first – though rare to get – was a slightly earlier published one-person effort; the second was a tiny bit later three-person effort, but much thicker and included a diskette with tools; both books complement each other well; I am listed in both):

Messages I am looking for:

Yes, I know that Windows Messages are usually noted as 4 hexadecimal digits, but since they are UINT, the logging framework logs them as 32-bit hexadecimal values as this was a 32-bit application, see these WM_* constants and message ranges:

  • 0x0400: [WayBack] WM_USER – Windows applications | Microsoft Docs
  • 0x8000: [WayBack] WM_APP – Windows applications | Microsoft Docs

    The WM_APP constant is used to distinguish between message values that are reserved for use by the system and values that can be used by an application to send messages within a private window class. The following are the ranges of message numbers available.

    Start End Meaning Note
    0 WM_USER–1 Messages reserved for use by the system.
    WM_USER 0x7FFF Integer messages for use by private window classes. Depends on the one that called RegisterClass, see below.
    WM_APP 0xBFFF Messages available for use by applications. Depends on the one that called CreateWindow, see below.
    0xC000 0xFFFF String messages for use by applications.
    0x10000 0xFFFFFFFF Reserved by the system.

Note that [WayBack] Which message numbers belong to whom? – The Old New Thing explains more about CreateWindow and RegisterClass, which are important for the above subranges.

Similarly, the sharing of the ID space for Windows Messages, Atom Names and Clipboard Formats:

It might be that two of the messages are related to an undocumented UserAdapterWindowClass: [WayBack] Windows Creators Update Crashes old C++ Apps – Stack Overflow.

On message handling in general:

Related (as my WM_TIMER knowledge was rusty when scheduling this blog post):

Read the rest of this entry »

Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

winapi – What format is the time member of a MSG structure? – Stack Overflow

Posted by jpluimers on 2020/12/22

Found it. GetMessageTime defines it as the number of milliseconds since the system was started.

Source: [WayBack] winapi – What format is the time member of a MSG structure? – Stack Overflow.

It is not documented in the MSG/tagMSG documentation: [WayBack] tagMSG | Microsoft Docs Contains message information from a thread’s message queue.

Luckily, The Old New Thing does: [WayBack] What clock do MSG.time and GetMessageTime use? – The Old New Thing

The unit is documented in [WayBack] GetMessageTime function | Microsoft Docs: Retrieves the message time for the last message retrieved by the GetMessage function.

–jeroen

Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Old New Thing IAccessible examples

Posted by jpluimers on 2020/12/17

The blog examples are only two:

The book has more: The Old New Thing: Practical Development Throughout the Evolution of Windows – Raymond Chen – Google Books

jeroen

Posted in COM/DCOM/COM+, Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

The alphabet, in alphabetical order, in various languages – The Old New Thing

Posted by jpluimers on 2020/10/09

I had to lough so loud when I bumped into this [WayBackThe alphabet, in alphabetical order, in various languages – The Old New Thing.

I got there because I wanted a few examples of languages having more than 26 ASCII letters in their alphabet.

Basically all non English languages (:

–jeroen

 

Posted in Development, Fun, LifeHacker, Power User, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Delphi XE6 .. 10.1 Berlin truncating non-VCL-control texts to 256 characters when styled

Posted by jpluimers on 2020/09/23

As of Delphi XE6, the VCL also styles non-VCL controls, but this truncates the texts to 256 characters, for instance in non-balloon hints. This is fixed in Delphi 10.2 Berlin, by making the buffer dynamic and switching obtaining those texts from using GetWindowText to sending a WM_GETTEXT message.

A fix for Delphi XE6..10.1 Berlin is at gitlab.com/wiert.me/public/delphi/DelphiVclStylesAndHintText, with many thanks to Stefan Glienke who based the patch on the ones used in Spring4D. I think they are similar to the ones in [Archive.is] VCL Fix Pack 1.4 | Andy’s Blog and Tools.

The Old New Thing explains the difference between GetWindowText and WM_GETTEXT in [WayBack] The secret life of GetWindowText – The Old New Thing. TL;DR:

GetWindowText strikes a compromise.

  • If you are trying to GetWindowText() from a window in your own process, then GetWindowText() will send the WM_GETTEXT message.
  • If you are trying to GetWindowText() from a window in another process, then GetWindowText() will use the string from the “special place” and not send a message.

So for your own process, it does not matter as GetWindowText uses WM_GETTEXT.

–jeroen

Related:

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Interesting insights by Andreas Hausladen Twitter on the Delphi splash screen process, license file handling

Posted by jpluimers on 2020/05/05

Interesting insights from [WayBackAndreas Twitter: “I was joking about #Delphi’s splash screen to be shown later so Embt can claim that it finishes much faster now. Today my Internet was down and guess what I had to “witness”. Seattle: 22 sec splash screen time Tokyo: 2 sec splash screen time Sounds fantastic, but…… https://t.co/FGtnJQZDyc”:

  • in earlier versions part of the copy protection (WinVerifyTrust calls) were done after the splash screen was visible and now they are done before.
  • That the WinVerifyTrust call took so long was because Windows (not Delphi) wanted to check for revoked certificates in the first WinVerifyTrust call (due to the missing only-cache flag) and my router seems to not like it if the modem doesn’t have a connection/link to the provider
  • consider using FILE_FLAG_DELETE_ON_CLOSE so that if the IDE is killed during its start (debug session when you see that you forgot something and want to abort) doesn’t wait ~3 minutes or more until the lock is lifted

More relevant links based on the above:

Via [WayBack] Anyone else saw the video on this Andreas Hausladen post? – Cesar Romero – Google+ where I found this observation interesting:

My vm installs have zero net on by default, host only lan, lan only, and internet provided on demand. I’m noticing a lot of differences in the splash screens of 10.2.2.2.2, often lacking registration confirm info (making me nervous).

–jeroen

Read the rest of this entry »

Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »