The Wiert Corner – irregular stream of stuff

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

  • My work

  • 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,822 other followers

Archive for May, 2014

A few Excel printing tips I always forget

Posted by jpluimers on 2014/05/30

With most software, most of the time you don’t use the majority of the features.

So when you need a part of that majority, it is always hard to find.

For Excel, most of my printing is standard (if I print at all), so these two are particularly hard to remember:

–jeroen

Posted in Excel, Office, Office 2007, Office 2010, Office 2013, Power User | Leave a Comment »

delphi – Is there a way to get a VCL Control’s name through the windows API? – Stack Overflow

Posted by jpluimers on 2014/05/29

Thanks Samaliani for posting a Delphi GetWinControlName function as answer to Is there a way to get a VCL Control’s name through the windows API?

The cool thing: it works across processes (as long as your own process has ReadProcessMemory rights).

It works from Delphi XE3 and up.

Be sure to also read the comments by Danny Thorpe on the automation framework in Delphi: that might also be a good place to get this information from.

–jeroen

via: delphi – Is there a way to get a VCL Control’s name through the windows API? – Stack Overflow.

Posted in Delphi, Delphi XE3, Delphi XE4, Development, Software Development | 3 Comments »

using tf to list the workspaces for the current directory in Team Foundation System

Posted by jpluimers on 2014/05/28

Since Visual Studio is always in a 32-bit directory, I needed the SetProgramFilesX86 batch file from

Windows batch file to set ProgramFilesX86 directory for 32-bit program files on x86 and x64 systems.

Here is a small batch file to list workspaces by any user for the current directory (assuming that directory is mapped to a workspace):

call "%~dp0SetProgramFilesX86.bat"
:: assume Visual Studio 2005:
::"%ProgramFilesX86%\Microsoft Visual Studio 8\Common7\IDE\tf" workspaces /owner:* /computer:* 
:: assume Visual Studio 2010:
"%ProgramFilesX86%\Microsoft Visual Studio 10.0\Common7\IDE\tf" workspaces /owner:* /computer:*

It uses TF, and assumes default locations for various Visual Studio versions based on the internal version number.

A generic TF batch file that finds the TF is this one:

call "%~dp0SetProgramFilesX86.bat"
:: assume Visual Studio 2005:
::"%ProgramFilesX86%\Microsoft Visual Studio 8\Common7\IDE\tf" %*
:: assume Visual Studio 2010:
"%ProgramFilesX86%\Microsoft Visual Studio 10.0\Common7\IDE\tf" %*

–jeroen

Posted in Batch-Files, Development, Scripting, Software Development | 1 Comment »

Windows batch file to set ProgramFilesX86 directory for 32-bit program files on x86 and x64 systems (via: Stack Overflow)

Posted by jpluimers on 2014/05/27

Every once in a while you need to execute a binaryfrom a batch file that will always be available 32-bits.
Examples include development tools (that usually are x86 hosts talking or encapsulating managed environments, and x64 debuggers) or office versions for which certain plugins are not available in x64 versions.

That’s why I wrote the below batch file to fill the ProgramFilesX86 environment variable to point to the 32-bit Program Files directory on any system (x86, x64, or one that does not make a distinction).

Determining processor architecture

The batch file makes use of the flags mentioned in HOWTO: Detect Process Bitness – David Wang – Site Home – MSDN Blogs:

Notes:

  • There are 3 distinct cases and two outcomes
  • We default to x86 just in case we run on a system that has none of the flags defined (for instance on legacy systems).
Environment Variable \ Program Bitness 32bit Native 64bit Native WOW64
PROCESSOR_ARCHITECTURE x86 AMD64 x86
PROCESSOR_ARCHITEW6432 undefined undefined AMD64

Source of 32-bit program files

The place of the 32-bit program files directory is determined by the environment variables mentioned in WOW64 Implementation Details (Windows):

Process Environment variables
64-bit process PROCESSOR_ARCHITECTURE=AMD64 or PROCESSOR_ARCHITECTURE=IA64
ProgramFiles=%ProgramFiles%
ProgramW6432=%ProgramFiles%
CommonProgramFiles=%CommonProgramFiles%
CommonProgramW6432=%CommonProgramFiles%
32-bit process PROCESSOR_ARCHITECTURE=x86
PROCESSOR_ARCHITEW6432=%PROCESSOR_ARCHITECTURE%
ProgramFiles=%ProgramFiles(x86)%
ProgramW6432=%ProgramFiles%
CommonProgramFiles=%CommonProgramFiles(x86)%
CommonProgramW6432=%CommonProgramFiles%
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: The ProgramW6432 and CommonProgramW6432 environment variables were added starting with Windows 7 and Windows Server 2008 R2.

Boolean logic and case insensitive compare in batch files

Many things in batch files can be tricky including these two:

The batch file

Finally: the batch file: Read the rest of this entry »

Posted in Batch-Files, Development, Scripting, Software Development | 4 Comments »

Move Around in paragraphs – Microsoft Word keyboard shortcuts

Posted by jpluimers on 2014/05/26

Boy, wish I had known these two Word keyboard shortcuts a long time ago:

  • Ctrl + Up: Go To the start of the previous paragraph
  • Ctrl + Down: Go To the start of the next paragraph

–jeroen

via: Move Around – Microsoft Word.

Posted in Keyboards and Keyboard Shortcuts, Office, Office 2003, Office 2007, Office 2010, Office 2013, Power User, Word | Leave a Comment »

 
%d bloggers like this: