![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2006
Posts: 1
Rep Power: 0
![]() |
Giving Focus To Another Window
I want to write a simple program that would allow me to make IE STAYONTOP with a push of a button, and make it not STAYONTOP with the push of another button. I want to write it in Visual Basic since I know that language a little bit. I
don't want it to be integrated with IE or anything. Is there code that would allow me to make a program like "IEXPLORE.EXE" stay on top? I know there is code in basic that can make the program you are making stay on top but can it make another program stay on top?? |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jan 2006
Posts: 1
Rep Power: 0
![]() |
Private Declare Function 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) As Long
Private Const FRMNOMOVE = 2 Private Const FRMNOSIZE = 1 Private Const BOTH = FRMNOMOVE Or FRMNOSIZE Private Const WNDTOPMOST = -1 Private Const WNDNOTOPMOST = -2 Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Sub Command1_Click() Dim ans As Long Dim LhWnd As Long LhWnd = FindWindow("IEFrame", vbNullString) ans = SetWindowPos(LhWnd, WNDTOPMOST, 0, 0, 0, 0, BOTH) End Sub Mark |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|