CN106126012A - Quickly judge the method whether user is currently in use specified application - Google Patents

Quickly judge the method whether user is currently in use specified application Download PDF

Info

Publication number
CN106126012A
CN106126012A CN201610430084.1A CN201610430084A CN106126012A CN 106126012 A CN106126012 A CN 106126012A CN 201610430084 A CN201610430084 A CN 201610430084A CN 106126012 A CN106126012 A CN 106126012A
Authority
CN
China
Prior art keywords
application program
point
interval
mark
specified
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.)
Granted
Application number
CN201610430084.1A
Other languages
Chinese (zh)
Other versions
CN106126012B (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.)
Zhejiang Wanpeng Digital Intelligence Technology Co.,Ltd.
Original Assignee
Zhejiang Wanpeng Education 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 Zhejiang Wanpeng Education Technology Co Ltd filed Critical Zhejiang Wanpeng Education Technology Co Ltd
Priority to CN201610430084.1A priority Critical patent/CN106126012B/en
Publication of CN106126012A publication Critical patent/CN106126012A/en
Application granted granted Critical
Publication of CN106126012B publication Critical patent/CN106126012B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Abstract

The invention discloses and a kind of quick judge whether user interface rests on the method on the application program specified.The present invention specifically comprises the following steps that one, obtains the resolution of screen, further according to practical situation, arranges grid distance value Interval, by resolution all divided by Interval, obtain the number of times of horizontal and vertical cycle criterion.Two, initialize a counting variable, then according to horizontal and vertical cycle-index, use two to recirculate, calculate the coordinate of the point that the needs in each loop body judge, call the api function that Windows provides, obtain the mark of the application program at this place, then the mark of the mark of this application program with the application program of anticipation is compared, if equal, then counting variable U is added 1.Three, coordinates computed falls the ratio on the application program specified, if more than threshold value U, then it is assumed that user is currently in use this application program.The present invention accelerates calculating speed, decreases interference factor.

Description

