Jump to content

Recommended Posts

Posted

Hiho,

I use WM_COPYDATA to synchronize different scripts. First I tried to use the default AutoIt Window for this, but had to realize that it does not seem to be part of the windows message queue. To have a 'fixed' entry point now I created a unique and hidden helper window. I did a quick test with GuiSwitch() and GuiCtrlCreate... but those didn't work too.

So, just as a question, is there a reason why the default AutoIt window can not be accessed / does not behave as any other AutoIt GUI?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hWnd_AutoIt_GUI = WinGetHandle(AutoItWinGetTitle(), "")
WinSetState($hWnd_AutoIt_GUI, "", @SW_SHOW)

GUICreate("My GUI")
GUISetState(@SW_SHOW)

Const $WM_MOVING = 0x0216
GUIRegisterMsg($WM_MOVING, "MY_WM_MOVING")

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()

Func MY_WM_MOVING($hWnd, $msg, $wParam, $lParam)
    ConsoleWrite(TimerInit() & @TAB & WinGetTitle($hWnd) & @TAB & $hWnd & @TAB & $msg & @TAB & $wParam & @TAB & $lParam & @CRLF)
    Return $GUI_RUNDEFMSG
EndFunc   ;==>MY_WM_MOVING
Posted

In all honesty we shouldn't use a standard window at all. We should be using a message window which exists solely for the purposes of providing the application access to a message pump. That's all the current window is for - so AutoIt can handle Windows events.

So to answer your question, yes, the reason is that window only exists so AutoIt has a message pump (A message pump is required for tray functionality, for example).

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...