Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API Set focus problem

Status
Not open for further replies.

dazzer123

IS-IT--Management
Nov 24, 2003
128
GB
I have an MS Access form that uses api to embed a window from another program (Microsoft Mappoint) into the form. The problem I am having is when the form loses focus (i.e. I open another program) and try to return to the Access form using the windows taskbar the Access form will not open.

It appears that when I click on the Access form in the taskbar the focus is being passed to the Mappoint window and not the Access window therefore the Access window isn't restoring.

I'm not sure if this makes any sense or not! But if anyone does understand! and has any ideas as to how I can resolve this issue I would be very grateful.

Dazzer
 

Don't rightly know since never run across your problem but I hope I can give you a starting place.

SetWindowPos
SetActiveWindow
SetForegroundWindow

But somehow you are going to need to intercept the recieving focus event of the mappoint app. You may perhaps be able to use the GetWindow in a timer looking for the top window and if your mappoint make sure you do a me.setfocus. You may also be able to use EnumWindows in pretty much the same fashion with a little more work.

Good Luck

 
Thanks for your help, i'll give this a go and let you know the result!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top