Skip to content

Commit

Permalink
fix: OneNote2016_Win11_Detect
Browse files Browse the repository at this point in the history
  • Loading branch information
snomiao committed Jan 10, 2022
1 parent c7f47ae commit 79413be
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 255 deletions.
20 changes: 19 additions & 1 deletion Modules/应用-OneNote2016增强.ahk
Expand Up @@ -57,9 +57,27 @@ getAscStr(str)
Return out
}

OneNote2016_Win11_Detect(){
IServiceProvider := ComObjCreate("{C2F03A33-21F5-47FA-B4BB-156362A2F239}", "{6D5140C1-7436-11CE-8034-00AA006009FA}")
IVirtualDesktopManagerInternal := ComObjQuery(IServiceProvider, "{C5E0CDCA-7B6E-41B2-9FC4-D93975CC467B}", "{F31574D6-B682-4CDC-BD56-1827860ABEC6}")
ObjRelease(IServiceProvider)
if (IVirtualDesktopManagerInternal) {
; win10
return false
}
; it is Win11 maybe
return true
}


; 打开快速笔记主页
OneNote快速笔记窗口启动(){
SendEvent #n
if (OneNote2016_Win11_Detect()){
SendEvent #!n
}else{
SendEvent #n
}

OneNote窗口匹配串 := ".* - OneNote ahk_class Framework`:`:CFrame ahk_exe ONENOTE.EXE"
WinWaitActive %OneNote窗口匹配串%, , 1 ; wait seconds
if (ErrorLevel) {
Expand Down

0 comments on commit 79413be

Please sign in to comment.