Thursday 6 July 2023

New GUID macro in CnWizards

 CNWIZARDS is one of the major multi-purpose plugins for the Embarcadero Delphi IDE (CnWizards is made in China, a country with very talented Delphi programmers). This free plugin has a HUGE number of useful features, among them several not available in other Delphi IDE plugins, for example, Copy Component's Class Name (to name only a single example):

Another useful CnWizards feature is the Source and Comment Templates wizard:

It allows inserting customizable snippets in the source code (each with a custom keyboard shortcut). Each of these snippets can contain macros that are dynamically expanded to their local or other context. One of these context macros is %CurrProcName%, which expands to the name of the current procedure name. I use it to quickly insert CodeSite debug messages:

So by simply typing CTRL++, I insert this CodeSite message where the macro is automatically expanded to the name of the containing function "PAMax":

Very smart!

Recently, I needed a macro for a Source and Comment Template that generates a GUID (Globally Unique Identifier). So, I wrote a message to Liu Xiao (the maintainer of CnWizards) asking him to implement a GUID macro. He answered, "This is a nice idea, and we will implement it." One day later, it was ready!

So, I now use this macro for a procedure where I log error messages containing a unique ID (so they can be easily found in the source code whenever an error occurs):

LogError('%CurrProcName%', '%GUID%', SysErrorMessage(GetLastError));

So by simply typing SHIFT+CTRL+L, I insert this LogError Statement in the source code (ideally inside an except section):

This contains all the information I need to trace any error:

  • The name of the procedure where the error occurred
  • The unique ID to easily find the error occurrence
  • The error cause generated by GetLastError
  • The date-time when the error occurred (encoded in the name of the log file)

This is the implementation where I save the Error to a log file:

The CnWizards plugin is full of such smart features!

Monday 19 June 2023

REALTIME Process Watcher added to Program Window Manager

 In the blog article about Program Window Manager I have described our newest app. Now I have created another professional tool for Program Window Manager - Process Watcher:

This Tool allows you to monitor any program's technical parameters (CPU load, Memory, Threads, IO rates, etc.) in REALTIME by simply CTRL-clicking on its window title bar! Here I tested it with CPUSTRES from Microsoft SYSINTERNALS:

I have plans to add other tools in the future, like a REALTIME Process Network Watcher.

However, I am open to user suggestions. But the most crucial task is writing the documentation for Program Window Manager.

Wednesday 14 June 2023

Introducing PROGRAM WINDOW MANAGER by Peter Aschbacher from PA-Soft

Unveiling the ground-breaking application Program Window Manager (PWM), an indispensable add-on to your essential Windows toolset, designed not only for the power users amongst us.

This innovative tool is an asset every Windows user must have in their arsenal. Its singular design and user-friendly interface seamlessly integrate with your workspace to provide efficient, time-saving features that redefine convenience.

Imagine boosting your productivity exponentially, saving up to 75% of your time and, by extension, your hard-earned money. All of this is now attainable at your fingertips. How do you tap into this powerhouse of excellent functionality?

After the installation of Program Window Manager, simply LEFT-CLICK on the TITLE BAR of any window while holding down the CTRL key: this will open the following menu, where you can choose from many useful features for the program/window you clicked on. Here is an example after having CTRL-clicked on the title bar of Windows Notepad:

On top of the menu, the name of the clicked program is displayed. Here is a detailed description of the menu features:

Copies the text on the title bar or the text area content to the clipboard.

Copies the program's FILE PATH to the clipboard, in this case: C:\Windows\System32\notepad.exe

Copies the program FILE to the clipboard, so you can paste it in any place in File Explorer:

Copies the Command-Line of the program to the clipboard, for example:

An exciting feature for programmers. Example: 2040176

Captures a screenshot of the clicked window and copies it to the clipboard (so you can paste it into a graphics program or your text processor), for example:

Sometimes it is essential to check whether the program is in 32-bit or 64-bit format, for example:

This opens WINDOWS FILE EXPLORER and selects the program file (so you can do anything you want with it), for example:

This shows you the Windows Properties dialog of the program file:

This checks whether the program is digitally signed (a vital feature!) and displays the details of its digital certificate data:

This shows a window with all images contained in the program:

You can copy and save the images
(However, respect the rights of the respective program owner)

This shows detailed information about the program version:

This also copies the version information to the clipboard
(so you can, e.g., paste it into an email message)

This shows you the amount of memory consumed by this program, for example:

This information is also automatically copied to the clipboard.

This opens a window with Low-Level Technical Information about the program, for example:

This Low-Level program information will most benefit software engineers and technically interested people.

This is an often-needed feature, as it keeps a window on top of other windows. Click it again to make the window not stay on top.

This feature has two choices: Create a shortcut to this program on the Desktop or in the Clipboard. The latter allows you to paste the shortcut into any location in File Explorer.

A hash is like a unique fingerprint for data or for a file. MD5, SHA1, and SHA256 are different ways to create unique fingerprints. SHA256 is the strongest and most secure one.
A file hash can be used to check whether a program file has been modified or corrupted.

This allows the program to be scanned by an anti-virus program - Windows' own anti-virus program Windows Defender or the well-known website Virus Total.

This full-blown Text Processor lets you document every program with your content (text, images, links, tables, etc.). It automatically creates and loads a Rich Text document for every individual program:

Program Window Manager stays resident in the TaskBar's Tray area:

A right mouse click on the Tray icon shows the tray menu of Program Window Manager:

A left mouse click on the Tray icon shows PWM's Configuration window:

Our innovative advanced HotKey technology allows you to use, in addition to standard modifier key combinations, even any combination of simultaneously pressed letter keys as a global hotkey! The PWM hotkey allows you to show the PWM menu even for windows without a title bar. And you can also set a global hotkey to access your most frequently used PWM feature without showing the PWM menu!

PA-Soft - a company in Salzburg (Austria) - is a technology leader and software innovator. Many more innovative software programs are being prepared in our labs. Program Window Manager will soon be released to the public and available for a very modest price. Stay tuned to the news at our website PA-Soft.

Tuesday 13 June 2023

Remove your temporary files!

During the program run of an application, it is sometimes unavoidable to create temporary files (e.g., in the Temp system directory), which may be needed until the program is closed. However, removing these temporary files at the latest when closing the program is a recommended good practice for many reasons. Here is a method to conveniently manage temporary files automatically:

First, declare a StringList Field variable in your Form class (it should be a public variable if you plan to use it in other forms of your application too):

Then create the StringList in the OnCreate event handler (of your main form):

Whenever you create a temporary file during the program execution, you should not forget to add it to this list of temporary files, for example:

Then, when the program terminates (preferably in the OnDestroy event handler of your main form), the collected temporary files are automatically deleted, and the allocated StringList object is removed from the memory:

That's how easy it is to manage your temporary files!

If you have any questions about this topic or about any other programming topic, contact me at my website:

How to Run a Silent Console Application in Delphi

 Author: PETER ASCHBACHER (PA-SOFT) Sometimes, it's necessary to hide the console window of a CONSOLE APPLICATION entirely to avoid dist...