Quick Search


Tibetan singing bowl music,sound healing, remove negative energy.

528hz solfreggio music -  Attract Wealth and Abundance, Manifest Money and Increase Luck



 
Your forum announcement here!

  Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums > Other Methods of FREE Advertising > Guest Books Directory

Guest Books Directory Here is a great way to get some inbound links to your site, and message heard by people who also post and read these books. (Tip: Dont use your real email address on them)

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-19-2011, 09:48 PM   #1
booard47
 
Posts: n/a
Default BOOL DragFlag

WINDOWS application window generally incorporate two types: typical habitual residence with the top-level windows and no high-level window title bar. The former is personalized from the internal functions WINDOWS, WINDOWS application window, it's got all of the regular features: a title bar, window borders, improve button, minimize button and the program default shortcut keys and mouse assistance functions, employing the left mouse button Drag the window's title bar with the species can move the window anywhere around the display once the mouse cursor on the border from the window can alter the window dimension; which is really a customized high-level window, it doesn't have any properties of ordinary window, the entire control of the window one by 1 to become decided from the programmer to make use of a common example of such windows in a WINDOWS application IME input approach, UCWIN4.0 platforms, floating toolbox, Workplace with the desktop toolbar and third-party developers Chinese character input platform.

WINDOWS title of this article without top-level windows of typical residence, a notable characteristic is the fact that without having changing the window dimensions, but ought to have a window client location of ​​the drag perform. Drag the window as an normal perform is achieved through the program, the preparation of common application without regard to the consumer area according to drag the issue, it truly is generally tough to encounter this dilemma programmer, let on your own the right way to attain this purpose. Developers regularly want their own created computer software has the traditional software program, drag the window consumer area purpose, I had to imitate the system by dragging the mouse to click on the window title bar plus the WINDOWS API provided within the system to deliver function to deliver commands towards the internal drag-free Title of regular residence, drag the top-level windows client function, the results aren't satisfactory. Later within the window function needed to cope with by immediate WM_LBUTTONDOWN, WM_MOUSEMOVE and WM_LBUTTONUP news, self-control window, drag the consumer command location, drag the start, move the window, drag the box to draw the virtual, virtual box, which include shifting and dragging the end from the process, to to obtain the top with the window consumer location of ​​high drag options. The subsequent particulars on his own experience of particular techniques to obtain the program and key abilities.

1, WINDOWS testing customer orders and drag the mouse cursor prompt implementation of dynamic procedures

WINDOWS habitual residence without having the title bar with the client area of ​​top-level windows are typically divided into two types: distinct customer buy area and non-specific consumer buy area. Distinct customer order region will be the utilization of specific consumer orders that all elements outside the area, the window purpose to establish whether or not the real wants from the area occurred in the mouse commands for processing. Continual great window onto the top ranking features essentially the most important issue is how you can detect and handle particular consumer orders, regional and non-specific customer orders in the area from the mouse commands, and how you can make use of the mouse cursor to dynamically prompt the user can then drag the window operation.

1, the mouse inside a particular customer location detection strategy

command set once the window operate to attain drag the icon for that command button, the file must be defined inside the resource-specific customer command button area,Office 2007 Serial, which typically command button that's shown inside the icon from the rectangular region, the region defined method . Proper and DragRT.BOTTOM 4 parameters to describe the rectangular location relative towards the upper left corner with the window customer region relative coordinates, the 4 parameters ought to be defined beforehand the certain values, you are able to also use

window purpose in processing the message WM_LBUTTONDOWN mouse when the mouse within the location with the getting method parameter lParam passed, by way of MAKEPOINT () perform to convert to window coordinates, making use of coordinates to establish whether or not a rectangular region in a particular operate PtInRect (), can establish whether or not the mouse pointer to drag the command button click within to be able to complete the window, drag the features from the begin task. The adhering to sample code describes ######ual perform:

situation WM_LBUTTONDOWN: / / mouse cursor click processing

Position pt; / / position the mouse pointer around the screen, such as two pt.X and pt.Y parameters,

/ / utilize the pointer worth is converted from MAKEPOINT through the lParam parameter

pt = MAKEPOINT (lParam); / / Get the current screen place the mouse pointer

