|
Too many sites to manage and a moving Db schema make them too hard to manage.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
If you are not going to use parameters, be sure to encode the values properly when you put the query together, or your application will be wide open for SQL injections.
---
b { font-weight: normal; }
|
|
|
|
|
I am using SendMessage from the Win32 API to send keystrokes to the foreground window. The keystrokes do not arrive, though, somehow. I have checked, and the handle to the window that I get is correct. When I use SendMessage to send a character to the application itself it works, but not to another window.
I use the following API functions:
<br />
[DllImport("user32.dll")]<br />
public static extern int SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);<br />
<br />
[DllImport("user32.dll")]<br />
public static extern IntPtr GetForegroundWindow();<br />
And the following to send the message:
<br />
char a = new char();<br />
a = 'A';<br />
this.WindowState = FormWindowState.Minimized;<br />
IntPtr handle = GetForegroundWindow();<br />
SendMessage(handle, (int)Win32API.Messages.Char, (IntPtr)a, (IntPtr)0);<br />
The char enum is set to 0x0102, which is equivalent to WM_CHAR.
Does anyone know what I'm doing wrong? I would appreciate some help!
Thanks!
|
|
|
|
|
Is the window within your application space? Security will prevent you from sending keystrokes to a window that is not within your application space unless you have a remoting solution that specifically marshals the request between each boundary.
|
|
|
|
|
You could try sending the additional messages that get generated when you press a key, as well (WM_KEYDOWN, WM_KEYUP)...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Without Using Visible how can you hide a user control?
|
|
|
|
|
Move it offscreen or set its size to (0,0).
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Moving the control offscreen? How is this done?
|
|
|
|
|
|
Set a location (x, y) beyond the screen. Lets say, if your screen is 1280x1024, set (x, y) to (1600, 0).
Best,
Jun
|
|
|
|
|
But check the Screens property as well, you may be moving it onto the second monitor.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Can anyone tell me how exactly does this "this.Left" method work in conjunction with a form or user control?
|
|
|
|
|
It returns the x coordinate of the control's left edge.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
Seems pretty straight forward to me
|
|
|
|
|
Mark Nischalke wrote: Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
Textbook answer.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
When all else fails, RTFM
|
|
|
|
|
joshp1217 wrote: how exactly does this "this.Left" method work
It basically gives the distance of the left edge of your control to the left edge of the container e.g. form,panel etc on which your control is lying.
Regards,
Wasif Ehsan.
|
|
|
|
|
joshp1217 wrote: ...how exactly does this "this.Left" method work...
It's not a method at all. It is a property (a pair of methods in this case). You can use ildasm.exe to understand how it works exactly. It returns a value of the "x" field of the control when you get it. And it calls SetBounds(...) method when you set it.
-- modified at 15:15 Monday 10th July, 2006
|
|
|
|
|
in winApp
how can make comboBox have text that will display and value to this text ??
as in asp.net ??
but with WinApp ??????????
Palestine
|
|
|
|
|
ex:
i have list of all country any city of the all world
i will give comboBox text as : France & value as 5
when use select France i will make new query with
this ID ==> 5
Palestine
|
|
|
|
|
|
ex:
i have list of all country any city of the all world
i will give comboBox text as : France & value as 5
when use select France i will make new query with
this ID ==> 5
Palestine
|
|
|
|
|
So your problem, if I understand correctly, is that you need to attach an integer to a combo box item. This is pretty easy:
private class MyComboBoxItem
{
public readonly string Text;
public readonly int Value
public MyComboBoxItem(string text, int value)
{
this.Text = text;
this.Value = value;
}
public override string ToString()
{
return this.Text;
}
}
MyComboBoxItem france = new MyComboBoxItem("France", 5);
myComboBox.Items.Add(france);
void myComboBox_SelectedValueChanged(object sender, EventArgs e)
{
MyComboBoxItem selectedItem = (MyComboBoxItem)myComboBox.SelectedItem;
int value = selectedItem.Value;
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Thanks so mutch man
thankss thanksssss
Palestine
|
|
|
|