Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Window caption and dialog-texts disappear from embedded application

  1. #1
    ria
    ria is offline
    Newbie
    Join Date
    Jul 2006
    Posts
    5

    Window caption and dialog-texts disappear from embedded application

    Hi guys.

    I'm trying to make the EcuTek diagnostic software (www.ecutek.com) for my Impreza Wrx work in a carputer front-end. I hope this excellent skinbedder app can solve it, but I'm a little stuck on a wierd problem.

    I got everything to work until i started making the exit button to close the dialog. The dialog opens and is embedded fine. I close it. The next time it is opened, the window caption is gone and so are most of the static texts in the dialog.

    Is there something wrong with my syntax? I open the dialog with this line (The "live tuning" button in ecutek5.JPG):
    ----------------------------------
    OnPressUp=Play(ButtonClick.wav),Focus(ecutek),Send (F8),wait(500),Embed(LiveTuning:0),Focus(LiveTunin g),wait(250),Send(tab),Send(tab),Send(tab),Send(en ter),HideSkin(ecutek_funcMenu_right),HideSkin(ecut ek_livedata_Left),LoadSkin(LiveTuning:exitMenu)
    ----------------------------------

    This line is ran when pressing exit (The "exit" button in ecutek6.JPG):
    ----------------------------------
    OnPressUp=Play(ButtonClick.wav),Focus(LiveTuning), wait(250),Type(ALT-F4),HideSkin(exitMenu),LoadSkin(EcuTek:ecutek_live data_Left),LoadSkin(EcuTek:ecutek_funcMenu_right), Focus(ecuTek),Close(LiveTuning)
    ----------------------------------

    When i try to open the same dialog a second time it looks like the ecutek7.jpg screenshot. Window caption and most of the static texts are gone.

    The same thing happens to all the dialogs in the program that i have tried to embed.

    Have anyone else had simular problems?
    Attached Images Attached Images    

  2. #2
    Banned RPM_VR4's Avatar
    Join Date
    Nov 2004
    Location
    L.A.
    Posts
    1,893
    Sorry for my late reply...

    The only think I can think of to suggest would be to not send Alt-F4 because Close(LiveTuning) should do that for you anyway. I'm not sure though.

    If you want to send me your program and skin I will debug the problem for you (as long as I can see it without being connected to a WRX). If it is a SKINbedder bug I will try to fix it and send you a new SKINbedder.exe. PM me for my e-mail address.

  3. #3
    ria
    ria is offline
    Newbie
    Join Date
    Jul 2006
    Posts
    5
    Quote Originally Posted by RPM_VR4
    Sorry for my late reply...

    The only think I can think of to suggest would be to not send Alt-F4 because Close(LiveTuning) should do that for you anyway. I'm not sure though.

    If you want to send me your program and skin I will debug the problem for you (as long as I can see it without being connected to a WRX). If it is a SKINbedder bug I will try to fix it and send you a new SKINbedder.exe. PM me for my e-mail address.
    Thanks for the reply.

    I tried removing the Alt-F4 and the window is still closed so Close(LiveTuning) does the same thing. The captions are still missing though.

    The program exists in demo form and can be downloaded from here: http://www.ecutek.com/downloads/DDDemo.zip, or i can send the exe file together with my skin in the e-mail attachment.

  4. #4
    Banned RPM_VR4's Avatar
    Join Date
    Nov 2004
    Location
    L.A.
    Posts
    1,893
    I just got around to trying this out for you. Sorry it took so long. I was unable to view Live Tuning, I just get an error message that my ECU does not support that. However I did notice that clicking exit worked the first time I opened it and not the second time ???.

    I now understand what you were saying in your screen-shots too, but that is incredibly puzzling... SKINbedder can't possibly remove fonts and stuff like in your last screen-shot. ???

    This one really has me stumped.

  5. #5
    Banned RPM_VR4's Avatar
    Join Date
    Nov 2004
    Location
    L.A.
    Posts
    1,893
    I hate to tell you to do this (especially since it may not help anything), but if you really want to try and fix it, I have 2 suggestions to start with... SKINbedder was never very stable with those semi-transparent buttons (plus they don't blend correctly anyway). Also I see by your screen-shots that you are not using the latest version.

    Download Sb V3-P2 from the sticky at the top of this forum.
    Re-do all your graphics using solid PNGs (you can have fully-transparent cut-outs, but no alpha-blended pixels).

  6. #6
    Banned RPM_VR4's Avatar
    Join Date
    Nov 2004
    Location
    L.A.
    Posts
    1,893
    Also update all your ini files to use "type()" instead of "send()".

  7. #7
    Banned RPM_VR4's Avatar
    Join Date
    Nov 2004
    Location
    L.A.
    Posts
    1,893
    Ok, I set it up for the correct ECU so I can fully test your problem. I tried to fix it but could not. I do not understand why the Exit button doesn't work on the second time nor why all the labels disapear the second time. ??? I will keep looking in to it.

  8. #8
    ria
    ria is offline
    Newbie
    Join Date
    Jul 2006
    Posts
    5
    Sorry I forgot to mention the which ecu type to choose. Nice work finding it.

    I have tried this with the new version, but with the same same result I'm afraid. I had trouble reaching the buttons (png's) when using the new version and the embedded application's client area were below a button. I have not tried redoing the graphics though. I can try this and see if the buttons are reacheable then. I will also try replacing send() with type().

    It looks like something happens to the application when the Close function is used since the labels work the first time the dialog is opened. I don't know how you do the embedding, but a window hook with an error could probably cause this kind of behaviour, if the labels are loaded in the ecutek application upon an internal message and this message is ignored after applying the hook. (not sure if it's possible to understand what I'm trying to say here. )

    I have tried an embedding test using C++. I used FindWindow to retrieve the hWnd, changed the style with SetWindowLong to remove the border etc, moving and sizing it with SetWindowPos and using SendInput to send keys to the application. I don't know how you do it, but the labels did not disappear when i tried this.

    Happy to support you if I can. The windows api functions are simular in C and Pascal i presume.

  9. #9
    Banned RPM_VR4's Avatar
    Join Date
    Nov 2004
    Location
    L.A.
    Posts
    1,893
    Yes, the API is all the same. I do not understand hooks... but I would like to. The Send() command uses old code I got off someone based on keybd_event(). Type() is only in the newest version SbV3-P2 and it uses a function I wrote from scratch with all VK_Keys based on SendInput. Your embed commands are the same as mine (for non-ES_EX_LAYERED), but you forgot SetParent() to make it a part of your own window (needed for cropping and dynamic re-sizing). I still need to work on making Layered windows better (for transparency/background-removal).

    ...so how could this cause such behavior? I don't even do anything on the Close() command other than free the item from my array:
    Code:
        //Close
        else if (copy(CurrCommand, 1, 6) = 'CLOSE(') then
         begin
          CurrCommand := copy(CurrCommand, 7, length(CurrCommand) - 7);
          //Close Code
          Index2 := 0;
          while Index2 < length(WindowArray) do
           begin
            if WindowArray[Index2].Name = CurrCommand then
             begin
              if (WindowArray[Index2].CloseCommand = '') then
                DoCommand(WindowArray[Index2].CloseCommand);
              if (Index2 = length(WindowArray) - 1) then
               begin
                WindowArray[Index2].Free;
                SetLength(WindowArray, length(WindowArray) - 1) ;
               end
              else
               begin
                System.Finalize(WindowArray[Index2]);
                WindowArray[Index2].Free;
                System.Move(WindowArray[Index2 + 1], WindowArray[Index2],(Length(WindowArray) - Index2 - 1) * SizeOf(string) + 1) ;
                SetLength(WindowArray, Length(WindowArray) - 1) ;
               end;
              Index2 := length(WindowArray) + 1;  //Skip to end
             end
            else
              Index2 := Index2 + 1;
           end;
         end
    It is also very strange how the exit button does not work the second time. I don't have any idea what is going on. Maybe the program explicitly checks to make sure its child-window was closed (not stolen by SKINbedder's SetParent() command) and behaves badly if it wasn't.

    ...Speaking of layered windows, maybe it would work if you have the window embedded with semi-transparency (because a layered windows parent is automatically the desktop, and trying to use SetParent will cause a crash). If you set it to 254 transparency or remove a color that doesn't exist (or just remove the background color), then it might work differently.

  10. #10
    ria
    ria is offline
    Newbie
    Join Date
    Jul 2006
    Posts
    5
    Quote Originally Posted by RPM_VR4 View Post
    Yes, the API is all the same. I do not understand hooks... but I would like to. The Send() command uses old code I got off someone based on keybd_event(). Type() is only in the newest version SbV3-P2 and it uses a function I wrote from scratch with all VK_Keys based on SendInput. Your embed commands are the same as mine (for non-ES_EX_LAYERED), but you forgot SetParent() to make it a part of your own window (needed for cropping and dynamic re-sizing). I still need to work on making Layered windows better (for transparency/background-removal).

    ...so how could this cause such behavior? I don't even do anything on the Close() command other than free the item from my array:

    It is also very strange how the exit button does not work the second time. I don't have any idea what is going on. Maybe the program explicitly checks to make sure its child-window was closed (not stolen by SKINbedder's SetParent() command) and behaves badly if it wasn't.

    ...Speaking of layered windows, maybe it would work if you have the window embedded with semi-transparency (because a layered windows parent is automatically the desktop, and trying to use SetParent will cause a crash). If you set it to 254 transparency or remove a color that doesn't exist (or just remove the background color), then it might work differently.
    I used SetParent(), just forgot to mention it. I can't see anything in your code that could cause this strange behavior, but I have experimented some more in c, and had some issues after closing the dialog as well. I close the live tuning window by sending it WM_CLOSE. When it is opened again the "FindWindow" command can't find the window. (It just looks like embedding succeeded because the window openes in the last opened position, but it is not actually embedded). Exiting the dialog then of course do not work because WM_CLOSE is sent to an invalid windowhandle.

    I got it to work by setting the parent of the live tuning window (using SetParent() ) back to the desktop before sending WM_CLOSE. Another thing that worked was setting the parent of the live tuning window to the handle of the applications main window. I have not tried your semi-transparency trick yet, but i suspect the same result since setting the desktop as parent did the trick.

    All the labels are still with me in any case though.

Page 1 of 2 12 LastLast

Similar Threads

  1. Onscreen keyboard
    By gti in forum Map Monkey
    Replies: 40
    Last Post: 06-14-2008, 10:00 PM

Bookmarks

Posting Permissions

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