473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

ShowWithoutActivation isn't working

I'm an trying to prevent my application from stealing the focus from the application that launched it. Overriding the ShowWithoutActivation property returns a value of true but does not prevent the application from activating.
Why is this not working?

Public Class Form1
Sub New()
InitializeComponent()
End Sub
Protected Overrides ReadOnly Property ShowWithoutActivation() As Boolean
Get
ShowWithoutActivation = True
Return ShowWithoutActivation
End Get
End Property

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim n As Boolean
n = Me.ShowWithoutActivation
End Sub
End Class

Similarly using the ShowWindow( ) API function works until it reaches the end of Form1_Load.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Win32.ShowWindow(Me.Handle, Win32.SW_SHOWNOACTIVATE)
For i As Int64 = 1 To 900000000
Next
End Sub
End Class
Public Class Win32
Declare Function ShowWindow Lib "user32" ( _
ByVal hWnd As Int32, ByVal nCmdShow As Int32) As Int32
Public Const SW_HIDE = 0
Public Const SW_SHOWNOACTIVATE = 4
End Class

I don't understand why the form continues to activate. I have been working on this problem for a week now and I am at the end of my rope. Any help would be greatly appreciated.

Doug
Oct 13 '06 #1
0 2267

Sign in to post your reply or Sign up for a free account.

Similar topics

63
by: IAmIronMan | last post by:
This individual is stealing other peoples code and claiming it as his own. The proof is when I asked him to explain his code he would not. For proof view these threads in dotnet.languages.vb ...
10
by: sp | last post by:
The application is written in Visual Basic / .NET and working without problems under Windows XP, Windows 2000, Windows 2003 but it isn't working under Windows ME and Windows 98 - the computer...
2
by: PrinceMhul | last post by:
var objListBox = document.getElementById('catalist'); var val = objListBox.value; var txt = dyevalue00.value; document.getElementById(val).value = txt; To explain real quick, this is for a...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
7
by: Ja NE | last post by:
(as first - thank you for all your help several years ago, and second - please apologise me for my clumsy enlgish) so, preface: some users on my photo related site sometimes enter (link) giant...
18
by: Philluminati | last post by:
I am writing a poker game which needs to work with cash. I am aware that there are problems with floats that make them unsuitable for storing money values. On top of this I may be expected to do...
3
by: Larry Hale | last post by:
Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll...
7
by: nassausky | last post by:
I acquired a very basic redirect script from: http://www.minisitegallery.com/blog/php-javascript-countdown-script-with-timezone-setting.html which is supposed to count down to a specified date and...
12
by: Hendor | last post by:
Hi all. I've recently set up Apache 2.2 with PHP 5.2 and MySQL 5.1. I played around with SQL a bit, and now I'm trying to access it with PHP. I currently have the code: <?php #...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.