473,378 Members | 1,384 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,378 software developers and data experts.

make windows always active

7
dear all..

i have some application running (ex. Winword, Notepad, and My Application).

the objective is ...
i want My Application always active ... i mean that the windows is always see in screen and any other can't be active ...

thx 4 ur advice

-junis-
Sep 22 '07 #1
1 1979
QVeen72
1,445 Expert 1GB
Hi,

This is doen by using "SetWindowPos" API
Declare this at the top of CodeWindow (after Option Explicit) :

Expand|Select|Wrap|Line Numbers
  1. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
  2. ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
  3. ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  4.  
  5. Private Const HWND_TOPMOST = -1
  6. Private Const HWND_NOTOPMOST = -2
  7. Private Const SWP_NOACTIVATE = &H10
  8. Private Const SWP_SHOWWINDOW = &H40
  9.  
Call this in FormLoad :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     Dim iFlag As Long
  3.     iFlag = IIf(True, HWND_TOPMOST, HWND_NOTOPMOST)
  4.     SetWindowPos Me.hwnd, iFlag, Me.Left / Screen.TwipsPerPixelX, Me.Top / Screen.TwipsPerPixelY, _
  5.                 Me.Width / Screen.TwipsPerPixelX, Me.Height / Screen.TwipsPerPixelY, SWP_NOACTIVATE Or SWP_SHOWWINDOW
  6.  
  7. End Sub
  8.  
REgards
Veena
Sep 22 '07 #2

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

Similar topics

0
by: Federico Moschini [328594] | last post by:
I have to make difference between2 data from a table in SQL. The page is made with Frontpage, and it extracts QtaGiaCons and Quantita from table "oclrighe". I have to make Quantita -...
40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
10
by: Jeffrey Haun | last post by:
I seems to me that in order for microsoft to survive past the windows os, that they need to support DOT.NET on other platforms. Wasn't this the rationel for DOT.NET in the first place, To break the...
2
by: Andrej Litowka | last post by:
Hi All! If anybody know, how I cann set an enviroment variable (with ANSI C) on Windows similar like on Linux. I tried setenv, but the function doesn't work correct on Windows - it sets env....
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
1
by: Frank F | last post by:
Hi, I want to read user information from the microsoft windows 2003 server. In the windows server 2003, i've create a domain, called "wissenskolleg". I've assigned a password to it. Now, i...
13
by: active | last post by:
With VS2005 the windows form designer uses the files *.Designer.vb I hope no one at MS is reading this because I know it will upset them to know - I like the old way better! I've been looking...
3
by: Rotsey | last post by:
Hi, I am writing app that I want to be able to hit a shortcut key (windows wide) and have it all launch my app and then be able to get the name of the process that was active when the key was...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.