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

Make an external App Always on Top -- VB6.0

Hi all,

I am using shell to call the calculator from an MDI app that always has at least one child open. However, the calculator is not on top once I click @ the MDI app.
Dim CalhWndApp As Long
Dim hProcessID As Long
Dim hWndDesktop As Long
Dim hWndChild As Long
Dim hWndChildProcessID As Long

hProcessID = Shell("calc.exe", vbNormalFocus)
hWndDesktop = GetDesktopWindow()
hWndChild = GetWindow(hWndDesktop, GW_CHILD)

Do While hWndChild <> 0
Call GetWindowThreadProcessId(hWndChild, hWndChildProcessID)
If hWndChildProcessID = hProcessID Then
CalhWndApp= hWndChild
Exit Do
End If
hWndChild = GetWindow(hWndChild, GW_HWNDNEXT)
Loop

SetWindowPos CalhWndApp , HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE

Thanks
Code Monkey
Jul 17 '05 #1
0 7865

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Juan Manuel Alegría B. | last post by:
Hi group I have been making a windows service to execute an external application. I use a timer control, I can execute the application but does't appear as a normal windows, just I see it in the...
4
by: Sivakumar Shanmugam | last post by:
Group.. We are running on db2 UDF V8 on Sun solaris platform. I created an UDF which calles a C-routine(SQL_API_FN). This C-routine in turn calls an external C-function. The C-function is provided...
4
by: Peter Ammon | last post by:
I would like to share a variable between two functions defined in two separate source files; no other functions will need the global variable so I'd prefer to not give it file scope. Thus, I want...
1
by: mb | last post by:
Hi, I picked up this JavaScript code (quiz code) at: http://javascript.internet.com/miscellaneous/multiple-choice-quiz.html and modified it (and may have deleted some line I shouldn't have) so...
4
by: windandwaves | last post by:
Hi Folk I have the following function: function eli() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("A"); for (var i=0; i<anchors.length; i++) {...
8
by: ghadley_00 | last post by:
Hi, I have an access database with a table linked to an external text file. Occasionally the location of the database and the text file change (but are always in the same directory). Is there a...
0
by: NvrBst | last post by:
I want to send a bunch of keys to an external window using PostMessage. I send a "KEYDOWN" message (then have to wait for the program to produce the CHAR message) then send the "KEYUP" message. ...
0
by: Echo | last post by:
Hi All: Does somebody know why everytime when we update our website, if there is DLLs involved(we are running VS 2003, .net Framework 1.1, the DLLs is for project or referenced external DLLs,...
5
by: prasannadhoj | last post by:
Dear all, I am newbie in XML world , and i've an issue, i want to use 3 dtd files in my xml. All these 3 dtd have their own root element. My idea was to keep one file Internal , 2nd one...
0
by: constructor | last post by:
Hello NG, I'm having to use a function in an external library that returns a pointer to an array of structs. The function declaration according to library vendor is: device** getList( int...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.