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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing the PresentWindowHandle

Status
Not open for further replies.

biren

Technical User
Sep 19, 2001
12
0
0
GB
Hi,

I am currently re-coding an application so that it is compatible with windows XP.

The current problem that i am having is that when the application is run on a Win XP operating system, the operating system seems to be taking control of this 'test player' and not bringing the main start page to the 'front'. What happens in this instance is that the 'test player' is running, but in the background, hence you can use ALT+TAB to get to that window. This is not desirable.

The app uses presentwindowhandle to find the relative window. What i want to add to the code is something that will force this window (when selected) to be at the 'front'.

I am going to use an API call to SetWindowPos to get the window positioned at the top (and also to a full screen).

The problem for me is where to actually add the code.....


here is a snippet of the section of code in which i think it might be.....

g_presentinstance = Shell(TestExec, 1)
DoEvents
Dim start_time As Long
start_time = Timer

If IType <> &quot;S&quot; Then

Do While True

presentwindowhandle = FindWindow(&quot;IAPresentWndClass&quot;, 0&)
If presentwindowhandle <> 0 Then
mdiform1_frm.ActiveForm.subclass.AddHwnd = presentwindowhandle
Exit Do
End If
If Timer - start_time > 120 Then
Endwaitpointer
MsgBox GetLangString(353)
Administer = False
Close g_safety_file
Unload parameters
Exit Function
End If


Probably wont get much joy on this.......but here's to trying and here's to it being Friday afternoon and not Monday morning!!!

Cheers

Biren.K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top