if (PtInRect (& DragRT, pt ))// determine whether the mouse button to click as you drag the

/ / mouse to drag the window to achieve the program's start function

else

/ / for other specific or non-client area to determine a specific command processing



break;

2, detected in non-client region mouse commands specific approach

taken once the window will be the application of non-specific consumer area drag method, you should decide upfront inside the resource file in all regions from the rectangular coordinates of a specific customer, then the consumer location can be a non-specific irregular region, it based on the real application window and the various command buttons to figure out the rectangular location, which is,Windows 7 Download, relative to each command button, the window with the rectangular location Window perform in processing mouse messages WM_LBUTTONDOWN, the first use of the operate PtInRect () to establish whether the present mouse pointer clicks the command button in each rectangular area, if not click on on any command button area, you can actually determine the mouse to click on within the location of ​​non-specific consumer , drag the window function in order to obtain the start off. The adhering to sample code describes ######ual operate:

situation WM_LBUTTONDOWN: / / mouse cursor click processing

Level pt; / / define the place with the mouse pointer on the display

pt = MAKEPOINT (lParam); / / obtain the current mouse cursor place pointer

for (I = 0; I

if (PtInRect (& DragRT [i], pt ))// DragRT [i] for the button rectangular array

break; / / mouse click on the button in the other interrupt



}

if (I

/ / mouse click on inside the other deals with particular customers within the region other button functions

} else

/ / mouse click in the non-client area, complete the window, drag the program start



break;

3, window, drag the mouse cursor perform approach for dynamic prompts

no title bar at the top of usual residence, senior window application in both regions is often used like a certain customer's approach of dragging the command button, you may also take the consumer region in the non-specific strategy of detection window, drag the command, or both of two techniques to make use of. When utilizing the first strategy, you'll be able to command button with a specified icon or text to prompt the user to the perform of the command button, and then a method can not ascertain the rectangular area can not use icons or text to prompt, or simply can not display icons and text (which include non-specific consumer area window border location), the user simply can not know the customer area with non-specific drag the window operate, then only the full use with the mouse cursor dynamic prompts, as WINDOWS ordinary window frame from the window the mouse cursor once the mouse cursor changes dual arrow shape to prompt the user can alter the window dimensions at this time, as within the Advanced window, this feature is really important to interface design.

obtain dynamic prompts the mouse cursor mouse cursor before the must customize the shape, drag the window operate News Tip arrow cursor shape into four basic patterns, which can take advantage of Microsoft's SDK, FPT3.0 and VC + +4.one development of software program and other large resource editor 2-color or 16 color. CUR image file, according to the function to attain specific patterns to decide the cursor or use WINDOWS program resource files available within the cursor, when your cursor utilizing the resource editor to draw patterns, you also need to have to make use of DEBUG. EXE application to modify the mouse cursor in the resource file offset coordinates of the cursor display for the cursor like a WINDOWS method design towards the dynamic prompt cursor because the center from the dynamic pattern of precisely when prompted inside the display the cursor's present location. the offset coordinates within the light show resource files 10 and 12 double-byte location, for example dynamic prompt cursor resource file named MOUSEM.CUR, make 32X32 (2 colors) graphic display once the cursor happens to be at the center of the pattern position with the existing display, which modification as follows:

C> DEBUG MOUSEM.CUR

-E 10A

XXXX: 10A 00.10 00.00 00.10 00.00

-W

build up your mouse cursor resource file, the application first requirements to define the mouse cursor inside the resource file, resource file defined techniques:

imecurm CURSOR mousem.cur

mouse Only the cursor after the definition from the resource file could be used within the application LoadCursor () function is transferred for the memory used, and their call is:

HCURSOR hCurm; / / the mouse cursor to the resource file data into memory

