Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How do I programmatically set the caption of an external application?

Posted on 2011-05-07
Medium Priority
Last Modified: 2012-05-11
Here is a screen shot of the application


Here are the properties of the "size" textbox as displayed in Spy++


Is there a simple command line C# application whereby I could set the size to a number of my choosing? (in the screen shot it is set to 400)

Question by:wordswithfriends
  • 2
LVL 13

Expert Comment

ID: 35714459

try the following code:

public static extern bool SendMessage(IntPtr hwnd, int uMsg, int wParam, string lParam);

const int WM_SETTEXT = 0xC;

private void SetCaption(IntPtr hwnd, string caption)
    SendMessage(hwnd, WM_SETTEXT, 0, caption);

Author Comment

ID: 35714564
What parameter should I use for hwnd?
LVL 13

Accepted Solution

iHadi earned 2000 total points
ID: 35714585
the handle of the textbox you want to change it's caption. This appears in your properties.png.

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question