Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

HowTo Capture A Window (Hidden/Behind Other Window/Partially Visible/Out Of Desktop)?

I'm new to GDI programming. Just a few days ago I've learned BitBlt,StretchBlt, Memory DC. Since then I've been trying this in every possible way I can imagine but can't make it.
I know how to take a screenshot of a visible window.
I want to know, how I can capture a window if the window is Hidden / Behind Other Window / Partially Visible / Out of desktop area ?
Thanks in advance.

Edit: This commercial dll does exacty what I want to do. But how to make my own ?

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Capturing (Partially) Hidden Window Image - CaptureWindow()
hey all!

if n e 1 could give me some suggestions for this it would be really
handy. here is the problem....

ive managed to get the program to list all open windows...
ive managed to capture the window handle i want.....

when i use;

capturewindow(handle, boolean, left, top, width, height)

to capture the window it works ONLY if the area i want to capture
is completely visible on the screen.

i originally thought that because i was specifiying the handle of the
window it would know what to capture exactly, seems i was wrong.

can n e 1 suggest a work around for this or even a different
call/function to capture window to do the job for me?

thanx a million!


Capture Hidden Window

  I am very much confused to know that if there is a way to capture a window which is not visible. All the codes I have or I see on web is to capture active window. What if I want to capture the window which is not active?

   Kindly help me.



Capture A Hidden Window/form To A Picturebox?
Is there any way to capture a hidden window without moving it to the top of the screen?

For example I have Notepad behind IE and I want to capture Notepad in a picturebox. I don't want to move Notepad on top of IE to capture it to the picturebox. Also, would it be possible to capture a Minimized window?

Any help would be appreciated.

Capture Desktop Window
Ok.. i know how to capture the desktop window with Bitblt. But the problem is that I don't want my form with it.

When I capture the Desktop Window..the image of my form is also captured withit and I want to avoid that..How can I do it?

Capture Shelled Window(Hidden) Output To A Text File
Dear ALL,
I want to capture the output of the shelled window in a text file.I am using This shell and wait method.

Thanks in Advance.

Showing Partially Window In DX
Hi folks,

is it possible to show a directx application inside a small box on you rwindow so that 3/4 is just normal windows and 1/4 is like a directx program or movie in a picturebox or something

Screen Capture Part Of Screen Where Window Is, But Not The Window... Phew
Hey there,

I was wondering if there is a (fast, quick, easy - not necessarily easy) way to do capture the part of the screen that lies under my form. What you would see if you would be able to look through it.
The only way I can think of is hiding your form, capturing, and then showing it again when done, but that causes some flickering...
I'm trying to figure this out, so any help is greatly appreciated!

Search before you ask - if you don't know where to search, ask before you search

Hidden Window
i think the cause of it is that i references the Microsoft Access 9.0 Object libraries. bec when i remove it i doesnt show anymore!

Always Visible Window
Hi people

I need to know how can I put my program windows aways visible.

Window Always Visible How????
I'm writing an internet timer but the only
problem is that i don't know how to make
the counter window always visible and not
minimized to task bar when another window
is active.

I've tried ZOrder method but did not work.
Any idea?

Is it possible to display the counter in the
system tray as for the Time of the computer?

Window Not Visible
hi all

i used the "" project from peejavery today. in that project u can minimize any window by just putting mouse pointer on the window. i did it with a window it was minimized and now after closing that application, i m not getting that window back, but the application's other window works fine but the main window on which i put mouse pointer is still invisible, actually the application runs in system tray. i uninstalled tht application and re-installed it, but no use. i think some value is gone in registry regarding this window. pleas help how can i get tht window back

thnx in advance

Howto Kill Another Active Window From Another Prog
I am trying to prevent my user from running multiple instances of the same program. I think there is a win32api declaration to do this but i am not sure. Ive tried App.PrevInstance with no success.

When the user tries to load the 2nd instance of the same program, i want it to automatically kill the first instance if it is running?

Any thoughts on how to do this. I tried the CloseHandle statement but with no success, perhaps i used it incorrectly.

Howto Resize A Window Outside The Current Project
I have code to resize/move a window within a application
but how about this....example:

create a program to resize/move a Internet Explorer window?

any help will be appreciated.


Sendkeys To Hidden Window

i was wondering if its possible to send keys to a hidden window. i hidded a window and its focussed but sendkeys (or just pressing keys) wont work. i read something about sendmessage or something but i don't know sure.

SendMessage With A Hidden Window
Is it possible to use SendMessage to communicate with a seperate VB program with its window hidden?

