Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How To Maximize A Window From The Task Bar

I need to maximize a program that is in the task bar. I'm using VBA from
within Excel. I already used AppActivate but it only works if the other
application is ALREADY maximized. I also tried using some calls to the
Windows API, but they also would only bring a window to the top if the window
was ALREADY maximized. I coundn't get a window that was minimized to be the
window on top. Well actually, I came close, but the main problem is FINDING
THE HWND for the window that is minimized in the task bar.

If someone could give me at least the code to find the hwnd to the minimized
window, I cound probably figure it out from there as long as there is a call
that will maximize at the same time.

Hope I was clear enough.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default How To Maximize A Window From The Task Bar

....will application.windowstate not do it?


Duncan


FourBlades wrote:

I need to maximize a program that is in the task bar. I'm using VBA from
within Excel. I already used AppActivate but it only works if the other
application is ALREADY maximized. I also tried using some calls to the
Windows API, but they also would only bring a window to the top if the window
was ALREADY maximized. I coundn't get a window that was minimized to be the
window on top. Well actually, I came close, but the main problem is FINDING
THE HWND for the window that is minimized in the task bar.

If someone could give me at least the code to find the hwnd to the minimized
window, I cound probably figure it out from there as long as there is a call
that will maximize at the same time.

Hope I was clear enough.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default How To Maximize A Window From The Task Bar

Create an instance of the Word application and take advantage of its 'tasks'
collection. Use the visible, name, and windowstate properties to locate
instances of the application that are minimized to the task bar and then use
the activate method to activate that minimized application.

Excel doesn't have the same tasks collection but it's easy enough to borrow
from Word.

Steve Yandl


"FourBlades" wrote in message
...
I need to maximize a program that is in the task bar. I'm using VBA from
within Excel. I already used AppActivate but it only works if the other
application is ALREADY maximized. I also tried using some calls to the
Windows API, but they also would only bring a window to the top if the
window
was ALREADY maximized. I coundn't get a window that was minimized to be
the
window on top. Well actually, I came close, but the main problem is
FINDING
THE HWND for the window that is minimized in the task bar.

If someone could give me at least the code to find the hwnd to the
minimized
window, I cound probably figure it out from there as long as there is a
call
that will maximize at the same time.

Hope I was clear enough.

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How To Maximize A Window From The Task Bar

Thanks Duncan and Steve,

However, the application that is running minimized in the taskbar is not
Excel. After two days of trying and now the third day. I finally found what
I needed using the Windows API. It took me five hours today to complete the
task. I can't believe how hard it is to work with the API ! You have to get
the handle to the desktop window, then sequence through all of the Desktop's
child windows until you get the handle to the window you want, then you
activate that child window.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default How To Maximize A Window From The Task Bar

As long as you have a solution that works, that is the important thing.
However, you could have used the tasks collection from Word and saved a lot
of time. The 'name' property of a task is the "friendly" name which might
be different than the name of the process (example, "Solitaire" vs
"Sol.exe") but presumably you would know that name.

Steve Yandl


"FourBlades" wrote in message
...
Thanks Duncan and Steve,

However, the application that is running minimized in the taskbar is not
Excel. After two days of trying and now the third day. I finally found
what
I needed using the Windows API. It took me five hours today to complete
the
task. I can't believe how hard it is to work with the API ! You have to
get
the handle to the desktop window, then sequence through all of the
Desktop's
child windows until you get the handle to the window you want, then you
activate that child window.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to maximize the Excel window? Eric Excel Discussion (Misc queries) 10 May 7th 10 01:56 PM
Re-post: How to maximize the Excel window? Eric Excel Discussion (Misc queries) 3 May 6th 10 01:10 PM
maximize window Bill Excel Discussion (Misc queries) 2 October 9th 07 02:43 PM
Can't maximize Excel window Neon520 Excel Discussion (Misc queries) 3 February 15th 07 01:28 PM
Can't maximize the Excel window Neon520 Excel Discussion (Misc queries) 2 February 15th 07 08:28 AM


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"