|
Your best bet is to look into Windows Shell documentation and find out which Win32 calls (or possibly, Registry keys) can retrieve the list of Windows context menu options. That's the easy part. From there, you're gonna have to hook up your application to interop with the Windows shell; so that if you right click on some object in your program, it will allow you to, say, copy the file or text to the clipboard. That will be difficult.
I recommend you look for other options. What is it you want to do?
|
|
|
|
|
Hi,
I have a client application that I am writing that connects to a database (MySql) running a server on the network. I would like to be able to communicate from the server with any running client application to be able to send them messages (eg, the server is about to be rebooted, save your work now!). What would be the best way to go about this? I'm thinking that I could have my client listen using the TcpListener class to a port and write a quick and dirty app to run on my server that will use "show processlist" on the MySql server to find everybody who has a connection and send a message to them. Is this a good idea? I've never tried anything like this before.
Thanks
WJ
|
|
|
|
|
hi there,
below is just my idea:
1. write an server app on machine that MySQL is running on. this will listen on a port
2. ur client have to register itself to the server app after successfully connecting to MySql. So that the server app is able to know which clients are connecting to server
3. When the MySql is about to rebooted, just broadcast messages to all clients that are connecting to the server
<< >>
|
|
|
|
|
Thanks for your feedback. I'm going to have to ponder this a while...
|
|
|
|
|
Please anyone. How can I trap the delete key and handle it in such a way that the text in the richtext box will not be deleted.
thanks.
Nana
|
|
|
|
|
In your form, override ProcessCmdKey method. Then,
if(keyData == Keys.Delete)
{
return true;
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
|
Can anyone tell me how to fill more form up with rectangles? Like Grid sheet
say size 20 X 20
|
|
|
|
|
As I told you last time, override the OnPaint method and draw your grid using the Graphics.DrawLine method. Something like this:
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
Pen p = new Pen(Color.Black);<br />
int width = this.ClientRectangle.Width/20;<br />
int height = this.ClientRectangle.Height/20;<br />
int x = 0;<br />
int y = 0;<br />
for (int i = 0; i<20; i++)<br />
{<br />
e.Graphics.DrawLine(p,x,0,x,this.ClientRectangle.Bottom);<br />
e.Graphics.DrawLine(p,0,y,this.ClientRectangle.Right,y);<br />
x += width;<br />
y += height;<br />
}<br />
base.OnPaint (e);<br />
}<br />
Would work. It would need some cleaning up and you might want to make sure your form size will fit exactly 20 squares because otherwise the last row and column may be bigger than the others. Or you could draw a border around the grid . Whatever works for you.
|
|
|
|
|
Well, Thank you once again
|
|
|
|
|
Hi!
I doing an application that it is a coder, and other that is the receptor, and is the decoder (base 4).
I need that the application sends a message to domain (like net send, of cmd), and
i don't know how i have to do.
PLEASE!
HELP ME!!
Thanks...
|
|
|
|
|
The source is:
private void Form1_Load(object sender, System.EventArgs e)
{
password.Text = " ";
password.PasswordChar = "*";
}
private void SubmitPass_Click(object sender, System.EventArgs e)
{
if (id.Text == " USER " && password.Text == " PASSWORD ")
{
//here you have put the action that you want that the application
//do when login is true (for example)
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
//this action does that the window state application is
//maximized
}
else
//here the action that you want that the application would do
//if the login is false (for example)
MessageBox.Show ("Login incorrect. Try again","Login by Rugi",MessageBoxButtons.OK,MessageBoxIcon.Error);
//this action is because the application shows a critical (message box)
Visca Catalunya ||*||
Salutacions cordials:
Roger Roca
|
|
|
|
|
Can you write your question in english, please?
'A programmer ist just a tool which converts caffeine into code'
|
|
|
|
|
The source is:
private void Form1_Load(object sender, System.EventArgs e)
{
password.Text = " ";
password.PasswordChar = "*";
}
private void SubmitPass_Click(object sender, System.EventArgs e)
{
if (id.Text == " USER " && password.Text == " PASSWORD ")
{
//here you have put the action that you want that the application
//do when login is true (for example)
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
//this action does that the window state application is
//maximized
}
else
//here the action that you want that the application would do
//if the login is false (for example)
MessageBox.Show ("Login incorrect. Try again","Login by Rugi",MessageBoxButtons.OK,MessageBoxIcon.Error);
//this action is because the application shows a critical (message box)
Visca Catalunya ||*||
Salutacions cordials:
Roger Roca
|
|
|
|
|
|
i want to write a code for a window, that should be appear at the right bottom corner of the window, where the windows clock is situated, as happen when any new client come online in msn or yahoo massenger, please help me, thanks
|
|
|
|
|
|
Look it!
You go to solutions explorer
right click to the name of your project
click to "add"
then, choose "add windows forms"
put the name that you want in this form, and
click to submit
to another window, you put in the source of a button:
[THE NAME OF YOUR WINDOW] f[A STRING];
f[YOUR STRING] = new [THE NAME OF YOUR WINDOW]();
f[YOUR STRING].Show();
Thanks!!
|
|
|
|
|
thanks for ur reply, will this give me msn like window look, that appear when anyone come online? let me try it. thankx
|
|
|
|
|
notifyIcon is good approch,but i want to copy the idea of MSN,how my window will appear from the botton right corner of my computer screen and display some message. thankx
|
|
|
|
|
How does one go about finding the type of a given token or variable?
Mainly, I'm looking for a way to tell if a token is a numerical value, rather than a string.
Thanks in advance!
|
|
|
|
|
What do you mean by 'token' ? You can use tryparse to find out if a string is a number or not.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am having trouble closing my application properly. I have a MDI environment. Each child can have a usercontrol loaded.
I have in my Parent the following. All is psudo-code.
ExitApp()<br />
{<br />
if(childForm != null)<br />
{<br />
childForm.ExitFunction();<br />
}<br />
else<br />
{<br />
App.Close();<br />
}<br />
}
in Childform,
ExitFunction()<br />
{<br />
if(userControl != null)<br />
{<br />
userControl.ExitFunction();<br />
}<br />
else<br />
{<br />
}<br />
}
A similar function in the userControl.
I had called a event handler that relaunched the ExitApp function. But obviously, the childform is not unloaded, so this just loops like crazy. How can I verify that the child is unloaded prior to Re-launching the Exit app function.
Thanks in advance...
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
Can't you avoid calling ExitApp recursively? If not, I think the only way is to add a flag that is set to true when the "else" part executes for the first time and then conditionally skip execution from the next time.
ExitFunction()
{
if (isRecursive)
return;
else
isRecursive = true;
if(userControl != null)
{
userControl.ExitFunction();
}
else
{
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
how do i get the current caret position in a rich text box. Anyone, Please.
Nana
|
|
|
|