Program Graphics Dissapearing After Program Loses Focus.
How would I fix this? I have a routine that will reBLT the graphics after this has happened, but I cannot figure out which trigger event to use.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Do Something When A Form Loses Focus To Another Program?
I'd like for my program to do some things when the user goes away from it (Like clicks anywhere other than the form, like the desktop or Notepad or whatever), but I have no idea how to do it. I've tried to use Form_LostFocus but it didn't do anything. Right now I just have a Standard EXE project open with only the following code:
VB Code:
Private Sub Form_LostFocus()Me.Caption = "AAAAAHAHAHAHAHAHHAHAHA"End Sub
The form's caption doesn't change when I go away from it. This isn't really what I'm wanting it to do in the long run, but I just put it there to see if the LostFocus thing works. I'm eventually going to want it to call some functions instead.
Main Program Loses Focus..
hi again folks..
i really appreciate all the help you guys give me with this stuff..
i am learning..
anyway,... got my program running under windows xp, but when it starts the .exe file in the dos type window.. .the focus of the main program changes to that, which is fine.. but it will not refresh the main program screen and you cannot get at any of the controls on it..
here is what i use to run my exe after the main program is running with a shell command...
strPath = (progdir & " -game tfc" & " -port " & portnum & " +map " & mapuse)
x = Shell(strPath, vbNormalFocus)
so, the other exe opens now in a dos type window in windows xp and when i try and go back to the original window of the main program., it is all wiped out by the new program opening, and the controls cannot be seen or clicked on ...
any ideas ?
thanks,
Kevin Rea
krea@socal.rr.com
DataSet Loses Info After MdiChild Loses Focus.
I think this is roughly the right forum to post this to...if not, please let me know.
My question involves MdiParent and MdiChild with OleDB. I've got a MdiChild that has a datagrid that I fill using a DataAdapter and a DataSet. The grid and all works great. I'm now trying to implement a delete record task that I initiate from a menu. The menu happens to be attached to the MdiParent. It seems that when I access the menu and call a Delete procedure from the MdiParent (Delete procedure is in the MdiChild.vb), the procedure loses all the info on the grid's datasource, namely the DataSet. I can't get back to the DataTable, I can't reset the DataSet, etc. I can get the clicked row in the grid, but the grid acts like no datasource is there (The DataSet is Null). Best I can assume is that the when the MdiChild loses the focus (by clicking the menu item from the parent) after filling the dataset, everything goes Null. I guess I can buy that, but it just seems odd to me. Does anybody have any ideas on how to proceed? I have quite a few things I want to do in this manner (deletes, edits, etc.) I'd rather not have to deal with merged menus, but if I have to, I guess I'll have to.
Thanks for any help you can provide.
Get My Program In Top And In Focus When The User Starts The Program.
Hello. I have a problem I have not found any good solution to:
How do I get my program to be on top and in focus whenever it starts, no mater any other circumstances.
The program I'm designing is connected to a remote control. Hence it must be able to control the entire computer as the user like.
I've tried searching, but found no satisfactory solution.
Access Report To Rtf File - Loses Graphics And Formatting
My program creates opens a report using DoCmd.SendReport
It sends the report in RTF format as an attachment in an email.
The reports looks OK but it loses a lot of the formatting ... i.e. any highlighting of text in addition to losing the graphics or company logo.
I've used both the image control and the Unbound object control to insert a company logo but when you open the email attachment which is an rtf file of the report, the logo graphic does not appear.
Is there any way to get around this and still keep graphics in a report after it has been exported to a different format?
Thanx,
Lorin
Graphics Program
Anybody knows a good program to draw the pictures for my flash animation.
Program Graphics
What do people use to make the graphics for there program? I have been working on a audio player and i want to give it a better graphical interface but I'm not sure where to go or what to do to make these graphics. I need buttons, backgrounds, etc.
How Can You Capture Graphics From Other Program
I would like to know how to capture graphics from another program that is running.
The project that I am working on would monitor another program running a card game. My project would "see" the face up cards dealt and report stats, odds, and possible hands. This is not an attempt to cheat by knowing the other players cards. My project would only look at cards that are face up that everybody can see.
Unless there is a better way, I think that if I could "see" or capture a portion of the other programs window at preset coordinates, my project could translate the image into what card was dealt in that location.
Any help would be greatly appreciated!
speters02@insightbb.com
Always On Top... And Then Loses Focus?
Hello, I have a dialog form that I can set always on top with:
CODEPublic Function AlwaysOnTop(bTopMost as Boolean) As Long
If bTopMost Then
AlwaysOnTop = SetWindowPos(Me.Hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
Else
AlwaysOnTop = SetWindowPos(Me.Hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
AlwaysOnTop = False '?
End If
End Function
Drawing Graphics Over Exsisting Program
I was wondering how to draw graphics over a program that is already running, preferably translucent, but I'll take what I can get. For example, a program that could display some text over a game like UT2004 of CS:S with out minimizing it.
When A Form Loses Focus...
How can I fire an event when my form (and the controls on it) lose focus. For example, if I click on another application, which is running in the background, how can I set it so that the form fires the Beep function?
BTW I already tried Form_Lostfocus() and it didn't do anything...
Closing App When It Loses Focus
Hi,
I've browsed this message board, and found many posts concerning closing apps, but my question differs slightly.
How do you get an app to close when it loses focus?
For example, I've created a button in an AS/400 emulation session that will launch my VB program.
The VB program is basically an image viewer. What I want to know is, can I make my VB program close automatically if the user clicks on any other program running in the windows taskbar?
Thanks
How To Tell If Program Got Focus From Other Program Or Within Itself
How do i know if the gotfocus routine was fired becuase the user clicked on a different program and then went back to the vb program or if the gotfocus routine got fired because the program called a different function and then calls back to the other function giving it focus this way? I hope that makes sense.
Thanks
Graphics Program Using Data From Text File
Hello,
I'm creating a program that displays a dxf map onto a vb picture box. Since the dxf files that I'm working with are absolutely huge (possibly up to 1 Gig) it is useless to simply parse through the dxf file looking for objects to draw onto the picture box.
This is why I decided to make a 'process dxf' routine that looks through the dxf file and extracts only the data that is needed to draw everything to the picture box. This information is stored in seperate files, one for all text entries, and one for all lines,circles, and arc's.
This speeds up the loading time of the map considerably, but I'm thinking more can be done to speed up the routine.
Is there some way I can use memory/hash tables/ or anything else to speed up this routine further?
Currently, it takes about 20 seconds to load up a map of size 33 Mb. This is pretty fast, compared to other dxf viewer's on the market such as Volo View Express. BUT, all of these programs on the market allow quick navigation/zooming with the drawing, whereas I simply redraw the image everytime the user zoom's or pan's around the image. This takes too long!!!
I'm using random access files right now, and just to give you an example of the kind of data that is located in this file here is my Type declaration.
VB Code:
'This is the Type declaration I use for storing all line information 'Line objectPublic Type mapLineType XPosStart As Single 'X position of the start point YPosStart As Single 'Y position of the start point XPosEnd As Single 'X position of the end point YPosEnd As Single 'Y position of the end point Colour As Long 'Colour of the line Thickness As Single 'Thickness of the lineEnd Type
So when I'm drawing the map on the screen, I open the 'lines file' and retrieve the information above and then display it.
Is there some way I could do this only once, so that every time after this, the graphics could be displayed much faster???
I'm frustrated and can't think of anything here, but there must be a way, since every other program does this kind of thing.
Listview Background When It Loses Focus
I recently converted several ListBox selection lists to ListView selection lists. Selected items in the ListView have a nice dark blue background when it has focus, but change to a pale tan/gray upon losing focus. This is very confusing to the users as it is difficult to discern which records are selected in the Listview. Is there any way to disable the color switch or a way to set it to the "in-focus" color?
DirectDraw... When Form Loses Focus...
Okay, normally DirectDraw slows down windows when it loses focus right? Well, I fixed it so that when the form is minimized it doesn't render the screen anymore, but if I just click on a window behind the form, it doesn't minimize the form, just makes it lose focus... I have a variable called Pause that I want to set when the form loses focus. I tried using the LostFocus event of the form, and the picturebox I'm rendering it to. Didn't work. I tried using the Deactivate event. Didn't work. I tried using Screen.ActiveForm and Screen.ActiveControl, neither worked.
So, how do I detect if they clicked on a window behind my form, causing the form to lose focus?
VB App Stops Responding When It Loses Focus
I have a short VB app that pings the ip addresses on our corporate intranet. All goes well as long as the program does not lose focus while running. If any other action takes th focus the ping program stops responding and will not resume even after regaining focus.
Any suggestions?
How Do I Determine When A Form Loses Focus
My vb app opens an excel spreadsheet in a browser control by passing it a url similar to "c:apps est.xls".
When I have the spreadsheet open in my browser control, I cannot open another excel session outside of the application. I am also unable to copy/paste between my app and an additional spreadsheet when I start with an open excel spreadsheet before I run my app.
My solution has been to try to disable the browser control when the form loses focus. I have tried the form_unload event, and the CallWindowProc lib, but nothing works.
I have spent countless hours on this and would appreciate any suggestions.
Problem When Form Loses Focus
I'm making the infamous snake game, but i'm running into a bit of a problem. All of the graphics (walls, apples & snake) are drawn on a picturebox, but if you minimize it or if another window goes overtop of it, whatever walls, apples or snake was under said window will disappear, never to come back. How would i get around this? I tried putting info in the form_GotFocus event, but that doesn't work. Any ideas would be most helpfull.
Thanks in advance,
Joey
Textbox Loses Focus To Listview
I have a form which has a frame with a listview in it.
When I click on an item, the listview's item_click event:
makes another frame visible (which has textboxes in it)
then does setfocus to one of the textboxes.
The problem is that the focus then drops back to the listview item after about a 1/10 of a second..[just slow enough to see it happen].
I have to click on a textbox for it to regain focus.
This occurs in more than one program where I do the same thing.
I have tried every workaround I can think of..... doevents, etc
Anyone help?
[SOLVED] How To Tell When Window Loses Focus?
Well, I've been coding for a little bit in VB6, and I'm trying to figure out how to get my Form to realize when it loses its focus (or whatever it's called when the window isn't selected anymore), so that it can minimize itself.
All I really need it to do is give me a msgbox telling me it lost focus, I can get the minimizing itself on my own.
Thanks
Form Loses Focus On Load
Does anyone know why a form would lose focus on load? Is there a way to make sure that the form will have focus on load? Thanks, Jeremy
Pausing Game When Loses Focus
What event is called when a form is no longer the selected form? Deactivate and LostFocus doesn't seem to work?
When exactly are they called?
Combobox On Toolbar Loses Focus In VB6
This is really infuriating and if anybody can help, I'll be eternally grateful.
I've placed a combobox on a toolbar on an MDI form. Works perfectly in every way except that, when I open a new child form, the combobox loses the focus and consequently, no keystrokes are processed in the combobox.
So far, the only method I've found that works to return focus to the combobox so that you can edit the contents, is to manually click on an empty area of the toolbar and then click back into the combobox.
Obviously this is not very professional and so, after trying everything I think of (including passing focus to other controls off-screen and calling EVERY combobox event) I've had to admit defeat on this issue.
I've done this many times before in VB4 and VB5 but don't recall ever coming across this problem before.
Thank you all for any help you're able to provide.
App Loses Focus (Timer Vs SubClass)
Hi - I searched the threads but I couldn't find an answer.
Obviously using subclassing is the way to tell if your VB app loses focus to another app.
If this was to be done using SetTimer/KillTimer, what would you suggest as a test in the timer loop.
GetForegroundWindow()? or something else?
Thanks, - Ron
Toolbar Disappears When Application Loses Focus
My toolbar and status bar disappear
If I minimize a child form, minimize the MDI form and my application loses focus, when I come back into my application the toolbar and status bar have disappeared !
Any ideas how to get the MDI form back - maximized with its toolbar and statusbar showing to the state it was in before my application lost focus
HELP
Menu Bar On Separate Form Loses Focus
I have this program where due to memory we have to load each form as the tab is selected rather than just putting the form on the tab. We wanted a universal menu bar for all of the forms so we created a separate form that holds the tabs and menu bar. The problem now is when the user Highlights a selection and tries to edit it the selection is unhighlighted and loses focus as soon as the user clicks on the menu bar and therefore the edit functions (cut, copy, paste...) become useless.
I have attahed a sample program that illustrates the point if any one has any suggestions.
Text Forced To Keep Highlighting When Loses Focus
When I select some text in a rich text box, to change the font size or style, I have two combo boxes.
The code to change the selected text size and font works just fine, but ....
How do I keep the highlighted text highlighted when the focus moves to the click event of the combo box?
Thanks
Maintain Hightlight When ListView Loses Focus
I have several listviews in my current project.
Generally, when a ListView item is selected it populates another ListView with related items. When a item in the second listview is selected it provides drill down details.
My problem is that when the second listview is selected, the highlighted item from the first listview loses the blue hightlight which indicates what was originally selected.
With a listbox, the item remains highlighted when selected even after the listbox has lost focus.
Is there a way to replicate this behavior with a ListView?
Highlight Disappears When Form Loses Focus
I have two forms, each with a text box. When I highlight text in one textbox, the highlight effect disappears when the other form gets focus. Is it possible to prevent this?
Drag & Drop Loses Window Focus
I'm working on a text editor. I've managed to implement loading a file when it is dragged and dropped onto my application.
The problem is that if I drag a file from a folder that's open on the desktop onto my application, it loads fine but my application's window doesn't have focus, the Windows Explorer window keeps it!
How do I programmatically set my application's window to get focus?
Thanks.
Hiding Popup Menu When It Loses Focus
Hello all,
I've got a popup menu working right now that appears when you right-click my program's icon in the system tray. The problem is that if you don't select an option from the menu, but instead click somewhere else on the desktop, the menu does not disappear. It stays there until you choose an option.
So how can I hide the menu when the user clicks elsewhere?
Thanks,
-Adrian
Make Progress Bar Update When Form Loses Focus??
Hello. I've created a form containing a progress bar that updates as the program runs. Simple stuff.
However, whenever the form loses focus (i.e. the user activates another program while mine is running - and then later activates my program), the progress bar is frozen and no longer updates (kinda defeats the purpose of a progress bar!)
Also, I've seen the form client area "turn white" (i.e. you can't see any controls on the form) after being activated again (I believe this occurs if the program has been running for a "long time").
Can someone provide some sample code detailing how to update the progress bar even when the form loses focus? FYI - in other projects, I've placed the progress bar update code inside a timer - is this the best way to do this?
Keeping TreeView Node Highlighted After It Loses Focus?
When I click on a node in the TreeView it of course becomes highlighted. But when I switch the focus to a button, or a textbox or anything it is no longer highlighted. I'm pretty sure it's still "selected" but not visually. Is there a way to make it stay visually selected?
Thanks!
URGENT - Need To Trap When Control On A UserControl On An MDI Form Loses Focus
I am writing a UserControl, which I then have put on another UserControl which is being displayed in a third party applications MDI Form
My problem is that I have a customdrawn dropdown on my first UserControl.
When the dropdown is open and the user clicks elsewhere in the third part application or even outside the application, the MyDropDown_LostFocus event is not called.
I need to capture this event to perform a close the dropdown.
I have tried setting CausesValidation on the MyDropDown and using the MyDropDown_Validation event, but this is not fired in these circumstances either.
Any Ideas.
Different Program Has Focus
How would I detect, say, Ctrl+F7, and act on it even if my program does not have any active windows? I'm assuming this is an API thing, but I could be wrong...
Jacob Sheehy
http://www.sheehy.ca
The more I C, the less I see.
What Program Has Focus?
I am using SendKeys() to send keys to a program when someone presses F5. I have got all the SendKeys() and F5 code done. The only problem is I have to find out whether the person has a certain program in focus or not?
I Want To Set My Program Away On Top With Never Focus It.
From my old topic about "How to make my own tooltips?(again)"
I will see "Call SetWindowPos(hwnd, -1, 0, 0, 0, 0, 3)" can make my program away on top but in sometime it may be get focus when use Form.Show.
With my target to make my own tooltips with make my Form to show as tooltips , It's must be never get focus for any case. How can I set It?
Program Focus
Is there a way that you can force someone to complete a program before they are able to launch any other window. I want to force a user to "LogIn" through a VB6 app before they can open any other application (eg, Word or Excel) on thier PC. Any ideas would be great. Thanks in advance!!!!!! Gene
How Do I Focus On A Program?
i'm checking to see if my application is already running with the following code:
VB Code:
'is app already running?If App.PrevInstance = True Then AppActivate "MyApp" Unload Me Exit SubEnd If
however, i would also like to set focus on the application, i.e. that the currently running program gets the focus.
how can i do this?
thanks!
w.
Which Program Has Focus?
Use the GetActiveWindow API function.
Code:
Private Declare Function GetActiveWindow Lib "user32.dll" () As Long
What Program Has Focus?
Say I have word, excel, and Microsoft internet explorer running, how can i check to see which one has the focus?
Program Focus Problems And More
Im trying to create a macro program that will allow me to push a mouse button and have the program press a key on the keyboard. When the program is not in focus, the keypress events dont work anymore. I need to have the program monitor all key and button presses all the time no matter what program has focus. Also, i am having trouble simulating the button being held down. Is there a way to hold the mouse button down and have it simulate the holding of a keyboard key?
Thank you for you input, this means alot to me if someone can help.
How To Detect When The Program Gets The Focus?
I thought the Form_GotFocus would do this, but after testing it never ever fired at all. How can I detect when my program has just gotten the focus (as in when a user switched from another program to mine, or maximizes it)?
Thanks
Setting Focus To Another Program
VB 6.0 SP 5 , Windows NT4.0
We have an application written in Windev and one I am doing in Visual Basic.
At some point my visual basic program sets itself in front of the running windev program (using windowstate and setfocus of the form).
The problem is getting the focus back to the windev program after the user has clicked something on my vb progrem.
I have used minimized, hide my form...
This hides my form and shows the windev program again but it doesnt has the focus back(toolbar is grey not blue)
Is there anyway to set the focus to another running program (except using the sendkeys command?)
Thank you for your time
If this requires some API call's please write them out because I am totally new to API calls.
Set Focus To A Window (Not In Your Own Program)
Hello,
Does anyone know how to set the focus and maximize a window that does not belong to your project?
Example:
I need my program to bring forward and maximize the Internet Explorer window, now lets say I have 5 different windows open. I would need it to get the one that is named google.com.
Is there anyway to do this?
Thank you in advance!
Stilekid007
|