I was wonder if anyone knew how to make a foreign window always have focus.....I mean always Active but I could still open other foreign windows and that window still should be active.
Printable View
I was wonder if anyone knew how to make a foreign window always have focus.....I mean always Active but I could still open other foreign windows and that window still should be active.
Hi!
I don't understand exactly what you mean but try thisThis makes the specified window (in this case me - me.hwnd) always stay on top.Code:'declarations
Private Const HWND_TOPMOST = -1
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE
Private Const SWP_DRAWFRAME = SWP_FRAMECHANGED
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
'in function
Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME)
______________
regards,
da_bob
What I mean is, you know how you're working with this browser right now?? It's active because you can tell by the title bar by the color is is. Lets say you open a program, the brower will become inactive because the color will change to that light grey color. Now I'm wondering if there's a way to make that program always be active, even if I open and work with another program.
No, AFAIk, windows system can only have one window active at a time. If you want a window active all the time you could use setforegroundwindow api frequently but i'm sure that the "working with other application" part is not going to work.
Yes, you cannot have two Active Windows, however, I believe you can have a window which will always be in the Foreground.
What do you mean
Say for example you have a program running. You can also have another program running in the Foreground.
What? I mean that "two active windows" part.
Yes that's right. You can have a Foregound Window that's Inactive but not two Active Windows.
No, not that, the Foreground Window IS the Active Window. A Window on top may be on top of that window but it's not the foreground window
You can make a fake title bar with the same color of the system title bar, just an idea
WHAT?=! Why didn't I think about that, that's damn cleaver Mih_Flyer! LOL, We programmers should all think like you
Hello!
I have a question here.
I have one VB program and another non-VB application (exe app) opened. My VB program is my active program. When I click a certain button, I want my non-VB program (which is not minimized and it is standing behind the active program) to be on top of the VB program (to indicate to the user that he/she must now work with the (non-VB program now).
So, how can I do that? I try looking for command setBackGround in VB but there is none. So, is there any other way?
Appreciate if someone could help. Thanks in advanced