|
|
Hello friends,
How do we get the position(top,left,height,width) of the child window control embedded in another window. The problem that I need to solve can be described below.
1)In skype when we have the video call we can see the video of the calling party in the window embedded in the main messenger window
2)I want to capture the video of the embedded video window of the main messenger window
3)From the process Skype.exe we can get the handle of the Skype main window and from that handle of the main window I want to find out the top,left and height,width of the embedded video window of the main messenger window. How I can achieve this? Any suggestions or alternate ways to do this?
Thanks in Advance
ritz1234
|
|
|
|
|
You can iterate over the child windows using C APIs, yes. You can use p/invoke to do it from C#. However, it sounds ugly to me. I am not sure how you'll work out what window you want. There's an API that gives you the window at a point, perhaps you need to get the user to click on the video window ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hellow
I am TAFIN from Bangladesh. I am new in C#. i need to read data from an excel file(.xsl).
plz help. code segment will be very appreciable.
Thanks in advance.
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
static OleDbConnection con;
//static OleDbCommand cmd;
public Form1()
{
InitializeComponent();
Connect();
}
DataSet ds = new DataSet();
DataTable dt = new DataTable();
private bool Connect()
{
string DB_Path= @"E:\Office Project\salary project\AttendanceSummary.xls";
string Con_Str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DB_Path + ";Extended Properties=\"Excel 8.0;HDR=No;IMEX=1\";";
con = new OleDbConnection(Con_Str);
con.Open();
//string query = "SELECT SNO, ECODE, NAME, PRESENT, ABSENT, OFF, LEAVE, LWP, OTHOURS FROM [AttendanceSummary$]";
string query = "SELECT * FROM [AttendanceSummary$]";
OleDbDataAdapter oda = new OleDbDataAdapter(query, con);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
oda.Fill(ds);
ds.Tables.Add(dt);
string n = ds.Tables[0].Columns[0].ToString();
MessageBox.Show(n);
for (int i = 1; i < ds.Tables [0].Rows .Count ; i++)
{
string result = (ds.Tables[0].Rows[i][ds.Tables [0].Columns [0].ToString ()]).ToString();
comboBox1.Items.Add(result);
}
//DataSet ds = new DataSet();
// DataTable dt = new DataTable();
dataGridView1.DataSource = ds.Tables[0];
dataGridView1.Update();
if (con.State == ConnectionState.Open)
{
MessageBox.Show("Connected");
return true;
}
else
return false;
//// oda.Dispose();
// con.Close();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//ds.Tables.Add(dt);
int index = comboBox1.SelectedIndex +1 ;
textBox1 .Text = (ds.Tables[0].Rows[index][ds.Tables[0].Columns[2].ToString()]).ToString();
}
}
/////////// Hope this will help u......... best of luck..... thank you
|
|
|
|
|
Thanks Amaan.
the code was really helpful.
i am greatful to U.
Thanks!!!
Tanim Tafin
mahbub.rabbani.84@gmail.com
tanim_csesust.2003@yahoo.com
|
|
|
|
|
your welcome........best of luck... happy coding
|
|
|
|
|
hi ,
where can i Download the Off-line Documentation about the message's question and answers of our codeproject.tell me!
i appreciate your helping!
|
|
|
|
|
I'm sorry, what on earth did you just ask ? Do you mean you want to download all the questions and answers from the past ? You can't do that.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
you mean i can only search messages from here?
but sometime i m out of internet service when do my job
so ....
|
|
|
|
|
|
so[^]..
I are Troll
|
|
|
|
|
i want to create a tree view based on data return from a database.hw can i do that?
|
|
|
|
|
Must first establish a connection, and then assign
|
|
|
|
|
please help me!
Client/Server and browser/Server how the Communication ?
|
|
|
|
|
I appreciate that English is not your first language, but this is still a very vague and meaningless question. The core answer is HTTP and TCP/IP I suspect. I also suspect that's not the question you meant to ask.
If you write a client/server app you need to write code to connect to the server. Your browser does that for you, obviously, you just need to set up a web host connected to the right URL with the code for a website.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
I need to create a tool, that would be able to "attatch" or launch other .net process and crash it in very special way
I want to be able to refuse the other process eg. access to file system, simulate out of memory exception, simulate lack of network connection etc.
All this is for testing purposes to verify that developer handled all this corner cases in his application and that this application crashes gracefully
My first thoughts are to use Mono and hook up into virtual machine or visual studio debugger.
Another idea was to use impersonation and during runtime change privileges of user running other application but i'm not sure if i'll be able to make runtime throw appriopriate exceptions eg. outofmemoryexception...
What do you think about approach? any sugestions or recomendations ? reasons why it doesn't have any sense or won't work?
Have you ever came across simmilar tool/problem/anything simmilar?
Thanks for you comments
Lukasz
|
|
|
|
|
I have created an object that, given a reference to a DataGridView will print it. I have one problem with my code, however. When I double-click the column separators to get the minimum size that will display all the contents of the columns and then print, not all of the content displays in the print. I need to figure out how to translate the on-screen column width to a printed width. Now, I know some of you are thinking "use MeasureString()". That would require two passes of my data to find the longest contents of the column. That is inefficient. There has to be (read as "please let there be") a way to simply convert the column width for printing purposes.
Any ideas?
|
|
|
|
|
Sometimes I have found that problems like this have been caused by the difference in dpi between the screen Graphics and the printer Graphics objects.
Not always though but it is worth looking at.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
They appear to be the same, when I look at the printerresolutions collection.
|
|
|
|
|
I have been using bothy generic lists and array lists, but I really don't see the difference. What is the difference between:
Customer cust = new Customer();
ArrayList customers = new ArrayList();
customers.Add(cust);
and
Customer cust = new Customer();
List<Customer> customers2 = new List<Customer>();
customers2.Add(cust);
Everything makes sense in someone's mind
|
|
|
|
|
Also
customers[3]
will return an object which has to be cast to be useful.
Whilst
customers2[3]
will return a Customer
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
ArrayList will be, in many aspects, the same as List<object>.
You can do: customers.Add(1); customers.Add("Test"); and customers.Add(cust);
When you get the value, it will be also a simple "object". So, if the Customer class has a name property, you will only be able to get the customer name doing:
((Customer)customers[0]).Name
instead of
customers2[0].Name
And, of course, you will get an exception if the first item is the 1 I added. But, the problem, you got the exception when getting the item, not when you were putting it into the list.
Also, there is more. For value types (the 1 is a value type) it will avoid boxing.
When you do arrayList.Add(1) it internally creates a full object (or box if you prefer) which contains the effective value type 1, and adds a reference to such box in the list.
If you do integerList.Add(1) (which is List<int>) you will add the 1 to the list. No reference. No additional object created.
|
|
|
|
|
Putting stuff in is fine; the difference is in getting stuff back out.
|
|
|
|
|
Such an eloquent, technically precise response!
|
|
|
|