Atitit. Activating a window Summary
1 activation window: Mouse activation vswindows message activation ... 1
1.1 Web framework activation ... 1
2 Exit activation window Hotkey (dbg mode) ... 1
3 Two window activation priority ... 2
4 Web control activates-code. 3
1 activation window: Mouse activation vs Windows message Activation
Use message activation as much as possible in principle:
Winget, Active_id2, ID, Ahk_classsunawtframe
; msgbox%active_id2%
Winactivate, Ahk_class Sunawtframe
1.1 Web Framework Activation
Use message cannot be activated. Controlfocus,internetexplorer_server
Controlfocus,internetexplorer_server1
Had to use mouse to activate. (The mouse key is not suitable for activation, the best in the construction of ...)
Final Robot RB = New Robot ();
clickmidkeymouse(RB, +);
Author:: Old Wow's paw attilax Ayron, email:[email protected]
Reprint please indicate source: Http://blog.csdn.net/attilax
2 Exit Activation Window Hotkey (DBG mode)
#c:: Exitapp:: Win+c
I want to put a loop behind it. Be not a cant exe
3 Two window activation priority
Detecthiddenwindows, ON
Loop
{
; Class PowerDVD14
; PowerDVD
; ahk_classpowerdvd14
winget,active_id, ID, powerdvd,,everything,everything
Winactivate,ahk_classpowerdvd14
Winmaximize,ahk_classpowerdvd14
;;,, everything,everything
; MsgBox AA
Ifwinnotexist,ahk_class PowerDVD14
{
Winget,active_id2, ID, Ahk_class sunawtframe
; msgbox%active_id2%
Winactivate, Ahk_class Sunawtframe
Controlfocus,internetexplorer_server
Controlfocus,internetexplorer_server1
}
; MsgBox tt
Sleep, 3000
}
#c:: Exitapp
4 Web Control Activation-code
public staticvoid activewin ()throws awtexception {
while(true)
{
Try {
booleanexistpower=false;
Try {
String playserver=propx. GetConfig(pathx. ClassPath() +"/cfg.properties","Actsleep");
intactsleep=3000;
Try {
actsleep=integer. parseint(playserver);
} catch (Exceptione) {
//TODO: Handle Exception
}
start: Thread. Sleep (actsleep);
} catch (interruptedexceptione) {
//TODO auto-generated Catch block
e. Printstacktrace ();
}
list<string> set=processx. getprocesslist();
//list<string>LST=
for (String line : set) {
if(linecontains ("PowerDVD.exe") | | Line . Contains ("Powerdvdmovie"))
{
System. out . println ("exist DVD");
existpower=true;
break ;
}
}
if(existpower) //If sexist power DVD ,, b actselect Win..
continue;
System. out . println ("---No exist DVD");
final Robotrb = new Robot ();
clickmidkeymouse(RB, +);
} catch (Exceptione) {
e. Printstacktrace ();
}
}
}
Reference
proj . Atibrow
Actplaywin.ahk
Atitit. Activating a window summarizing swing java. NET PHP