Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Window - Minimize Icon


Hi,How can I associate an event and know when the user has clicked the minimize icon on the window.. Why because there is no event associated to it.. Is it possible or no.. Or is there any API related to it.. Why because there is a ConstantSC_MINIMIZE .. Can I post this to the Window Queue and do somethingswith that..Pl give me your idea regarding this..RegardsArun Kumar




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Get Active Window Handle / Minimize Window
Hello,

I have two (hopefully) simple questions that I hoped could be answered.

How do you obtain the currently active window's handle? I have tried GetActiveWindow, it doesn't seem to work.

How do you minimize a window through the use of the window handle? I do not want to have to focus on the window I am trying to minimize.

Thankyou

Edit: I just thought of another question I need answered.
Could somone please tell me how to use the API SetCursor, and whether SetCursor persists through a restart?

Quote:




Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long

Minimize To Icon....
How can you minimize your program to a taskbar icon?

How Can I Make An Icon Minimize To The Tray?
How can I make an Icon minimize to the tray? (I mean in the tray next to the clock

I would also like to know pls how I can right click on that icon in the tray then and then that there a menu appears where I can click on all sorts of items

Minimize To Tray - Check If Icon Ist Still Visible
I hope this question is not to "cheeky"

Second post and I'm still a complete newbie to VB and so I just grabbed some code from MS for minimizing an application to tray. This works really fine but the problem is that I can't really figure out how it works. I just want (would like to be able to...) to make a slight adaption so that the tools checks if the icon is still in the tray because it gets lost after explorer-crashes. So mabye someone has too much time

The code is here: http://support.microsoft.com/default...;EN-US;q176085

Btw.: Where could I find out more about those Api-Calls etc?

How To Put Minimize An Icon To Windows System Tast Bar
How can i dispaly a background application in the windows system tray as an icon only.
Amendra

Minimize Window
Hi all - I wrote a small program that will use rundll to load any of the web sites (in internet explorer) that I've placed in a certain folder - my problem is that I can't control the way that they open, they all open in about a half sized window box with focus, I'd like them to open minimized, and I've tried the standard procedure, something like x=shell("blah.exe",0) and it won't do it, I then used a API call to minimize all windows, but the last two don't respond to the call...... Can anyone help me here?????
Thanks
Chris

Minimize Window
I set my program to not show up in the task bar, but when I minimize it, it just goes on top of the Start button. How can I stop this and make it disappear when I minimize it? Thanks.

Minimize Window
Is there a way to minimize a window when a command is executed
then restore the window back when program has finished ?

Minimize Window
Hi Gurus... How can I make the window to be minimized when a user click on a command button?

thank you,
kethees

Minimize A Window With SendMessage
Hi, all. I use the GetForegroundWindow API to get the handle of the topmost window(a non-VB window). Now, I want to minimize it using the SendMessage API. Is there a WM_MINIMIZE constant that I can pass to the SendMessage API function? If none, how can I minimize the window using the SendMessage API? Please post sample code. Thanks.

Forcing A Window To Minimize
Hello,
I'm currently having problems making a DirectX game window minimise. I can make it maximise but not minimise . I've seen it done before so I know it's possible. I had a brief moment of success by making the window maximise and then minimise but it's not reliable as it hardly ever works......

Please help

Force A Window To Minimize
Is anyone aware of a way to force a window to minimize itself? I know the window handle if that helps. Thanks peeps

Don't Minimize When Window Has Focus?
WinNT4

When a certain event happens in my program
it is set to miminize frmMain nomatter what.

I dont want it to minimize if it has focus.
or if something is currently being typed into
a textbox that is on frmMain

I know NT has problems with VB Focus events.
Anyone have any ideas?

Thanks much!
Garrett

Minimize Popup Window
Hi I think that the following problem will be a challenge : )

There is enough code for closing a window but not I can't find help in
maximizing and minimizing a window.As concern the maximizing I don't
want to just maximize it and that's all but in second clic to restore it
in previous dimensions. As the 3 upright buttons of Windows in a window
do, I need to find a piece of code that will do the same work.
If you could help me I would appreciate it.
Most of the code I found was in Javascript, so if there is something in VBscript or Javascript please mention it to me
Thanks on advancce

Minimize Or Hide This DOS Window
hi,
when i run a batch file it always pop up a DOS window on my windows 2000 computer.
how can i Minimize or hide this DOS window?
thanks

Minimize, Max, Restore Window
Does anyone have a code sample for minimizing to and restoring from the taskbar?

I constantly drop the forms to the taskbar but then when I need them again I go back to the button that calls the form. When it does not call the form, I then remember I minimized it to the taskbar.

