コード例 #1
0
ファイル: WinForm.cs プロジェクト: ahsaeldin/projects
        /* 
		'==============================================================================
		' Method:        axSubClass3_MessageReceived
		'
		' Description:  Stop the form from being resized below or above a user-defined amount.
		'==============================================================================
        */
		private void axSubClass3_MessageReceived(object sender, AxASTC.__SubClass_MessageReceivedEvent e)
		{
			/*
			'e.hwnd()        Handle of the subclassed window or control.
			'e.msg()         The ID of the intercepted message.
			'e.wParam()      The wParam value of the intercepted message.
			'e.lParam()      The lParam value of the intercepted message.
			'e.cancel        Further processing state.
			*/
			
			const int WM_GETMINMAXINFO = 36;

            ShellNotify.MINMAXINFO mmiMsg = new ShellNotify.MINMAXINFO();   

              if (e.msg == WM_GETMINMAXINFO)
			  {
               
			   ShellNotify.CopyMemory (ref mmiMsg,e.lParam, Marshal.SizeOf(mmiMsg));
               if (mmiMsg.ptMinTrackSize.X > 0)
				   mmiMsg.ptMinTrackSize.X = 304;
               if (mmiMsg.ptMinTrackSize.Y > 0)
				   mmiMsg.ptMinTrackSize.Y = 576;
               ShellNotify.CopyMemory2 (e.lParam,ref mmiMsg, Marshal.SizeOf(mmiMsg));
              
			   //Cancel any further processing.
			   e.cancel = true;

			   }
		}
コード例 #2
0
ファイル: WinForm.cs プロジェクト: ahsaeldin/projects
		/*
		'==============================================================================
		' Method:        axSubClass1_MessageReceived
		'
		' Description:   Extends the listbox functionality.
		'==============================================================================
        */
		private void axSubClass1_MessageReceived(object sender, AxASTC.__SubClass_MessageReceivedEvent e)
		{
		  /*
		   'e.hwnd()        Handle of the subclassed window or control.
           'e.msg()         The ID of the intercepted message.
           'e.wParam()      The wParam value of the intercepted message.
           'e.lParam()      The lParam value of the intercepted message.
           'e.cancel        Further processing state.
		  */

          Int32 ret;

		  const int WM_RBUTTONUP = 517;
          const int LB_ITEMFROMPOINT = 425;

			if (e.msg ==  WM_RBUTTONUP)
			{
			  //Retrieve the zero-based index of the item nearest a specified point in the list box.
              ret = ShellNotify.SendMessage(e.hwnd, LB_ITEMFROMPOINT, 0, e.lParam);
				for (int g = 0; g != (int)ListBox1.Items.Count + 1; g++)
				{
					if (ret == g)
					{
						ListBox1.SetSelected(g,true);  
						Label3.Text = "item" + ListBox1.GetItemText(ListBox1.SelectedIndex) + " had been clicked";
						int X = Cursor.Position.X;
                        int Y = Cursor.Position.Y;
					    //Extends Listbox functionality by Display a popup menu related to the clicked item.
						ShellNotify.TrackPopupMenu(ContextMenu1.Handle.ToInt32(), 0, X, Y,0,Handle.ToInt32(), 0);
	                 }
                     
				}


			
			}
			 
         }
コード例 #3
0
ファイル: WinForm.cs プロジェクト: ahsaeldin/projects
        /*
		'==============================================================================
		' Method:        axSubClass2_MessageReceived
		'
		' Description:   Disable a context menu in a text box.
		'==============================================================================
		*/
		private void axSubClass2_MessageReceived(object sender, AxASTC.__SubClass_MessageReceivedEvent e)
		{
           /*
		   'e.hwnd()        Handle of the subclassed window or control.
           'e.msg()         The ID of the intercepted message.
           'e.wParam()      The wParam value of the intercepted message.
           'e.lParam()      The lParam value of the intercepted message.
           'e.cancel        Further processing state.
           */

           const int WM_CONTEXTMENU = 123;
              
			if (e.msg == WM_CONTEXTMENU) 
			{
				Label5.Text = "Context Menu had been disabled";
				//Cancel any further processing.
				e.cancel = true;
			}  
		
		}
コード例 #4
0
ファイル: Form1.cs プロジェクト: ahsaeldin/projects
		/*
		'==============================================================================
		' Method:        axSubClass1_MessageReceived
		'
		' Description:   Extends the listbox functionality.
		'==============================================================================
        */
		private void axSubClass1_MessageReceived(object sender, AxASTC.__SubClass_MessageReceivedEvent e)
		{
		  /*
		   'e.hwnd()        Handle of the subclassed window or control.
           'e.msg()         The ID of the intercepted message.
           'e.wParam()      The wParam value of the intercepted message.
           'e.lParam()      The lParam value of the intercepted message.
           'e.cancel        Further processing state.
		  */

          Int32 ret;
          
		   
          int ButHandle;

		  const int WM_MOUSEMOVE = 512;
          const int LB_ITEMFROMPOINT = 425;		
	      
		  

			if (e.msg ==  WM_MOUSEMOVE)
			{
			  //Retrieve the zero-based index of the item nearest a specified point in the list box.
              ret = ShellNotify.SendMessage(e.hwnd, LB_ITEMFROMPOINT, 0, e.lParam);
				for (int g = 0; g != (int)ListBox1.Items.Count + 1; g++)
				{
					if (ret == g)
					{   
						if (OldItem != g)
						{
						  Balloon1.Destroy();
                          Balloon2.Destroy();
						}

						ListBox1.SetSelected(g,true);  
				        Label3.Text = "item" + ListBox1.GetItemText(ListBox1.SelectedIndex) + " had been hovered.";
					    
						ButHandle = ListBox1.Handle.ToInt32();
						    
						if (g == 3)
						{
							Balloon1.Destroy();     
							Balloon2.ShowBalloon(ref ButHandle, "Click Me.", "SubClass", ASTC.BIcoType.Info, 500, 5000);
						}
						else
							Balloon1.ShowBalloon(ref ButHandle, "item" + ListBox1.GetItemText(ListBox1.SelectedIndex) + " had been hovered.", "SubClass", ASTC.BIcoType.Info, 500, 5000);
                   
					    OldItem = g;
					}
                     
				}
             }
			 
         }