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

getWindowDC vs Process.Handle

Hi
I'm having this problem of accessing the handle of a window.
I retrive it by:
Dim procs As Process() = Process.GetProcessesByName("ArcScene")
dim intHWND1 IntPtr = procs(0).Handle

and get a number BUT when i try to get a screenshot with
...
Dim hdcSrc As IntPtr = User32.GetWindowDC(handle)
...
I get Zero !

Any suggstions would be appriciated,
thanks
Sephi

--------------------------------
From: Sephi berry

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>AD0+pQZ4Dk2R7PF2wh046Q==</Id>
Nov 21 '05 #1
1 2501
* Sephi berry via .NET 247 <an*******@dotnet247.com> scripsit:
I'm having this problem of accessing the handle of a window.
I retrive it by:
Dim procs As Process() = Process.GetProcessesByName("ArcScene")
dim intHWND1 IntPtr = procs(0).Handle


Notice that 'procs(0).Handle' returns a process handle, but
'GetWindowDC' requires a window handle. You can use
'procs(0).MainWindowHandle' to get a handle to the process' main window
handle, and then pass this handle to 'GetWindowDC'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

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

Similar topics

11
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new...
3
by: s-galit | last post by:
hi, im using the getWindowDC but getting the error- " Value of type 'System.IntPtr' cannot be converted to integer " can someone tell me whats wrong?? Declare Function GetWindowDC Lib "user32"...
12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
2
by: Fei Yuan | last post by:
Please forgive me re-posting this question since I wasn't clear in my original post. ---- Starting an external process needs to pass it a ProcessStartInfo() object. ProcessStartInfo has a...
1
by: Fei Yuan | last post by:
Please forgive me re-posting this question since I wasn't clear in my original post. --------> Starting an external process needs to pass it a ProcessStartInfo() object. ProcessStartInfo has a...
9
by: DraguVaso | last post by:
Hi, I want my application to bring another application to the Front. I thought best way to do this was by the Process-model: Dim c As Process = Process.GetCurrentProcess() Dim p As Process...
4
by: Katit | last post by:
Here is what I need to accomplish: 1. Start new process using Process.Start 2. Get it's handle and save to text file. On next execution I read text file and see if process with same...
2
by: Tim | last post by:
Hey guys, I tried to get a process handle with the following code snippet: 00 Process processes = Process.GetProcesses(); 01 if (null != processes && processes.Length 0) 02 { 03 foreach...
2
by: subrahmanya | last post by:
Hi All Does any one has idea about how to set stdout and stderr to a spawned process? I don't want to have all the handles of the parent process in the child process but I want only one of it...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.