Get the window title or name of the user - pidgin

I am trying to write a plugin for Pidgin, and stuck at a roadblock. I want to get the name of the user or the title of the window (because the default source code of Pidgin puts the name of the user in the title). Any pointers as to where shall I look through more to get the information.
So, essentially, as shown in the screenshot below, what I am looking for is getting the string "Ashwin" from the window title, or any other place where pidgin stores it. Alternately, if we have some global variable set to the username with whom we are having a conversation, that will also work for me.

Related

Need help locating element with XPath

I am learning about xpath , can you help me go to the "i class" tag and click on reddit's up vote icon. I tried to find the comment text
I can connect the paragraph
//div[contains(p/text(),'The user name completes this')]
and find the up vote icon tag right below this comment
https://www.reddit.com/r/me_irl/comments/zg7nr5/comment/izgy4a3/?utm_source=reddit&utm_medium=web2x&context=3
You can locate the parent div block of the entire comment by the text content and then go to upvote button inside it as following:
"//div[contains(.,'The user name completes this')][contains(#class,'Comment')]//button[#aria-label='upvote']"
I'm not sure you really need that i icon element so I gave the locator of the upvote button.
In case you really need the i element inside it - it can be located similarly as following
"//div[contains(.,'The user name completes this')][contains(#class,'Comment')]//i[contains(#class,'upvote')]"
Like this:
//div[contains(.,'The user name completes this')]//button[#data-click-id='upvote']

vb6 common dialog box save as, which file extension was chosen

With the common dialog control, lets say I set
.Filter = "Text (.txt)|*.txt|Comma Separated (.csv)|*.csv|Excel (.xls)|*.xls"
If the user does not explicitly type .txt or .csv or .xls but just enters a filename, how does one know WHICH extension they want it saved as?
As you have noticed, FilterIndex can unfortunately only be used to specify the default filter, and the Common Dialog Control will not actually give you the filter selected by the user.
I too had to do the same and switch to the Win32 API version. Here's a well written example and goes into great detail about the use of the GetSaveFileName() API and OPENFILENAME structure:
http://www.jasinskionline.com/windowsapi/ref/g/getsavefilename.html
At which point, you can use the filebox.nFilterIndex parameter after the GetSaveFileName() call to see what the user had actually selected.

Setup Project: user enters a value then store it in a text file or database

As the title said, how can i do that?
I've search some tuts on google, but only for creating simple setup projects.sample
When the user enters 'something', that value will be stored in a textfile or database after installation and is located in the application location (ProgramFiles). thank you ^_^
That dialog looks like a TextBoxes dialog, and that dialog has uppercase property names for the content. If it's TextBoxes(A) the property name is probably EDITA1 so you use it in the format [EDITA1] to pass it to custom actions. Without knowing exactly what kind of custom action you'll be using I can't be explicit, but you'll probably start by having [EDITA1] in the CustomActionData property of the custom action. For (a bad) example, in a VBScript custom action you'd use the value session.property ("CustomActionData").

MFC: Delete elements from GUI

After tinkering and modifying a GUI I have been working on for some time I ended up with a group of EditControllers and Radio Buttons that I do not need any more, so I would like to get rid of them. However, if I simply delete them from the GUI edit, I get assertion errors. How am I supposed to get rid of these elements?
You need to remove all code from your program that refers to the deleted controls. For each control you want to delete, take its ID and search the source for statements that refer to it.
Start like this:
Check the ID of that given control. Copy it. Now remove the control from dialog resource.
Ensure that ID is not used by other dialogs. If not, you can use following.
Delete that ID from resource.h.
When you compile it, you'd get error (around GetDlgItem, DDX_Control etc). Remove or comment them. Remove appropriate CWnd-derived variables (like CEdit, CComboBox etc).
You are done!
If given ID is used by other dialogs (check it from Resource View's context menu Resource Symbols...), then you cannot directly remove it from resource editor. You, however, need to remove it from appropriate implementation file (of CDialog/CPropertyPage-derived class).

Adding Hyperlinks to created Bookmarks in a Word documnet using Ruby

How do you add a Hyperlink to a word document using an existing bookmark. I have been testing using IRB but continue to get Command Failed.
I have attached to a running word application have text selected that I want to tie to the hyperlink. For testing I have been trying to just add a google hyperlnk. I figure once I get that then I would be able to figure out the bookmark. This is the command I am using
doc.Hyperlink.add(word.selection, 'http://www.google.com', '','','text to display')
The two blank parms are for SubAddress and ScreenTip respectivly.
Luke-
You're very close...
Change this...
doc.Hyperlink.add(word.selection, 'http://www.google.com', '','','text to display')
...to this...
doc.Hyperlinks.add(word.selection.Range, 'http://www.google.com', '','','text to display')
There were two changes necessary:
(1) You call the Add method on the Hyperlinks (plural) collection, and (2) the first argument needs to be a Range object.
With these changes, your code works for me.

Resources