1 using System;
2 using System.Diagnostics;
3 using System.Drawing;
4 using System.Collections;
5 using System.ComponentModel;
6 using System.Windows.Forms;
7 using System.Data;
8 using System.Runtime.InteropServices;
9 
10 namespace CSharpFormLibrary
11 {
12 	public class IMECandidateForm2D : System.Windows.Forms.Form
13 	{
14 		//����index
15 		//int now_index;
16 		//int baseSize;	//������(�S��candidate��form���j�p)
17 		private System.ComponentModel.Container components = null;
18 		private System.UInt64 m_hwnd;
19 		private const int WM_MOUSEACTIVATE = 0x0021;
20 		private const int MA_ACTIVATE=0x0001;
21 		private const int MA_ACTIVATEANDEAT = 0x0002;
22 		private const int MA_NOACTIVATE=0x0003;
23 		private System.Windows.Forms.Panel panel1;
24 		private System.Windows.Forms.Button button1;
25 		private System.Windows.Forms.Label label1;
26 		private System.Windows.Forms.Panel panel2;
27 		private System.Windows.Forms.Button button2;
28 		private System.Windows.Forms.Label label2;
29 		private System.Windows.Forms.Panel panel3;
30 		private System.Windows.Forms.Button button3;
31 		private System.Windows.Forms.Label label3;
32 		private System.Windows.Forms.Panel panel4;
33 		private System.Windows.Forms.Button button4;
34 		private System.Windows.Forms.Label label4;
35 		private System.Windows.Forms.Panel panel5;
36 		private System.Windows.Forms.Button button5;
37 		private System.Windows.Forms.Label label5;
38 		private System.Windows.Forms.Panel panel6;
39 		private System.Windows.Forms.Button button6;
40 		private System.Windows.Forms.Label label6;
41 		private System.Windows.Forms.Panel panel7;
42 		private System.Windows.Forms.Button button7;
43 		private System.Windows.Forms.Label label7;
44 		private System.Windows.Forms.Panel panel8;
45 		private System.Windows.Forms.Button button8;
46 		private System.Windows.Forms.Label label8;
47 		private System.Windows.Forms.Panel panel9;
48 		private System.Windows.Forms.Button button9;
49 		private System.Windows.Forms.Label label9;
50 		private const int MA_NOACTIVATEANDEAT = 0x0004;
51 		private System.Windows.Forms.Button button10;
52 		private System.Windows.Forms.Button button11;
53 		private System.Windows.Forms.Button button12;
54 		private ArrayList buttonList ;
55 
IMECandidateForm2D()56 		public IMECandidateForm2D()
57 		{
58 			InitializeComponent();
59 			buttonList= new ArrayList();
60 			buttonList.Add(this.button1);
61 			buttonList.Add(this.button2);
62 			buttonList.Add(this.button3);
63 			buttonList.Add(this.button4);
64 			buttonList.Add(this.button5);
65 			buttonList.Add(this.button6);
66 			buttonList.Add(this.button7);
67 			buttonList.Add(this.button8);
68 			buttonList.Add(this.button9);
69 			buttonList.Add(this.button12);
70 			//baseSize = this.lbCandidates.Location.Y+100;
71 			//this.Opacity = 0.85;
72 
73             this.SetStyle(
74                 ControlStyles.UserPaint |
75                 ControlStyles.AllPaintingInWmPaint |
76                 ControlStyles.OptimizedDoubleBuffer, true);
77             Application.EnableVisualStyles();
78 		}
79 		/*public IMECandidateForm(string[] candidates)
80 		{
81 			InitializeComponent();
82 		}*/
WndProc(ref Message m)83 		protected override void WndProc(ref Message m)
84 		{
85 
86 			if (m.Msg == WM_MOUSEACTIVATE)
87 			{
88 				//this.RaiseMouseEvent( button1,);
89 				m.Result = (IntPtr)MA_NOACTIVATE;
90 				//m.Result = (IntPtr)MA_NOACTIVATE;
91 				return;
92 			}
93 
94 			base.WndProc(ref m);
95 		}
Dispose( bool disposing )96 		protected override void Dispose( bool disposing )
97 		{
98 			if( disposing )
99 			{
100 				if (components != null)
101 				{
102 					components.Dispose();
103 				}
104 			}
105 			base.Dispose( disposing );
106 		}
107 		#region Windows Form Designer generated code
108 		/// <summary>
109 		/// Required method for Designer support - do not modify
110 		/// the contents of this method with the code editor.
111 		/// </summary>
InitializeComponent()112 		private void InitializeComponent()
113 		{
114 			this.panel1 = new System.Windows.Forms.Panel();
115 			this.button1 = new System.Windows.Forms.Button();
116 			this.label1 = new System.Windows.Forms.Label();
117 			this.panel2 = new System.Windows.Forms.Panel();
118 			this.button2 = new System.Windows.Forms.Button();
119 			this.label2 = new System.Windows.Forms.Label();
120 			this.panel3 = new System.Windows.Forms.Panel();
121 			this.button3 = new System.Windows.Forms.Button();
122 			this.label3 = new System.Windows.Forms.Label();
123 			this.panel4 = new System.Windows.Forms.Panel();
124 			this.button4 = new System.Windows.Forms.Button();
125 			this.label4 = new System.Windows.Forms.Label();
126 			this.panel5 = new System.Windows.Forms.Panel();
127 			this.button5 = new System.Windows.Forms.Button();
128 			this.label5 = new System.Windows.Forms.Label();
129 			this.panel6 = new System.Windows.Forms.Panel();
130 			this.button6 = new System.Windows.Forms.Button();
131 			this.label6 = new System.Windows.Forms.Label();
132 			this.panel7 = new System.Windows.Forms.Panel();
133 			this.button7 = new System.Windows.Forms.Button();
134 			this.label7 = new System.Windows.Forms.Label();
135 			this.panel8 = new System.Windows.Forms.Panel();
136 			this.button8 = new System.Windows.Forms.Button();
137 			this.label8 = new System.Windows.Forms.Label();
138 			this.panel9 = new System.Windows.Forms.Panel();
139 			this.button9 = new System.Windows.Forms.Button();
140 			this.label9 = new System.Windows.Forms.Label();
141 			this.button10 = new System.Windows.Forms.Button();
142 			this.button11 = new System.Windows.Forms.Button();
143 			this.button12 = new System.Windows.Forms.Button();
144 			this.panel1.SuspendLayout();
145 			this.panel2.SuspendLayout();
146 			this.panel3.SuspendLayout();
147 			this.panel4.SuspendLayout();
148 			this.panel5.SuspendLayout();
149 			this.panel6.SuspendLayout();
150 			this.panel7.SuspendLayout();
151 			this.panel8.SuspendLayout();
152 			this.panel9.SuspendLayout();
153 			this.SuspendLayout();
154 			//
155 			// panel1
156 			//
157 			this.panel1.Controls.Add(this.button1);
158 			this.panel1.Controls.Add(this.label1);
159 			this.panel1.Location = new System.Drawing.Point(0, 0);
160 			this.panel1.Name = "panel1";
161 			this.panel1.Size = new System.Drawing.Size(72, 32);
162 			this.panel1.TabIndex = 6;
163 			//
164 			// button1
165 			//
166 			this.button1.Dock = System.Windows.Forms.DockStyle.Right;
167 			this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
168 			this.button1.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
169 			this.button1.Location = new System.Drawing.Point(16, 0);
170 			this.button1.Name = "button1";
171 			this.button1.RightToLeft = System.Windows.Forms.RightToLeft.No;
172 			this.button1.Size = new System.Drawing.Size(56, 32);
173 			this.button1.TabIndex = 0;
174 			this.button1.Text = "���";
175 			this.button1.Click += new System.EventHandler(this.button1_Click);
176 			//
177 			// label1
178 			//
179 			this.label1.BackColor = System.Drawing.Color.Pink;
180 			this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
181 			this.label1.Dock = System.Windows.Forms.DockStyle.Left;
182 			this.label1.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
183 			this.label1.Location = new System.Drawing.Point(0, 0);
184 			this.label1.Name = "label1";
185 			this.label1.Size = new System.Drawing.Size(16, 32);
186 			this.label1.TabIndex = 3;
187 			this.label1.Text = "W";
188 			this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
189 			//
190 			// panel2
191 			//
192 			this.panel2.Controls.Add(this.button2);
193 			this.panel2.Controls.Add(this.label2);
194 			this.panel2.Location = new System.Drawing.Point(72, 0);
195 			this.panel2.Name = "panel2";
196 			this.panel2.Size = new System.Drawing.Size(72, 32);
197 			this.panel2.TabIndex = 7;
198 			//
199 			// button2
200 			//
201 			this.button2.Dock = System.Windows.Forms.DockStyle.Right;
202 			this.button2.FlatStyle = System.Windows.Forms.FlatStyle.System;
203 			this.button2.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
204 			this.button2.Location = new System.Drawing.Point(16, 0);
205 			this.button2.Name = "button2";
206 			this.button2.RightToLeft = System.Windows.Forms.RightToLeft.No;
207 			this.button2.Size = new System.Drawing.Size(56, 32);
208 			this.button2.TabIndex = 0;
209 			this.button2.Text = "���";
210 			//
211 			// label2
212 			//
213 			this.label2.BackColor = System.Drawing.Color.Pink;
214 			this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
215 			this.label2.Dock = System.Windows.Forms.DockStyle.Left;
216 			this.label2.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
217 			this.label2.Location = new System.Drawing.Point(0, 0);
218 			this.label2.Name = "label2";
219 			this.label2.Size = new System.Drawing.Size(16, 32);
220 			this.label2.TabIndex = 3;
221 			this.label2.Text = "E";
222 			this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
223 			//
224 			// panel3
225 			//
226 			this.panel3.Controls.Add(this.button3);
227 			this.panel3.Controls.Add(this.label3);
228 			this.panel3.Location = new System.Drawing.Point(144, 0);
229 			this.panel3.Name = "panel3";
230 			this.panel3.Size = new System.Drawing.Size(72, 32);
231 			this.panel3.TabIndex = 8;
232 			//
233 			// button3
234 			//
235 			this.button3.Dock = System.Windows.Forms.DockStyle.Right;
236 			this.button3.FlatStyle = System.Windows.Forms.FlatStyle.System;
237 			this.button3.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
238 			this.button3.Location = new System.Drawing.Point(16, 0);
239 			this.button3.Name = "button3";
240 			this.button3.RightToLeft = System.Windows.Forms.RightToLeft.No;
241 			this.button3.Size = new System.Drawing.Size(56, 32);
242 			this.button3.TabIndex = 0;
243 			this.button3.Text = "���";
244 			//
245 			// label3
246 			//
247 			this.label3.BackColor = System.Drawing.Color.Pink;
248 			this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
249 			this.label3.Dock = System.Windows.Forms.DockStyle.Left;
250 			this.label3.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
251 			this.label3.Location = new System.Drawing.Point(0, 0);
252 			this.label3.Name = "label3";
253 			this.label3.Size = new System.Drawing.Size(16, 32);
254 			this.label3.TabIndex = 3;
255 			this.label3.Text = "R";
256 			this.label3.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
257 			//
258 			// panel4
259 			//
260 			this.panel4.Controls.Add(this.button4);
261 			this.panel4.Controls.Add(this.label4);
262 			this.panel4.Location = new System.Drawing.Point(0, 32);
263 			this.panel4.Name = "panel4";
264 			this.panel4.Size = new System.Drawing.Size(72, 32);
265 			this.panel4.TabIndex = 9;
266 			//
267 			// button4
268 			//
269 			this.button4.Dock = System.Windows.Forms.DockStyle.Right;
270 			this.button4.FlatStyle = System.Windows.Forms.FlatStyle.System;
271 			this.button4.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
272 			this.button4.Location = new System.Drawing.Point(16, 0);
273 			this.button4.Name = "button4";
274 			this.button4.RightToLeft = System.Windows.Forms.RightToLeft.No;
275 			this.button4.Size = new System.Drawing.Size(56, 32);
276 			this.button4.TabIndex = 0;
277 			this.button4.Text = "���";
278 			//
279 			// label4
280 			//
281 			this.label4.BackColor = System.Drawing.Color.Pink;
282 			this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
283 			this.label4.Dock = System.Windows.Forms.DockStyle.Left;
284 			this.label4.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
285 			this.label4.Location = new System.Drawing.Point(0, 0);
286 			this.label4.Name = "label4";
287 			this.label4.Size = new System.Drawing.Size(16, 32);
288 			this.label4.TabIndex = 3;
289 			this.label4.Text = "S";
290 			this.label4.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
291 			//
292 			// panel5
293 			//
294 			this.panel5.Controls.Add(this.button5);
295 			this.panel5.Controls.Add(this.label5);
296 			this.panel5.Location = new System.Drawing.Point(72, 32);
297 			this.panel5.Name = "panel5";
298 			this.panel5.Size = new System.Drawing.Size(72, 32);
299 			this.panel5.TabIndex = 10;
300 			//
301 			// button5
302 			//
303 			this.button5.Dock = System.Windows.Forms.DockStyle.Right;
304 			this.button5.FlatStyle = System.Windows.Forms.FlatStyle.System;
305 			this.button5.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
306 			this.button5.Location = new System.Drawing.Point(16, 0);
307 			this.button5.Name = "button5";
308 			this.button5.RightToLeft = System.Windows.Forms.RightToLeft.No;
309 			this.button5.Size = new System.Drawing.Size(56, 32);
310 			this.button5.TabIndex = 0;
311 			this.button5.Text = "���";
312 			//
313 			// label5
314 			//
315 			this.label5.BackColor = System.Drawing.Color.Pink;
316 			this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
317 			this.label5.Dock = System.Windows.Forms.DockStyle.Left;
318 			this.label5.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
319 			this.label5.Location = new System.Drawing.Point(0, 0);
320 			this.label5.Name = "label5";
321 			this.label5.Size = new System.Drawing.Size(16, 32);
322 			this.label5.TabIndex = 3;
323 			this.label5.Text = "D";
324 			this.label5.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
325 			//
326 			// panel6
327 			//
328 			this.panel6.Controls.Add(this.button6);
329 			this.panel6.Controls.Add(this.label6);
330 			this.panel6.Location = new System.Drawing.Point(144, 32);
331 			this.panel6.Name = "panel6";
332 			this.panel6.Size = new System.Drawing.Size(72, 32);
333 			this.panel6.TabIndex = 11;
334 			//
335 			// button6
336 			//
337 			this.button6.Dock = System.Windows.Forms.DockStyle.Right;
338 			this.button6.FlatStyle = System.Windows.Forms.FlatStyle.System;
339 			this.button6.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
340 			this.button6.Location = new System.Drawing.Point(16, 0);
341 			this.button6.Name = "button6";
342 			this.button6.RightToLeft = System.Windows.Forms.RightToLeft.No;
343 			this.button6.Size = new System.Drawing.Size(56, 32);
344 			this.button6.TabIndex = 0;
345 			this.button6.Text = "���";
346 			//
347 			// label6
348 			//
349 			this.label6.BackColor = System.Drawing.Color.Pink;
350 			this.label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
351 			this.label6.Dock = System.Windows.Forms.DockStyle.Left;
352 			this.label6.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
353 			this.label6.Location = new System.Drawing.Point(0, 0);
354 			this.label6.Name = "label6";
355 			this.label6.Size = new System.Drawing.Size(16, 32);
356 			this.label6.TabIndex = 3;
357 			this.label6.Text = "F";
358 			this.label6.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
359 			//
360 			// panel7
361 			//
362 			this.panel7.Controls.Add(this.button7);
363 			this.panel7.Controls.Add(this.label7);
364 			this.panel7.Location = new System.Drawing.Point(0, 64);
365 			this.panel7.Name = "panel7";
366 			this.panel7.Size = new System.Drawing.Size(72, 32);
367 			this.panel7.TabIndex = 12;
368 			//
369 			// button7
370 			//
371 			this.button7.Dock = System.Windows.Forms.DockStyle.Right;
372 			this.button7.FlatStyle = System.Windows.Forms.FlatStyle.System;
373 			this.button7.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
374 			this.button7.Location = new System.Drawing.Point(16, 0);
375 			this.button7.Name = "button7";
376 			this.button7.RightToLeft = System.Windows.Forms.RightToLeft.No;
377 			this.button7.Size = new System.Drawing.Size(56, 32);
378 			this.button7.TabIndex = 0;
379 			this.button7.Text = "���";
380 			//
381 			// label7
382 			//
383 			this.label7.BackColor = System.Drawing.Color.Pink;
384 			this.label7.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
385 			this.label7.Dock = System.Windows.Forms.DockStyle.Left;
386 			this.label7.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
387 			this.label7.Location = new System.Drawing.Point(0, 0);
388 			this.label7.Name = "label7";
389 			this.label7.Size = new System.Drawing.Size(16, 32);
390 			this.label7.TabIndex = 3;
391 			this.label7.Text = "X";
392 			this.label7.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
393 			//
394 			// panel8
395 			//
396 			this.panel8.Controls.Add(this.button8);
397 			this.panel8.Controls.Add(this.label8);
398 			this.panel8.Location = new System.Drawing.Point(72, 64);
399 			this.panel8.Name = "panel8";
400 			this.panel8.Size = new System.Drawing.Size(72, 32);
401 			this.panel8.TabIndex = 13;
402 			//
403 			// button8
404 			//
405 			this.button8.Dock = System.Windows.Forms.DockStyle.Right;
406 			this.button8.FlatStyle = System.Windows.Forms.FlatStyle.System;
407 			this.button8.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
408 			this.button8.Location = new System.Drawing.Point(16, 0);
409 			this.button8.Name = "button8";
410 			this.button8.RightToLeft = System.Windows.Forms.RightToLeft.No;
411 			this.button8.Size = new System.Drawing.Size(56, 32);
412 			this.button8.TabIndex = 0;
413 			this.button8.Text = "���";
414 			//
415 			// label8
416 			//
417 			this.label8.BackColor = System.Drawing.Color.Pink;
418 			this.label8.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
419 			this.label8.Dock = System.Windows.Forms.DockStyle.Left;
420 			this.label8.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
421 			this.label8.Location = new System.Drawing.Point(0, 0);
422 			this.label8.Name = "label8";
423 			this.label8.Size = new System.Drawing.Size(16, 32);
424 			this.label8.TabIndex = 3;
425 			this.label8.Text = "C";
426 			this.label8.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
427 			//
428 			// panel9
429 			//
430 			this.panel9.Controls.Add(this.button9);
431 			this.panel9.Controls.Add(this.label9);
432 			this.panel9.Location = new System.Drawing.Point(144, 64);
433 			this.panel9.Name = "panel9";
434 			this.panel9.Size = new System.Drawing.Size(72, 32);
435 			this.panel9.TabIndex = 14;
436 			//
437 			// button9
438 			//
439 			this.button9.Dock = System.Windows.Forms.DockStyle.Right;
440 			this.button9.FlatStyle = System.Windows.Forms.FlatStyle.System;
441 			this.button9.Font = new System.Drawing.Font("PMingLiU", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
442 			this.button9.Location = new System.Drawing.Point(16, 0);
443 			this.button9.Name = "button9";
444 			this.button9.RightToLeft = System.Windows.Forms.RightToLeft.No;
445 			this.button9.Size = new System.Drawing.Size(56, 32);
446 			this.button9.TabIndex = 0;
447 			this.button9.Text = "���";
448 			//
449 			// label9
450 			//
451 			this.label9.BackColor = System.Drawing.Color.Pink;
452 			this.label9.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
453 			this.label9.Dock = System.Windows.Forms.DockStyle.Left;
454 			this.label9.Font = new System.Drawing.Font("PMingLiU", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
455 			this.label9.Location = new System.Drawing.Point(0, 0);
456 			this.label9.Name = "label9";
457 			this.label9.Size = new System.Drawing.Size(16, 32);
458 			this.label9.TabIndex = 3;
459 			this.label9.Text = "V";
460 			this.label9.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
461 			//
462 			// button10
463 			//
464 			this.button10.BackColor = System.Drawing.Color.MistyRose;
465 			this.button10.Cursor = System.Windows.Forms.Cursors.PanNorth;
466 			this.button10.Location = new System.Drawing.Point(216, 0);
467 			this.button10.Name = "button10";
468 			this.button10.Size = new System.Drawing.Size(48, 32);
469 			this.button10.TabIndex = 15;
470 			this.button10.Text = "��";
471 			//
472 			// button11
473 			//
474 			this.button11.BackColor = System.Drawing.Color.MistyRose;
475 			this.button11.Cursor = System.Windows.Forms.Cursors.PanSouth;
476 			this.button11.Location = new System.Drawing.Point(216, 64);
477 			this.button11.Name = "button11";
478 			this.button11.Size = new System.Drawing.Size(48, 32);
479 			this.button11.TabIndex = 16;
480 			this.button11.Text = "��";
481 			//
482 			// button12
483 			//
484 			this.button12.BackColor = System.Drawing.Color.PeachPuff;
485 			this.button12.Cursor = System.Windows.Forms.Cursors.Hand;
486 			this.button12.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
487 			this.button12.Font = new System.Drawing.Font("Arial", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
488 			this.button12.Location = new System.Drawing.Point(216, 32);
489 			this.button12.Name = "button12";
490 			this.button12.Size = new System.Drawing.Size(48, 32);
491 			this.button12.TabIndex = 17;
492 			this.button12.Text = "1/1";
493 			//
494 			// IMECandidateForm
495 			//
496 			this.AutoScaleBaseSize = new System.Drawing.Size(6, 18);
497 			this.BackColor = System.Drawing.SystemColors.Window;
498 			this.ClientSize = new System.Drawing.Size(264, 96);
499 			this.Controls.Add(this.button12);
500 			this.Controls.Add(this.button11);
501 			this.Controls.Add(this.button10);
502 			this.Controls.Add(this.panel9);
503 			this.Controls.Add(this.panel8);
504 			this.Controls.Add(this.panel7);
505 			this.Controls.Add(this.panel6);
506 			this.Controls.Add(this.panel5);
507 			this.Controls.Add(this.panel4);
508 			this.Controls.Add(this.panel3);
509 			this.Controls.Add(this.panel2);
510 			this.Controls.Add(this.panel1);
511 			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
512 			this.Location = new System.Drawing.Point(199, 199);
513 			this.Name = "IMECandidateForm";
514 			this.ShowInTaskbar = false;
515 			this.Text = "Form1";
516 			this.Click += new System.EventHandler(this.IMECandidateForm_Click);
517 			this.Validating += new System.ComponentModel.CancelEventHandler(this.IMECandidateForm_Validating);
518 			this.Validated += new System.EventHandler(this.IMECandidateForm_Validated);
519 			this.Activated += new System.EventHandler(this.IMECandidateForm_Activated);
520 			this.Leave += new System.EventHandler(this.IMECandidateForm_Leave);
521 			this.Enter += new System.EventHandler(this.IMECandidateForm_Enter);
522 			this.Deactivate += new System.EventHandler(this.IMECandidateForm_Deactivate);
523 			this.panel1.ResumeLayout(false);
524 			this.panel2.ResumeLayout(false);
525 			this.panel3.ResumeLayout(false);
526 			this.panel4.ResumeLayout(false);
527 			this.panel5.ResumeLayout(false);
528 			this.panel6.ResumeLayout(false);
529 			this.panel7.ResumeLayout(false);
530 			this.panel8.ResumeLayout(false);
531 			this.panel9.ResumeLayout(false);
532 			this.ResumeLayout(false);
533 
534 		}
535 
536 		#endregion
537 
538 		#region public methods
539 
SetCandidates(string inputs)540 		public void SetCandidates(string inputs)
541 		{/*
542 			string[] a_inputs = inputs.Split(' ');
543 			if(a_inputs==null) return;
544 			this.lbCandidates.Height=(a_inputs.Length+1)*15;
545 			this.ShowListView(a_inputs); // not show, only setstring*/
546 			string[] a_inputs = inputs.Split(' ');
547 			if(a_inputs==null) return;
548 			//this.lbCandidates.Height=(a_inputs.Length+1)*15;
549 			this.ShowListView(a_inputs);
550 		}
551 
SetLocation(int x, int y)552 		public void SetLocation(int x, int y)
553 		{
554 			//System.Diagnostics.Debug.WriteLine("Screen.GetBounds().Width="+Screen.GetBounds(this).Width);
555 			//System.Diagnostics.Debug.WriteLine("Screen.GetBounds().Height="+Screen.GetBounds(this).Height);
556 
557 			int screenW=Screen.GetBounds(this).Width;
558 			int screenH=Screen.GetBounds(this).Height;
559 			if (x+this.Width> screenW)
560 			{
561 				x=screenW-this.Width;
562 			}
563 			if (y+this.Height> screenH)
564 			{
565 				y=screenH-this.Height;
566 			}
567 			this.Location = new Point(x,y);
568 		}
569 
DisposeForm()570 		public void DisposeForm()
571 		{
572 			this.Dispose(true);
573 		}
574 
575 		/*public int GetValue()
576 		{
577 			return this.lbCandidates.SelectedIndex;
578 		}*/
ClearCandidates()579 		public void ClearCandidates()
580 		{
581 			//this.lbCandidates.Items.Clear();
582 			System.Diagnostics.Debug.WriteLine("ClearCandidates");
583 			for(int i=0;i<=9;i++)
584 			{
585 				((Button)this.buttonList[i]).Text="";
586 			}
587 		}
588 		/*public void DepthOfList(int number)
589 		{
590 			//14 = lbCandidate.Size.Height/9 �i�� - Height%9
591 			this.Size = new Size(this.Size.Width,baseSize+number*13);
592 		}*/
SetHWND(System.UInt64 hwnd)593 		public void SetHWND(System.UInt64 hwnd)
594 		{
595 			System.Diagnostics.Debug.WriteLine("SetHWND");
596 			m_hwnd=hwnd;
597 		}
598 
599 		#endregion
600 
601 		#region a protected override method for WS_POPUP
602 
603 		protected override CreateParams CreateParams
604 		{
605 			get
606 			{
607 				CreateParams cp = base.CreateParams;
608 				cp.Style = unchecked((int)0x80000000); //WS_POPUP
609 				return cp;
610 				/*const int WS_EX_NOACTIVATE = 0x08000000;
611 				CreateParams cp = base.CreateParams;
612 				cp.ExStyle = cp.ExStyle | WS_EX_NOACTIVATE;
613 				return cp;*/
614 			}
615 		}
616 
617 		#endregion
618 
619 		#region private methods
620 
ShowListView(string[] pageCandidates)621 		private void ShowListView(string[] pageCandidates)
622 		{
623 			/*this.lbCandidates.Items.Clear();
624 			this.lbCandidates.Items.AddRange(pageCandidates);
625 			this.lbCandidates.SelectedItem= this.lbCandidates.Items[0];*/
626 			System.Diagnostics.Debug.WriteLine("ShowListView");
627 			for(int i=0;i<=9;i++)
628 			{
629 
630 				if(i<pageCandidates.Length-1)
631 				{
632 					((Button)this.buttonList[i]).Text=pageCandidates[i].Substring(2);
633 					System.Diagnostics.Debug.WriteLine(pageCandidates[i]);
634 				}
635 				else if (i==pageCandidates.Length-1)
636 				{
637 					//((Button)this.buttonList[9]).Text=pageCandidates[i];
638 					this.button12.Text=pageCandidates[i];
639 					System.Diagnostics.Debug.WriteLine(pageCandidates[i]);
640 				}
641 				else
642 				{
643 					//((Button)this.buttonList[i]).Text="";
644 				}
645 			}
646 
647 		}
648 		#endregion
GetWidth()649 		public int GetWidth()
650 		{
651 			return this.Width;
652 		}
GetHeight()653 		public int GetHeight()
654 		{
655 			return this.Height;
656 		}
ShowNoActive()657 		public void ShowNoActive()
658 		{
659 			//Debug.WriteLine("ShowNoActive cand ");
660 			UtilFuncs.SetVisibleNoActivate(this, true); // true to show.
661 		}
HideNoActive()662 		public void HideNoActive()
663 		{
664 			//Debug.WriteLine("HideNoActive cand ");
665 			UtilFuncs.SetVisibleNoActivate(this, false); // false to hide.
666 		}
667 
IMECandidateForm_Click(object sender, System.EventArgs e)668 		private void IMECandidateForm_Click(object sender, System.EventArgs e)
669 		{
670 			//System.Diagnostics.Debug.WriteLine("Click");
671 		}
672 
lbCandidates_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)673 		private void lbCandidates_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
674 		{
675 			//MessageBox.Show(this.lbCandidates.Parent.ToString());
676 			//SendKeys.SendWait((this.lbCandidates.SelectedIndex+1).ToString());
677 		}
678 
IMECandidateForm_Activated(object sender, System.EventArgs e)679 		private void IMECandidateForm_Activated(object sender, System.EventArgs e)
680 		{
681 			//ShowNoActive();
682 			//if(!isTouched)
683 		{
684 			//UtilFuncs.GiveBackFocus(m_hwnd);
685 			//System.Diagnostics.Debug.Write("Cand Active(); give back focus to ");
686 			//System.Diagnostics.Debug.WriteLine(m_hwnd);
687 			//	isTouched = true;
688 		}//else
689 			//	isTouched = false;
690 		}
691 
IMECandidateForm_Deactivate(object sender, System.EventArgs e)692 		private void IMECandidateForm_Deactivate(object sender, System.EventArgs e)
693 		{
694 			//HideNoActive();
695 			//System.Diagnostics.Debug.WriteLine("Cand DeActive();");
696 		}
697 
lbCandidates_Enter(object sender, System.EventArgs e)698 		private void lbCandidates_Enter(object sender, System.EventArgs e)
699 		{
700 			//System.Diagnostics.Debug.WriteLine("lbCandidates_Enter");
701 		}
702 
lbCandidates_Leave(object sender, System.EventArgs e)703 		private void lbCandidates_Leave(object sender, System.EventArgs e)
704 		{
705 			//System.Diagnostics.Debug.WriteLine("lbCandidates_Leave");
706 		}
707 
IMECandidateForm_Enter(object sender, System.EventArgs e)708 		private void IMECandidateForm_Enter(object sender, System.EventArgs e)
709 		{
710 			//System.Diagnostics.Debug.WriteLine("Cand Enter");
711 		}
712 
IMECandidateForm_Leave(object sender, System.EventArgs e)713 		private void IMECandidateForm_Leave(object sender, System.EventArgs e)
714 		{
715 			//System.Diagnostics.Debug.WriteLine("Cand Leave");
716 		}
717 
IMECandidateForm_Validated(object sender, System.EventArgs e)718 		private void IMECandidateForm_Validated(object sender, System.EventArgs e)
719 		{
720 
721 			//System.Diagnostics.Debug.WriteLine("Cand Validated");
722 		}
IMECandidateForm_Validating(object sender, System.ComponentModel.CancelEventArgs e)723 		private void IMECandidateForm_Validating(object sender, System.ComponentModel.CancelEventArgs e)
724 		{
725 			//System.Diagnostics.Debug.WriteLine("Cand Validating");
726 
727 		}
728 
button1_Click(object sender, System.EventArgs e)729 		private void button1_Click(object sender, System.EventArgs e)
730 		{
731 			SendKeys.SendWait("1");
732 		}
733 	}
734 }
735 
736 
737