Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 7 of 7

Thread: ChildWindow

  1. #1
    Join Date
    Mar 2010
    Posts
    39

    ChildWindow

    hi again ^^
    I'am now trying to create a child window by using "lua lanes" and "winapi" to force DialogEx become a child of main window. But sometime, the **** is not working.
    Please tell me a better way ^^

  2. #2
    Join Date
    May 2006
    Posts
    5,557
    it already is a child of the main window but its modal, you can just enable the main window "EnableWindow" in User32.dll to regain control of the main window, be careful tho, doing that can cause some unstable results!
    Embrace change in your life, you never know, it could all work out for the best

  3. #3
    Join Date
    Mar 2010
    Posts
    39
    I think my problem came from "lua lanes", because I use it to call a DialogEx, I will not lock the main window
    I don't understand very clear. You mean that you can unlock the main window when you call a DialogEx by using User32? If so, could you tell me how, it could help me a lot

  4. #4
    Join Date
    Mar 2010
    Posts
    39
    nMainWindow=WinApi.FindWindow("", "FreshSys Software Designer")
    DLL.CallFunction(_SystemFolder.."\\User32.dll", "EnableWindow", nMainWindow..",true", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)

    I can enable/disable any window but cannot enable the main window when calling a DialogEx

  5. #5
    Join Date
    May 2006
    Posts
    5,557
    Use the main window handle as retrieved with Application.GetWndHandle(), and WinAPI does not understand lua boolean values, you must use 0 for false and 1 for true
    Code:
    DLL.CallFunction(_SystemFolder.."\\User32.dll", "EnableWindow", Application.GetWndHandle()..",1", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    Embrace change in your life, you never know, it could all work out for the best

  6. #6
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,623
    Mmm, in the past I made some experiments with the WinApiMultiDialogs example provided with the WinApi plugin, but the real problem is not how to set the main window enabled but the fact that AMS runtime stops the execution of the code of the main window when the DialogEx is opened, so there is nothing to do.

    Yes, the main window is active, buttons react when you hover the mouse cursor or click on them, but the code in them is not executed, nor timers and so on. So, totally usefulness.
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  7. #7
    Join Date
    Mar 2010
    Posts
    39
    yes, it worked. But like Cyber says... it's useless. When I use "lua lanes", it more better than this but the application is not stable.
    so, there is no way to solve this problem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts