VS isolated shell creating custom document windows - visual-studio-2010

I am trying to create custom document windows in VS isolated shell. What I hope to have is something similar to a ToolWindowPane where I can extend it for my custom tool windows and set the content to my custom user control. However, I am not sure if this is possible for VS document windows. I could not find any examples on how to extend the superclass WindowPane in order to create custom document windows that can be repeatedly created dynamically.
Any pointers or suggestions are greatly appreciated!
Edit: Or is there a way to prevent tool windows from restoring to its previous state on VS start? I basically want all of the tool windows to act like document windows and reset/delete themselves on close.
Edit2: Solved previous edit. Set transient flag to true, which prevents tool window from opening on IDE start.

Found work around here:
http://social.msdn.microsoft.com/forums/en/vsx/thread/d60f8cef-2523-4b53-8f24-92eb90912e7c/
However, if anyone has solution on how to create a custom document pane, that'd be great. ToolWindowPane has several drawbacks that I would rather avoid.

Related

Handle GUI window changes

I'm doing an automation script for installation wizards using AutoIt. I'm trying to handle window changes in some way.
Can some one explain how these GUI's work?
When I click on the Next button it looks just like the components in the GUI is beeing changed. Is this tha case? Or is a new window created and the old destroyed?
I've noticed that the process ID is the same for all windows.
I'm sure there is some way to know which "state" the GUI is in, or which step?
By the way. All the windows has the same title.
Thanks
/Anders
This will be dependant on the program you are automating.
The easiest approach would be to look at what changes in the GUI between stages, likely candidates are if there is a label that is giving instructions for that step, or a button that has text changing (e.g. if the button says "Finish" then you know your at the end).
Most installer programs have child windows for grouping the controls of each stage. These are typically implemented as dialog resources (as can be seen when using something like reshacker on them). So although the window remains the same, the panels are being created/destroyed as appropriate. This is a very neat method of doing it, for the obvious reason that you don't need to have to code to create/destroy a lot of controls. Resource created dialogs don't have nice class names like windows sometimes do though, so this may not be a reliable way to check the state.

Custom folder field for windows 7

I would like to be able to add a custom field to folders in windows 7, and then be able to show that column(field) when viewing the folder in explorer (sort and group etc).
Question:
How can I achieve this? (is there a program I can buy / use or is there a way of doing this in windows 7?)
Example use case: I have folders for each job that I do - I'd like to mark the folder as "pending", "done" etc. I'm using custom folder markers at the moment - but that's limited. Having a number of these fields would be really powerful.
Basically, you need to create a new Windows Property. See Windows Property System at http://msdn.microsoft.com/en-us/library/ff728898(VS.85).aspx. I do not know of any program that allows you to create properties.
Moreover, see Creating Custom Properties at http://msdn.microsoft.com/en-us/library/cc144135(VS.85).aspx.
Here is an MSDN search for "Windows Property System" to get you started (http://social.msdn.microsoft.com/Search/en-US?query=%22Windows%20Property%20System%22)
Note, that Windows Runtime (WinRT) will make handling this properties fairly easy.
See: http://blog.rodhowarth.com/2008/06/how-to-set-custom-attributes-file.html
It appears using the DSOFile DLL from Microsoft you can add custom attributes to a file as long as it is on a NTFS.
However re-saving some file types depending on how their applications handle it - may strip the previously added custom property.
I think, you are just being silly, this will quickly overwhelm you with information overload,
you should simply instead of adding columns, just create folders and dump every folder you need inside it like so,,,
> - Pending
> - client 1
> - client 2
> - Done
> - client 3
lets, say you have finished with client 2 you just drag and drop it on the Done folder, or cut, and paste it on done,
easier to manage,
here is a something, I stumbled across, I think its alot more difficult to manage eitherway, your better off using excel, or simply the structure I mentioned above.
http://rkeithhill.wordpress.com/2005/12/10/msh-get-extended-properties-of-a-file/
hope this helps somehow.

how to get the .tsr file in QTP

We all know that the .tsr file stores the information of the object repository, and We can load the file to an ObjectRepositoryUtil Object in VBS, then we can do a lot through this object.
But how can I capture all the widgets in a window and stores into the .tsr file using VBS?
I mean when we do the following in the QTP GUI:
Resources->Object Repository Manager->Object->Add Object->
"CLICK THE WINDOW WE WANT TO CAPTURE"->File->Save
we actually get the .tsr file of the window and all its components we want to capture.
But how can I do this in VBS, does it have any API?
I look up the document called ObjectRepositoryUtil and find the method GetAllObjects, but it is just not the same thing.
Could anyone solve my problem ? I would really appreciate it.
Thank you.
I'm not sure why you want to automate creating an object repository. Usually object repositories are created once and then used for creating tests.
Are you familiar with QTP's Navigate and Learn feature, it allows adding all objects from an application while interacting with the application.
If you are looking for a tool or code that can actually mimic the object capturing capability of QTP, outside of QTP - then no such tool/code is available as of now. However code can be written to retrieve the object properties of an application and that I assume you are aware of.

Creating quick GUI front ends

I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain.
I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window.
So, basically I'm looking at some corss-platform program that lets me create a window from a text description, probably XML or the like. Please suggest.
Thanks
Jeenu
Mozilla's XUL is a cross platform application framework - . You could write an app as a Firefox plugin or a standalone XUL application.
mono and monodevelop could work for this. Or even something super simple like shoes.

Update desktop "show window contents while dragging" setting programatically

One of my programs seems to be changing the Display Properties > Appearance > Effects > Show window contents while dragging setting to off every few hours.
I'm not sure exactly which program, or when it happens. I have a number of programs that seem like likely culprits - wallpaper rotators, software for multiple monitors, multiple virual desktops and switching, and a few others.
I am just thinking to create a little batch script to run periodically and set the setting back to on.
Does anyone know how to do this in windows? I'm using xp pro sp3.
Thanks!
The best option is to do this programmatically using the supported API. i haven't tested this, but it should do the trick:
SystemParametersInfo(SPI_SETDRAGFULLWINDOWS,
TRUE,
NULL,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE)
You can use SPI_GETDRAGFULLWINDOWS to see if the the bit has been flipped to avoid unnecessarily triggering a WM_SETTINGCHANGE.
You can use RegMon to find the program that keeps changing your settings. Maybe that's a better start than hacking around it.
There is a simple and effective solution to this problem. In Notepad type the following lines :
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop] "DragFullWindows"="1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows] "CheckedValue"=dword:00000001 "UncheckedValue"=dword:00000001
Save the file as "Show Window Contents.reg" Double clicking this file and restarting will cure the problem permanently. Post a message if you find this useful.
Aravind Banerjee
It seems the registry setting which controls that preference is HKCU\Control Panel\Desktop\DragFullWindows. You can read more about it here. However, trying it on my own computer does not register the change right away, so a batch script won't do it. You'll probably have to write a program to manipulate it using SystemParametersInfo(). You can pass it the SPI_SETDRAGFULLWINDOWS parameter. Here's a page explaining it more. Here's a page showing how to call it, albeit not for the same parameter.
I suspect it's kept in the registry - maybe [HKEY_CURRENT_USER\Control Panel\Desktop] - "DragFullWindows"?
It would be easy to flip the registry setting back to "1" every hour or so with a batch file.

Resources