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,861 other subscribers

Archive for the ‘Windows Development’ Category

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 »

Not to self: ERROR_ALREADY_EXIST (183) can also mean your named Mutex already exists

Posted by jpluimers on 2020/09/16

A while ago, I had an error like this when debugging plugins:

Project bds.exe raised exception class EOSError with message ‘System Error.  Code: 183.
Cannot create a file when that file already exists’.

It got was raised when [WayBackGetLastError returned ERROR_ALREADY_EXIST which according to [WayBackSystem Error Codes (0-499) (Windows) has this description:

ERROR_ALREADY_EXISTS

183 (0xB7)
Cannot create a file when that file already exists.

 

The last line is the same description that [WayBackFormatMessage returns. And it put me on the wrong foot as it wasn’t a file, but a mutex that was created: indeed [WayBackCreateMutex documents it:

If the mutex is a named mutex and the object existed before this function call, the return value is a handle to the existing object, GetLastError returns ERROR_ALREADY_EXISTS, bInitialOwner is ignored, and the calling thread is not granted ownership. However, if the caller has limited access rights, the function will fail with ERROR_ACCESS_DENIED and the caller should use the OpenMutex function.

In the mean time, the plugin doesn’t raise that as an exception any more.

–jeroen

 

Posted in Development, Software Development, Windows Development | Leave a Comment »

GitHub – blackrosezy/gui-inspect-tool: Gui Inspect tool for Windows

Posted by jpluimers on 2020/08/11

Old but useful: [WayBackGitHub – blackrosezy/gui-inspect-tool: Gui Inspect tool for Windows, a collection of Windows UI inspection tools:

  • AccEvent.exe
  • AccExplorer32.exe
  • Inspect.exe
  • SPYXX.EXE
  • swapy-ob-0.4.3.exe
  • UISpy.exe
  • ViewWizard.exe
  • WSEdit.EXE
  • swapy-ob-0.4.3.exe

–jeroen

Posted in Development, Software Development, Windows Development | Leave a Comment »

UAC elevation steps

Posted by jpluimers on 2020/07/29

Just in case I need to explain this to someone, as it has been a long time ago I did this: [WayBack] windows – Is there a single UAC binary? – Super User.

Via: [WayBack] Jeroen Wiert Pluimers: Is there a UAC binary? – Google+

Most important reference: [WayBack] How User Account Control Works | Microsoft Docs

  1. Logon:
  2. Elevation steps: decision tree in the various pieces:
  3. Elevation confirmation via consent.exe
  4. Consent example prompt:

 

–jeroen

Posted in Development, Power User, Security, Software Development, Windows, 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 »

Bug Finder, A Real Win32 Extensible Passive Debugger – CodeProject

Posted by jpluimers on 2020/04/09

On my research list is [WayBack] GitHub – DareDevil73/bug-finder: Windows passive debugger.  with an article at [WayBack] Bug Finder, A Real Win32 Extensible Passive Debugger – CodeProject:

The Bug Finder is a real Win32 debugger, entirely written in Borland Delphi, which analyzes your application execution flow, so you can:

  1. Catch exceptions on the main executable, external DLLs, primary and working threads.
  2. Produce a detailed stack trace about each exception.
  3. Place a symbolic breakpoint to get, in place of a program debug break, a full stack trace log message (dynamic tracing).
  4. Produce detailed and rotative log files for a batch application behaviour inspection.
  5. Capture output of OutputDebugString API to log file (to provide extra debugging information by yourself directly into your code).
  6. Trace Process, Threads and DLLs activities.

I found documentation at [WayBackDareDevil73 … docs, but the binary dependencies and installer are on SourceForge (where the project was originally located) and CodeProject which cannot be archived so I will look into that when it pops to the top of my research list.

–jeroen

via: [WayBack] Bug Finder by Antonio Petricca (in 2013?) Have any of you tried it? – Lars Fosdal – Google+

Posted in Delphi, Development, Software Development, Windows Development | Leave a Comment »

Optimizing BitBlt by generating code on the fly – The Old New Thing

Posted by jpluimers on 2020/03/25

Blast from the past machine generated code by the various assembly versions of the  [WayBack] Windows BitBlt function [WayBackOptimizing BitBlt by generating code on the fly – The Old New Thing.

Via: [WayBack] Rodrigo Ruz on Twitter: “Optimizing BitBlt by generating code on the fly https://t.co/gWmKjex20i”

–jeroen

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

User Experience topics like “Why does Explorer use the term KB instead of KiB”

Posted by jpluimers on 2020/03/24

Designing for a good user experience is hard, especially to programmers. So if you are a programmer, please read, let them sink in, rinse, repeat the below linked articles multiple times. Being ~15 years old, they are still so very relevant:

–jeroen

Posted in Development, Software Development, The Old New Thing, Usability, User Experience (ux), Windows Development | Leave a Comment »

What are the size restrictions for the VCL controls like TPanel and TPaintBox…

Posted by jpluimers on 2020/02/27

Via [WayBack] What are the size restrictions for the VCL controls like TPanel and TPaintBox.? Are they documented anywhere? I’m talking about placing these on a TScro… – Thomas Mueller (dummzeuch) – Google+:

Some Windows messages use the LPARAM to carry width and height, which allows only 16 bit for each.

So 32k-1 (or decimal 32767) is the maximum size of a GDI based visual element in Windows.

–jeroen

Posted in Development, Software Development, Windows Development | Leave a Comment »