Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 11th, 2005, 01:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default Restoring minimized window

hi all..

i'm triying to restore a window that is minimized. i have the handle of the process and i can get the hwnd of the window with GethWndFromProcessID.
But im using SetWindowPos to get the windows, but if the proccess if minimized it get the focus but remain minimized... i want to restore it to it previous state.. maybe there is an api i didnt find around it to do it???

my parameter to SetWindowPos are hVentana, HWND_TOP, 0, 0, 0, 0, TOPMOST_FLAGS

hventana = handle to the window
HWND_TOP = Places the window at the top of the Z order.
TOPMOST_FLAGS =

SWP_SHOWWINDOW = Displays the window. OR
SWP_NOMOVE = Retains the current position (ignores the X and Y parameters). OR
SWP_NOSIZE = Retains the current size (ignores the cx and cy parameters).

SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

looks like the parameters are wrong, but at least i get to change the focus to that windows...

any idea??? or any other api???

HTH

Gonzalo
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old July 11th, 2005, 01:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you try:

Public Declare Function OpenIcon Lib "user32" Alias "OpenIcon" (ByVal hwnd As Long) As Long

This is the MSDN: The OpenIcon function restores a minimized (iconic) window to its previous size and position; it then activates the window.

Marco
 
Old July 11th, 2005, 02:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi marco..

just try it.. but no luck... it doesnt restore the window...

i forgot to mention that the function to restore the window is in a dll outside the main exe (dont know if this make that work diferent, but worth the advice)...

thanks in advance...

HTH

Gonzalo





Similar Threads
Thread Thread Starter Forum Replies Last Post
Popup window automatically minimized on click! elisabeth Javascript How-To 19 January 29th, 2017 02:43 AM
change form color when minimized maricar C# 3 September 10th, 2008 07:34 PM
how to blink window in minimized state serveshsaxena Javascript 1 January 13th, 2007 12:55 PM
how to blink the minimized window vickyj Classic ASP Basics 0 January 25th, 2005 07:18 AM
New created popup window automatically minimized! elisabeth Javascript How-To 1 September 21st, 2004 07:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.