GetWindowInfo: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with '== Description == Quick and dirty example of how to use System plug-in to call GetWindowInfo. == Code == <highlight-nsis> OutFile "ShowWindow.exe" ShowInstDetails show !include …')
 
No edit summary
Line 1: Line 1:
{{PageAuthor|Zinthose}}
== Description ==
== Description ==
Quick and dirty example of how to use System plug-in to call GetWindowInfo.
Quick and dirty example of how to use System plug-in to call GetWindowInfo.
Line 73: Line 74:


</highlight-nsis>
</highlight-nsis>
[[Category:System Plugin Examples]]

Revision as of 22:55, 5 August 2009

Author: Zinthose (talk, contrib)


Description

Quick and dirty example of how to use System plug-in to call GetWindowInfo.

Code

OutFile "ShowWindow.exe"
ShowInstDetails show 
!include WinMessages.nsh
 
Section Main1
    System::Alloc 56
    Pop $0
    System::Call "*$0(i 28)"
    System::Call "User32::GetWindowInfo(i $HWNDPARENT,i r0) i .r1"
 
    DetailPrint "RC=$1"
 
    ## rcWindow
        IntOp $R0 $0 + 4
        System::Call "*$R0(i .r1,i .r2,i .r3,i .r4)"
 
        DetailPrint "rcWindow.left=$1"
        DetailPrint "rcWindow.top=$2"
        DetailPrint "rcWindow.right=$3"
        DetailPrint "rcWindow.bottom=$4"
 
    ## rcClient
        IntOp $R0 $0 + 20
        System::Call "*$R0(i .r1,i .r2,i .r3,i .r4)"
 
        DetailPrint "rcClient.left=$1"
        DetailPrint "rcClient.top=$2"
        DetailPrint "rcClient.right=$3"
        DetailPrint "rcClient.bottom=$4"
 
    ## dwStyle
        IntOp $R0 $0 + 36
        System::Call "*$R0(i .r1)"
        intfmt $1 "0x%08X" $1
 
        DetailPrint "dwStyle=$1"
 
    ## dwExStyle
        IntOp $R0 $0 + 40
        System::Call "*$R0(i .r1)"
        intfmt $1 "0x%08X" $1
 
        DetailPrint "dwExStyle=$1"
 
    ## dwWindowStatus
        IntOp $R0 $0 + 44
        System::Call "*$R0(i .r1)"
        intfmt $1 "0x%08X" $1
 
        DetailPrint "dwWindowStatus=$1"
 
    ## cxWindowBorders
        IntOp $R0 $0 + 48
        System::Call "*$R0(i .r1)"
        intfmt $1 "%u" $1
 
        DetailPrint "cxWindowBorders=$1"         
 
    ## cyWindowBorders
        IntOp $R0 $0 + 52
        System::Call "*$R0(i .r1)"
        intfmt $1 "%u" $1
 
        DetailPrint "cyWindowBorders=$1"   
 
        System::Free $0
 
SectionEnd