Couldn't I put code behind the command button that calls the form so it will restore it?

Minimize TopMost Window
Hi,
I have an MDI form with many MDIChild forms and I also have a non-MDIChild form called from within the program. I want this non-MDIChild form to be always on top of every other MDIChild form. So I call the following API Function:

SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 400, 100, SWP_SHOWWINDOW

"Public Declare Sub 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)"

Everything works fine apart from when I minimize the MDI form, then the non-MDIChild form stays on top of every other window or program running on my pc.
I want this form to minimize when the MDI forms is minimized and I suppose I can use the same API function to do that, but I have a problem to control the MDI-minimization event.

Remove Close,minimize And Maximize Button But Retain The Icon
I would like to put icon on the title bar without the close,maximize and minimize buttons. Is this possible?

Putting A Custom Icon Into The Form Caption Bar - Minimize To Tray
Hi!

I wonder how this can be done? I've just made a very small programmer's utility for generating Property Procedure listings from a list of variables, and I wonder how I can keep this form handy at all times. A tray icon could be handy. I already have the trayicon class and it's working, but I need to hide the form from a custom command button procedure instead of by minimizing.

Thanks in advance,
Stas

I Need To Maximize A Window Which Is At Minimize State
hi friends ,
i need in asp that i can get a minimized window tobe maximised as some value of my another page is changed .here i will like to mention that i don't need to reload the minimized window but just maximise it
plz its urgent

Minimize Access Window On Opening
How can I minimize the access window when my application starts. I would like to simply see the form that I have set to open when the application starts.

Scott

Window Minimize Event Handler
Hey Guys,

Could someone please help me with code that would detect a window minimize event in VB6?

Perform An Action When A Window Is Minimize??
I would like to place an icon in the task tray when my program is minimized. I am able to create the icon but not when the program is minimized. This is what I would like to accomplish:
When the program is minimized, hide it from the start bar and place it's icon in the task tray.

Any ideas?

Thanks.

Minimize Window If Focus Lost
I have a program the runs in NT4. The "lostfocus" and "gotfocus" sub options dont work.
what I need to do is if my form loses focus, for it to minimize. how can I accomplish this?

Thanks for any help
Garrett

Window Minimize Event Handler
Hey Guys,

Could someone please help me with a window minimize event handler?

The Activated Window Disappear/minimize By Itself
Hi All,

I am new in this forum,and maybe someone can help me.

General background:
My VB6.0 program starts with USB communication to the user and gets as a respond back parameters to intiates.
Then the aplication initiates two batch files: one is transmitter and the other one initiates another batch files that starts parallely three receivers(VLAN IP data). All this with external windows XP .dll's,and Shell command.       
The received data is saved on files and then analyzed with my program.
The external transmiting/receiving procces takes a lot of time ~1Min,and the VB program looks like paralyzed in this time.


The Problems:
1) While the first interactive USB communication with the user in real time mode take place,the active window shakes
   and it is refreshed slowly.I am using the DoEvents, Form.Visible, Form.refresh, Form.Enabled = True, Form.SetFocus, Form.Show, and delays. All those in the loops and outside the loops.
   Increasing the delay time in the loops stabilyze the active window,but makes the updates refreshing active window slow.
   It doesn't happen regulary and I can't predict when.

2) While the active window is waitting for data to be analyzed,suddenly it could minimize or disapper and then it is showed minimized, and I have to maximize it back (As a user).For proccess data from the files,the program uses loop.



A)  My question is: How do you communicate or activate  
    external programs interactively displayed with the user response(to active displayed window nicely and
    still, and not shaking,and mealwhile programs running in background?)  
      

B)  My second questin is:How can I prevent the Active window to minimized to the bottom bar menu? or disappear? or become white suddenly? Sometime when the external program is done the active windows comes back or it gets its own color back,or it let me maximize it.   


Thank you very much
Gidon Zilberman

I'm Not Able To Minimize The Window Durring My Prog Run
I put DoEvents in many place in my prog but am not able to do minimize.

Where is the problem?

Thanks
Redg

Minimize, Maximize, Restore Other Window.
Is there a way to make my application tell something else to minimize/maximize/restore itself.

Example: My form commands Windows Media Player to minimize, but not just Media Player. I want to minimize/maximize/restore any window.

Why Would Picture Boxes Clear Itself When I Minimize The Window It's In...
Then sometimes if I click that picturebox again, they may all show up. So frustuating...

