Bonjour a tous!

Voila, je programme en VB.NET, j'ai créer un petit programme pour Windows CE. Il marche bien.

Mon problème est que je dois trouver un moyen de cacher la barre des taches de Windows.

Or apres avoir fais mes recherche, la seule chose que j'ai trouver de tengible est le code suivant en C# (je crois):

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
public const int SWP_ASYNCWINDOWPOS = 0x4000;
		public const int SWP_DEFERERASE = 0x2000;
		public const int SWP_DRAWFRAME = 0x0020;
		public const int SWP_FRAMECHANGED = 0x0020;
		public const int SWP_HIDEWINDOW = 0x0080;
		public const int SWP_NOACTIVATE = 0x0010;
		public const int SWP_NOCOPYBITS = 0x0100;
		public const int SWP_NOMOVE = 0x0002;
		public const int SWP_NOOWNERZORDER = 0x0200;
		public const int SWP_NOREDRAW = 0x0008;
		public const int SWP_NOREPOSITION = 0x0200;
		public const int SWP_NOSENDCHANGING = 0x0400;
		public const int SWP_NOSIZE = 0x0001;
		public const int SWP_NOZORDER = 0x0004;
		public const int SWP_SHOWWINDOW = 0x0040;
 
		public const int HWND_TOP = 0;
		public const int HWND_BOTTOM = 1;
		public const int HWND_TOPMOST = -1;
		public const int HWND_NOTOPMOST = -2;
 
		[DllImport("coredll.dll", SetLastError = true)]
		[return: MarshalAs(UnmanagedType.Bool)]
		public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);
 
		[DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError = true)]
		public static extern IntPtr FindWindowW(string lpClassName, string lpWindowName);
 
 
	public static void HideStartBar()
		{
			IntPtr handle;
			try
			{
				handle = FindWindowW("HHTaskBar", null);
				if (handle != IntPtr.Zero)
				{
					SetWindowPos((IntPtr)handle, (IntPtr)0, 0, 0, 0, 0, SWP_HIDEWINDOW);
				}
			}
			catch
			{
				MessageBox.Show("Impossible de masquer la barre d'état.");
			}
		}
 
		public static void ShowStartBar()
		{
			IntPtr handle;
 
			try
			{
				handle = FindWindowW("HHTaskBar", null);
				if (handle != IntPtr.Zero)
				{
					SetWindowPos(handle, (IntPtr)0, 0, 0, LARGEURECRANPDA, 26, SWP_SHOWWINDOW);
				}
			}
			catch
			{
				MessageBox.Show("Impossible d'afficher la barre d'état");
			}
		}
J'ai donc voulu créer une DLL que je pourrai utilisé dans mon appli.

J'ai donc créer une nouvelle solution, ajouter un projet de Bibliotheque de Classe. et j'ai tout simplement copier/coller ce code dans la classe.

Mais j'ai plusieurs erreurs souligné:
-
Code : Sélectionner tout - Visualiser dans une fenêtre à part
[DllImport("coredll.dll", SetLastError = true)]
: Le type ou l'espace de nom est introuvable
-
Code : Sélectionner tout - Visualiser dans une fenêtre à part
[return: MarshalAs(UnmanagedType.Bool)]
: Le type ou l'espace de nom est introuvable
-
Code : Sélectionner tout - Visualiser dans une fenêtre à part
SetWindowPos(handle, (IntPtr)0, 0, 0, LARGEURECRANPDA, 26, SWP_SHOWWINDOW);
:le nom n'existe pas dans le contexte actuel.


Comme je n'y connais pas grand chose en C#, étant très débutant en création de DLL, si quelqu'un pouvait me donner un petit coup de main. Merci d'avance.