Jump to content
Macro Express Forums

How To Select The 'Details' Tab Initially In Task Manager

Recommended Posts

Hello, so the topic title is pretty much self explanatory. When I open the Task Manager (Ctrl+Shift+Esc), it opens to the Processes tab initially. The thing is that I don't use this tab at all; I click on the Details tab, since I'm more familiar with that. I would like to automatically open the Details tab every time I open the Task Manager. How can I do that?


I've tried a few different attempts of creating Macros that try to select the Details tab, yet they didn't work.


I want Macro Express to be aware of whenever I open the Task Manager (Taskmgr.exe) to use the keyboard to press CTRL+TAB five times to go to the Details tab. Can you please try to make a Macro to make it work somehow?


Link to comment
Share on other sites

What part are you having problems with? I would create a macro that was triggered by the appearance of the Task Manager window then do as you say. However I'd use control commands but that's a more advanced topic and Ctrl+Tab works just fine in this case.


You might be experiencing some timing issues. IE typing before the WinForm is listening to your input. Normally when I write macros like this I put in some long delays. Sometimes even as a variable. Then after I have it working I reduce those delays. Also sometimes the typing delays/speed.


One nice thing about the controls is that you can use them for flow control. EG "Wait for control to exist".

Link to comment
Share on other sites

I'm using Windows 7 which does not have a Details tab. Hopefully this simple approach will work. You will need to assign the macro to something different than Ctrl + Shift + Esc.



Text Type (Simulate Keystrokes): <SHIFT><CONTROL><ESC>
Delay: 100 milliseconds

' Move focus from the listview to the tabbed page control...
Text Type (Simulate Keystrokes): <SHIFT><TAB>
Delay: 100 milliseconds

' Go to the leftmost tab...
Text Type (Simulate Keystrokes): <HOME>

' Arrow over as many times as needed to reach the Details tab...
Text Type (Simulate Keystrokes): <ARROW RIGHT> <ARROW RIGHT> etc.

' Move focus from the tabbed page control to the listview...
Text Type (Simulate Keystrokes): <TAB>

Link to comment
Share on other sites

Hello, and sorry for the delay in my reply; I thought I signed up for notifications of replies to this post, but I apparently missed selecting that somehow.


Note: I am using Version, because I had some problem or something when I tried to install the latest version (and I believe that's one reason to why my macros didn't work). But anyways:



Cory: I've tried the simple attempts with no luck, so I was thinking of a more advanced approach like you mentioned, using "controls" which I don't know too much about. What's that WinForm thing you're talking about? I've also tried to put in delays to see if it works, it never did. "Wait for control to exist"?


terrypin: Thank you so much for creating that! That's pretty much exactly how I set it up before. I even tried putting a delay in the beginning, with no luck. I thought this example would've been perfect, but it doesn't work here. I don't understand why Macro Express doesn't see Task Manager? I see no running man icon in the bottom right corner of the screen.


Alan: I see what you mean by activating the macro with the shortcut keys, and as a matter of fact, that possibly could work, yet haven't tried it yet. The reason why is because CTRL+Shift+ESC is a little annoying compared to the old skool CTRL+ALT+Delete. So I avoid pressing the CTRL+Shift+ESC with a 3rd party program I got. If you double click on the Taskbar, it opens the Task Manager. So easy and I got used to that. So I open the Task Manager by that method. Maybe if you modify your macro, let me try it out, ya?

Thanks all for your replies.
Link to comment
Share on other sites

Terry's approach is sound: set the macro to activate when "Windows Task Manager" opens.


His approach for navigating to the tabbed page is different than my approach, but both are likely to work.


Cory's suggestion of using controls is more elegant than the approach Terry and I articulated -- acting on the user interface via keystrokes. But controls are more challenging to learn. My experiences of acting on controls programmatically via Macro Express have been mixed. When the approach succeeds, it's phenomenal.

Link to comment
Share on other sites

Hmm, I may have figured the reason why the macro becomes unresponsive. I tried a different example to show a window that is minimized once the Task Manager is opened, and it showed that window.


So is there some option that causes Macro Express to never use a macro on Task Manager itself? (or in other words: Is Task Manager ignoring any macro that is attempting to access it?)

Link to comment
Share on other sites

Nope, I was incorrect. I finally figured it out. Apparently Task Manager runs as an administrator, and Macro Express isn't running as an administrator. I ran it as an administrator, and it worked!


I just hope that all my other macros would still work. It's too late at night for me to try it out now, so I'll try that tomorrow.


Thanks for everyone's responses.

Link to comment
Share on other sites

Pleased to see you have it working.


I'm curious about your earlier comment: "If you double click on the Taskbar, it opens the Task Manager." That doesn't happen here on my Windows 10 PC. A double left click does nothing. A single (or double) right click displays this menu, from which Task Mgr can then be opened.



Link to comment
Share on other sites

A WinForm is a Windows Form, the "windows" in Windows. IE practically every application you have running in Windows including the Task Manager. Technically the WinForm is the class in .NET and is the base controls we build everything on. When I write a user interactive program I start with a WinForm. It looks like this. On top of it I place controls like buttons, text boxes, and so forth. Hence why these are WinForm based applications.


Controls are just about everything you see in a WinForm including the form itself. Every control has a handle. A handle is a address in your Desktop that Windows knows. Handles are random and ever changing have to be. IE imagine having two of the same applications running at the same time. MEP can interact with these controls. EG get the text from a control, send text to a control, click on a control. Understand when MEP does something like setting a control's text it's not using keystrokes, it's doing it in one shot programatically. Or clicking on a button doesn't actually involve the mouse. In fact you can make the entire WinForm invisible and interact with it. EG you want to do some trigonometry so you open the Windows Calculator as a hidden window and interact with it's controls to enter value and click the cosine button and retrieve the results from the text box.


I think you can see the advantages here. You can use it for flow control, EG "Wait for Control", which will proceed as soon as the program is ready instead of having to put an overly long delay in to accommodate the worst case. And you don't have to know where the control is. So if a user resizes the calculator it doesn't matter.


Learning to use control command in MEP seems an advanced topic but it's no more difficult than learning something like the text type command. Granted it's a more difficult concept at first but I wish I would have taken the time to learn it in the very beginning. Had I it would have saved me hundreds of frustrating hours. Remember those bits of advice your parents gave you when you were a teen that you ignored? The ones that later you looked back on and realized had you followed such advice your life would have been much better and you would have been much richer? This is one of those things.


If you do decide to get into ask me to explain the Get Control command. I was using controls for a long time without understanding and it made life very difficult for me. Everyone needs to understand this before trying to use controls. The rest of the learning is covered really well in some samples provided by ISS. There's one using Windows Calculator that's really good and simple. I think it's on the support website and if not the samples.mex file that installed with MEP.

Link to comment
Share on other sites

terrypin: I have a 3rd party program that enables that option for me. Check the attached image.


Cory: Thanks for the explanation of what you were saying. That sounds pretty advanced and thanks for saying all that. But I finally figured out what the problem is. I stated what it was a few posts back.



Now I have one little tiny problem =) I have Macro Express in my Startup folder, and I set that shortcut to run as an Administrator. Yet when I restart my computer and the computer starts up, Macro Express doesn't automatically run; I have to manually start it. Lame. But I believe I know the solution. No worries about that.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...