|
-
Mar 28th, 2004, 06:50 AM
#1
Thread Starter
Fanatic Member
I don't want to GetFocus
Can I make a form that isn't able to get a focus?
Example: I start WinAmp, then click my form. WinAmp should keep it's focus.
Or else: Is there a way to reset the focus to the form that lost it.
Example: I start WinAmp, then click my form. My form get's the focus but the code in GetFocus resets the focus to the previous form, being WinAmp.
(It should work for other programs too, not just WinAmp)
I hope you understand what my problem is....
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Mar 28th, 2004, 07:12 AM
#2
PowerPoster
May I ask, whats that you are trying to achieve, maybe theres a work-around
-
Mar 28th, 2004, 07:44 AM
#3
Thread Starter
Fanatic Member
I'm making somesort of desktop.
I can start a program from the desktop by clicking on an item. The selected program starts and runs. Then, when I click the desktop, the program loses its focus. That shouldn't happen. The program should keep it's focus even though my desktop is selected.
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Mar 28th, 2004, 12:41 PM
#4
Member
Hi you can do this:
In your form:
VB Code:
Private Sub Form_Load()
Call ShowWindow(Me.hwnd, SW_SHOWNOACTIVATE)
End Sub
In a module:
VB Code:
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_MAXIMIZE = 3
Private Const SW_MINIMIZE = 6
Private Const SW_RESTORE = 9
Private Const SW_SHOW = 5
Private Const SW_SHOWDEFAULT = 10
Private Const SW_SHOWMAXIMIZED = 3
Private Const SW_SHOWMINIMIZED = 2
Private Const SW_SHOWMINNOACTIVE = 7
Private Const SW_SHOWNA = 8
Private Const SW_SHOWNOACTIVATE = 4
Private Const SW_SHOWNORMAL = 1
Hope it works! Good luck.
Good programming site:
*http://www.planet-source-code.com
Our CS Clan Page:
*http://h2p.inter-gamer.com/index.html
-
Mar 28th, 2004, 12:43 PM
#5
Member
OPS i misunderstood your question. So i think you want to keep focus at all times, you want to make the window stay on top at all times, seach this forum for how to do that,I remember seeing that. Sorry for the misunderstanding
Good programming site:
*http://www.planet-source-code.com
Our CS Clan Page:
*http://h2p.inter-gamer.com/index.html
-
Mar 29th, 2004, 01:49 AM
#6
PowerPoster
Originally posted by Insane_Magician
OPS i misunderstood your question. So i think you want to keep focus at all times, you want to make the window stay on top at all times, seach this forum for how to do that,I remember seeing that. Sorry for the misunderstanding
no brother, u understood him correctly in the first case. he doesnt want to get focus on his application.
-
Mar 29th, 2004, 06:30 PM
#7
Member
K cool, thanks veryjonny. I wrote that all out then I re read the question and I think i second guessed myself. Oh well, Ill wait for them to reply to see how it works
Good programming site:
*http://www.planet-source-code.com
Our CS Clan Page:
*http://h2p.inter-gamer.com/index.html
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|