Esempio n. 1
0
//        [STAThread]
//        internal void CreateToolTip(string highlighterData)
//        {
//        	// painting a new form
//        	int left =
//        		this.rightSide.Left - 20;
//        	int top =
//        		this.bottomSide.Top - 15;
//        	int height =
//        		this.bottomSide.Top - top;
//        	int width =
//        		this.rightSide.Left - left;
//
//        	labelForm =
//        		new LabelForm(
//        			left,
//        			top,
//        			width,
//        			height, 
//        			highlighterNumber,
//        			this.bottomSide.BackColor);
//        }
        
        private  NativeMethods.CursorPoint getPoint(
            double X,
            double Y,
            int intHandle)
        {
            NativeMethods.CursorPoint p = new NativeMethods.CursorPoint();
            p.X = (int)X;
            p.Y = (int)Y;
            if (intHandle != 0) {
                try { // Windows Vista or higher only
                    IntPtr handle = 
                        new IntPtr(intHandle);
                     NativeMethods.PhysicalToLogicalPoint(handle, ref p);
                } 
                catch {
            	}
            }
            return p;
        }
Esempio n. 2
0
//        [STAThread]
//        internal void CreateToolTip(string highlighterData)
//        {
//            // painting a new form
//            int left =
//                this.rightSide.Left - 20;
//            int top =
//                this.bottomSide.Top - 15;
//            int height =
//                this.bottomSide.Top - top;
//            int width =
//                this.rightSide.Left - left;
//
//            labelForm =
//                new LabelForm(
//                    left,
//                    top,
//                    width,
//                    height, 
//                    highlighterNumber,
//                    this.bottomSide.BackColor);
//        }
        
        private  NativeMethods.CursorPoint getPoint(
            double X,
            double Y,
            int intHandle)
        {
            var p = new NativeMethods.CursorPoint {X = (int) X, Y = (int) Y};
            if (intHandle == 0) return p;
            try { // Windows Vista or higher only
                var handle = 
                    new IntPtr(intHandle);
                NativeMethods.PhysicalToLogicalPoint(handle, ref p);
            } 
            catch {
            }
            
            /*
            NativeMethods.CursorPoint p = new NativeMethods.CursorPoint {X = (int) X, Y = (int) Y};
            if (intHandle == 0) return p;
            try { // Windows Vista or higher only
                IntPtr handle = 
                    new IntPtr(intHandle);
                NativeMethods.PhysicalToLogicalPoint(handle, ref p);
            } 
            catch {
            }
            */

            /*
            if (intHandle != 0) {
                try { // Windows Vista or higher only
                    IntPtr handle = 
                        new IntPtr(intHandle);
                     NativeMethods.PhysicalToLogicalPoint(handle, ref p);
                } 
                catch {
                }
            }
            */
            return p;
        }