Hello

Hello,

I want to take screenshots of my application in a automatic way, it work fine until I need to show a PopupMenu...the popup() method is blocking the code.

How can I show a PopupMenu, take a screenshot and close the menu to continue the execution of my automatic code ?

Note that the code is in the application, I create forms, set controls properties, take a photo, etc...so I can handle error conditions very easly...but I can't figure how to display a popupmenu.

Comments

  1. YEs ! I've put the screenshot in a Thread...but Winapi.Windows.EndMenu do not close the menu...probably because I'm not in the same thread...

    ReplyDelete
  2. FillChar(GTI, SizeOf(GTI), 0);
    GTI.cbSize := SizeOf(GTI);
    GetGUIThreadInfo(0, GTI);
    SendMessage(GTI.hwndCapture, WM_CANCELMODE, 0, 0);

    :)

    ReplyDelete
  3. I often find the answer to my question just after asking :)

    ReplyDelete
  4. Question often contains the answer. It s always a pleasure to read your posts.

    ReplyDelete
  5. Paul TOTH What about calling EndMenu in the OnTerminate event of the thread?

    ReplyDelete
  6. Uwe Raabe didn't try, and I'm already very late on my project :)

    ReplyDelete
  7. Stefan Glienke I thought it was talent :)

    ReplyDelete
  8. Stefan Glienke My first time heard about it, and I had similar experiences several times too!

    ReplyDelete
  9. Edwin Yip It is a skill that every professional developer should have as it improves the problem finding and solving process significantly.

    ReplyDelete
  10. Stefan Glienke Yes, I guess it works because languages refine our thinking process.

    ReplyDelete
  11. Thinking aloud sometimes helps. Teddybear debugging too, where you explain the problem to your favorite stuffed toy.

    ReplyDelete

Post a Comment