hCurm = LoadCursor (hInstance, window class defines the resource take care of from the corresponding mouse cursor when the mouse cursor over the corresponding time window immediately turn into a custom cursor shape, out from the corresponding window, the cursor automatically restore the original shape. to attain the mouse cursor prompts the definition of this dynamic method as follows:

wc.hCursor = hCurm;

the window once the mouse cursor to the certain needs of customers inside the command button location or region particular consumer purchase dynamic prompt, you can actually not utilize the above definition methods must be handled within the window operate WM_MOUSEMOVE message for special treatment: First, figure out whether the existing place the mouse cursor pointer button, drag the command to move inside the area or particular customers, and if the window drag the mouse pointer place to meet the specifications of functional areas, the use of API function SETCURSOR () to alter the mouse cursor patterns, prompts the user can then drag the window and mouse input control for the present window, and set to change the mouse cursor signs; dragging out the window once the mouse pointer when you begin the command region to restore the original design while releasing the mouse the mouse cursor manage input focus, and clear indication marks the mouse cursor dynamic unit. its functional code description is as follows:

BOOL DragFlag; / / Dynamic prompt cursor mark

situation WM_MOUSEMOVE: / / mouse cursor handling

pt = MAKEPOINT (lParam); / / existing cursor place mouse pointer

if (PtInRect (& DragRT, pt ))// Drag the mouse pointer in the command area is

SetCursor (hCurm); / / dynamically change the mouse cursor shape

SetCapture (hWnd); / / mouse input control to the current window

iFlag = TRUE; / / set the mouse cursor shape changes sign

else if (iFlag == TRUE) / / drag the mouse pointer is not in the command area

SetCursor (LoadCursor (NULL, IDC_ARROW ));// to restore the original shape

ReleaseCapture () / / Release the mouse input control

iFlag = FALSE; / / restore the mouse cursor shape changes signs



break;

II, WINDOWS advanced window, drag the plan technique of dragging the custom box above

introduced before the window, drag the mouse cursor placement detection and consumer orders within the area from the mouse cursor to drag the perform with the dynamic prompt method, the mouse cursor when the user prompts to acquire the dynamic drag the window to meet the conditions, start off by clicking the left mouse button to drag the program, then probably the most critical technology The difficulty will be the method of moving the mouse to drag the window frame dragging within the display and erase purpose realization. window, drag the empty box is displayed WINDOWS explain the complete display region the dimensions from the frame by dragging the window, its size ought to be towed rectangular area the dimension of relocating window along with the actual requirements of specifically identified, in common, was dragged under the rectangular location the dimensions of the window.

WINDOWS drawing method is via implementation with the display device description, the drawing operation requires take some GDI resources, the method for the windows, menus, dialog boxes, fonts, and a variety of GDI drawing features to allocate sufficient resources, WINDOWS 95 of GDI resources in the GDI resources than WINDOWS3.X much. WINDOWS There are two sorts of display device descriptor table to make use of the technique: Update window displays and immediate client area consumer region of ​​window operations. Update window consumer area is directly against the terms with the application window rectangle, in response to WM_PAINT message window purpose using graphical command window update process:

InvalidateRect (hWnd, & WinRECT, TRUE); / / WinRECT order to update the regional

UpdateWindow (hWnd);

initial window established by default when updating the complete window area of ​​the rectangle to be updated when the update window NULL, said all of the rectangular area. Purpose UpdateWindow () notification program to update the rectangular location to send a WM_PAINT message window, the window receives a WM_PAINT message operate first Utilizing BeginPaint () purpose to get the device descriptor table, then utilize the graphics commands directly towards the display device to update, the last use of EndPaint () function to notify the end from the method update. The description with the operate code is as follows:

situation WM_PAINT :

PAINTSTRUCT ps;

hdc = BeginPaint (hWnd, & ps); / / get device descriptor table

SetBkMode (hdc, OPAQUE); / / Equipment Regeneration

SetBkColor (hdc, 0x00c0c0c0);

/ / update rectangle region graphical

EndPaint (hWnd, & ps); / / finish from the update operation

break;

update window rectangular region defined within the class directly with the screen window brush, even with SelectObject () perform to select the proper brush display is also invalid, plus the updated range of rectangular area by InvalidateRect () operate is cumulative, by the UpdateWindow () operate to notify the program updates the window to start off the entire method is scheduled by the program, and therefore can not be attained employing this technique drag the window frame rendering and virtual real-time operating.

directly using the window client location is to make use of GetDC () function directly to obtain cope with towards the display device, working with a variety of graphics manipulation commands for drawing directly around the display device, which uses the existing settings screen, pen and brush to obtain a variety of graphics drawing operation, without having any information program application towards the window about the screen in real-time updates and mapping operations. The operation is the first display device descriptor handle obtained:

HDC hDC;

hDC = GetDC (hWnd); / / get device descriptor table hWnd Window manage

once the hWnd parameter is NULL, get the entire display device descriptor table cope with, and then use SelectObject () perform sets the present screen pen and brush drawing capabilities can be completed working with a variety of display drawing operations, Finally ReleaseDC () operate to get the release with the display device context. Because this method can directly manage the present screen with the pen and brush plus the will need for program operation can operate equipment directly around the screen, so utilizing this technique can achieve virtual drag the window frame. drag the window frame is used to explain the virtual window size to move the dotted and solid frame, Drag the box once the rectangular dotted line, you must draw points, or draw a line making use of the operate after a particular algorithm to attain, which requires the display to set the existing pen; drag the window frame once the frame is solid, if only by drawing a line operate brush is often set to the display, draw a rectangle operate, if the use of Rectangle () set the present display, while the brush must use SelectObject (hDC, GetStockObject (NULL_BRUSH)) block out any display brush, otherwise the plan will soon swallow WINDOWS Divination out all GDI resources, equipment resources, equivalent to an increase in the screen numerous rectangular area.

drag the box to erase the window, just drag the box for the screen graphics drawing capabilities will set the brush mode of operation R2_XORPEN XOR means that SetROP2 (hDC2, R2_XORPEN), drag the box to draw attention to the finish of recovery, and then drag the window frame before moving towards the next place, location within the original screen drawing operate is called once again drag the box to wipe the original In addition. Here are the author uses the art rectangle, drawing lines and painting to accomplish the drag point operate box purpose, users can choose their own utilization of real or imaginary like drag box operate.

perform 1 draw a rectangle by dragging the genuine perform implementation of the box, that is characterized by function, the effect of high speed, drag the box plot; perform 2 is achieved by drawing a line purpose, drag the box, which can be characterized by drawing a line by setting the different varieties of can draw virtual box can draw real box; perform 3 for drawing a line perform implementation making use of virtual box, drag perform, virtual box, drag the pattern is characterized by changes in flexible, low efficiency is the lack of mapping operate is slow. function selectable by parameter Drag the empty boxes of different patterns or density. perform parameters XY one 3 WINDOWS 3.X window using the default virtual box, drag the same as a single dashed box, if the XY parameters for two moments of tooth drag the border of virtual box . will probably also really need to choose a different box designs and also the corresponding virtual drag brush and brush to accomplish different effects.

/ / Operate one: draw a rectangle function implementation making use of real drag box

void DrawMoveRect (int xx1, int yy1, int xx2, int yy2, int xy)



HDC hDC;

int oldrop2, m, k;

hDC = GetDC (NULL); / / get full-screen device context handle

oldrop2 = GetROP2 (hDC); / / get the original screen drawing mode

SetROP2 (hDC,Windows 7 Ultimate Key, R2_XORPEN); / / set exclusive or screen drawing mode

SelectObject (hDC, GetStockObject (NULL_BRUSH ));// shielded brush

SelectObject (hDC2, GetStockObject (WHITE_PEN ));// Select the Brush

for (k = 0; k

xx1-= 1;

xx2 + = 1;

yy1-= 1;

yy2 + = 1;

Rectangle (hDC2, xx1, yy1, xx2, yy2);



SetROP2 (hDC2, oldrop2); / / restore the original mapping strategy

ReleaseDC (NULL, hDC2); / / release the device descriptor table

}

/ / Function 2: draw a line perform implementation utilizing real frame dragging or virtual box

void DrawMoveRect (int xx1, int yy1, int xx2, int yy2, int xy)

HDC hDC2;

int oldrop2, m, k;

hDC = GetDC (NULL); / / get full-screen device context handle

oldrop2 = GetROP2 (hDC); / / get the original screen drawing mode

SetROP2 ( hDC, R2_XORPEN); / / set exclusive or screen drawing mode

SelectObject (hDC, GetStockObject (NULL_BRUSH ));// shielded brush

SelectObject (hDC2, GetStockObject (WHITE_PEN)); / / Select the Brush

for (k = 0; k

xx1-= 1;

xx2 + = 1;

yy1-= 1;

yy2 + = 1;

MoveTo (hDC2, xx1, yy1);

LineTo (hDC2, xx2, yy1);

MoveTo (hDC2, xx1 ,Office 2007, yy1);

LineTo (hDC2, xx2, yy1);



SetROP2 (hDC2, oldrop2); / / restore the original mapping approach

ReleaseDC (NULL, hDC2); / / release the device descriptor table

}

/ / Perform 3: Employing the drawing level drag perform to achieve different patterns of virtual box

void DrawMoveRect (int xx1, int yy1, int xx2, int yy2, int xy)

HDC hDC2;

int oldrop2, I, j, x1, x2, y1, y2 ;

hDC = GetDC (NULL); / / get full-screen device context handle

oldrop2 = GetROP2 (hDC); / / get the original screen drawing mode

SetROP2 (hDC, R2_XORPEN); / / set exclusive or screen drawing mode

SelectObject (hDC, GetStockObject (NULL_BRUSH ));// shielded brush

SelectObject (hDC2, GetStockObject (WHITE_PEN)) ; / / Select the Brush

for (j = 0; j

x1 = xx1-j; / / with a comments section to another pattern

x2 = xx2 + j ;

y1 = yy1-j;

y2 = yy2 + j;

for (I = x1; I

SetPixel (hdc, I, y1, RGB (255,0,Office 2010 Key,0));

/ / if (I

for (I = y1; I

SetPixel (hdc, x2, I, RGB (255,0,0));

/ / if (I

for (I = x2; I> x1; I-= 2)

SetPixel ( hdc, I, y2, RGB (255,0,0));

/ / if (I> x1 +2) SetPixel (hdc, I-1, y2-1, RGB (255,0, 0));

for (I = y2; I> y1; I-= 2)

SetPixel (hdc, x1, I, RGB (255,0,0));

/ / if (I> y1 +2) SetPixel (hdc, x1 +1, I-1, RGB (255,0,0));}

}

SetROP2 (hDC2, oldrop2); / / restore the original mapping method

ReleaseDC (NULL, hDC2); / / release the device descriptor table

}

three , WINDOWS advanced technology to obtain drag the window consumer region of ​​the around the really need to implement drag the entire process of dragging the system in the commence window, drag the box to move and drag the end with the method of dealing using the trilogy. So inside the window perform must be directly WM_LBUTTONDOWN, WM_MOUSEMOVE and WM_LBUTTONUP messages to specifically address the three The details of the steps.

first step the window perform on mouse click on message WM_LBUTTONDOWN judge the treatment to handle consumer prompts to obtain the mouse cursor to meet the dynamic conditions with the window dragging, press the left mouse important to commence the drag produced through the process of news, its function code is as follows:

Stage pt;

BOOL MoveFlag = FALSE;

situation WM_LBUTTONDOWN:

pt = MAKEPOINT (lParam); / / obtain the mouse cursor pointer

if (PtInRect (& DragRT, pt ))// DragRT to drag the command area

DragBegin ((LPRECT) & WinRT, lParam, hWnd, 2);

/ / start the window, drag the process

else for other processing

break;

The DragBegin () perform I begin dragging the window purpose development, due to a significant window, there is regularly a lot of application windows, so its perform as being a separate treatment. which WinRT rectangular area for your higher window, drag the box here as rectangular region parameter to pass, lParam pointer for your mouse cursor a long integer, hWnd is the deal with from the present window is being dragged, drag the box for the width of 2. also really need to control the mouse is dragged for the existing window, drag the window to set logo unit, save the present mouse placement on the screen and displays the drag is drag the window frame. drag characteristic is enabled the perform prototype code as follows:

void DragBegin (

LPRECT WinRect, / / drag rectangle box

LPARAM lParam, / / ​​the existing mouse cursor pointer

HWND hwnd, / / ​​the current window take care of

unsigned int kk) / / Drag the box shows the width of the

{

SetCapture (hwnd); / / drag the mouse input when the window must have the right to

MoveFlag = TRUE; / / set the drag logo

oldmx = LOWORD (lParam); / / Record
  Reply With Quote

Sponsored Links
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 10:31 AM.

 

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum