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




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?ThanksRedg




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

Load Printers/Fax Window From VB6 Prog.
I have a need to allow user to swap between printers while running an application written in VB6. Can someone help me and explain how do I load up the Printers/Fax window from the application and using the Printer.Print redirect the print output to the new default device.

Drag-and-drop A Window Into My Prog
Let's say i have Notepad open. Im my prog, i have a picture box. How hard would it be to allow the user to drag notepad into the picture box?

I know how to use the SetParent function. I know how to get the handle for the notepad window. I just dont know how to drag and drop the Notepad window.

I know there is a way, the only question is how clean will it be and how much will i have to improvise...

Thanks a lot.

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

Howto Kill Another Active Window From Another Prog
I am trying to prevent my user from running multiple instances of the same program. I think there is a win32api declaration to do this but i am not sure. Ive tried App.PrevInstance with no success.

When the user tries to load the 2nd instance of the same program, i want it to automatically kill the first instance if it is running?

Any thoughts on how to do this. I tried the CloseHandle statement but with no success, perhaps i used it incorrectly.

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.

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 Constant
SC_MINIMIZE .. Can I post this to the Window Queue and do somethings
with that..

Pl give me your idea regarding this..

Regards

Arun Kumar

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

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?

Form Freezes Up Durring Refresh
I got a form with a text box to show a status and a progress bar that I created. When my program is working and I am refreshing the screen often, the screen will just freeze up. Mouse works and moves fine but the screen just quits refreshing and part of it will be just a white rectangle. I'm only refreshing the form once a second and it 's still doing it.

How can I fix this?????

Close Msgbox Durring Run Time
is it possible to close a message box after opening it in code? i would like it to show for 5 seconds then close itself.

Thanks,
Brian

Wrong Option Durring Form_load
I have a form that has a listview control on it. The selection that the user makes sets properties of another form that is not loaded yet. So the selection forces a load of the second form. With me so far?

Here's the problem. If the user selects the wrong option and reselects another, that option is ignored and the first (incorrect) option is used when the form show is called because the form_load does not (and shouldn't) run a second time.

Am I explaining well enough? Any help?

Thanks,
Bernie

Adding Controls Durring Runtime In VBA
I have been searching all around the web to add controls during the runtime of my MS Access 2000 form, but have had no luck. I have a form that opens a recordset and add a lable for each record in the recordset. I have seen several people say to just add the for and change the visibility property but that won't do, there is no max. I have also tried form.control.add and load(object as label) but none of this works. I don't know how diffrent VBA is from VB but I have had no luck with VBA. I would appreciate any help I can get.

Add Multiple Instances Of The Same Control Durring Run-time
If i want to make my own original control such as a listbox control to show images, using an infinite array of picture boxes. i dont know any other way of making a control like that unless i add a lot of picture boxes while developing the list box. is it possible to make control be created durring run-time? and if so is there a limit?

RadioButton Problem Durring Form Validation
I have a form with a group of radio buttons. When all required fields in the form are not filled out I re-display the form keeping all the users current values.

My problem is, how do I set my radiobuttons to the proper value it was before.

Agh as I type this out Im beggining to realize this is not really a VB problem. But Everyone here normally gives such good answers, so I am going to post this anyway and cross my fingers.

Change Column Width Durring Run Time
Hi All,

Is it possible to change the column width in a list view depending the text length?

I have created a list view object and I have the Column header set to 5000, but I want to be able to adjust to column width to the longest text string in the list.

Thanks

Execute Console Prog Inside Vb Prog
i have some console based programs. and i would like to create a gui front end with it wherein the console prog is embedded with my vb prog and the output is placed in a textbox. is this possible? i have a code that is capable to output console to textbox but this proceedure requires the prog must be present and not embedded.

thanks a lot!

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

How To Make Ur Prog Run Another Prog In Form_load....
How would I make the program I am making run another program found on a users computer as my program starts up. I no I need to put the code in the form_load bit but Ive got no idea as how to do it. FOr example as someone opens my program, it plays a sound stored on their computer in the windows directory called hello.wav...any ideas would be gratefully 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

How Can Minimize Button Act As Minimize To Tray ?
how can minimize button act as Minimize to tray ?

i have separate button for............ Minimize To Tray........ but i want that..... my minimize button of form must work as minimize to tray !! how can i do that !!

Run A Prog Inside Of A Other Prog
is there any way to run an existing program "in" a form.

i have tryed this but i would not know how to begin nor do i know in what you must putt it.

dos anyone know how to run a prog inside of a other prog????

Call Vb Prog From A Vb Prog
I am trying to build a monitor program to run a separate program based on records in a file. If the file is there then it reads each record. The records contain 3 fields, the path/name of the 2nd file the other program will run over, the name of the program to run and the path/file name to send the results to. The called program will FTP the file or create a new record in an existing file on a server. Something like this...

Control file:
rcd 1 "c:
eceiveclient1.ord","Proc1.exe","inboundorders.client1"

rcd 2 "c: ransmitclient2.ord","Proc2.exe","outboundship.client2"

rcd n input file, process pgm, output file


Can I call program X passing it parms A and B?

Type "minimize" To Minimize Form1 ***SOLVED***
hi
I have this code:

VB Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)If KeyCode = vbKeyReturn Then    If Text1.Text = "minimize" Then        Form1.WindowState = 1        Text1.Text = ""    Else         Text2.Text = Text1.Text        Text1.Text = ""    End IfEnd IfEnd Sub

when i press Enter, it cleans Text1 but also create a new line...
then if I type something; press Enter; then try to minimize, it doesn't work
What can I do

Thanks

Add A Button In Front Of The Minimize-button Kind Of 'minimize-to-system-tray-button'
At the moment I'm trying to add an icon in the system tray for my app - maybe i'll make it.
When I have made it I'd like to add a button in front of the min-button on the title bar of the apps form (like the one on All-API's API-Guide ), in order to empower the user to minimize the app even further, i.e. to the system tray - how can this be achieved?

thx,

Helger

Difference Between Immediate Window , Watch Window , Localas Window
difference between immediate window , watch window , localas window ...?

Help On A New Prog.
whats the code for when an user inputs data into the text fields and when he presses the button that says submit all that data is send to an e-mail address?

Using A DOS Prog With VB
Is it possible for me to:

*Create a .bat file
*Run it
*Make VB continue AFTER the .bat file is finished? (NOT before)
(The .bat file runs a DOS based EXE file. (MP3 encoder)

See my problem?
The VB app sets up the WAV files for encoding, and writes the .bat file. It then "shells" the .bat file.
The .bat file uses a thirdparty EXE file to encode from WAV to MP3. But only in 8+3 names. So the VB app is supposed to use FileCopy and Kill to get it right...

Yes, I could just use a DLL file and make the encoder, but that is way out of my league. (I think)

Any replies are welcome!

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