|
Thanks,
I remove the override method of WndProc from form1,but it didn't work fine.
PS: We can capture all msgs except the WM_CREATE in PreFilterMessage method.
N a v a n e e t h wrote: Also use this[^] overload of Application.Run.
I have changed
Form1 f = new Form1();<br />
f.Show();<br />
Application.Run();
to
Application.Run(new Form1());
May be I didn't clear what you mean.
|
|
|
|
|
It seems it wasn't catch by PreFilterMessage.
Is there some way to catch WM_CREATE for all forms in my application without override those WndProc in each winform?
|
|
|
|
|
I reproduced the problem you are saying. Sadly, I don't have any solution to offer.
hwswin wrote: Is there some way to catch WM_CREATE for all forms in my application without override those WndProc in each winform?
Yes. Just create a class which derives from System.Windows.Forms.Form and override the WndProc there. You can derive all your forms from this class.
|
|
|
|
|
Ok, Here is my thought on this
The filter added using Application.AddMessageFilter will only get called for messages posted to the message queue. Some win32 messages like WM_CREATE will be sent directly to the control. If you see the win32 APIs, there are SendMessage and PostMessage available. SendMessage doesn't post the message to queue and the messages sent by SendMessage won't be caught by the filter. PostMessage posts the message to the application message queue and filter gets called.
I guess this would be the reason for filter not getting called.
|
|
|
|
|
Thks again!
Greate,Use the hook can figure out my "Question".
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;318804">See here</a>[<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;318804" target="_blank" title="New Window">^</a>]
|
|
|
|
|
Curently i take a picture from webcam and load into the picture box by this way. take picture and save in to hard disk and load it again into picture box. is there any easy way to do this?
try
{
DeviceManager manager = new DeviceManagerClass();
Device d = null;
foreach (DeviceInfo info in manager.DeviceInfos)
{
d = info.Connect();
}
int i = 0;
Item item = d.ExecuteCommand(CommandID.wiaCommandTakePicture);
foreach (string format in item.Formats)
{
WIA.ImageFile imagefile = item.Transfer(format) as WIA.ImageFile;
imagefile.SaveFile("d:\\" + i + ".jpeg");
pictureBox1.Image = Image.FromFile("d:\\" + i + ".jpeg");
i++;
A S E L A
|
|
|
|
|
Well, no, because the file you have, is not a .NET bitmap or image object. If you can save from the ImageFile to a memory stream, you could use that as a point of conversion.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
that mean i need to save the image in a memory stream to use is back, am i correct?
is there a way to convert in to Image?
A S E L A
|
|
|
|
|
Hi everybody!
I use tool WebBrowser in VS2008 to load image from Page web to my computer, but I want do it.
Help me!
Thanks you very much
|
|
|
|
|
I'm sorry, but I don't understand. You're using the webbrowser control ? You say you've opened a web page ? So, what do you want to do ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I want copy the image from web in control webbrowser for application to my computer
If I do by hand, i have must click right mouse, choose save as picture, I want to do automation work by programming
|
|
|
|
|
Hello
I'm looking for some Csharp component to display all character of a selected font, allowing selection
Charmap.exe is a good example
It can be very usefull in order to select special character as Webdings, Windings, Symbols or cyrillic . etc
Any idea ?
Thanks for your help
|
|
|
|
|
I would try a TextBox (set to multi-line) or a RichTextBox; insert the appropriate characters, and then set the font as required.
Or you could use a whole bunch of Labels .
|
|
|
|
|
Someone did a similar thing here (can't post the code, I'm afraid) by :
For each char from 32 to 255
create a label with a border, width and height as appropriate, and the font set to the desired font, Text of the char.ToString();
The labels can then be positioned however you want for a pleasing display.
On the click event of the label, it displays the same character in a label using the same font with an increased size, and on double-click it raises a 'CharacterSelected' event which pass back the font and character selected.
Should be enough to get you started?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Yeah, but how can one find out ALL the characters present in a specific font, without looping all Unicode char codes and measuring string width looking for non-zero?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
not sure you need to - just display 'em - you'll get an empty box if they're not defined in that font.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
I am not going to create a grid with ten thousands of cells, I want to know what characters are present without painting anything.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Sorry - misread/misunderstood.
Yep - you don't want to have a dialog popping up that you have to scroll forever to find used characters... just stick with 33 through 255 if you ask me!
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hello thanks for all reply
I was lookin for an "out of the box" tool
The solution to create 256 labels seems a liitle bit heavy
Finaly maybe using a datagridview can be the right solution ??
|
|
|
|
|
Well, behind the scenes all a datagridview is going to do is to create the labels for you, so I'm not sure why you think it's a bit heavy - it also gives you complete control over your presentation.
I reckon you could knock up the code in 1/2 day easy - then publish it as an article on CP for the glory of it
.\\axxx
|
|
|
|
|
Hello , i have the following situation : with my function i get an XML file , parse it and add group box with image and a text box for every post node in the XML file , And for each group box i assign name and toolstrip menu which has a dinamicly added 1 item the thing i want to do is this - when clicked this item ( lets say the item has name Jeff) so .. when i press the menu item Jeff to add text to a text box ( the text is "@Jeff) . as u can see i managed to make the name adding in the toolstripmenu but i cant make it when i clic to add the name to the text box for each person
and here is my function so you could see what im talking about
public void parseXmlatme()
{
string sUser, sUrl;
string avatar;
sUser = Settings.Default.user;
AtMeFlowLayoutPanel.Controls.Clear();
sUrl = "http://edno23.com/api/xml/get.php?username=" + sUser + "&type=posts_mention_me";
rssReader = new XmlTextReader(sUrl.ToString());
rssDoc = new XmlDocument();
rssDoc.Load(rssReader);
for (int i = 0; i < rssDoc.ChildNodes.Count; i++)
{
if (rssDoc.ChildNodes[i].Name == "edno23")
{
nodeRss = rssDoc.ChildNodes[i];
}
}
for (int i = 0; i < nodeRss.ChildNodes.Count; i++)
{
if (nodeRss.ChildNodes[i].Name == "posts")
{
nodeChannel = nodeRss.ChildNodes[i];
}
}
for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
{
if (nodeChannel.ChildNodes[i].Name == "post")
{
nodeItem = nodeChannel.ChildNodes[i];
string C;
C = nodeItem["user_from"].InnerText;
avatar = nodeItem["user_from_avatar"].InnerText; ;
GroupBox grpBox = new GroupBox();
TextBox txtBox = new TextBox();
PictureBox picBox = new PictureBox();
ContextMenuStrip rightMenu = new ContextMenuStrip();
ToolStripMenuItem atMe = new ToolStripMenuItem();
rightMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
atMe});
rightMenu.Name = "rightclick";
rightMenu.Size = new System.Drawing.Size(153, 70);
atMe.Name = "toolStripMenuItem2";
atMe.Size = new System.Drawing.Size(152, 22);
atMe.Text = "@"+C;
name = C;
atMe.Click += atMe_Click;
grpBox.Location = new System.Drawing.Point(3, 3);
grpBox.Name = "grpBoxatme" + i;
grpBox.Size = new System.Drawing.Size(301, 73);
grpBox.TabIndex = 0;
grpBox.TabStop = false;
grpBox.Text = C;
grpBox.ContextMenuStrip = rightMenu;
txtBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
txtBox.Location = new System.Drawing.Point(59, 16);
txtBox.Multiline = true;
txtBox.Name = "txtBoxatme" + i;
txtBox.ReadOnly = true;
txtBox.Size = new System.Drawing.Size(235, 49);
txtBox.TabIndex = 2;
txtBox.Text = nodeItem["message"].InnerText;
picBox.Dock = System.Windows.Forms.DockStyle.Left;
picBox.ImageLocation = "http://img.edno23.com/avatars/thumbs/" + avatar;
picBox.Location = new System.Drawing.Point(3, 16);
picBox.Name = "pictureBoxatme" + i;
picBox.Size = new System.Drawing.Size(50, 54);
picBox.TabIndex = 0;
picBox.TabStop = false;
AtMeFlowLayoutPanel.Controls.Add(picBox);
AtMeFlowLayoutPanel.Controls.Add(grpBox);
grpBox.Controls.Add(picBox);
grpBox.Controls.Add(txtBox);
}
}
}
Thanks in advance
I'm a bomb technician, if you see me running - try to keep up.
|
|
|
|
|
this is a clue ...
using System;
using System.Drawing;
using System.Windows.Forms;
public partial class Form1 : Form
{
public Button sb;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int x = 0; x < 10; x++)
{
sb = new Button();
sb.Size = new Size(25, 25);
sb.Location = new Point(x * 25, 10);
sb.Visible = true;
sb.Text = x.ToString();
sb.Click += new EventHandler(sb_Click);
Controls.Add(sb);
}
}
private void sb_Click(object sender, System.EventArgs e)
{
Button sb = sender as Button;
this.Text = sb.Text;
}
}
I know nothing , I know nothing ...
|
|
|
|
|
thank you very much ! this helped me solve the problem !
Mess with the best, die like the rest !
|
|
|
|
|
Hi
I have DataSet that I fill like this:
dsView = new DataSet();
adp = new OleDbDataAdapter("select * from Worki", Conn);
adp.Fill(dsView, "Worki");
this.dataGridView1.DataSource = dsView.Tables["Worki"].DefaultView;
If I change any cell in the Datagrid, How I can update the DataBase too ?
(I dont want to use sql query like Update table....)
thank's in advance
|
|
|
|
|