Is there anyway through a form ontop without using API.....my program limits a users time....when time is up it throughs form1 ontop...howeveri f someone is on internet explorer for example....it overlaps form1..... any suggestions?
Printable View
Is there anyway through a form ontop without using API.....my program limits a users time....when time is up it throughs form1 ontop...howeveri f someone is on internet explorer for example....it overlaps form1..... any suggestions?
When you use the word "through" (as in I walked through the park), do you really mean "throw" (as in throw the ball)?
The real question is why do you want to avoid using the APIs?
Sorry i meant throw, i don't want to avoid using API, it's just that when I get help from you guys. Its for the newer version of VB.....Everytime theres a byval, there is either a kernerl32, user32 or something 32 and its not supported by VB 3.0, so the code is useless to me. Got what im saying? Iv'e tried dropping the 32 to just "user" it works sometimes but not all. Think you can help me? Is there sendkeys to go to IE and minimize or better yet any program on top of form1......
Quick side question, zorder wouldnt work because that just puts that form as top most in "YOUR" program, correct?
Doesn't have VB3 an API viewer??
As far as I know, a lot of API's can be "downgraded" by removing the 32, and change long to integer. I'm not sure about the byval if that has to be changed (don't think so)
Yes, that's correct.Quote:
Quick side question, zorder wouldnt work because that just puts that form as top most in "YOUR" program, correct?
these are vb 2 & 3 API's
this works, I had to use strings instead of boolean, but I dont know how to declare booleans or even if they exist in vb3.Code:' in a module
Declare Sub SetWindowPos Lib "User" (ByVal hWnd%, ByVal hWndInsertAfter%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, ByVal wFlags%)
Const HWND_NOTOPMOST = -2
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOACTIVATE = &H10
Const HWND_TOPMOST = -1
Sub OnTop(frm As Form, blnTF$)
If blnTF = "True" Then
SetWindowPos frm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE
Else
SetWindowPos frm.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE
End If
End Sub
' in form_load
ontop Me, "True"
[Edited by denniswrenn on 07-12-2000 at 03:47 PM]