简体   繁体   English

如何检查NSIS中startmenu文件夹页面中按下的后退按钮?

[英]How to check back button pressed in startmenu folder page in NSIS?

var startmenu
!insertmacro MUI_PAGE_STARTMENU DefaultPage $startmenu

In the above one line code can be used to create startmenu folder page.If the user click back button of this page want to move control some specific page. 在上面的一行代码中,可以使用它来创建startmenu文件夹页面。如果用户单击该页面的后退按钮想要将控件移动到某个特定页面。 I have tried ${NSD_Back}, OnClick functions but i dont know where to implement this code to check back button pressed? 我已经尝试过${NSD_Back}, OnClick函数,但是我不知道在哪里实现此代码来检查按下的按钮?

How to check back button pressed in the startmenu folder page? 如何查看startmenu文件夹页面中按下的后退按钮?

Start menu page is created by third party plug-in, not by NSIS code. “开始”菜单页面是由第三方插件创建的,而不是由NSIS代码创建的。

So you need to modify Start menu plug-in sources to get notifications about. 因此,您需要修改“开始”菜单插件源以获取有关的通知。

Maybe if you say what are you trying to achieve we can help you? 也许如果您说您要达到什么目的,我们可以为您提供帮助?

There are plenty of other functions you can use - eg page's callback to check state of previous/next page. 您还可以使用许多其他功能-例如页面的回调以检查上一页/下一页的状态。

What you are asking for does not make any sense but here you go: 您要的东西没有任何意义,但是您可以进行以下操作:

!include MUI2.nsh
Var MyStartFolder
Var BackDetection
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_PRE PageCallbackBeforeSMPre
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE PageCallbackSMPre
!insertmacro MUI_PAGE_STARTMENU DefaultPage $MyStartFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English

# nsis.sf.net/Go_to_a_NSIS_page
Function RelGotoPage
IntCmp $R9 0 0 Move Move
StrCmp $R9 "X" 0 Move
StrCpy $R9 "120"
Move:
SendMessage $HWNDPARENT 0x408 $R9 ""
FunctionEnd

Function PageCallbackBeforeSMPre
${If} $BackDetection == "SM"
    StrCpy $BackDetection ""
    StrCpy $R9 -1
    Call RelGotoPage
${EndIf}
FunctionEnd

Function PageCallbackSMPre
StrCpy $BackDetection SM
FunctionEnd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM