CHyperStatic: a hypertext static control in ATL and WTL

As well known, WTL provides CHyperLinkImpl custom control implementation to use clickable hyperlink controls. Also control uses a few styles (underlining, tags, command vs. notify notifications), the main implementation is limited:

  • control frequently requires static text, tooltip text and location for ShellExecute; you cannot embed all three strings into dialog template control’s window text so you need an additional resource strings separated from the control definition
  • you cannot have two or more links per control
  • you can mix clickable text with unclickable, however this style is underimplemented: text wrap is not supported

So, CHyperLinkImpl is great when you have nothing, but you are likely to still want more. Here goes more.

17-image001.png

Continue reading →

Shell extension to save screen shots to file with minimal effort

Alax.Info ScreenShot Shell Extensions extend windows shell to provide a helpful command to work with screenshots. A new command “Paste Image as PNG File…” is added to directory context menus when clipboard contains an image.

10-image001.png

User will be prompted to enter file name for the saved image. Should Control key be pressed at the moment of command invocation, the shell extension will auto-name the file using ImageNNN.png format, where NNN is an auto incremented number.

Images are saved in PNG (Portable Network Graphics) format with an automatic color depth reduction to create more compact images for web.

The extension is designed to work with Windows hotkeys PrintScreen and Alt+PrintScreen, which copy a shot of screen or active window into clipboard. The image becomes pasteable into file with this shell extension.

Application Name: Alax.Info ScreenShot Shell Extensions
License: Free for personal use, request commercial licenses via email or contact form
Latest Version: 1.0.0.42
Download Link: Alax.Info ScreenShot Shell Extensions 1.0.0.42 (237K)

CAPTCHA for ASP

CAPTCHA stands for “Completely Automated Public Turing test to tell Computers and Humans Apart” which is more known to public as a verification code one needs to enter in order to proceed with certain action. The challenge is aimed to prevent from automated operation, such as, for instance, user registration, spam or data mining.

Alax.Info Captcha Module offers a COM object to generate CAPTCHA PNG (Portable Network Graphics) images:

08-image001.png

Continue reading →

Replace in Clipboard: update

Alax.Info Replace in Clipboard updates:

  • New: hotkey (default Win+C, configurable) to perform pending replacement; “global” section of configuration file defines hot key to use
  • New: “suppresstooltips” per-replacement option to suppress system tray icon tool tips for the replacement
  • Updated: after replacement the tool tip also shows the replacement text put into clipboard

Application Name: Alax.Info Replace in Clipboard
License: Freeware
Latest Version: 1.0.0.100
Download Link: Alax.Info Replace in Clipboard 1.0.0.100 (71K)

Windows Sockets fun

Simple stress application brings down Windows Sockets subsystem within tens of seconds on Microsoft Windows XP Professional Service Pack 2… It appears to be a key point that SO_RCVBUF and SO_SNDBUF sockets options are increased from default value.

The expected behavior, and it is the case with default socket buffer sizes, is running out of available anonymous sockets (ports 1024-5000 are engaged by active sockets or those on wait list to be freed, see “Windows NT Clients Run Out of Ports” for details). Expected failure code is 10048 (WSAEADDRINUSE) “Address already in use” on client.

Instead, at some critical moment client side sockets start failing with 10054 (WSAECONNRESET) “Connection reset by peer” error and server side sockets massively fail with 10093 (WSANOTINITIALISED) “Successful WSAStartup not yet performed” code including, as it seems, a number of sockets already closed on client side and expected to get closed on server. After server connection sockets report failure, the listening socket reports ERROR_OUT_OF_MEMORY error.

Download Visual Studio .NET 2003 source code and compiled binaries.

How to add features to standard message boxes in ATL and WTL

MessageBox function is easy to use but it sometimes lacks features. They can be added through a hook, however. This sample demonstrates three features for message boxes:

  1. AtlMessageBoxEx shows message box centered by parent window
  2. AtlTimedMessageBoxEx shows message box with countdown timer to close
  3. AtlOptionalMessageBoxEx shows message box with checkbox to suppress the box in future (the setting is stored into registry)

Continue reading →

Replace in Clipboard: update

Alax.Info Replace in Clipboard updates:

  • Fixed: application might stop watching clipboard
  • Updated: default configuration file location moved to Application Data subdirectory of user’s profile directory; should it be missing there, the application will still look into binary directory
  • New: open configuration file and reload configuration commands in tray menu
  • Updated: better UI feedback on application status

Application Name: Alax.Info Replace in Clipboard
License: Free for personal use, request commercial licenses via email or contact form
Latest Version: 1.0.0.82
Download Link: Alax.Info Replace in Clipboard 1.0.0.82