Quickly judge the method whether user is currently in use specified application
Technical field
The invention belongs to computer desktop application, especially need to judge user interface whether rest on specify should With time in program, the method quickly judged, it is provided that a kind of quick judge whether user interface rests on the application program specified Method.
Background technology
Along with developing rapidly of cyber-net, the application of long-distance education is more and more extensive, when long-distance education is applied Time with underage child, generally there is attention due to underage child not enough, the situation such as easily desert, causes result of training to beat Discount, for this reason, it may be necessary to one judges that student, when using Remote Courseware, quickly judges whether conscientious technology, in order to adopt Take follow-up.
Summary of the invention
It is an object of the invention to the blank for prior art, it is provided that one quickly judges whether user interface rests on The method on application program specified.
Concretely comprising the following steps of the inventive method:
Step one, obtains the resolution of screen, is designated as CXScreen, CYScreen, further according to practical situation, arranges one Grid distance value Interval, by CXScreen, CYScreen all divided by Interval, obtains horizontal and vertical cycle criterion Number of times, be designated as CXNum, CYNum respectively.
Step 2, initializes a counting variable UseNum=0, then according to CXNum, CYNum, uses one double to follow Ring, calculates the coordinate Point of the point that the needs in each loop body judge(n,m):
Point(n,m)=(n × Interval, m × Interval)0≤n≤CXNum,0≤m≤CYNum
After the coordinate of point calculates, call the api function that Windows provides, obtain the application program at this place Mark, then the mark of application program of the mark of this application program with anticipation is compared, if equal, then by counting change Amount UseNum=UseNum+1.
Step 3, coordinates computed Point(n,m)Fall the ratio on the application program specified, if more than threshold value U, then it is assumed that User is currently in use this application program.
The detailed description of each step is as follows:
In step one, grid distance value Interval, for determining the distance between the mesh point judged, is traditionally arranged to be Between 10 to 50 pixels, arrange little then detection precision the highest, arrange the most then detection speed the fastest, according to actual requirement, An acceptable value is used after test.
In step 2, obtained the window handle at specified point place by the WindowFromPoint in Windows API, The input parameter of this API is the coordinate figure of a point, and output parameter is the window handle at this place, then uses GetWindowThreadProcessId obtains the process ID at this window handle place, by the process ID of this application program and need The process ID of application program to be judged compares, thus obtains whether this point belongs to the application program that needs judge.
In step 3, the computing formula of ratio R atio fallen on the application program specified is as follows:
R a t i o = U s e N u m C X N u m × C Y N u m
The codomain of calculated Ratio is [0,1], general when Ratio is in [0.85,1], it is believed that student makes With application program, also having the spaces such as taskbar by shared by system because general on user's screen, these areas need row Except outside.
The present invention has the beneficial effect that:
The thought of this method is the power function provided by Windows system, is judged by simple recursive call Whether some screen position belongs to the application program specified, after getting all of information, according to whether rest on specify should With the point of program account for ratio a little, it is judged that the application program whether user specifies in use, main innovative point is obstructed Cross the judgment mode of the window level of complexity, only by the way of directly judging point, accelerate calculating speed, decrease interference Factor, makes this method can preferably work under various user environments.
Accompanying drawing explanation
Fig. 1 is the embodiment of the present invention.
Detailed description of the invention
The present invention will be further described with embodiment below in conjunction with the accompanying drawings.
Quickly judge whether user interface rests on the method on the application program specified, specifically comprise the following steps that
Step one, obtains the resolution of screen, is designated as CXScreen, CYScreen, further according to practical situation, arranges one Grid distance value Interval, by CXScreen, CYScreen all divided by Interval, obtains horizontal and vertical cycle criterion Number of times, be designated as CXNum, CYNum respectively.
Step 2, initializes a counting variable UseNum=0, then according to CXNum, CYNum, uses one double to follow Ring, calculates the coordinate Point of the point that the needs in each loop body judge(n,m):
Point(n,m)=(n × Interval, m × Interval)0≤n≤CXNum,0≤m≤CYNum
After the coordinate of point calculates, call the api function that Windows provides, obtain the application program at this place Mark, then the mark of application program of the mark of this application program with anticipation is compared, if equal, then by counting change Amount UseNum=UseNum+1.
Step 3, coordinates computed Point(n,m)Fall the ratio on the application program specified, if more than threshold value U, then it is assumed that User is currently in use this application program.
The detailed description of each step is as follows:
In step one, grid distance value Interval, for determining the distance between the mesh point judged, is traditionally arranged to be Between 10 to 50 pixels, arrange little then detection precision the highest, arrange the most then detection speed the fastest, according to actual requirement, An acceptable value is used after test.
In step 2, obtained the window handle at specified point place by the WindowFromPoint in Windows API, The input parameter of this API is the coordinate figure of a point, and output parameter is the window handle at this place, then uses GetWindowThreadProcessId obtains the process ID at this window handle place, by the process ID of this application program and need The process ID of application program to be judged compares, thus obtains whether this point belongs to the application program that needs judge.
In step 3, the computing formula of ratio R atio fallen on the application program specified is as follows:
R a t i o = U s e N u m C X N u m × C Y N u m
The codomain of calculated Ratio is [0,1], general when Ratio is in [0.85,1], it is believed that student makes With application program, also having the spaces such as taskbar by shared by system because general on user's screen, these areas need row Except outside.
Embodiment:
As it is shown in figure 1, be used for judging whether PC is using unlimited precious (blue title bar and the program of frame).The most such as Under: screen resolution is 1440*900 at present, and grid distance value Interval is set to 200, then screen is divided into longitudinally 5 Point, horizontal 8 points, the cross point of red line i.e. these 40 points on totally 40 point diagrams, the point wherein indicated with blue five-pointed star is judged to Breaking as belonging to unlimited precious application program, 18 altogether, accounting is 18/40=45%, the threshold value less than 85%, it is determined that be not Conscientiously using unlimited precious program.

Claims (4)

1. quickly judge whether user interface rests on the method on the application program specified, it is characterised in that include walking as follows Rapid:
Step one, obtains the resolution of screen, is designated as CXScreen, CYScreen, further according to practical situation, arranges a grid Distance value Interval, by CXScreen, CYScreen all divided by Interval, obtains the secondary of horizontal and vertical cycle criterion Number, is designated as CXNum, CYNum respectively;
Step 2, initializes a counting variable UseNum=0, then according to CXNum, CYNum, uses one two and recirculates, Calculate the coordinate Point of the point that the needs in each loop body judge(n,m):
Point(n,m)=(n × Interval, m × Interval)0≤n≤CXNum,0≤m≤CYNum
After the coordinate of point calculates, call the api function that Windows provides, obtain the mark of the application program at this place Know, then the mark of the mark of this application program with the application program of anticipation is compared, if equal, then by counting variable UseNum=UseNum+1;
Step 3, coordinates computed Point(n,m)Fall the ratio on the application program specified, if more than threshold value U, then it is assumed that user It is currently in use this application program..
The most according to claim 1 quick judge whether user interface rests on the method on the application program specified, its It is characterised by described step one that grid distance value Interval, for determining the distance between the mesh point judged, is typically arranged Be between 10 to 50 pixels, arrange little then detection precision the highest, arrange the most then detection speed the fastest, according to actual requirement Set.
The most according to claim 1 quick judge whether user interface rests on the method on the application program specified, its It is characterised by described step 2, is obtained the window at specified point place by the WindowFromPoint in Windows API Handle, the input parameter of this API is the coordinate figure of a point, and output parameter is the window handle at this place, then uses GetWindowThreadProcessId obtains the process ID at this window handle place, by the process ID of this application program and need The process ID of application program to be judged compares, thus obtains whether this point belongs to the application program that needs judge.
The most according to claim 1 quick judge whether user interface rests on the method on the application program specified, its It is characterised by that in described step 3, the computing formula of ratio R atio fallen on the application program specified is as follows:
R a t i o = U s e N u m C X N u m × C Y N u m
The codomain of calculated Ratio is [0,1], general when Ratio is in [0.85,1], it is believed that student is currently in use should By program, also having the spaces such as taskbar by shared by system because general on user's screen, these areas need to get rid of Outward.
CN201610430084.1A 2016-06-17 2016-06-17 Quickly judge the method whether user is used specified application Active CN106126012B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610430084.1A CN106126012B (en) 2016-06-17 2016-06-17 Quickly judge the method whether user is used specified application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610430084.1A CN106126012B (en) 2016-06-17 2016-06-17 Quickly judge the method whether user is used specified application