If it isn't, which would be better to use?

1. Open the secondary program with a shell command and send a set of arguments at that time and close it by closing the process.

2. Use winsock to send commands to it. The main program will already be using winsock for the two player option.

The secondary program is going to be used to play and automatically loop whatever the user selects. Since it requires timers to loop it after it reaches the end of it, it could desync fairly easily if the main program was running something at the same time the timer's interval went off even with DoEvents every so often in the main process.

Reshowing Hidden Window
I am designing a computer project for a fictitious company (My System Project for school) and I am using multiple executables for the separate departments in the project. The main screen is a logon screen (switchboard type) and after the user logs in, the department executable loads and the switchboard is hidden (to preserve the login when switching tasks (to avoid logging back in)

What I need to know is how to reshow the Switchboard form that has been hidden.

frmMain is the name of the form
The Tavern System Logon is the form Caption
"The Tavern.exe" is the executable that frmMain is in.

It is hidden and still running... so I just need the code to kill the Department Application, and reshow the switchboard form. Thanks in advance. Once I know this, I can implement it through all of my exe files.

When in the switchboard form... I called the Department apps with the Call Shell Function... in case you need to know that!

Please help... I am running short on semester.... LOL!

Check If A Window Is Visible
I have the handle of a window (the start menu). How can I tell when it's visible and when it isn't?

Detect If A Window Is Visible
Greetz folks,
I am looking for a code which will tell me if a window of an external program (for example Notepad) is visible or not. I think it is simple to determine that using the window's handler.
Also, can I determine if that program popped-up a message box, and if yes read its text for it an select Yes, No, Cancel...?

Thank you in advance!

How To Determine If All Of A Window Is Visible
Is there a way to determine if a window or dialogbox is visible? I.e. the whole window region, and that not part of the window is overlapped by another window?

How To Tell If A Mdi Child Window Is Visible
i tried to use findwindowex with no results i want to tell if a mdi child window is visible without loading it


Permanently Visible Window
I want to create an AddIn utility that will open a small window at a corner of the screen. I need this window to be VISIBLE at all times. How to create a window that will not disapear behind the VB environment when it loses focus? Any idea, I'm lost...

Window Menu Not Visible
Got a weird thing happening. I open up Access and I don't have a Window
Menu at the top. Even if I don't open a database it's not there. Any ideas
why. I'm using Access 97. I just install Office 2000, but the only thing I
installed was Outlook 2000 and I installed that into a different directory
than the other MS Office 97 applications.

Joel Foudy

Click Event On Hidden Window
I have an application (visual basic) in wich about 20 forms are running.
I would like to simulate a click event on those forms without them to
come in first plan. all those forms are in full screen mode so just one
of them is visible and i don't want this one to swap with the others
forms in the first plan. Is it possible to do? how?

thanks to all who will try to answer.

If you don't understand what i mean could tell it to me so i can
reformulate my question

Capturing Hidden Screen / Window
does any one know how i can capture a hidden window?

ive looked on here and asked before (trying again now)

it seems i have to use WM_PRINT.

Ive read up at,

sadly thats real complicated and not in VB. Does n e 1
know/have a vb example or know where i can get one?

Even better if n e 1 can explain the website above ill work
from the explanation.

thanx for any help.


How This Open Hidden Window Works ?
How this code work

Hi all . I used this code to open a hidden closed window in an external window. There are a few other hidden invisable windows that i want to open them but i do not know how this code work for other window and how to get the bold number part for other hidden windows. I be happy if an expert explain to me how this code works and how to use it for other hidden windows.Thanks

VB Code:
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long  Const WM_COMMAND = &H111  Private Sub Command1_Click() Dim window As Long window = FindWindow("my window class", vbNullString)PostMessage window, WM_COMMAND, [b]32947[/b], 0 End Sub

Screenshot Minimized/hidden Window?
Is it possible to screenshot a window that is minimized or hidden behind other windows? I'd like to write a program that takes a screenshot of a minimized window every so often (actually, just the area where text appears while chatting on an online game) so that I can monitor if anyone is talking to me while minimized. I've been able to capture the screen when it's the active window, which was easy, but I have searched and cannot find any examples of what I'm trying to do.

Thanks a lot, post questions if I wasn't clear on anything.

Find Hidden Window Handle
I know how to find a normal window i can see on my desktop with

FindWindow(lpClassName, lpWindowName)

i.e. hWind = FindWindow(vbNullString, "NOX")

but i want to find a hidden window with the title "GAME" and get that handle, can someone help me out?


Show The Hidden Process Window
I have created a process window in hidden state initially using the shell command as follows :-

processID = Shell(App.path & "
un_qserver.bat", vbHide)

I want to show that process window at some instance later. How do I show it ??

Toolbar / Taskbar Window To Be Visible
I have my forms set to ShowInTaskbar = true but when I compile and install the program as an .exe file, my program doesn't appear in the menu at the bottom of my desktop. What am I doing wrong? Help!!


HOWTO: Move Forms Inside A MDI Form But Will Not Exceed Through Its Window.
I want to move forms inside a MDI Form but these forms usually exceeded in MDI Form's window. (Try moving the forms inside a MDI Form). See? I want to fix that problem in my program.

Hope anyone from this forum could share a nice answer.


Open File Window Hidden Behind All Tabs???
I am using the getopenfilename to try to open a file. I use this line in numerous vba apps and until today the window always appeared "on top" of all the other windows.

today i wrote the code for a new macro and when the program gets to the line it executes and opens the file browse window but it is behind all the windows..

here is some code:
For a = 1 To 10
Application.ScreenUpdating = True
Windows(modelname).Application.ActiveWindow.WindowState = _ xlMaximized

Excel.Application.DisplayAlerts() = True
sfilename = Windows(modelname).Application.GetOpenFilename("All _ files (*.*), *.*")

the few lines starting with "windows. xxxxxxxxx" i inserted hoping it would activate the window and bring it to the front and then the box would be on top of all the other windows but it is not working..

is there some way to ensure that the file browse window will be put to the top??


How To Send Text To An Hidden Htaccess Window ?

i got a little question: how can i open a site (with htaccess) so the htaccessw idow is in the background, and send the username and password to it ? is it possible to do this with the sendkeys command ? plz help me


Retrieving A Hidden Variable Value From A Browser Window
Does anyone know how to retrieve a hidden variable from a web page in vb's browser module.
I have a gis map that's loaded into a vb browser. I want to click a buttom to read the html code
stored in the browser module and pull out a hidden variable value for use in the vb program.

Making A Partially Hidden Form
I was wondering if making my form partially hidden (like WMP 9, the edges disappear) is possible. I have seen a few program that would, for example, place a cat or another thing on the desktop that chase your mouse around. Thanks

Properties Of Usercontrol Should Not Be Visible In Property Window
While creating user control how do u create a property which will be not available at design time in property window but it will be available at run time.

Capture Window Again
relevant declarations:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const PRF_NONCLIENT As Long = &H2
Private Const PRF_CLIENT As Long = &H4
Private Const WM_PRINT As Long = &H317
Private pWnd As Long

The following code doesn't seem to be working:

pWnd = GetForegroundWindow
SendMessage(pWnd, WM_PRINT, Form1.hdc, PRF_CLIENT Or PRF_NONCLIENT)
Form.AutoRedraw is set to True.
The code is activated when a HotKey is pressed.
Everything is in one Module.

this does work:

Dim wDC As Long
pWnd = GetForegroundWindow
wDC = GetDC(pWnd)
StretchBlt Form1.hdc, 0, 0, w1, h1, wDC, 0, 0, w2, h2, vbSrcCopy
ReleaseDC pWnd, wDC
But my goal is to capture the window together with it's border so it's no good.

Using the PrintWindow function works well, and i'm wondering why the 1st code doesn't
(PrintWindow is the same as sending the WM_PRINT message according to the platform sdk).


Window Capture
hi all, i want to capture a window but it is under another window. i dont' wanna make focus for a second to capture it, but i still need to capture all the window under the other window/windows.

how could that be done?

How Do I Capture Every Window ??
I want to capture every window and create a picturebox for each window in the size of each window, and I want to know the caption of each window.....and when I move the picturebox, I want the window with that caption to move..

Desktop Window
I want to get a snap of the screen, copy it to a picture box and then save it as an image file. I want to know what is the fastest code to do it? Is Bitblt the fastest ? Can someone kindly give me the code to do it? I will be really thankful .

Window Capture- HELLLLLP
I'm trying to capture a window to the system clipboard. The window is a child window. The keybd_event with VK_SNAPSHOT will take a capture of the entire window. How can I only capture a child window.

Capture An Application Window

I have an application with more than 5 forms. One of these forms is the main form. Everytime a window is called, the main form is still in the background and the newly called window was shown modally. Is there any possibility that I can capture only the called window and the main form will never be visible?

How To Capture DOS Window Event In VB6
Dear all hi,

The problem which I am facing in VB6 is, I am calling a DOS application in my VB project in one frame and another frame contains an text box and a command button. I wants that whenever a user working in DOS application and he press any key like F9 or F12 or any other key than the focus should be transfer on the textbox or on command button. so please tell me the solution of the above problem asap.

Deependra Pathak

Capture Window (help Me MartinLiss)
I am trying to capture the form as an image and put it on my clip board or save it as an image. I have code to save it as an image but the form has to be visible. I want to do it while the form is in the background, not visible. Any ideas???

Capture IE Window Contents
Does anybody know if it is possible to use VB to get the handle for an IE window and then capture all of its contents?

How Do I Capture All Of The Text In A DOS Window
Visual Basic 5.0

Below is a VB program that call a batch file to be run in DOS window.

How do I capture all of the text in a DOS window and store it in
a Visual Basic string variable ?



Private Sub Start_IPsec_Click(Index As Integer)
Dim Program_Name As String

Program_Name = "C:ipsecpolping.bat"
Call Run_DOS_Program(Program_Name)
Text1.Text = "The IPsec program has started."

End Sub

Private Sub Run_DOS_Program(Program_Name)
Dim MyAppID, ReturnValue

' AppActivate can also use the return value of the Shell function.
MyAppID = Shell(Program_Name, 1) ' Run DOS program
End Sub

Cannot Get Hidden MDI Window To Close & Cannot Get RICHEDIT Text Contents To Stick
I've got two problems on my hands here. If I'm able to solve one, I shouldn't have to need to figure out the other.

Q1: I am trying to close out a hidden MDI child window so that it no longer appears in the window list. I managed to perform a WM_MDIDESTROY on it, but then when the external program attempts to re-create or un-hide that window, it gives a repeated error in the program. I have tried using WM_CLOSE, but that does not seem to close it, as I am still able to find the window by iterating through the MDI child windows.

Q2: The same window as above, a hidden MDI child window, has a RICHEDIT (found via a window spy utility) control. I tried using the WM_SETTEXT to alter the text contents of the control, but when I close out/minimize the window and bring it back up or reopen the window, the old contents show up. I have tried using the EM_SETREADYONLY message to false, writing the message with EM_SETTEXT, then setting EM_SETMODIFY to false, but still have the same thing happening.

If any of you API gurus out there can help me out on either of these, I would greatly appreciate it. I've spent so much time already trying to figure both of these problems out with no solution.

How To Access Controls On An Window Hidden By A Special Parent Class?
Hi, I hope someone can help me with this problem.

I am trying to make a program that will read various details from another program such as status/progress and carry out actions within the program.

This should all be relatively simple using standard API calls such as FindWindow and SendMessage, however the program I need to access is hiding all the labels I want to read behind a special class.

This pictrue below demonstrates my problem. As you can see, the API spy can read the standard controls such as the username and password boxes , but it cannot read the captions of the buttons such as "Delete", or the labels such as "Character Name". These labels/buttons are hidden behind the class 'AfxOleControl42' which does not have any visible child classes or any text of its own.


The program that I am trying to read controls off was made in Visual Basic, but I am not familiar with the method thats been used to hide the labels/buttons from being visible by the API. I would like to know how to find these controls using API or otherwise in my own Visual Basic program.

I hope someone can help, if anyone would like more information then please let me know.

Ashley Adams

How To Check A Window Is Opening Or Not? And How To Make A Task Become Hidden Process
Hi all,

I want to ask everybody here how to check a window is opening or not? For example, i have a console program is running as server. In my client, firstly i need to check for the server is opening or not, how can i do that by check for all open window to make sure that window of server is opened and running?

One more question that i have a program is running, how can i make it become hidden? I mean the unknow program, for example, when you start using cmd by type "cmd" in RUN command of window, now you have a cmd instance, how can you make it becom visible or hidden?

Thanks alot!


How To Check A Window Is Opening Or Not? And How To Make A Task Become Hidden Process
Hi all,

I want to ask everybody here how to check a window is opening or not? For example, i have a console program is running as server. In my client, firstly i need to check for the server is opening or not, how can i do that by check for all open window to make sure that window of server is opened and running?

One more question that i have a program is running, how can i make it become hidden? I mean the unknow program, for example, when you start using cmd by type "cmd" in RUN command of window, now you have a cmd instance, how can you make it becom visible or hidden?

Thanks alot!

Copyright 2005-08, All rights reserved