Advertisement
andrzejiwaniuk

Jak wywoływać funkcje z systemowych bibliotek dll

Aug 28th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Runtime.InteropServices.WindowsRuntime;
  6. using Windows.Foundation;
  7. using Windows.Foundation.Collections;
  8. using Windows.UI.Xaml;
  9. using Windows.UI.Xaml.Controls;
  10. using Windows.UI.Xaml.Controls.Primitives;
  11. using Windows.UI.Xaml.Data;
  12. using Windows.UI.Xaml.Input;
  13. using Windows.UI.Xaml.Media;
  14. using Windows.UI.Xaml.Navigation;
  15. using System.Runtime.InteropServices;
  16.  
  17. // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
  18.  
  19. namespace App8
  20. {
  21.     /// <summary>
  22.     /// An empty page that can be used on its own or navigated to within a Frame.
  23.     /// </summary>
  24.     public sealed partial class MainPage : Page
  25.     {
  26.  
  27.         [DllImport("user32.dll")]
  28.         public static extern int MessageBox(int h, string m, string c, int type);
  29.  
  30.         public MainPage()
  31.         {
  32.             this.InitializeComponent();
  33.         }
  34.  
  35.         private void button_Click(object sender, RoutedEventArgs e)
  36.         {
  37.             MessageBox(0, "Witajcie", "Wiadomość", 0);
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement