Skip to main content

It is possible to do this in VC

Attached is the C # project

using System.Runtime.InteropServices;

namespace GUI_V_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("user32.DLL", EntryPoint = "ReleaseCapture")]
private extern static void ReleaseCapture();
[DllImport("user32.DLL", EntryPoint = "SendMessage")]
private extern static void SendMessage(System.IntPtr hwnd, int wmsg, int wparam, int lparam);

private void BarraTitulo_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle,0x112,0xf012,0);
}

Obrigado!

It is possible to do this in VC

Attached is the C # project

using System.Runtime.InteropServices;

namespace GUI_V_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("user32.DLL", EntryPoint = "ReleaseCapture")]
private extern static void ReleaseCapture();
[DllImport("user32.DLL", EntryPoint = "SendMessage")]
private extern static void SendMessage(System.IntPtr hwnd, int wmsg, int wparam, int lparam);

private void BarraTitulo_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle,0x112,0xf012,0);
}

Obrigado!

Straight conversion below:

$set ilusing(System.Runtime.InteropServices) class-id GUI_V_2.Form1 partial inherits type Form. method-id new. invoke InitializeComponent() end method. method-id ReleaseCapture private static attribute DllImport("user32.DLL", prop EntryPoint = "ReleaseCapture"). end method. method-id SendMessage (hwnd as type System.IntPtr, wmsg as binary-long, wparam as binary-long, lparam as binary-long) private static attribute DllImport("user32.DLL", prop EntryPoint = "SendMessage"). end method. method-id BarraTitulo_MouseDown (sender as object, e as type MouseEventArgs) private. invoke ReleaseCapture() invoke SendMessage(self::Handle, h"112", h"f012", 0) end method. end class.

 

VC also supports p/invoke using the call statement:
E.g.

01 pp procedure-pointer. set pp to entry "user32.dll" call "ReleaseCapture"

set pp to entry "user32.dll" is only required if you do not add a p/invoke reference to user32.dll to your project.


Straight conversion below:

$set ilusing(System.Runtime.InteropServices) class-id GUI_V_2.Form1 partial inherits type Form. method-id new. invoke InitializeComponent() end method. method-id ReleaseCapture private static attribute DllImport("user32.DLL", prop EntryPoint = "ReleaseCapture"). end method. method-id SendMessage (hwnd as type System.IntPtr, wmsg as binary-long, wparam as binary-long, lparam as binary-long) private static attribute DllImport("user32.DLL", prop EntryPoint = "SendMessage"). end method. method-id BarraTitulo_MouseDown (sender as object, e as type MouseEventArgs) private. invoke ReleaseCapture() invoke SendMessage(self::Handle, h"112", h"f012", 0) end method. end class.

 

VC also supports p/invoke using the call statement:
E.g.

01 pp procedure-pointer. set pp to entry "user32.dll" call "ReleaseCapture"

set pp to entry "user32.dll" is only required if you do not add a p/invoke reference to user32.dll to your project.


It didn't work when I use invoke it doesn't run the program, when I use call aborts in SendMessage