(I didn't do anything to alter the minimize button...)

Custom GUI - Minimize To Taskbar, Drag Window
Hi everyone,

How can I make my custom border/GUI have a minimize that goes down to the taskbar? Right now I've got it going to the system tray, but I do not want that, and once it is put in there, you can't get it back out unless you end the process.

Also, how can I make the border/custom GUI window draggable like a normal window, i.e., have a 'handle' across the top bar for them to it with.

Thanks again!

Control Program When Minimize Window Or Lose Focus
Hi,

Perhaps this question is very simple, but I've started with VB a short time ago. I've made a program to comunicate with a mail server. It is necessary to stay continusly receiving information from the server. But when I minimize the window or when I open another program, my program stops! How can I control this?

Thank you,

Eider

Minimize To Tray, But Program Still Listed As Open Window
I just got a nice bit of freeware called NoAds that allows me to block the pop-up ads. Running NoAds, however made me aware of the fact that when my own personal project is minimized to the system tray, it's the only one of the programs from the system tray that NoAds lists as "Currently Open Windows". (Whoops!)

Here's my code:


Code:
Private Sub Form_Resize()
If ResizeAllow = True Then
If Me.WindowState = vbMinimized Then
tIcon.Visible = True
Me.Visible = False
Else
I tried Me.Hide, too, same effect. I don't know why but I thought maybe the fact that my program uses a timer might be the difference, but upon removing the timer, and running the program and minimizing to the tray, still it was listed as a currently open window.

What am I failing to do that's making mine the only program in the tray that comes up listed as a currently open window?

How To Maximize And Minimize The Window Named &"Reminder&" Thorugh Code
Hi,

I developed a project in VB6, it checks the database and if the date field matches then, the application will mail the user(i.e Reminder). I compiled this project & placed the Exe in Scheduled Tasks in Control Panel and assign it to run daily at 8:00Am. So it will atumatically run daily. I am getting mails when i test from Project it works fine.

The issue here is, as soon as the 8:00 Am comes the application started running, but it is minmized in the Taskbar,after i click the application from the Taskbar the application starts working & sending mail process is completed.
If i didn't click the application in the Taskbar, that remains in teh minimized state for ever. How to solve this issue.

I hope this could be solved if i click the Application once through code & minimize it again.

Kindly reply me about it & any idea or code sample will be helpful.

Thankyou,
Chock.

How To Maximize And Minimize The Window Named &"Reminder&" Thorugh Code
Hi,

  I developed a project in VB6, it checks the database and if the date field matches then, the application
will mail the user(i.e Reminder). I compiled this project & placed the Exe in Scheduled Tasks in Control Panel and
assign it to run daily at 8:00Am. So it will atumatically run daily. I am getting mails when i test from Project it works fine.

  The issue here is, as soon as the 8:00 Am comes the application started running, but it is minmized in the Taskbar,after i click the application from the Taskbar the application starts working & sending mail process is completed.If i didn't click the application in the Taskbar, that remains in teh minimized state for ever. How to solve this issue.

I hope this could be solved if i click the Application once through code & minimize it again.

Kindly reply me about it & any idea or code sample will be helpful.

Thankyou,
Chock.



Edited by - chs on 11/28/2005 10:39:05 PM

Getting Icon From A Window ?
How do I rip the icon from a Window ?

I want to get the icon from a window's Titlebar and paint it on Target DC...please help me with this one !

Systray Icon Without Window
Hello people!

I am busy with a new project and have a minor problem creating a windowless systray icon. The service I write never has a window so making one seems a little odd to me, besides it shouldn't be necessary in my opinion. Does anyone know if there's a way to create a messagehandler for hwnd which is not bound to a window?

I only found a VB.NET reference for this:
http://jachman.wordpress.com/2006/05...hout-a-window/

The sample extends the ApplicationContext class and proves that it is possible to have a windowsless systray icon. I am building my project in C++ so that's not an option (I am posting here because it's probably a thingy of calling the right API, making no difference in whether I post in this forum or the forum of C++, whereas there is a difference in the amount of visitors).

I hope anyone is able to help, but thanks for reading and thinking with me anyway!

With kind regards,
Merlijn

Get Other Window's Icon *Resolved*
Is there a way to get the icon of another window outside my app, given the HWnd?

I'm trying to do something similar to the little window you get when you hold down ALT + TAB. I already have code to get all the windows for stuff like that, but none to get the icons of those windows.

Icon Less MDI Child Window
hi..

i'm using MDI , i wanted to display MDI child without a icon.

i tried removing the icon setting icon property to None, but
still it shows the windows default icon.

is there a way to display the child without an icon or merge the icon of child with parent

help me

thanks in advance

ICON When Minimized The Window
hi all,

I have the window with border zero(that is without caption). Now if the window is minimized, then it doesn't deisplays the icon. How can I do this. I want to display the ICON when window(with border style 0) is minimized.

