|
Hey,
has anybody tried using global hooks with WH_JOURNALRECORD or WH_JOURNALPLAYBACK in c#?
I used the class found at http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/ and it works fine with WH_MOUSE or WH_KEYBOARD (i have modified the code to make system-wide and it works fine).
However, once i set the hook to WH_JOURNALRECORD or WH_JOURNALPLAYBACK the system stops responding (but the mouse still works) and the system only un-freezes when i pres CTRL+ALT+DEL...i also noticed that the journal callback procedure is never called in WH_JOURNALRECORD but it IS called after WH_JOURNALPLAYBACK but ONLY when i press CTRL+ALT+DEL...anybody knows anything about this?
Thanks
|
|
|
|
|
hello guys i have a critical problem.what i want to do
"I have a webform and which has a help button.when i press the help button
the web form must divide in to 2 piece.like 3/4 space for previous content
and 1/4 space for help content.this should exactly look like the help features
in microsoft word. "
so how can i do this and what are the methods that i can use.
|
|
|
|
|
try this:
your web page(test.htm):
<html>
<head>
<title>WebForm1</title>
<script>
function ShowHelp()
{
var height = window.screen.height;
var width = window.screen.width;
var aWidth = width * 3 / 4;
var bWidth = width / 4;
window.moveTo(0,0);
window.resizeTo(aWidth,height);
window.open("Help.htm","Help","top=0,left=" + aWidth + ",height=" + height + ",width=" + bWidth + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}
</script>
</head>
<body>
<a href="javascript:ShowHelp();">Help</a>
</body>
</html>
your help page(help.htm):
<HTML>
<HEAD>
<title>Help</title>
<script>
function CloseHelp()
{
var height = window.screen.height;
var width = window.screen.width;
window.opener.moveTo(0,0);
window.opener.resizeTo(width,height);
}
</script>
</HEAD>
<body onunload="javascript:CloseHelp();">
</body>
</HTML>
|
|
|
|
|
Hi duaneye2003,
Your code is working fine... but(o oh) when we refresh the help.htm the body onunload function is getting fired which changes the opener page to its original(full screen) size but we don't want this.
So if possible can u tell me how to stop the onunload function while refreshing the help page.
I hope you are getting me.
|
|
|
|
|
Maybe this can solve this problem, but i don't think this is a good method.
change help.htm to this:
<HTML>
<head>
<title>Help</title>
<script>
function CloseHelp()
{
var height = window.screen.height;
var width = window.screen.width;
window.opener.moveTo(0,0);
window.opener.resizeTo(width,height);
}
function ResizeOpener()
{
var height = window.screen.height;
var width = window.screen.width;
var aWidth = width * 3 / 4;
var bWidth = width / 4;
window.opener.moveTo(0,0);
window.opener.resizeTo(aWidth,height);
}
</script>
</head>
<body onunload="javascript:CloseHelp();" onload="javascript:ResizeOpener();">
</body>
</HTML>
if you get a good idea, please tell me.
|
|
|
|
|
after click the help,help.htm is not loading.give me a solution.
|
|
|
|
|
I think u have to add ":" while calling the javascript function like this
body onunload="javascriptCloseHelp();">
change this to
body onunload="javascript:CloseHelp();">
Similarly change others also
Hope now it'll run.
|
|
|
|
|
ok guys thanx a lot about your feedback.but the problem is i don't want seperate web form for help.i just want to do it on the same web.aspx file.
so how can i do that.
|
|
|
|
|
|
I need to following filter in a dataview:
EventTime > '7:00' AND EventTime < '12:00'
But it simply doesn't work. The result is an empty grid showing up.
All properties have been linked correctly. So it should be something with this filter. Can anyone tell me how to use time as your RowFilter?
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
Hi,
How can i develop a application which can execute once and the executive file would be removed from device. Like: After program show a message, this executive file is removed. I got a straight way that after the application executes, deleting this application file. But how? Running program couldn't delete itself. Any suggestion is welcome. Thanks!
Regards, ginee
|
|
|
|
|
Hi!
I don't think that it is possible to delete a program that's running, but you could add an entry to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce to delete the file at the next system start.
Regards,
mav
|
|
|
|
|
You can't delete the .EXE file if it's running, or any of it's loaded .DLL's for that matter.
Your app would have to launch an external process, that handles changing out the executable you want to replace, then quit. This external process (.EXE) would have to wait for the original app to quit, then it could change out any of the files that it needs to upgrade or modify, then when done, launch the original app, then quit.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
A simple solution would be to use a batch file (.bat) to run your application. You could run the executable from within the batch file and when you have exited the main application it could delete the executable. I use something like the following to quickly write a test sample, compile it, run it and then delete it when the app is done:
csc /target:winexe test.cs
pause
test.exe
del test.exe
- Nick Parker My Blog | My Articles
|
|
|
|
|
In my "Drag Enter" method, how can I get the path of the file I dragged? Is it in the IDataObject somewhere or what?
/\ |_ E X E GG
|
|
|
|
|
AFAIK path and name are the dragged String data:
<br />
private void control_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) {<br />
String droppedItem = (String)e.Data.GetData(typeof(String));<br />
}<br />
|
|
|
|
|
Dosn't seem to work.....
/\ |_ E X E GG
|
|
|
|
|
Hello,
I am creating a custom schedule control similar to the way Outlook behaves.
I am having some difficulty trying to graphically/visually resolve conflicting appointments on a schedule.
Anyone have some ideas or a pointer or two to help me out?
Thanks,
Eric
|
|
|
|
|
i want, form another form, and at a specified condition, to create an object from a certain control and add it to the first form, like :
namespace Win
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1 = new Button();
private System.Windows.Forms.Button button2 = new Button();
public System.Windows.Forms.Panel panel1;
public Form1()
{
InitializeComponent();
}
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void button2_Click(object sender, System.EventArgs e)
{
Form2 f2 = new Form2();
f2.Show();
}
}
public class Form2 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1 = new Button() ;
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, System.EventArgs e)
{
Button b = new Button();
b.Text = "Hello" ;
Form1 f1 = new Form1();
f1.panel1.Controls.Add(b);
}
}
}
this code does not work. What is the wrong here ?
thanks
|
|
|
|
|
In Form2.button1_Click you're creating a new instance of Form1 , adding a Button to its panel1 control and... well, that's it. f1 is going the way of the dodo bird when the method exits.
What I think you're trying to do is add the Button to the instance of Form1 that called Form2.Show in the first place. You'll need a reference to that object in Form2 . You can pass it in Form2 's constructor or as a property. Here's an example:
public class Form2 : Form
{
Form1 _form1;
public Form2(Form1 form1)
{
_form1 = form1;
}
private void button1_Click(object sender, EventArgs e)
{
_form1.panel1.Controls.Add(b);
}
}
public class Form1 : Form
{
private void button2_Click(object sender, System.EventArgs e)
{
Form2 f2 = new Form2(this);
f2.Show();
}
}
Charlie
if(!curlies){ return; }
|
|
|
|
|
ImanMahmoud wrote:
public Form1() { InitializeComponent(); }
I don't see the method InitializeComponent. Either create it, or get rid of this line
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
The project I'm developing is an Explorer bar which loads and saves files. Because it's an Explorer bar, the target output is a DLL (C# assembly). When the saved files are double-clicked, I would like to launch the Explorer bar.
Is it possible to setup an open handler within the DLL, rather than writing a helper EXE that will launch the Explorer bar, etc.? I like the idea of keeping the open-file handler bundled with the Explorer bar in the same DLL. In the mean time, until I hear from someone, I'll work on a helper EXE.
Thanks!
Arun
|
|
|
|
|
I am not sure about this one:
What about rundll32.exe ?
You, IMHO, should be able to associate an extension not only with an executable, but also with an executable with custom parameters.
If I am right here, you could then simply associate your extension with
"rundll32.exe mydll.dll MyExplorerBarStarter" or something like that.
I am not sure it will work with .NET-DLLs though
Cheers
Sebs
|
|
|
|
|
Hello all,
I have a simple custom control I use to draw an ellipse. The code is shown below. The problem is that if one ellipse is drawn INSIDE the area of another, the larger of the two always gets displayed in the foreground despite the z-order of the smaller ellipse. In fact, I can call BringToFront() on the smaller ellipse all day and the larger ellipse still gets displayed in the foreground.
I really don't understand why this is. Could someone more versed in painting custom controls help me out?
Thank you,
-dotbomb
~~~~~~~~~~~~~~~~ BEGIN CUSTOM CONTROL CODE SNIPPET ~~~~~~~~~~~~~~~~~~~~
public class ellipseControl : System.Windows.Forms.UserControl
{
private System.ComponentModel.Container components = null;
public Color backgroundColor;
protected override CreateParams CreateParams
{
get
{
CreateParams cp=base.CreateParams;
cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
protected void InvalidateEx()
{
if(Parent==null)
return;
Rectangle rc=new Rectangle(this.Location,this.Size);
Parent.Invalidate(rc,true);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
//do not allow the background to be painted
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
int penWidth = 1;
Pen pen = new Pen(Color.Black, penWidth);
SolidBrush brush = new SolidBrush(backgroundColor);
graphics.DrawEllipse(pen, 0, 0, (Width - 2), (Height - 2));
graphics.FillEllipse(brush, 1, 1, (Width - 4), (Height - 4));
brush.Dispose();
pen.Dispose();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
}
~~~~~~~~~~~~~~~~~~~~~ END CUSTOM CONTROL CODE SNIPPET ~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|