Get TaskBar Windows
Use this board to post your code snippets - tips and tricks
3 posts
Page 1 of 1
Hello,
Because I have released the source-code to AppIconBarv3 which uses the following code I have moved this from the VIP 'First Look' section for general viewing.
Here is a nice easy way to get a complete list off Windows/Applications that are open on the taskbar.
First start a new project or use an existing project and add a "ListBox" control to the form.
Then in code-view add this underneath "Public Class Form..":
This one will get a list off all windows 'Titles'
Happy coding! cooll;
Because I have released the source-code to AppIconBarv3 which uses the following code I have moved this from the VIP 'First Look' section for general viewing.
Here is a nice easy way to get a complete list off Windows/Applications that are open on the taskbar.
First start a new project or use an existing project and add a "ListBox" control to the form.
Then in code-view add this underneath "Public Class Form..":
Code: Select all
Then inside the "Form_Load" event or whichever event you wish to use to get the list just add this code:<System.Runtime.InteropServices.DllImport("user32.dll")> _
Shared Function ShowWindow(ByVal handle As IntPtr, ByVal nCmd As Int32) As Boolean
End Function
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Shared Function SetForegroundWindow(ByVal hWnd As IntPtr) As Boolean
End Function
Code: Select all
Change the line that says "ListBox1.Items.Add..." to one of the following to get the required result:For Each TaskPro As Diagnostics.Process In Diagnostics.Process.GetProcesses
If TaskPro.MainWindowTitle <> Nothing Then
ListBox1.Items.Add(TaskPro.MainWindowTitle)
End If
Next
This one will get a list off all windows 'Titles'
Code: Select all
This one will get a list off all the programs used by the windows (notepad, Paint etc)
ListBox1.Items.Add(TaskPro.MainWindowTitle)
Code: Select all
Thats all there is to it ;) ListBox1.Items.Add(TaskPro.ProcessName)
Happy coding! cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Hmm, nice... So that was how you added the Show Taskbar Apps in your IconBar ^^
Hello,
Yes it is, I added alot more code to it though ;)
Yes it is, I added alot more code to it though ;)
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023