CN101377738B - Method for implementing page turning of electric document - Google Patents

Method for implementing page turning of electric document Download PDF

Info

Publication number
CN101377738B
CN101377738B CN2007101208242A CN200710120824A CN101377738B CN 101377738 B CN101377738 B CN 101377738B CN 2007101208242 A CN2007101208242 A CN 2007101208242A CN 200710120824 A CN200710120824 A CN 200710120824A CN 101377738 B CN101377738 B CN 101377738B
Authority
CN
China
Prior art keywords
window
page
program
turning
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2007101208242A
Other languages
Chinese (zh)
Other versions
CN101377738A (en
Inventor
郑士奇
钮兴昱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hanwang Technology Co Ltd
Original Assignee
Hanwang Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hanwang Technology Co Ltd filed Critical Hanwang Technology Co Ltd
Priority to CN2007101208242A priority Critical patent/CN101377738B/en
Publication of CN101377738A publication Critical patent/CN101377738A/en
Application granted granted Critical
Publication of CN101377738B publication Critical patent/CN101377738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a method which realizes the page-turning of the electronic document, including the following steps: creating a window as an example used for capturing the mouse information in a hosted-program window or other child windows; dividing a screen window into two areas, wherein, one area is used for responding to the page-up accident and the other is used for responding to the page-down accident. The invention consults the page-turning habit of users, thus getting a fast and effective page-turning method. The users do not need to search for the page-up key and the page-down key on the keyboard or the screen, and only need to move the mouse to any position of the screen area for clicking, thus turning the page up and down naturally. The method can be applied to browsing electronic documents, such as system interface and the like, which has the advantages of convenient page-turning and humanized design, thus increasing the displaying speed and the browsing speed of the documents.

Description

Realize the method for electric document page-turning
Technical field
The present invention relates to computer software technology, particularly a kind of method that realizes electric document page-turning.
Background technology
Usually, the computing machine user is when reading multipage " electronic document ", when particularly browsing " electronic document " as the lantern slide on the Powerpoint, two kinds of methods of main employing realize page turnings up and down: a kind of is page turning key about seeking on the interface consciously and clicking, and general application program basically all on screen right side or window certain certain location this two buttons are set, promptly the user need move mouse on the appointed positions and to click the page turning up and down that could realize lantern slide; Another comes the last nextpage of switching electronic documents by " PageUp ", " PageDown " two buttons on the keyboard.Two kinds of methods all have a common shortcoming: need the user to find button could realize page turning up and down.
How when not influencing the document projection and browsing, can realize reaching fast and effectively the page turning purpose again becomes problem to be solved is arranged.
Summary of the invention
The page turning method that the purpose of this invention is to provide a kind of view electronic documents.
For achieving the above object, a kind of method that realizes electric document page-turning comprises step:
Foundation is connected with host program;
Create a window example, be used to intercept and capture the mouse information on the arbitrary window of host program,
Wherein, set up a window class that from MFC CWnd, derives from;
The window derived class is carried out instantiation;
Utilize the window example application programs of creating to realize that the window of nature page-turning function carries out SubClassing and handles, with the user profile on the intercepting respective window;
Utilize the message response incident on the new arbitrary window of forms intercepting and capturing application program, judge which zone the mouse point point that this incident is transmitted into is in;
Mouse point point is in one of two zones, according to predefined pattern, goes up page module in the invokes application and realizes page turning forward, if be in another zone, then realizes page turning backward by calling down page module.
Custom is clicked in the present invention person's of being used in combination page turning, has realized a kind of fast and effectively page turning method.The user need not to seek page turning key up and down on screen or keyboard, the position, any place that only needs mouse to be moved to conveniently screen area is clicked, and can realize upwards page turning and page turning downwards.
Description of drawings
Fig. 1 realizes module invokes graph of a relation of the present invention on the Powerpoint application program;
Fig. 2 is each window of Powerpoint application program and corresponding window class name;
Fig. 3 realizes program realization flow figure of the present invention on the Powerpoint application program.
Embodiment
Present embodiment realizes page turning with Microsoft Powerpoint as host program.Powerpoint is the application program that Microsoft has developed, therefore the present invention realizes as its pin function in Powerpoint, as shown in Figure 1, belongs to the application and development of COM, COM is a The Component Object Model, is the abbreviation of three word initials of Component Object Model.Powerpoint is one of office software of Microsoft's release, except that having powerful text editing and slide presentation function, can also add the interface of expanded function by Add-in.A kind of new technology that the Add-in function that to be Microsoft further expand Office 2000/XP and above version for convenient numerous developers provides, this technology also are based on the COM technical development and come.
Utilize COM, add-in technology, the present invention is divided into following steps:
Step (one): connect, obtain the application program root object.Utilize the Add-in technology, IDTExtensibility2 interface definition method according to Microsoft's regulation can seamlessly be connected to Powerpoint with the plug-in unit of being developed, the automatic loading of plug-in of energy after thereby assurance Powerpoint starts, meanwhile the developer also can obtain the Application root object of Powerpoint, to realize that Powerpoint is exposed calling of incident API.
Step (two): create a window example, by the mouse information on these window intercepting and capturing Powerpoint slideshow window.
Step (three): utilize the window example of front that the message that intercepts is handled, screen window is divided into upper and lower two rectangular areas from the centre.When the user clicked screen the first half rectangular area, the api function that utilizes Application object reference Powerpoint to provide was realized page turning forward; Otherwise, call page turning function backward.
Below specific implementation details in each step and the technology that is adopted are described one by one.
Step (one): connect, obtain the application program root object.
Before the elaboration concrete operations, introduce the startup principle of application plug Addins earlier, concrete principle is as follows:
1. behind the application program launching, by registration table or deposit in other and obtain the plug-in unit tabulation Anywhere.Plug-in unit generally provides with the com component form, as long as so the CLSID or the ProgID of a plug-in unit are arranged, promptly be used to identify com component, each com component all has the CLSID of oneself in windows registry, so that allow other application programs load.In addition, the function of plug-in unit can vary, but needs to realize a unified interface, for example _ and IDTExtensibility2 or similar interface.
2. the tabulation of traversal plug-in unit is created and each plug-in unit of initialization.Key is initialization.Application program needn't know what plug-in unit can do, and just obtains _ IDTExtensibility2 or similar interface, calls initialization function wherein, as function OnConnection ().
3. plug-in unit is initialized the time, and application program can be commonly referred to Application to the root interface of the DOM model of self automatically and transmit into.In _ IDTExtensibility2, root interface is defined as IDipatch type, i.e. IDispatch*Application.This Application root object has been arranged, and plug-in unit just can call wants any API of calling.
Can adopt VC++ATL in the actual performance history is that ATL is developed, the first step as shown in Figure 3.The developer is when utilizing guide VC to generate ATL COM Appwizard engineering, must realize one _ IDTExtensibility2 dispatch interface, the realization of this interface, can make VC++ treat that Development Engineering generates following 5 automatically and can be used to handle the interface function that is developed plug-in unit and host program, it is respectively:
1.OnConnection: call when loading plug-in unit, load plug-in unit when promptly host program starts automatically to internal memory.
2.OnDisconnection: call when from internal memory, unloading plug-in unit.
3.OnAddinsUpdate:COM plug-in unit calls when changing.
4.OnStartupComplete: plug-in unit has just loaded and has called when finishing when application program launching.
5.OnBeginShutdown: plug-in unit unloading is just called when finishing when closing application program.
In general, the developer need write the code among OnConnection and the OnDisconnection again.Special needs to be pointed out is: the root object of OnConnection function passes host program (present embodiment refers to Powerpoint) exposes the condition of providing convenience of calling of incident for realizing application programs later on.This function prototype is as follows:
OnConnection(IDispatch*Application,
ext_ConnectMode?ConMode,
IDispatch*AddInInst,
LPSAFEARRAY*Custom);
Each parameter meaning sees the following form:
Figure GSB00000299392200051
This shows, the global variable that the developer can be provided with the IDispatch* type in the OnConnection function with the Application record and be delivered to Add-In, so that the calling of plug-in unit other module of inside.
Step (two): create a window example, intercept and capture the mouse information on a certain window in the application program by this window.
In the present embodiment, the present invention realizes " natural page turning " function on the window slide of Powerpoint, promptly have only the handle that obtains the Powerpoint window slide, could correspondingly handle, shown in the step of second among Fig. 3 the user message on this window.
The present invention intercepts and captures message on the Powerpoint window slide according to following steps:
The first step: the main window handle that obtains the Powpoint application program.
Second step: utilize the main window handle to obtain in Powpoint, to need to carry out the subwindow handle of Message Processing.
The 3rd step: create a window example, the subwindow that previous step is obtained by this window example carries out the SubClassing processing, so that intercept and capture the user message on the subwindow.
In actual exploitation of the present invention, only need call three api functions can realize above-mentioned three steps, is respectively: GetForegroundwindow, FindWindowEx and SubclassWindow.Hereinafter in specific implementation, adopt these three functions to describe with regard to above-mentioned each step.
Because the present invention realizes on the Powerpoint application program, so after the Powerpoint startup, the developer must obtain the main window handle that current application program is Powerpoint.And in the api function that Windows provides, GetForegroundwindow then just in time possesses such function.This function prototype is as follows:
HWND?GetForegroundwindow(VOID);
Can obtain the handle of foreground window by this function, " foreground window " herein is meant the application window with user interactions.Special needs to be pointed out is: when application program is moved and during with user interactions, this function can return correct window handle on the table; Otherwise,, then return NULL if other application program is moved also and user interactions on the table.
Although can obtain the Powerpoint application main window by GetForegroundwindow, this window is not the window that the present invention will carry out Message Processing.This is because many companies for certain needs, have overlapped several subwindows again in the application main window of the exploitation of being everlasting.Powerpoint is no exception, and the main window handle that obtains previously is not the handle of window slide, and this point developer can check the class name of each window correspondence in the Powerpoint application program by the instrument SPY++ of Microsoft, as shown in Figure 2.Equally, Word, Excel or other application program are also like this.
Among Fig. 2, window slide and Powerpoint main window are not the same windows, are the handle that paneClassDC obtains window slide but the developer can utilize the class name of main window handle and window slide.The api function FindWindowEx that Windows provides provides this function.This function prototype is as follows:
HWND?FindWindowEx(HWND?hwndParent,
HWND?hwndChildAfter,
LPCTSTR?lpszClass,
LPCTSTR?lpszWindow);
This function can find the window that is complementary with given window class name character string according to the class name (character string) of main window handle and subwindow to be found, if function is searched successfully, then returns the handle of subwindow to be found; Otherwise, return NULL.Concrete parameter setting can be referring to following table:
Figure GSB00000299392200081
As can be seen from the table:, just can obtain required window handle as long as determine hwndParent and these two parameters of lpszClass.All the other parameters are set to NULL.
After adopting said method to obtain the window handle of Powerpoint lantern slide,, still can carry out the default behavior of Powerpoint system regulation because this window belongs to the Powerpoint system.Therefore have only the message that adopts the Window Subclassing technology to go to intercept and capture on this window just can address this problem.In fact so-called Window Subclassing is exactly the related parameter that has that changes in the window memory block.Because this modification only relates to the window memory block of this window, therefore can not have influence on the function and the performance of other window that belongs to the same window class.Modal in the Window Subclassing is the window function address (lpfnWndProc) of revising in the window memory block, makes it point to a new window function, thereby changes the disposal route of parent window function, to reach the purpose of improving its function.Specifically, the function that requires exactly the some or all of message maps of a window to be replaced to oneself responds, and can stop original window to do the behavior of system default so effectively, but carries out the instruction of appointment.
In the actual exploitation, the present invention is that the window class CWnd that utilizes MFC to provide derives from a new class, after to this window class instantiation, call the protected function S ubclassWindow of CWnd, window handle with the Powerpoint lantern slide is delivered among the SubclassWindow simultaneously, just can easily realize the intercepting and capturing to Powerpoint window slide message.Function prototype is as follows:
BOOL?SubclassWindow(HWND?hWnd);
Annotate: hWnd is a forms handle for the treatment of SubClassing
In MFC, the forms example be object by call SubclassWindow to certain forms handle SubClassing after, will possess following two kinds of abilities:
1. the forms example is the forms that object can directly change relevant forms handle correspondence.
System pass to the message of relevant forms handle can be at first through the message maps of this forms example (object).
This also is the reason that adopts the SubClassing technology.So far, possessed some message that allows on the Powerpoint window slide fully and gone the condition of operating according to idea of the present invention.Below how to utilize the message that intercepts to go to realize that " natural page turning " of the present invention function is further elaborated with regard to step (three).
Step (three): the message that intercepts is handled.
Finishing of step () and step (two) will inevitably be realized " natural page turning " incident of Powerpoint lantern slide.Hereinafter how to utilize the user message realization " natural page turning " that intercepts to set forth with regard to the present invention.Its concrete steps are as follows, shown in the step of the 3rd among Fig. 3:
1. two rectangular areas about with whole screen divider being.
2. present embodiment is set upper-side area and is realized upwards page turning, and underside area realizes downward page turning.When the user clicks the screen upper-side area, realize upwards page turning; Otherwise, page turning downwards.
Utilization of the present invention be that the CRect class that provides of MFC is carried out instantiation respectively in the zone up and down to the screen of having divided, just can easily finish division to screen area.When user's mouse is clicked in position, any place of screen and is lifted, utilizing the forms created previously to intercept and capture the message response function is message OnLButtonUP (UINT nFlags on the window slide, CPoint point), which zone the mouse point point that judgement is come in by this function passes is in, if the mouse point is positioned at screen upside rectangular area, then the api function Previous that provides by Application object reference Powerpoint realizes page turning forward; Otherwise, call api function Next and realize page turning backward.
In addition, described two zones comprise up and down two zones or about two zones.Two zones comprise the zone of rectangular area or other shapes.Two zones comprise viewing area and implicit expression zone.
Above-mentioned performance history not only can partly or entirely be applicable to the realization of other office softwares of office " natural page turning " function, can also comprise the realization of functions such as operating system (as XP) or application program own.

Claims (13)

1. method that realizes electric document page-turning comprises step:
Foundation is connected with host program;
Create a window example, be used to intercept and capture the mouse information on the arbitrary window of host program,
Wherein, set up a window class that from MFC CWnd, derives from;
The window derived class is carried out instantiation;
Utilize the window example application programs of creating to realize that the window of nature page-turning function carries out SubClassing and handles, with the user profile on the intercepting respective window;
Utilize the message response incident on the new arbitrary window of forms intercepting and capturing application program, judge which zone the mouse point point that this incident is transmitted into is in;
Mouse point point is in one of two zones, according to predefined pattern, goes up page module in the invokes application and realizes page turning forward, if be in another zone, then realizes page turning backward by calling down page module.
2. method according to claim 1 is characterized in that described window comprises the subwindow of host program window and host program.
3. method according to claim 1 is characterized in that, described foundation comprised with being connected of host program: as the function development of program own, only need set up the call relation between master routine and the functional module.
4. method according to claim 1, it is characterized in that, described foundation comprised with being connected of host program: as the application plug function development, need set up interface according to the method for the interface definition of procedure stipulation, with loading and the initialization of realization program to plug-in unit.
5. method according to claim 1 is characterized in that, window example of described establishment, and the mouse information that is used to intercept and capture on the arbitrary window of host program also comprises the mouse message that is used to intercept and capture the host program subwindow.
6. method according to claim 5 is characterized in that, described application program need realize that the window procurement process of nature page-turning function comprises: intercept and capture the window message of application program, only need to obtain the window handle of foreground application.
7. method according to claim 5, it is characterized in that, described application program need realize that the window procurement process of nature page-turning function comprises: intercept and capture the subwindow message of application program, need could obtain the handle of application program subwindow behind the window handle that obtains application program.
8. method according to claim 6 is characterized in that, the acquisition of the window handle of described foreground application need be called a module that can obtain foreground application active window handle.
9. method according to claim 7 is characterized in that, the acquisition of described subwindow handle need be called a module that can obtain application program specified window handle.
10. method according to claim 5 is characterized in that, described Window Subclassing comprises:
Revise the window function address in the arbitrary window memory block of application program, make it point to new window example.
11. method according to claim 1 is characterized in that, described two zones comprise two zones up and down.
12. method according to claim 1 is characterized in that, two zones about described two zones comprise.
13. method according to claim 1 is characterized in that, described two zones comprise viewing area and implicit expression zone.
CN2007101208242A 2007-08-27 2007-08-27 Method for implementing page turning of electric document Active CN101377738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101208242A CN101377738B (en) 2007-08-27 2007-08-27 Method for implementing page turning of electric document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101208242A CN101377738B (en) 2007-08-27 2007-08-27 Method for implementing page turning of electric document

Publications (2)

Publication Number Publication Date
CN101377738A CN101377738A (en) 2009-03-04
CN101377738B true CN101377738B (en) 2011-06-22

Family

ID=40421293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101208242A Active CN101377738B (en) 2007-08-27 2007-08-27 Method for implementing page turning of electric document

Country Status (1)

Country Link
CN (1) CN101377738B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043560B (en) * 2009-10-20 2015-04-01 腾讯科技(深圳)有限公司 Method and device for realizing electronic document page turning
CN101931687A (en) * 2009-12-24 2010-12-29 康佳集团股份有限公司 Method for realizing split-screen gesture operation at mobile communication terminal
CN102207815A (en) * 2010-07-15 2011-10-05 优视科技有限公司 Web browsing method and device for mobile communication equipment terminal
CN102541404B (en) * 2010-12-22 2013-09-18 安徽康佳同创电器有限公司 Display control method and device for mobile terminal
CN102081503B (en) * 2011-01-25 2013-06-26 汉王科技股份有限公司 Electronic reader capable of automatically turning pages based on eye tracking and method thereof
CN102810041B (en) * 2011-06-02 2015-11-18 深圳市金蝶友商电子商务服务有限公司 A kind of conversion method of multiple document interface and relevant apparatus
CN102819377A (en) * 2011-06-10 2012-12-12 深圳市金蝶友商电子商务服务有限公司 Method and device for controlling sub-interface in multi-document interface
CN103677547B (en) * 2012-09-04 2018-05-25 腾讯科技(深圳)有限公司 interface display method and device
CN109446351B (en) * 2018-09-19 2020-10-27 北京文香信息技术有限公司 Method for controlling PPT to automatically turn pages
CN110673724A (en) * 2019-09-16 2020-01-10 Tcl移动通信科技(宁波)有限公司 Interface switching method and device, storage medium and terminal
CN111078070B (en) * 2019-11-29 2021-06-15 深圳市镜玩科技有限公司 PPT video barrage play control method, device, terminal and medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877506A (en) * 2005-06-10 2006-12-13 鸿富锦精密工业(深圳)有限公司 E-book reading device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877506A (en) * 2005-06-10 2006-12-13 鸿富锦精密工业(深圳)有限公司 E-book reading device

Also Published As

Publication number Publication date
CN101377738A (en) 2009-03-04

Similar Documents

Publication Publication Date Title
CN101377738B (en) Method for implementing page turning of electric document
KR100986415B1 (en) Application of data-binding mechanism to perform command binding
US7017118B1 (en) Method and apparatus for reordering data items
Mori et al. Tool support for designing nomadic applications
US6263492B1 (en) Run time object layout model with object type that differs from the derived object type in the class structure at design time and the ability to store the optimized run time object layout model
Balme et al. Cameleon-rt: A software architecture reference model for distributed, migratable, and plastic user interfaces
JP3565850B2 (en) Object-oriented notification framework system
US9582288B1 (en) Method for integrating software components into a spreadsheet application
JP3341893B2 (en) Concurrent framework system
US20030221165A1 (en) System and method for metadata-driven user interface
KR20050039551A (en) Programming interface for a computer platform
US20110119684A1 (en) Combining Interfaces Of Shell Applications And Sub-applications
Shah et al. Reverse-engineering user interfaces to facilitateporting to and across mobile devices and platforms
Bharat et al. Building distributed, multi-user applications by direct manipulation
WO2017189643A1 (en) Software application creation for non-developers
AU748105B2 (en) System to associate control with applications using drag and drop interface
Beaudouin-Lafon Human-computer interaction
US7073136B2 (en) Method for keystroke delivery to descendants of inactive windows
CN106371818B (en) Method for processing user-level events to program application program
Noble et al. Functional languages and graphical user interfaces: a review and a case study
Boudreaux Programming the iphone user experience: Developing and designing cocoa touch applications
Costanich Developing C# Apps for IPhone and IPad Using MonoTouch: IOS Apps Development for. NET Developers
Borycki et al. Touch
Figueroa et al. A conceptual model and specification language for mixed reality interface components
JP2007293904A (en) Object-oriented cursor tool

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant