Jump to content

Recommended Posts

Posted (edited)

I'm looking to attach a blank GUI around the notepad. Instead of the script running the notepad, I'm trying to make it attach a GUI around a notepad i have opened manually. Its based on a script which runs notepad. I played about with the script and this is what i have came up with, it runs, works but then comes up an error. Would it be possible to advise on my mistake, thanks in advance.

test.au3

HotKeySet("{ESC}", "Terminate")


#include <WinAPI.au3>
#include <GUIConstants.au3>

Local $msg, $hwnd, $Nhandle

$hwnd = GUICreate("MyTest")
GUISetState()

$Nhandle = WinGetHandle("Untitled - Notepad")

_WinAPI_SetParent($Nhandle, $hwnd)
_WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE)
WinMove($Nhandle, "", 0, 0)




While ProcessExists()
    $msg = GUIGetMsg()
    Switch
        Case $GUI_EVENT_CLOSE
            ProcessClose()
    EndSwitch
WEnd

 

Edited by Jos
Just post the code in codetags.....

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...