Thanks.

DragDrop Toolbar Icon To Window
Does anyone have sample code, or an internet source, on how to drag and drop an icon from a toolbar to a form? I'm specifically interested in dragging an icon from a toolbar to anywhere on the form, and a label control being created at the target location.

As a starting point, how would the following simple code be modified to implement the toolbar as a source?



Code:
Dim dx As Single, dy As Single
Dim numLabel As Integer

Private Sub lblAddLabel_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
dx! = X!
dy! = Y!
lblAddLabel.Drag
End Sub

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
numLabel = numLabel + 1

Dim ctlLabel As Label
Set ctlLabel = Form1.Controls.Add("VB.Label", "Label" & numLabel, Form1)
ctlLabel.Caption = "Label" & numLabel
ctlLabel.Visible = True
ctlLabel.Move X! - dx!, Y! - dy!
End Sub
TIA,
Steven

Visual Basic Window Icon
how do you change the icon in the top left corner of the windows in a visual basic app ?

Hook A Window And Replace Its Icon.
I'm trying to find a way to change the icon for any window.
I'm doing this because I'll typically have multiple windows of an application. Each window is being used for a different purpose. Accounting, Inventory, Software developent, etc. I know how to change the caption but I want the ability to change the icon as well.

Obtaining The Icon Used For A Window Or Application
Hi, I am trying to find out how to obtain the icon image from a given Window e.g. The page with an e in used for Internet Explorer or the pot of paint brushes for Paint. The reason for this is so that I can create a small popup Window which shows all of the open applications/Windows and the icon used for them - Windows has a semi similar thing for switching between open applications. I can quite easily obtain the hwnd of any open Window, there title or class they belong to so if anyone knows of an API or code snippet I can look at it would be much appreciated.

How Do You Remove The Icon From The Controlbar Of A Window?
How do you remove the icon from the controlbar of a window while leaving the min/max/close buttons intact? The ControlBox option removes everything so its not good...

Perhaps some one knows some tricks with messing the window handle.

I want it so the icon of an MDI child won't interrupt the MDI menus (Basically remove the icon altogether.)

Cheers~

(I see programs have certain windows in this state so i know its possible.)

Icon And Exefile From Window Handle
my application now lists all window handles, that are for sure windows of running tasks that have an icon and obviously a program file.

how can i determine the icon and the filename of that application ?

thank you for any help.

Putting Form/window's Icon
I am using a form , but it is without title bar, control box and clip box. i.e. its borderstyle property is none.now i m customising the control box with coding.but i m getting problem in putting a icon for this form. i just want to show an icon when some one minimize it. (i m minimizing it through code.) as there is no title bar so form.icon is not working.window's title bar also i set fm Setwindowtext api.i used draw icon but that draws on window's client area not on title bar.form'2 showintaskbar property is true.
but i m not able to show an icon when it get minimized , any API fucntion or any other method to do it ????

let me know if it can happen ...

thanks ...

Cannot Hide DB Window With Custom Icon
In Access, Tools->Start... I uncheck the "Show Database Window" checkbox to hide the database window when the database opens.

When I enter an icon to be used for the program, the hide DB window utility cease to work on Windows 2000, but not on Windows XP, e.g. the DB window is shown when opening the database on a Window 2000 system.

Any suggestions on how to solve this?

Change The Icon Of Another Window By Its HWnd
I am trying to change the icon of another program from my VBA program. I can do things like change the title, etc... but can't work out how to change it's icon.

I am using SHGetFileInfo to load the icon from an exe.

I have found the following code from some other website but it doesn't work:

Private Declare Function SetClassWord Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal wNewWord As Long) As Long
Const GCL_HICON = (-14)


SetClassWord hwnds(i), GCL_HICON, SHInfo.hIcon

Where, hwnds() is an array of a few handles of windows i have already populated.
and SHInfo is a custom type:

Public Type SHFILEINFO
   hIcon As Long
   iIcon As Long
   dwAttributes As Long
   szDisplayName As String * MAX_PATH
   szTypeName As String * 80
End Type

and is populated by the following code:

  hImgSmall& = SHGetFileInfo(fname, 0&, _
                             SHInfo, Len(SHInfo), _
                              BASIC_SHGFI_FLAGS Or SHGFI_SMALLICON)

where fname is the path to the exe.

Where am i going wrong? I have a feeling it's the SetClassWord function because it's not listed anywhere in any API function lists.

Any help most appreciated.

How Do I Minimize A Form Without Clicking The Minimize Button???
Hi,

I would like to mimimize a form with a button called cmdMinimize???

Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved