Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fortran callable QM functions
#7
C# example
Code:
Copy      Help
    //using System.Runtime.InteropServices;

    [DllImport("user32.dll", EntryPoint = "SendMessageW", CharSet = CharSet.Unicode)]
    internal static extern IntPtr SendMessageS(IntPtr hWnd, int Msg, uint wParam, string lParam);

    [DllImport("user32.dll", EntryPoint = "FindWindowW", CharSet = CharSet.Unicode)]
    internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

    static void TestQm2SendMessage()
    {
        var hwnd = FindWindow("QM_Editor", null);
        if(hwnd == default(IntPtr)) return;
        SendMessageS(hwnd, 12, 1, "Q ' M 'Macro295' C test C#");
    }

VB.NET example
Code:
Copy      Help
   'Imports System.Runtime.InteropServices

   <DllImport("user32.dll", EntryPoint:="SendMessageW", CharSet:=CharSet.Unicode)>
   Function SendMessageS(hWnd As IntPtr, Msg As Int32, wParam As UInt32, lParam As String) As IntPtr
   End Function

   <DllImport("user32.dll", EntryPoint:="FindWindowW", CharSet:=CharSet.Unicode)>
   Function FindWindow(lpClassName As String, lpWindowName As String) As IntPtr
   End Function

   Sub TestQm2SendMessage()
       Dim hwnd = FindWindow("QM_Editor", Nothing)
       If hwnd = IntPtr.Zero Then Return
       SendMessageS(hwnd, 12, 1, "Q ' M 'Macro295' C test VB")
   End Sub


Messages In This Thread
Fortran callable QM functions - by ssimop - 06-27-2018, 09:00 AM
RE: Fortran callable QM functions - by Gintaras - 06-27-2018, 11:57 AM
RE: Fortran callable QM functions - by ssimop - 01-22-2019, 06:48 PM
RE: Fortran callable QM functions - by Gintaras - 01-22-2019, 08:05 PM
RE: Fortran callable QM functions - by ssimop - 01-24-2019, 08:29 AM
RE: Fortran callable QM functions - by win - 01-30-2019, 08:30 PM
RE: Fortran callable QM functions - by Gintaras - 01-30-2019, 10:09 PM
RE: Fortran callable QM functions - by win - 01-30-2019, 10:52 PM
RE: Fortran callable QM functions - by Gintaras - 01-31-2019, 09:36 AM
RE: Fortran callable QM functions - by win - 01-31-2019, 12:29 PM
RE: Fortran callable QM functions - by win - 02-01-2019, 06:38 AM
RE: Fortran callable QM functions - by win - 02-01-2019, 09:39 AM
RE: Fortran callable QM functions - by Gintaras - 02-03-2019, 06:35 PM
RE: Fortran callable QM functions - by win - 02-03-2019, 11:54 PM
RE: Fortran callable QM functions - by Gintaras - 02-04-2019, 06:50 AM
RE: Fortran callable QM functions - by win - 04-21-2019, 09:31 AM
RE: Fortran callable QM functions - by win - 04-21-2019, 10:59 PM
RE: Fortran callable QM functions - by win - 04-22-2019, 08:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)