final int WM_NCLBUTTONDOWN = 0xA1; private final int HTCAPTION = 0x2;
/** @attribute DllImport( "user32.dll" ) */ public static native boolean ReleaseCapture(); /** @attribute DllImport("user32.dll" ) */ public static native int SendMessage( IntPtr hWnd, int Msg, int wParam, int lParam ); private void Form1_MouseDown( Object sender, MouseEventArgs e ) { if ( e.get_Button() == MouseButtons.Left ) { ReleaseCapture(); SendMessage( Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0 ); } }
Before compiling this code... 1. Import following packages ... import System.Runtime.InteropServices.*; import System.*; import System.Windows.Forms.*;
Also looking at the converted code can you please post here that what in C# you were finding difficult to convert into J#. Based upon that we may provide you pointers to understand those J# concepts/language constructs.
click n' drag: easy question (i hope)
grellsworth
Hi,
You may like to post this query on Windows Forms Forum. That's the best place to get quick response on language agnostic winforms related queries.
Is you are unable to do so then please let us know. We will write and post a sample code here.
Thanks.
Snommit
private const int WM_NCLBUTTONDOWN = 0xA1;
private const int HTCAPTION = 0x2;
[ DllImport( "user32.dll" ) ]
public static extern bool ReleaseCapture();
[ DllImport( "user32.dll" ) ]
public static extern int SendMessage( IntPtr hWnd, int Msg, int wParam, int lParam );
private void Form1_MouseDown( object sender, MouseEventArgs e )
{
if ( e.Button == MouseButtons.Left )
{
ReleaseCapture();
SendMessage( Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0 );
}
}
id really appreciate the j# code.
Anand Kumar S.R
Here is the J# equivalent ...
private
final int WM_NCLBUTTONDOWN = 0xA1;private final int HTCAPTION = 0x2;
/** @attribute DllImport( "user32.dll" ) */
public static native boolean ReleaseCapture(); /** @attribute DllImport("user32.dll" ) */
public static native int SendMessage( IntPtr hWnd, int Msg, int wParam, int lParam ); private void Form1_MouseDown( Object sender, MouseEventArgs e )
{
if ( e.get_Button() == MouseButtons.Left )
{
ReleaseCapture();
SendMessage( Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0 );
}
}
Before compiling this code...
1. Import following packages ...
import System.Runtime.InteropServices.*;
import System.*;
import System.Windows.Forms.*;
2. Replace Handlewith appropriate window handle.
3. Add reference to System.Windows.Forms.dll.
Also looking at the converted code can you please post here that what in C# you were finding difficult to convert into J#. Based upon that we may provide you pointers to understand those J# concepts/language constructs.
Thanks.