Windows XP control panel - providing a value for the "comments" field - windows-xp

Where does the Windows XP control panel get the value for the "Comments" field from? I'm writing an EXE control panel application, and it doesn't appear from the documentation that you can provide a value for that field.

Registering an Executable File (exe) as a Control Panel Applet on Windows Vista using Windows Installer XML (WIX) at Link
[previous answer]
See the Executable Control Panel Item Registration of Registering Control Panel Items at http://msdn.microsoft.com/en-us/library/cc144195(VS.85).aspx
Specifically, you want InfoTip, which is the comments.
Registering Control Panel Items
Control Panel items must be registered
in order to appear in the Control
Panel window. If the Control Panel
item is implemented as part of a .exe
file then it is registered as a
command object. Registration differs
if the item is implemented as a .dll
file that exports the CPlApplet
function.

Using CPLApplet:
When Control Panel loads a .dll (or
.cpl) file, it calls the CPlApplet
function to get information such as
the number of Control Panel items the
file hosts, as well as information
about each item.
When Windows first loads the Control
Panel item, it retrieves the address
of the CPlApplet function and
subsequently uses that address to call
the function and pass it messages. It
might send the following messages.
You need to handle CPL_INQUIRE Message and fill the CPLINFO Structure.
typedef struct tagCPLINFO {
int idIcon;
int idName;
int idInfo;
LONG_PTR lpData;
} CPLINFO;
idInfo is the resource identifier of the string containing the description. You cannot simply set this thing by filling in some registry key.
Edit: Ok, my bad, this is an old solution.

This string is retrieved from the HKCR\CLSID{guid}\InfoTip registry value. How to whack the registry into shape is explained very well in this MSDN Library article, not much I can add to that.

Related

Is there a way to retrieve information from a ui element that has the property IsControlElement = False? (Python + Appium + WinAppDriver)

Greetings and salutations!
I'm working on a UI automation project for a windows desktop app (FrameworkId: Win32)
Stack: Python (3.7) + Appium (1.15.1) + WinAppDriver (v1.1).
I have identified an element using Inspect.exe, but when I try to code, whatever I do I receive this error:
selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters.
The locator strategy I'm using is xpath:
self.driver.find_element_by_xpath("//*[#LocalizedControlType='text' and #IsControlElement='false']")
As you can see, Inspect.exe has shown that it has the property "IsControlElement='false'", but I cannot for the life of me "access" it via code.
I would also like to point out that any elements that had the IsControlElement='true' are properly found and I can "interact" with them.
Thank you very much for your help!
Source of issue
This is probably an issue within Microsoft's UI Automation implementation in .NET.
The property IsControlElement should have returned true while it didn't.
From my tests, it seems to be an issue somewhere within UIAutomationCore.dll.
I speculate that the root cause is that the automation implementation was targeted for accessibility in mind, and they have mistakenly ignored some controls which are NOT readable (Image, Geometry, etc.).
Workaround for some cases
Try to use UI control from a type that has a text.
if it's already a textual control, try to use a different textual control type. for example - in WPF project - use Label instead of TextBlock
if it's NOT a textual element, if possible, wrap the control in a textual element. in WPF projects you can use a <Label Padding="0"> as a wrapper.
Other things to consider
Try to use UIAComWrapper
Related issues
https://stackoverflow.com/a/46452431/426315
UIAutomation won't retrieve children of an element
UI Automation - #32770 (Dialog) shows in Insepct.exe but not in VisualUIAVerifyNative.exe
Side Note
Since you haven't specified which Python GUI library are you using, I was not able to provide examples for your library. Sorry.

MSComctlLib reference/components load with "was not a loaded control class" error