Publications (2)

Publication Number Publication Date
CN106126012A true CN106126012A (en) 2016-11-16
CN106126012B CN106126012B (en) 2019-09-20

Family

ID=57469702

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610430084.1A Active CN106126012B (en) 2016-06-17 2016-06-17 Quickly judge the method whether user is used specified application

Country Status (1)

Country Link
CN (1) CN106126012B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103595753A (en) * 2013-05-24 2014-02-19 漳州师范学院 Remote learning monitoring system based on eye movement locus tracking, and monitoring method of remote learning monitoring system
CN104965773A (en) * 2015-07-09 2015-10-07 网易(杭州)网络有限公司 Terminal, jamming detection method, device as well as game jamming detection method and device
CN105354306A (en) * 2015-11-04 2016-02-24 魅族科技(中国)有限公司 Application recommendation method and terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103595753A (en) * 2013-05-24 2014-02-19 漳州师范学院 Remote learning monitoring system based on eye movement locus tracking, and monitoring method of remote learning monitoring system
CN104965773A (en) * 2015-07-09 2015-10-07 网易(杭州)网络有限公司 Terminal, jamming detection method, device as well as game jamming detection method and device
CN105354306A (en) * 2015-11-04 2016-02-24 魅族科技(中国)有限公司 Application recommendation method and terminal

Also Published As

Publication number Publication date
CN106126012B (en) 2019-09-20

Similar Documents

Publication Publication Date Title
CN110188720A (en) A kind of object detection method and system based on convolutional neural networks
CN104599292A (en) Noise-resistant moving target detection algorithm based on low rank matrix
CN104574439A (en) Kalman filtering and TLD (tracking-learning-detection) algorithm integrated target tracking method
CN103455813A (en) Method for facula center positioning of CCD image measurement system
CN104700405B (en) A kind of foreground detection method and system
CN103777821B (en) Anti-interference method and device for touch system
CN104200426A (en) Image interpolation method and device
CN104599291B (en) Infrared motion target detection method based on structural similarity and significance analysis
CN103281554A (en) Video objective quality evaluation method based on human eye visual characteristics
CN103475897A (en) Adaptive image quality evaluation method based on distortion type judgment
CN106204633A (en) A kind of student trace method and apparatus based on computer vision
CN109727226A (en) A kind of position table automatic generation method based on machine learning
CN104281850A (en) Character area identification method and device
CN109544516A (en) Image detecting method and device
Wofk et al. Monocular visual-inertial depth estimation
CN106126012A (en) Quickly judge the method whether user is currently in use specified application
CN116524062B (en) Diffusion model-based 2D human body posture estimation method
CN105389781A (en) Vehicle light repairing method based on saliency detection and Criminisi algorithm
CN101469986B (en) Automatic point search system and method for fuzzy boundary
CN104463896A (en) Image corner point detection method and system based on kernel similar region distribution characteristics
CN107122715A (en) It is a kind of based on frequency when conspicuousness combine moving target detecting method
CN104504697A (en) Automatic extracting method for neck-edge line of denture repair preparation mesh model
CN102867308A (en) Method for detecting change of video image output by computer
CN103942792A (en) Impurity detecting method in medicine detection robot based on time domain features of sequence images
CN106443760A (en) Scintillation pulse model-simplifying, reconstruction and energy-obtaining methods

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder

Address after: 310051 12 / F, building 8, No. 19, Jugong Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK Co.,Ltd.

Address before: Electronic Commerce Building No. 118 Xihu District West Road, Hangzhou City, Zhejiang Province, 310013 room 1406

Patentee before: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK Co.,Ltd.

CP02 Change in the address of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 12 / F, building 8, No. 19, Jugong Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Patentee after: Zhejiang Wanpeng Digital Intelligence Technology Co.,Ltd.

Address before: 12 / F, building 8, No. 19, Jugong Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Patentee before: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK CO.,LTD.

CP01 Change in the name or title of a patent holder