.NET

Reply
Active Contributor
WWFreeman
Posts: 27
Registered: ‎09-02-2012
Message 1 of 3 (438 Views)

Minimizing the AutoCAD Text Window

438 Views, 2 Replies
03-13-2013 09:24 AM

This refers to the AutoCAD Text Window one can toggle by pressing F2.

 

I found the property that toggles it:

Autodesk.AutoCAD.ApplicationServices.Application.DisplayTextScreen = true; // ... or false

But so far no luck finding how it can be minimized through the API. I went for doing this the WIN API way. It allows you to iterate through the list of opened windows, and to examine the window text (title). There you can find one or more windows whose name stars with "AutoCAD Text Window" and minimize them. Here is the iterator and a loop example, and here is the tip how you can minimize a window. The reason I'm not posting the code is seeing shame in mostly copy-paste work.

 

TIP: from the looks of things you might need to cast the delegate. The error would give you the name of the class it cannot cast the delegate to. Just copy-paste it between brackets to cast the delegate.

 

The risk / flaw here is that if another window with such text appears that basically has nothing to do with AutoCAD, you will have chance of dropping a wrong window and not dropping the right one. I guess I am lazy to go after double checking with help of FindWindow, as I would have to do research whether variants of AutoCAD (such as AutoCAD Architecture) use the same class name.

 

Are these instructions in vain or there is really no way to minimize the window through the .NET exposed API?

*Expert Elite*
norman.yuan
Posts: 1,062
Registered: ‎04-27-2009
Message 2 of 3 (411 Views)

Re: Minimizing the AutoCAD Text Window

03-13-2013 02:08 PM in reply to: WWFreeman

Just curious: why you must keep the text window minimized instead of closed (when set DiaplayTextScreen to false)?

 

From usability point of view, whether the text window is closed or minimized, if user want to see it, the user need to press button and click mouse once. And if you have make an opened text screen out of way through your code, what is it that makes you reluctant to close it and have to minimize it?

 

All AutoCAD user should have know simply hitting F2 toggles the text screen on and off. If your code somehow closes the text screen, user can always opens it by pressing F2 once, which is not much different by clicking icon in task bar to restore minimized text screen (may die-hard command line/keyboard oriented user would even feel pressing F2 key is a lot better than moving mouse to find and click minimized window!).

Active Contributor
WWFreeman
Posts: 27
Registered: ‎09-02-2012
Message 3 of 3 (397 Views)

Re: Minimizing the AutoCAD Text Window

03-13-2013 08:28 PM in reply to: norman.yuan

Funny you should ask. Last year I watched that guy doing this over and over and asked him about it. No rational response. I can only guess that one was about a subconscious fear the contents would go away if the window was closed.

 

"Why did the goose cross the road..."

 

This here is my mere wondering whether there is actual control over this tiny feature.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.