I'm having trouble oppening an project developed in VB6. Some controls attached with MSComctLib class are not loading.
I'm using Windows 7.
In the error analysis the following message appears (without the number of lines):
Class MSComctlLib.ImageList of control ImageList1 was not a loaded control class.
Class MSComctlLib.Toolbar of control Toolbar1 was not a loaded control class.
MSComctlLib.StatusBar class of control sbStatusBar was not a loaded control class.
and then a lot of invalid property names,
Ex:
The property name _ExtentX in ImageList1 is invalid
The property name Buttons in Toolbar1 is invalid
...
According to the guidance of microsoft support site http://support.microsoft.com/kb/896559, an update would be the solution http://www.microsoft.com/en-us/download/details.aspx?id=10019
I tried running the executable VisualBasic6-KB896559-v1-ENU
but I still have the same error when opening the project.
Could someone tell me how to solve it?
Thanks in advance!
If you don't have the common controls selected in your project, but the controls are on a form, then you'll receive these errors when you try to load the project (or add a pre-existing form to a project that doesn't have the component selected).
On the VB6 menu, select Project-Components. Scroll down to Microsoft Windows Common Controls 6.0 (if you have a service pack installed, then the SP level will usually be at the end of the library name). Select that component, click Ok. Save the project, and then reload the project.
If this is the source of your issue, you should now be able to load those forms that have a reference into the common controls.

How to lock on to a cloned form in Delphi?

I am writing a chat program that has a bunch of clients connect to it and populate themselfs to a listview, I want to be able to click on each individual client and open up a form that looks like a chat, but I want to be able to do it to multiple clients at the same time.
I have made Form2 (the chat window) clone itself for every instance, however I need to know how to lock on to the cloned form to make changes such as Form2.RichEdit.Lines.Add
However when I try to do this it does not work because I'm not locking on to the right form since it is cloned I am assuming it is no longer Form2
Any info on this would be highly appreciated.
Update
I am going to go ahead a reword what I am trying to do.
I will explain what im trying to do: I have a chat program (server) that is listening for clients to connect via Indy10 sockets When the client connects it populates the ListView with the user name and when I click on the user name (the server) opens privatemessageform where I can chat with the client.
I want to be able to have multiple clients connected and I want to be able to click on as many as I want and have it clone the privatemessageform and have 2 separate chat windows to 2 separate clients
The problem is: When trying to click on the seccond user the program gets confused and cannot lock on to that seccond user's privatemessageform (clone).
And if any more info is needed and I mean anything at all please do not hesitate to ask I will be on for several hours and constantly checking this thread.
I've been stuck on this for 3 days so I would really love to get this resolved and move forward with my project. Any information is highly appreciated. Thanks in advance!
Open Project Options and remove Form2 from auto-creation list. Do not use that variable any more.
Rename TForm2 to some meaningful name. Once you would have ~10 forms in your program you would forget what you meant by numbers 2, 5, 7 ...
ALWAYS give variables meaningful names, that includes components, that includes forms. Here i will name TForm2 a TPrivMessageForm
Use a special array of variables to keep several forms, not a single global variable. For example like that:
Type TChatUser = string;
// to begin with, user is a name. Then it may become URL, or GUID or something
// complex like `record` or `class` or whatever
Type TPMForms = TDictionary<TChatUser, TPrivMessageForm>;
PMForms := TPMForms.Create;
Creating new private message window after clicked on user:
if not PMForms.ContainsKey(ClickedUser)
then PMForms.Add(ClickedUser, TPrivMessageForm.Create(Application) );
PMForms[ClickedUser].ChatWith := ClickedUser; // variable in ex-TForm2 to tell several instances apart
When such form is closed - it should via its OnClose
Remove itself from PMForms list (so no dangling pointers would remain)
chose caRelease for closing actions (making VCL actually free the form object)
See Also
http://delphi.about.com/od/beginners/a/using-t-dictionary-hash-tables-in-delphi.htm
http://docwiki.embarcadero.com/CodeExamples/XE4/en/Generics_Collections_TDictionary_(Delphi)
PS. Edit your question please and add TAG with your specific Delphi version.
PPS. download ready-made FLOSS chat programs and just read and learn how they do it. Maybe instead of opening a free-floating (cluttering desktop) form you'd better open Tab in PageControl. "Use the Source, Luke"
https://sourceforge.net/p/dreamchat/wiki/Home/
https://sourceforge.net/p/achat/wiki/Home/
http://www.visualirc.net/features.php
For the latter to find the sources one has to type two words "Visual IRC" at www.google.com and get http://sourceforge.net/p/visualirc/mercurial/ci/default/tree/ - this crucial information i did omitted in fair belief that a person interested in finding sources would be able to do it on his own.
PPPS. Those is not "cloned": cloned are separated objects. What you talk is several instances of the same form class. Like you may have two or more labels on the form, you can have two or more forms in your application.

How to read message from console tab view in eclipse plugin development

requirement is to read message from IConsoleConstants.ID_CONSOLE_VIEW and write it into text file.
Say myConsole (of type MessageConsole) is the reference to your console. The below code will give you the required.
myConsole.getDocument().get();
I don't think you will be able to retreive a direct stream to read the console content. Note also that the console view may have multiple different consoles, you will have to retrieve the good one.
Retrieving the content displayed in a single console should be possible going through the IDocument of a TextConsole. You can get the whole text content. You could also have a look to the IDocumentListener if you can be notified of changes.
Another solution should be to go with a PatternMatchListener of the TextConsole directly.
Anyway I don't think there is a direct solution to do this with the Eclipse console API.

I want to call an installer class on a button click in C#. Is it possible?

How can I call an installer class on a button click event which read from the registry and also write a value in the registry in C#?
This cannot be done with a single custom action. You should have 2 separate custom actions:
one which is executed on button click and reads information from registry
another one which writes information in registry during install
The second action needs Administrator privileges and should run as deferred with no impersonation in InstallExecuteSequence.
Assuming you want to set installer properties based on what is read from registry, using an Installer Class is not really an option. I recommend using a DLL custom action which gets a handle to the installer session. You can find a tutorial here:
http://www.codeproject.com/KB/install/msicustomaction.aspx