View Single Post
Old 28th March 2016, 21:54   #4
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 343
i have a code with vb6,this application show windows focus on witch application and show that title in a label

HTML Code:
Option Explicit

Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long



Private Sub Timer1_Timer()

Dim foreground_hwnd As Long
Dim txt As String
Dim length As Long

    foreground_hwnd = GetForegroundWindow()

    txt = Space$(1024)
    length = GetWindowText(foreground_hwnd, txt, Len(txt))
    txt = Left$(txt, length)
    lblCaption = txt
    
    
    
End Sub

i how can change this vb6 code to nsis code?
i want check if focus on "New Text Document.txt - Notepad" then messagebox show focus is on you want! else messagebox show focus is on another application in nsis
is possible whit this code with nsis?!
r2du-soft is offline   Reply With Quote